[fpc-devel]missing syscalls
Thomas.Hergenhahn at nexans.com
Thomas.Hergenhahn at nexans.com
Thu Jan 3 16:29:10 CET 2002
Hello, developers,
a happy new Year to all of You !
I use fpc 1.0.4 and I missed the following syscalls:
procedure getResUid(var ruid: longint; var euid:longint; var suid:longint);
var
regs : SysCallregs;
x: longint;
begin
{ This was only for verifying that values are really set by system call:}
(*
ruid:=44;
euid:=45;
suid:=46;
*)
regs.reg2:=longint(@ruid);
regs.reg3:=longint(@euid);
regs.reg4:=longint(@suid);
{ x:=}SysCall(SysCall_nr_getresuid,regs);
{ writeln('X: ',x);}
Linuxerror:=errno;
end;
procedure setResUid(var ruid: longint; var euid:longint; var suid:longint);
var
regs : SysCallregs;
x: longint;
begin
regs.reg2:=ruid;
regs.reg3:=euid;
regs.reg4:=suid;
{ x:=}
SysCall(SysCall_nr_setresuid,regs);
{ writeln('X: ',x);}
{
ruid:=regs.reg2;
euid:=regs.reg3;
suid:=regs.reg4;
}
Linuxerror:=errno;
end;
BTW, why does SysCall store errors in LinuxError? IMHO, it would be nice to make functions of all the syscalls and return
error numbers as negative values. This would be inherently thread safe, or do I miss a point here?
More information about the fpc-devel
mailing list