+#if 0
+ /* The Linux manual page of flock(2) says:
+ "A process may only hold one type of lock (shared or exclusive) on a
+ file. Subsequent flock() calls on an already locked file will convert
+ an existing lock to the new lock mode."
+ So, the call below should convert the exclusive lock for fd to a shared
+ and thus succeeds. The fact that it doesn't but instead fails is
+ apparently a bug. */
+ /* The Solaris manual page of flock(2) says:
+ "More than one process may hold a shared lock for a file at any given
+ time, but multiple exclusive, or both shared and exclusive, locks may
+ not exist simultaneously on a file. ...
+ Requesting a lock on an object that is already locked normally causes
+ the caller to block until the lock may be acquired. If LOCK_NB is
+ included in operation, then this will not happen; instead, the call
+ will fail and the error EWOULDBLOCK will be returned."
+ So, the call below should fail and set errno to EWOULDBLOCK. The fact
+ that it succeeds is apparently a bug. */
+ r = flock (fd2, LOCK_SH | LOCK_NB);
+ ASSERT (r == -1);
+#endif
+