Browse Source

* added resource consts and types

git-svn-id: trunk@1749 -
marco 20 years ago
parent
commit
238510c59d
3 changed files with 44 additions and 7 deletions
  1. 33 0
      rtl/bsd/ostypes.inc
  2. 9 6
      rtl/darwin/ptypes.inc
  3. 2 1
      rtl/freebsd/ptypes.inc

+ 33 - 0
rtl/bsd/ostypes.inc

@@ -247,6 +247,39 @@ Const
   S_IFWHT = 57344;
   S_ISVTX = 512;
 
+{
+ * Resource limits from FreeBSD5. To be checked for the others.
+}
+  RLIMIT_CPU      = 0;              { cpu time in milliseconds }
+  RLIMIT_FSIZE    = 1;              { maximum file size }
+  RLIMIT_DATA     = 2;              { data size }
+  RLIMIT_STACK    = 3;              { stack size }
+  RLIMIT_CORE     = 4;              { core file size }
+  RLIMIT_RSS      = 5;              { resident set size }
+  RLIMIT_MEMLOCK  = 6;              { locked-in-memory address space }
+  RLIMIT_NPROC    = 7;              { number of processes }
+  RLIMIT_NOFILE   = 8;              { number of open files }
+{$IFDEF FreeBSD}
+  RLIMIT_SBSIZE   = 9;              { maximum size of all socket buffers }
+  RLIMIT_VMEM     =10;              { virtual process size (inclusive of mmap) }
+{$ENDIF}
+  RLIMIT_AS       = RLIMIT_VMEM;    { standard name for RLIMIT_VMEM }
+
+  {$ifdef FreeBSD}
+  RLIM_NLIMITS    =11;              { number of resource limits }
+  {$endif}
+
+  {$ifdef Darwin}   // OS X 10.3
+  RLIM_NLIMITS    =9;              { number of resource limits }
+  {$endif}
+
+Type 
+        TRLimit  = record
+                     rlim_cur,               { current (soft) limit }
+          	     rlim_max : TRLim;     { maximum value for rlim_cur }
+		    end;	
+        PRLimit  = ^TRLimit;
+       
 CONST
  { Constansts for MMAP }
   MAP_PRIVATE   =2;

+ 9 - 6
rtl/darwin/ptypes.inc

@@ -91,12 +91,15 @@ type
     ptimeval = ^timeval;
     TTimeVal = timeval;
 
-  timespec = packed record
-    tv_sec   : time_t;
-    tv_nsec  : clong;
-  end;
-  ptimespec= ^timespec;
-  Ttimespec= timespec;
+    timespec = packed record
+      tv_sec   : time_t;
+      tv_nsec  : clong;
+    end;
+    ptimespec= ^timespec;
+    Ttimespec= timespec;
+
+    rlim_t		= int64;
+    TRlim		= rlim_t;
 
 CONST
    { System limits, POSIX value in parentheses, used for buffer and stack allocation }

+ 2 - 1
rtl/freebsd/ptypes.inc

@@ -121,7 +121,8 @@ type
    pthread_rwlockattr_t = pointer;
 
    sem_t                = pointer;
-
+   rlim_t		= int64;
+   TRlim		= rlim_t;
   {
      Mutex types (Single UNIX Specification, Version 2, 1997).