X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: "BJ" Subject: file locking problem Date: Wed, 19 Sep 2007 19:30:26 -0400 Lines: 30 Message-ID: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I have a file locking problem that is solved under Mac and Linux using fcntl: int lockRepFile (int fd, char lock, size_t from, size_t length) { struct flock fl; fl.l_start = from; fl.l_len = length; fl.l_pid = 0; if (lock == 'r') fl.l_type = F_RDLCK; else if (lock == 'w') fl.l_type = F_WRLCK; else if (lock == 'u') fl.l_type = F_UNLCK; fl.l_whence = SEEK_SET; return (fcntl(fd, F_SETLKW, &fl)); } Now, unfortunately this hangs occasionally using cygwin - gcc. I would appreciate any comments and suggestions on how debug this and how to improve the performance i.e. stop it from hanging... Thanks B -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/