diff options
Diffstat (limited to 'winsup/cygwin/posix.sgml')
-rw-r--r-- | winsup/cygwin/posix.sgml | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/winsup/cygwin/posix.sgml b/winsup/cygwin/posix.sgml index b532e6e5c..b88ecb973 100644 --- a/winsup/cygwin/posix.sgml +++ b/winsup/cygwin/posix.sgml @@ -954,6 +954,13 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para> <sect1 id="std-bsd"><title>System interfaces compatible with BSD functions:</title> <screen> + __b64_ntop + __b64_pton + arc4random + arc4random_addrandom + arc4random_buf + arc4random_stir + arc4random_uniform bindresvport bindresvport_sa cfmakeraw @@ -1460,10 +1467,32 @@ CLOCK_REALTIME and CLOCK_MONOTONIC. <function>clock_setres</function>, <function>clock_settime</function>, and <function>timer_create</function> currently support only CLOCK_REALTIME.</para> +<para>POSIX file locks via <function>fcntl</function> or +<function>lockf</function>, as well as BSD <function>flock</function> locks +are advisory locks. They don't interact with Windows mandatory locks, nor +do POSIX fcntl locks interfere with BSD flock locks or vice versa.</para> + <para>BSD file locks created via <function>flock</function> are only propagated to the direct parent process, not to grand parents or sibling -processes. The locks are only valid in the creating process, its parent, -and subsequently started child processes sharing the same file descriptor. +processes. The locks are only valid in the creating process, its parent +process, and subsequently started child processes sharing the same file +descriptor.</para> + +<para>In very rare circumstances an application would want to use Windows +mandatory locks to interact with non-Cygwin Windows processes accessing the +same file (databases, etc). For these purposes, the entire locking mechanism +(fcntl/flock/lockf) can be switched to Windows mandatory locks on a +per-descriptor/per-process basis. For this purpose, use the call + +<screen> + fcntl (fd, F_LCK_MANDATORY, 1); +</screen> + +After that, all file locks on this descriptor will follow Windows mandatory +record locking semantics: Locks are per-descriptor/per-process; locks are not +propagated to child processes, not even via <function>execve</function>; +no atomic replacement of read locks with write locks and vice versa on the +same descriptor; locks have to be unlocked exactly as they have been locked. </para> <para><function>fpclassify</function>, <function>isfinite</function>, |