* 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 -
This commit is contained in:
marco 2009-10-16 18:47:43 +00:00
parent fff6e218af
commit 5121f470a2
4 changed files with 19 additions and 4 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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}