[fpc-devel] Fpsigprocmask

Michael Schnell mschnell at lumino.de
Mon Jan 25 17:16:59 CET 2010

On 01/22/2010 03:02 PM, Marco van de Voort wrote:
> (baseunix.)
> fpsignal, fpsigemptyset fpsigaddset fpsigprocmask

Thanks !

Martins source now does compile with
uses baseunix and
fpsignal(), fpsigemptyset(), fpsigaddset() and fpsigprocmask(),
fpwrite(), ... :)

but there are some more libc functions used, that I did not yet find an
equivalent for::


As sem_post does not seem to be exported somewhere, I defined sem_post
like this:

    function sem_post(__sem:Psem_t):longint;cdecl;external;

(also alike for sem_init() and friends)

it does compiler and link, but I_m not sure if it will work. I'd need to
do some additional porting, as this function has different parameters
from the sem_init() Martin uses (var parameter for the __sem argument).

Any further tips ?

what is the complicated thread save stuff with sys_semdestroy()
necessary for ?
Would it not be useful to use a Futex instead of a sema ?

Direct Futex calls of course are only available with libc, but I suppose
there are some baseunix things, as futex implicitly is used by by the
ptrhead library with thread-semaphores.

Thanks to both of you,

More information about the fpc-devel mailing list