Ver código fonte

set errno after syscalls. this fixes tiorte test at least. this code ideally should be in assembly, but it seems the assembler reader needs some fixing first...

git-svn-id: trunk@26828 -
Károly Balogh 11 anos atrás
pai
commit
c6d60979d2
1 arquivos alterados com 7 adições e 0 exclusões
  1. 7 0
      rtl/linux/m68k/syscall.inc

+ 7 - 0
rtl/linux/m68k/syscall.inc

@@ -29,6 +29,7 @@ begin
     trap #0
     move.l d0, @Result
   end ['d0'];
+  if (result < 0) then seterrno(-result);
 end;
 
 
@@ -40,6 +41,7 @@ begin
     trap #0
     move.l d0, @Result
   end ['d0', 'd1'];
+  if (result < 0) then seterrno(-result);
 end;
 
 
@@ -52,6 +54,7 @@ begin
     trap #0
     move.l d0, @Result
   end ['d0', 'd1', 'd2'];
+  if (result < 0) then seterrno(-result);
 end;
 
 
@@ -65,6 +68,7 @@ begin
     trap #0
     move.l d0, @Result
   end ['d0', 'd1', 'd2', 'd3'];
+  if (result < 0) then seterrno(-result);
 end;
 
 function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; [public,alias:'FPC_SYSCALL4'];
@@ -78,6 +82,7 @@ begin
     trap #0
     move.l d0, @Result
   end ['d0', 'd1', 'd2', 'd3', 'd4'];
+  if (result < 0) then seterrno(-result);
 end;
 
 
@@ -93,6 +98,7 @@ begin
     trap #0
     move.l d0, @Result
   end ['d0', 'd1', 'd2', 'd3', 'd4', 'd5'];
+  if (result < 0) then seterrno(-result);
 end;
 
 
@@ -109,5 +115,6 @@ begin
     trap #0
     move.l d0, @Result
   end ['d0', 'd1', 'd2', 'd3', 'd4', 'd5', 'a0'];
+  if (result < 0) then seterrno(-result);
 end;