Pārlūkot izejas kodu

* moved ugetrlimit to the implementation (as linux specific call it shouldn't be exported)
* syscall implementation for FreeBSD of get/setrlimit

git-svn-id: trunk@13875 -

marco 16 gadi atpakaļ
vecāks
revīzija
5121f470a2
4 mainītis faili ar 19 papildinājumiem un 4 dzēšanām
  1. 10 0
      rtl/bsd/ossysc.inc
  2. 2 0
      rtl/freebsd/sysnr.inc
  3. 7 0
      rtl/linux/system.pp
  4. 0 4
      rtl/unix/oscdeclh.inc

+ 10 - 0
rtl/bsd/ossysc.inc

@@ -545,3 +545,13 @@ begin
   fpreadlink:=do_syscall(syscall_nr_readlink, TSysParam(name),TSysParam(linkname),maxlen);
 end;
 
+function FpGetRLimit(resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_GETRLIMIT'];
+begin
+  fpgetrlimit:=do_syscall(syscall_nr_getrlimit,TSysParam(Resource),TSysParam(rlim));
+end;
+
+function FpSetRLimit(Resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_SETRLIMIT'];
+begin
+  fpsetrlimit:=do_syscall(syscall_nr_getrlimit,TSysParam(Resource),TSysParam(rlim));
+end;
+

+ 2 - 0
rtl/freebsd/sysnr.inc

@@ -337,5 +337,7 @@ syscall_nr_getdirentries                =196;
  syscall_nr_kse_thr_interrupt           = 382;
  syscall_nr_kse_release                 = 383;
  syscall_nr_kse_switchin                = 440;
+ syscall_nr_getrlimit                   = 194;
+ syscall_nr_setrlimit                   = 195;
 
 

+ 7 - 0
rtl/linux/system.pp

@@ -302,6 +302,13 @@ begin
  GetProcessID := SizeUInt (fpGetPID);
 end;
 
+{$ifdef FPC_USE_LIBC}
+{$ifdef HAS_UGETRLIMIT}
+    { there is no ugetrlimit libc call, just map it to the getrlimit call in these cases }
+function FpUGetRLimit(resource : cInt; rlim : PRLimit) : cInt; cdecl; external clib name 'getrlimit';
+{$endif}
+{$endif}
+
 function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
 var
   limits : TRLimit;

+ 0 - 4
rtl/unix/oscdeclh.inc

@@ -134,10 +134,6 @@ const
 //    function  fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
 {$endif}
     function FpGetRLimit(resource : cInt; rlim : PRLimit) : cInt; cdecl; external clib name 'getrlimit';
-    {$ifdef HAS_UGETRLIMIT}
-    { there is no ugetrlimit libc call, just map it to the getrlimit call in these cases }
-    function FpUGetRLimit(resource : cInt; rlim : PRLimit) : cInt; cdecl; external clib name 'getrlimit';
-    {$endif}
 
 {$ifdef linux}
 {$ifndef FPC_IS_SYSTEM}