* 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:
Jonas Maebe 2007-11-10 18:22:37 +00:00
parent 422b5d916b
commit f60c72b773
8 changed files with 43 additions and 2 deletions

1
.gitattributes vendored
View File

@ -5445,6 +5445,7 @@ rtl/unix/ipc.pp svneol=native#text/plain
rtl/unix/ipccdecl.inc svneol=native#text/plain
rtl/unix/keyboard.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/ports.pp svneol=native#text/plain
rtl/unix/printer.pp svneol=native#text/plain

View File

@ -65,6 +65,7 @@ end;
{$ifdef FPC_USE_LIBC}
{$Linklib c}
{$i oscdeclh.inc}
{$i oscdecl.inc}
{$else}
{$I syscallh.inc}
{$I syscall.inc}

View File

@ -84,6 +84,7 @@ end;
{$ifdef FPC_USE_LIBC}
{$Linklib c}
{$i oscdeclh.inc}
{$i oscdecl.inc}
{$else}
{$I syscallh.inc}
{$I syscall.inc}

View File

@ -61,6 +61,7 @@ end;
{$ifdef FPC_USE_LIBC}
{$Linklib c}
{$i oscdeclh.inc}
{$i oscdecl.inc}
{$else}
{$I syscallh.inc}
{$I syscall.inc}

View File

@ -40,6 +40,7 @@ end;
{$Linklib c}
{$i oscdeclh.inc}
{$i oscdecl.inc}
{*****************************************************************************
Error conversion

View File

@ -76,7 +76,9 @@ Uses Sysctl;
{$I gensigset.inc} // general sigset funcs implementation.
{$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 sysnr.inc} // syscall numbers.
{$i bsyscall.inc} // cpu specific syscalls

27
rtl/unix/oscdecl.inc Normal file
View 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}

View File

@ -1,6 +1,6 @@
{
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,
to import the base calls from libc.
@ -74,7 +74,14 @@ const
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 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';
{$endif bsd or solaris}
{$ifdef beos}
Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; cdecl; external 'net' name 'select';
{$else}