[fpc-devel] Typo in unistdh.inc

Den Jean Geeken at telenet.be
Tue Feb 1 01:15:10 CET 2005


Hi,

1) sysconf:
could someone please fix sysconf in unistdh.inc.
The library name is not correct

packages/base/libc/unistdh.inc:function sysconf (__name : longint) : longint; cdecl; external clib name 'syconf';


The compile error is typically :

 In function `START_SESSION':
SYS_UTIL.pas:329: undefined reference to `syconf'

The rest is nice to have...........

2) PUserContext: 

   It would be nice to add the the following type definion for more Kylix compatibility
   type PUserContext = ^TUserContext;
  grep -> ./packages/base/libc/sucontexth.inc:  TUserContext = ucontext_t;


3) sigaction:
 It would be nice to fix the definition of sigaction. If a libc function is defined 
     to take pointers as an argument, it only looks cleaner to define the parameter as a var,
     but mostly it is better to define it with a pointer, this way it remains possible to pass nil as parameter.
     If passing nil does not make sense, using var is ok. All this only to avoid too many IFDEFS in code that
     is to be Kylix and FPC compatible.

     So I prefer (Kylix extract)

function sigaction(SigNum: Integer; Action: PSigAction; OldAction: PSigAction): Integer;

   instead of 

./packages/base/libc/signalh.inc:function sigaction(__sig:longint; Const act: _sigaction; Var oldact: _sigaction):longint;cdecl;external clib name 'sigaction';

4) setrlimit:

Here again Kylix has another definition and more logical (you cannot omit the rlimit)
It would be nice (Kylix compatibility) to have the Kylix type of definition.

fpc:
function setrlimit(__resource:__rlimit_resource_t; __rlimits:Prlimit):longint;cdecl;external clib name 'setrlimit';

Kylix:
function setrlimit (__resource: __rlimit_resource_t; const __rlimits: TRLimit): Integer; cdecl;

5) I need many more ifdefs, but I notice sometimes that it is better in FPC, then I just add an IFDEF and shut up.


kind regards,

Den Jean




More information about the fpc-devel mailing list