mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 20:26:00 +02:00
* fixed ioctl for non-linux: the third parameter is "..." there rather
than a pointer. The interface still accepts a plain pointer for backwards compatibility. git-svn-id: trunk@9176 -
This commit is contained in:
parent
422b5d916b
commit
f60c72b773
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5445,6 +5445,7 @@ rtl/unix/ipc.pp svneol=native#text/plain
|
|||||||
rtl/unix/ipccdecl.inc svneol=native#text/plain
|
rtl/unix/ipccdecl.inc svneol=native#text/plain
|
||||||
rtl/unix/keyboard.pp svneol=native#text/plain
|
rtl/unix/keyboard.pp svneol=native#text/plain
|
||||||
rtl/unix/mouse.pp svneol=native#text/plain
|
rtl/unix/mouse.pp svneol=native#text/plain
|
||||||
|
rtl/unix/oscdecl.inc svneol=native#text/plain
|
||||||
rtl/unix/oscdeclh.inc svneol=native#text/plain
|
rtl/unix/oscdeclh.inc svneol=native#text/plain
|
||||||
rtl/unix/ports.pp svneol=native#text/plain
|
rtl/unix/ports.pp svneol=native#text/plain
|
||||||
rtl/unix/printer.pp svneol=native#text/plain
|
rtl/unix/printer.pp svneol=native#text/plain
|
||||||
|
@ -65,6 +65,7 @@ end;
|
|||||||
{$ifdef FPC_USE_LIBC}
|
{$ifdef FPC_USE_LIBC}
|
||||||
{$Linklib c}
|
{$Linklib c}
|
||||||
{$i oscdeclh.inc}
|
{$i oscdeclh.inc}
|
||||||
|
{$i oscdecl.inc}
|
||||||
{$else}
|
{$else}
|
||||||
{$I syscallh.inc}
|
{$I syscallh.inc}
|
||||||
{$I syscall.inc}
|
{$I syscall.inc}
|
||||||
|
@ -84,6 +84,7 @@ end;
|
|||||||
{$ifdef FPC_USE_LIBC}
|
{$ifdef FPC_USE_LIBC}
|
||||||
{$Linklib c}
|
{$Linklib c}
|
||||||
{$i oscdeclh.inc}
|
{$i oscdeclh.inc}
|
||||||
|
{$i oscdecl.inc}
|
||||||
{$else}
|
{$else}
|
||||||
{$I syscallh.inc}
|
{$I syscallh.inc}
|
||||||
{$I syscall.inc}
|
{$I syscall.inc}
|
||||||
|
@ -61,6 +61,7 @@ end;
|
|||||||
{$ifdef FPC_USE_LIBC}
|
{$ifdef FPC_USE_LIBC}
|
||||||
{$Linklib c}
|
{$Linklib c}
|
||||||
{$i oscdeclh.inc}
|
{$i oscdeclh.inc}
|
||||||
|
{$i oscdecl.inc}
|
||||||
{$else}
|
{$else}
|
||||||
{$I syscallh.inc}
|
{$I syscallh.inc}
|
||||||
{$I syscall.inc}
|
{$I syscall.inc}
|
||||||
|
@ -40,6 +40,7 @@ end;
|
|||||||
|
|
||||||
{$Linklib c}
|
{$Linklib c}
|
||||||
{$i oscdeclh.inc}
|
{$i oscdeclh.inc}
|
||||||
|
{$i oscdecl.inc}
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
Error conversion
|
Error conversion
|
||||||
|
@ -76,7 +76,9 @@ Uses Sysctl;
|
|||||||
{$I gensigset.inc} // general sigset funcs implementation.
|
{$I gensigset.inc} // general sigset funcs implementation.
|
||||||
{$I genfdset.inc} // general fdset funcs.
|
{$I genfdset.inc} // general fdset funcs.
|
||||||
|
|
||||||
{$ifndef FPC_USE_LIBC}
|
{$ifdef FPC_USE_LIBC}
|
||||||
|
{$i oscdecl.inc} // implementation of wrappers in oscdeclh.inc
|
||||||
|
{$else}
|
||||||
{$i syscallh.inc} // do_syscall declarations themselves
|
{$i syscallh.inc} // do_syscall declarations themselves
|
||||||
{$i sysnr.inc} // syscall numbers.
|
{$i sysnr.inc} // syscall numbers.
|
||||||
{$i bsyscall.inc} // cpu specific syscalls
|
{$i bsyscall.inc} // cpu specific syscalls
|
||||||
|
27
rtl/unix/oscdecl.inc
Normal file
27
rtl/unix/oscdecl.inc
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
Copyright (c) 2007 by the Free Pascal development team
|
||||||
|
|
||||||
|
This file should become an alternative to the syscalls in due time,
|
||||||
|
to import the base calls from libc.
|
||||||
|
Be very careful though. Kernel types and libc types are often not the
|
||||||
|
same on Linux.
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
***********************************************************************}
|
||||||
|
|
||||||
|
{$if defined(bsd) or defined(solaris)}
|
||||||
|
function real_FpIOCtl (Handle:cint;Ndx: TIOCtlRequest):cint; cdecl; varargs; external clib name 'ioctl';
|
||||||
|
|
||||||
|
function FpIOCtl (Handle:cint;Ndx: TIOCtlRequest;Data: Pointer):cint;
|
||||||
|
begin
|
||||||
|
FpIOCtl:=real_FpIOCtl(Handle, Ndx, Data);
|
||||||
|
end;
|
||||||
|
{$endif bsd or solaris}
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
This file is part of the Free Pascal run time library.
|
This file is part of the Free Pascal run time library.
|
||||||
Copyright (c) 2001 by Free Pascal development team
|
Copyright (c) 2001 by the Free Pascal development team
|
||||||
|
|
||||||
This file should become an alternative to the syscalls in due time,
|
This file should become an alternative to the syscalls in due time,
|
||||||
to import the base calls from libc.
|
to import the base calls from libc.
|
||||||
@ -74,7 +74,14 @@ const
|
|||||||
procedure FpExit (status : cint); cdecl; external clib name '_exit';
|
procedure FpExit (status : cint); cdecl; external clib name '_exit';
|
||||||
function fpmmap (addr:pointer;len:size_t;prot:cint;flags:cint;fd:cint;ofs:off_t):pointer; cdecl; external clib name 'mmap'+suffix64bit;
|
function fpmmap (addr:pointer;len:size_t;prot:cint;flags:cint;fd:cint;ofs:off_t):pointer; cdecl; external clib name 'mmap'+suffix64bit;
|
||||||
function fpmunmap (addr:pointer;len:size_t):cint; cdecl; external clib name 'munmap';
|
function fpmunmap (addr:pointer;len:size_t):cint; cdecl; external clib name 'munmap';
|
||||||
|
{$if defined(bsd) or defined(solaris)}
|
||||||
|
{ The BSD/Solaris version has "..." as third parameter -> wrap for }
|
||||||
|
{ interface compatibility with Linux }
|
||||||
|
function FpIOCtl (Handle:cint;Ndx: TIOCtlRequest;Data: Pointer):cint;
|
||||||
|
{$ifdef FPC_IS_SYSTEM}forward;{$endif}
|
||||||
|
{$else bsd or solaris}
|
||||||
function FpIOCtl (Handle:cint;Ndx: TIOCtlRequest;Data: Pointer):cint; cdecl; external clib name 'ioctl';
|
function FpIOCtl (Handle:cint;Ndx: TIOCtlRequest;Data: Pointer):cint; cdecl; external clib name 'ioctl';
|
||||||
|
{$endif bsd or solaris}
|
||||||
{$ifdef beos}
|
{$ifdef beos}
|
||||||
Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; cdecl; external 'net' name 'select';
|
Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; cdecl; external 'net' name 'select';
|
||||||
{$else}
|
{$else}
|
||||||
|
Loading…
Reference in New Issue
Block a user