mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:29:20 +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.
|
both old 3.0.X definition and new definition using pcint type.
|
||||||
Problem solved using a special type called
|
Problem solved using a special type called
|
||||||
FPSysCtlFirstArgType. }
|
FPSysCtlFirstArgType. }
|
||||||
{$ifdef VER3_0}
|
{$if defined(VER3_0_0) or defined(VER3_0_2)}
|
||||||
type
|
type
|
||||||
FPSysCtlFirstArgType = PChar;
|
FPSysCtlFirstArgType = PChar;
|
||||||
{$else}
|
{$else}
|
||||||
@ -491,7 +491,7 @@ Begin
|
|||||||
len := 4;
|
len := 4;
|
||||||
oerrno:= fpgeterrno;
|
oerrno:= fpgeterrno;
|
||||||
if (FPsysctl(FPSysCtlFirstArgType(@mib), 2, pchar(@v), @len, NIL, 0) = -1) Then
|
if (FPsysctl(FPSysCtlFirstArgType(@mib), 2, pchar(@v), @len, NIL, 0) = -1) Then
|
||||||
Begin
|
Begin
|
||||||
if (fpgeterrno = ESysENOMEM) Then
|
if (fpgeterrno = ESysENOMEM) Then
|
||||||
fpseterrno(oerrno);
|
fpseterrno(oerrno);
|
||||||
GetOSRelDate:=0;
|
GetOSRelDate:=0;
|
||||||
|
@ -81,11 +81,19 @@ TYPE CtlNameRec = Record
|
|||||||
//
|
//
|
||||||
|
|
||||||
{$ifdef FPC_USE_LIBC}
|
{$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';
|
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 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';
|
function FPsysctlnametomib (Name: pchar;mibp:pcint;sizep:psize_t):cint; cdecl; external name 'sysctlnametomib';
|
||||||
{$else}
|
{$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;
|
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 FPsysctlbyname (Name: pchar; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint;
|
||||||
function FPsysctlnametomib (Name: pchar; mibp:pcint;sizep:psize_t):cint;
|
function FPsysctlnametomib (Name: pchar; mibp:pcint;sizep:psize_t):cint;
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -101,10 +109,14 @@ Uses Syscall;
|
|||||||
CONST syscall_nr___sysctl = 202;
|
CONST syscall_nr___sysctl = 202;
|
||||||
{$endif}
|
{$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;
|
function FPsysctl (Name: pcint; namelen:cuint; oldp:pointer;oldlenp:psize_t; newp:pointer;newlen:size_t):cint;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
Begin
|
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)))
|
exit(do_syscall(syscall_nr___sysctl,TSysParam(name), namelen, TSysParam(oldp), TSysParam(oldlenp), TSysParam(newp), TSysParam(newlen)))
|
||||||
else
|
else
|
||||||
Exit(0);
|
Exit(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user