mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 11:29:24 +02:00
* fix bootstrapping issue on freebsd x86_64
git-svn-id: trunk@36162 -
This commit is contained in:
parent
141238bb90
commit
818a64952c
@ -466,7 +466,7 @@ function GetOSRelDate:Longint;
|
||||
both old 3.0.X definition and new definition using pcint type.
|
||||
Problem solved using a special type called
|
||||
FPSysCtlFirstArgType. }
|
||||
{$ifdef VER3_0}
|
||||
{$if defined(VER3_0_0) or defined(VER3_0_2)}
|
||||
type
|
||||
FPSysCtlFirstArgType = PChar;
|
||||
{$else}
|
||||
@ -491,7 +491,7 @@ Begin
|
||||
len := 4;
|
||||
oerrno:= fpgeterrno;
|
||||
if (FPsysctl(FPSysCtlFirstArgType(@mib), 2, pchar(@v), @len, NIL, 0) = -1) Then
|
||||
Begin
|
||||
Begin
|
||||
if (fpgeterrno = ESysENOMEM) Then
|
||||
fpseterrno(oerrno);
|
||||
GetOSRelDate:=0;
|
||||
|
@ -81,11 +81,19 @@ TYPE CtlNameRec = Record
|
||||
//
|
||||
|
||||
{$ifdef FPC_USE_LIBC}
|
||||
{$if defined(VER3_0_0) or defined(VER3_0_2)}
|
||||
function FPsysctl (Name: pchar; namelen:cuint; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint; cdecl; external name 'sysctl';
|
||||
{$else}
|
||||
function FPsysctl (Name: pcint; namelen:cuint; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint; cdecl; external name 'sysctl';
|
||||
{$endif}
|
||||
function FPsysctlbyname (Name: pchar; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint; cdecl; external name 'sysctlbyname';
|
||||
function FPsysctlnametomib (Name: pchar;mibp:pcint;sizep:psize_t):cint; cdecl; external name 'sysctlnametomib';
|
||||
{$else}
|
||||
{$if defined(VER3_0_0) or defined(VER3_0_2)}
|
||||
function FPsysctl (Name: pchar; namelen:cuint; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint;
|
||||
{$else}
|
||||
function FPsysctl (Name: pcint; namelen:cuint; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint;
|
||||
{$endif}
|
||||
function FPsysctlbyname (Name: pchar; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint;
|
||||
function FPsysctlnametomib (Name: pchar; mibp:pcint;sizep:psize_t):cint;
|
||||
{$endif}
|
||||
@ -101,10 +109,14 @@ Uses Syscall;
|
||||
CONST syscall_nr___sysctl = 202;
|
||||
{$endif}
|
||||
|
||||
{$if defined(VER3_0_0) or defined(VER3_0_2)}
|
||||
function FPsysctl (Name: pchar; namelen:cuint; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint;
|
||||
{$else}
|
||||
function FPsysctl (Name: pcint; namelen:cuint; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint;
|
||||
{$endif}
|
||||
|
||||
Begin
|
||||
if (name[0] <> CTL_USER) Then
|
||||
if (pcint(name)[0] <> CTL_USER) Then
|
||||
exit(do_syscall(syscall_nr___sysctl,TSysParam(name), namelen, TSysParam(oldp), TSysParam(oldlenp), TSysParam(newp), TSysParam(newlen)))
|
||||
else
|
||||
Exit(0);
|
||||
|
Loading…
Reference in New Issue
Block a user