* set/getrlimit now also visible in baseunix when syscalls are used.

on systems that force ugetrlimit, use that transparently. (since 
    ugetrlimit is not posix in theory or practice, we can't export it),
    resolves 13916

git-svn-id: trunk@13903 -
This commit is contained in:
marco 2009-10-17 19:14:09 +00:00
parent 7ad93d7e52
commit 778505701c
3 changed files with 16 additions and 3 deletions

View File

@ -552,6 +552,6 @@ end;
function FpSetRLimit(Resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_SETRLIMIT'];
begin
fpsetrlimit:=do_syscall(syscall_nr_getrlimit,TSysParam(Resource),TSysParam(rlim));
fpsetrlimit:=do_syscall(syscall_nr_setrlimit,TSysParam(Resource),TSysParam(rlim));
end;

View File

@ -568,13 +568,18 @@ begin
fpgettimeofday:=do_syscall(syscall_nr_gettimeofday,TSysParam(tp),TSysParam(tzp));
end;
{$ifndef NO_SYSCALL_GETRLIMIT}
function FpGetRLimit(resource : cInt; rlim : PRLimit) : cInt;
begin
{$ifndef NO_SYSCALL_GETRLIMIT}
FpGetRLimit := do_syscall(syscall_nr_getrlimit,
TSysParam(resource), TSysParam(rlim));
end;
{$else}
FpGetRLimit := do_syscall(syscall_nr_ugetrlimit,
TSysParam(resource), TSysParam(rlim));
{$endif}
end;
{$ifdef HAS_UGETRLIMIT}
function fpugetrlimit(resource : cInt; rlim : PRLimit) : cInt;
@ -592,3 +597,8 @@ begin
end;
{$endif}
function FpSetRLimit(Resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_SETRLIMIT'];
begin
fpsetrlimit:=do_syscall(syscall_nr_setrlimit,TSysParam(Resource),TSysParam(rlim));
end;

View File

@ -106,3 +106,6 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
Function FpGetEnv (name : pChar): pChar;
function fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
function FpGetRLimit(resource:cint;rlim:PRLimit):cint; external name 'FPC_SYSC_GETRLIMIT';
function FpSetRLimit(Resource:cint;rlim:PRLimit):cint; external name 'FPC_SYSC_SETRLIMIT';