[fpc-devel]missing syscalls

Michael Van Canneyt michael.vancanneyt at wisa.be
Mon Jan 7 10:13:10 CET 2002


On 3 Jan 2002 Thomas.Hergenhahn at nexans.com wrote:

> 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;

I will add these calls.

>
> 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?

It has grown historically, and is a known problem...

I suppose we can make overloaded versions of each call for this which
does what you describe...

Michael.





More information about the fpc-devel mailing list