mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 06:09:11 +02:00
Use prlimit64 in FpSetRLimit and FpSetRLimit
This commit is contained in:
parent
2928837225
commit
f202dda5c5
@ -126,5 +126,6 @@
|
|||||||
{$ifdef cpuloongarch64}
|
{$ifdef cpuloongarch64}
|
||||||
{$define generic_linux_syscalls}
|
{$define generic_linux_syscalls}
|
||||||
{$define use_statx_syscall}
|
{$define use_statx_syscall}
|
||||||
|
{$define use_prlimit64}
|
||||||
{$undef usestime}
|
{$undef usestime}
|
||||||
{$endif cpuloongarch64}
|
{$endif cpuloongarch64}
|
||||||
|
@ -737,11 +737,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$ifdef USE_PRLIMIT64}
|
||||||
|
function FpPRlimit64(pid : pid_t; resource : cInt; nrlim, orlim : PRLimit) : cInt;
|
||||||
|
begin
|
||||||
|
FpPRlimit64 := do_syscall(syscall_nr_prlimit64, TSysParam(pid),
|
||||||
|
TSysParam(resource), TSysParam(nrlim), TSysParam(orlim));
|
||||||
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
function FpGetRLimit(resource : cInt; rlim : PRLimit) : cInt; [public, alias : 'FPC_SYSC_GETRLIMIT'];
|
function FpGetRLimit(resource : cInt; rlim : PRLimit) : cInt; [public, alias : 'FPC_SYSC_GETRLIMIT'];
|
||||||
begin
|
begin
|
||||||
{$ifndef NO_SYSCALL_GETRLIMIT}
|
{$ifndef NO_SYSCALL_GETRLIMIT}
|
||||||
FpGetRLimit := do_syscall(syscall_nr_getrlimit,
|
{$ifndef USE_PRLIMIT64}
|
||||||
TSysParam(resource), TSysParam(rlim));
|
FpGetRLimit := do_syscall(syscall_nr_getrlimit,
|
||||||
|
TSysParam(resource), TSysParam(rlim));
|
||||||
|
{$else}
|
||||||
|
FpGetRLimit := FpPRlimit64(0, RLIMIT_STACK, PRLimit(0), rlim);
|
||||||
|
{$endif}
|
||||||
{$else}
|
{$else}
|
||||||
FpGetRLimit := do_syscall(syscall_nr_ugetrlimit,
|
FpGetRLimit := do_syscall(syscall_nr_ugetrlimit,
|
||||||
TSysParam(resource), TSysParam(rlim));
|
TSysParam(resource), TSysParam(rlim));
|
||||||
@ -767,7 +779,11 @@ end;
|
|||||||
|
|
||||||
function FpSetRLimit(Resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_SETRLIMIT'];
|
function FpSetRLimit(Resource:cint;rlim:PRLimit):cint; [public, alias : 'FPC_SYSC_SETRLIMIT'];
|
||||||
begin
|
begin
|
||||||
|
{$ifndef USE_PRLIMIT64}
|
||||||
fpsetrlimit:=do_syscall(syscall_nr_setrlimit,TSysParam(Resource),TSysParam(rlim));
|
fpsetrlimit:=do_syscall(syscall_nr_setrlimit,TSysParam(Resource),TSysParam(rlim));
|
||||||
|
{$else}
|
||||||
|
fpsetrlimit:=FpPRlimit64(0, RLIMIT_STACK, rlim, PRLimit(0));
|
||||||
|
{$endif USE_PRLIMIT64}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FpSchedGetAffinity(pid : pid_t;cpusetsize : size_t;mask : pcpu_set_t) : cint;
|
function FpSchedGetAffinity(pid : pid_t;cpusetsize : size_t;mask : pcpu_set_t) : cint;
|
||||||
|
Loading…
Reference in New Issue
Block a user