The following patch addresses problem associated with process locks when called from cloned process created with CLONE_THREAD flag. The fcntl locks are per-process and creates a dead-lock for cloned (w/CLONE_THREAD) processes. It should use tgid instead pid (same way as getpid()). Thanks, Saurabh Desai (sdesai@austin.ibm.com) =======================================