* some more fixes. Testing on idefix

This commit is contained in:
marco 2003-12-30 16:26:10 +00:00
parent 42d5e0e005
commit 0afb6fd8ca
3 changed files with 41 additions and 9 deletions

View File

@ -154,7 +154,7 @@ end;
Function Errno2InoutRes : longint;
begin
Errno2InoutRes:=PosixToRunError(Errno);
Errno2InoutRes:=PosixToRunError(getErrno);
InoutRes:=Errno2InoutRes;
end;
@ -212,7 +212,7 @@ Function Do_Write(Handle,Addr,Len:SizeInt):longint;
Begin
repeat
Do_Write:=Fpwrite(Handle,pchar(addr),len);
until (Do_Write>=0) or (ErrNo<>ESysEINTR);
until (Do_Write>=0) or (getErrNo<>ESysEINTR);
If Do_Write<0 Then
Begin
Errno2InOutRes;
@ -227,7 +227,7 @@ Function Do_Read(Handle,Addr,Len:SizeInt):Longint;
Begin
repeat
Do_Read:=Fpread(Handle,pchar(addr),len);
until (Do_Read>=0) or (ErrNo<>ESysEINTR);
until (Do_Read>=0) or (getErrNo<>ESysEINTR);
If Do_Read<0 Then
Begin
Errno2InOutRes;
@ -345,7 +345,7 @@ Begin
{ real open call }
FileRec(f).Handle:=Fpopen(p,oflags,MODE_OPEN);
if (FileRec(f).Handle<0) and
(ErrNo=ESysEROFS) and
(getErrNo=ESysEROFS) and
((OFlags and O_RDWR)<>0) then
begin
Oflags:=Oflags and not(O_RDWR);
@ -594,7 +594,10 @@ End.
*)
{
$Log$
Revision 1.10 2003-12-21 20:30:49 peter
Revision 1.11 2003-12-30 16:26:10 marco
* some more fixes. Testing on idefix
Revision 1.10 2003/12/21 20:30:49 peter
* don't exit in getdir when fpstat gives a failure
Revision 1.9 2003/12/14 14:28:36 peter

View File

@ -446,7 +446,7 @@ begin
if sbrk=pointer(-1) then
sbrk:=nil
else
errno:=0;
seterrno(0);
end;
Function Do_IsDevice(Handle:cint):boolean;
@ -467,7 +467,10 @@ end;
{
$Log$
Revision 1.11 2003-12-30 15:43:20 marco
Revision 1.12 2003-12-30 16:26:10 marco
* some more fixes. Testing on idefix
Revision 1.11 2003/12/30 15:43:20 marco
* linux now compiles with FPC_USE_LIBC
Revision 1.10 2003/12/16 09:43:04 daniel

View File

@ -34,6 +34,29 @@ Interface
Implementation
{$ifdef FPC_USE_LIBC}
const clib = 'c';
type libcint=longint;
plibcint=^libcint;
function geterrnolocation: Plibcint; cdecl;external clib name'__errno_location';
function geterrno:libcint; [public, alias: 'FPC_SYS_GETERRNO'];
begin
geterrno:=geterrnolocation^;
end;
procedure seterrno(err:libcint); [public, alias: 'FPC_SYS_SETERRNO'];
begin
geterrnolocation^:=err;
end;
{$else}
{$ifdef ver1_0}
Var
{$else}
@ -52,7 +75,7 @@ procedure seterrno(err:longint); [public, alias: 'FPC_SYS_SETERRNO'];
begin
Errno:=err;
end;
{$endif}
{$I system.inc}
@ -141,7 +164,10 @@ End.
{
$Log$
Revision 1.10 2003-12-30 15:43:20 marco
Revision 1.11 2003-12-30 16:26:10 marco
* some more fixes. Testing on idefix
Revision 1.10 2003/12/30 15:43:20 marco
* linux now compiles with FPC_USE_LIBC
Revision 1.9 2003/12/30 12:36:56 marco