mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 00:59:07 +02:00
* pipe cleanup from Ales, also fixes TProcess for AMD64.
git-svn-id: trunk@12006 -
This commit is contained in:
parent
65637e301f
commit
e0821f6682
@ -45,26 +45,13 @@ Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_
|
||||
{
|
||||
Sets up a pair of file variables, which act as a pipe. The first one can
|
||||
be read from, the second one can be written to.
|
||||
If the operation was unsuccesful, linuxerror is set.
|
||||
If the operation was unsuccesful, errno is set.
|
||||
}
|
||||
var
|
||||
ret : longint;
|
||||
errn : cint;
|
||||
{$ifdef FPC_USE_LIBC}
|
||||
fdis : array[0..1] of cint;
|
||||
{$endif}
|
||||
pip : tfildes;
|
||||
begin
|
||||
{$ifndef FPC_USE_LIBC}
|
||||
ret:=intAssignPipe(pipe_in,pipe_out,errn);
|
||||
if ret=-1 Then
|
||||
fpseterrno(errn);
|
||||
{$ELSE}
|
||||
fdis[0]:=pipe_in;
|
||||
fdis[1]:=pipe_out;
|
||||
ret:=pipe(fdis);
|
||||
pipe_in:=fdis[0];
|
||||
pipe_out:=fdis[1];
|
||||
{$ENDIF}
|
||||
AssignPipe:=ret;
|
||||
assignPipe:=fppipe(pip);
|
||||
pipe_in:=pip[0];
|
||||
pipe_out:=pip[1];
|
||||
end;
|
||||
|
||||
|
@ -84,43 +84,6 @@ begin
|
||||
fpFlock:=do_syscall(syscall_nr_flock,fd,mode);
|
||||
end;
|
||||
|
||||
{$ifdef CPUI386}
|
||||
// needs oldfpccall;
|
||||
Function intAssignPipe(var pipe_in,pipe_out:longint;var errn:cint):cint; oldfpccall;
|
||||
{
|
||||
Sets up a pair of file variables, which act as a pipe. The first one can
|
||||
be read from, the second one can be written to.
|
||||
If the operation was unsuccesful, linuxerror is set.
|
||||
}
|
||||
|
||||
begin
|
||||
asm
|
||||
mov $42,%eax
|
||||
int $0x80
|
||||
jb .Lerror
|
||||
mov pipe_in,%ebx
|
||||
mov %eax,(%ebx)
|
||||
mov pipe_out,%ebx
|
||||
mov $0,%eax
|
||||
mov %edx,(%ebx)
|
||||
mov %eax,%ebx
|
||||
jmp .Lexit
|
||||
.Lerror:
|
||||
mov %eax,%ebx
|
||||
mov $-1,%eax
|
||||
.Lexit:
|
||||
mov Errn,%edx
|
||||
mov %ebx,(%edx)
|
||||
end;
|
||||
end;
|
||||
{$else CPUI386}
|
||||
Function intAssignPipe(var pipe_in,pipe_out:longint;var errn:cint):cint; oldfpccall;
|
||||
begin
|
||||
runerror(217);
|
||||
end;
|
||||
{$endif CPUI386}
|
||||
|
||||
|
||||
function MUnMap (P : Pointer; Size : size_t) : cint;
|
||||
begin
|
||||
MUnMap:=do_syscall(syscall_nr_munmap,TSysParam(P),Size);
|
||||
|
Loading…
Reference in New Issue
Block a user