@@ -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'];
+ fpsetrlimit:=do_syscall(syscall_nr_getrlimit,TSysParam(Resource),TSysParam(rlim));
@@ -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;
@@ -302,6 +302,13 @@ begin
GetProcessID := SizeUInt (fpGetPID);
+{$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}
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
var
limits : TRLimit;
@@ -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}