[fpc-devel] mlockall() unit libc

Marco van de Voort marcov at stack.nl
Wed Jan 6 11:54:15 CET 2010

In our previous episode, Stefan Kisdaroczi said:

> i need the mlockall() call (unit libc) in my realtime apps on linux i386
> to lock the address space of the process. Works, but unit libc has no
> future and it's the only function i need from this unit.

mlockall is part of the posix 2001 realtime extensions, which are afaik
optional. And usually it only works for root.

IOW not all Unices might implement it, which is more or less the rule of
thumb to get into one of the portalbe units (unix,baseunix)

Sometimes exceptions to this rule are made (e.g. for UUID functions) when
the function are found to be implemented on all unix platforms.

I checked and they (+ the corresponding unlock) are in FreeBSD5+, so FreeBSD
is no problem (MCL_CURRENT and MCL_FUTURE are the mandatory flags by Posix,
and FreeBSD only supports those)

I saw some hints on the web that OS X doesn't support it (but it should be
checked against 10.3/10.4+ since afaik those implement a lot more calls due
to synchronization with FreeBSD5)

Then solaris and Haiku as the other unices must be checked.

More information about the fpc-devel mailing list