From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964817AbVJLPhF (ORCPT ); Wed, 12 Oct 2005 11:37:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964816AbVJLPhF (ORCPT ); Wed, 12 Oct 2005 11:37:05 -0400 Received: from mail.gmx.net ([213.165.64.21]:7099 "HELO mail.gmx.net") by vger.kernel.org with SMTP id S964817AbVJLPhE (ORCPT ); Wed, 12 Oct 2005 11:37:04 -0400 Date: Wed, 12 Oct 2005 17:37:02 +0200 (MEST) From: "Michael Kerrisk" To: "linux-os \(Dick Johnson\)" Cc: raa.lkml@gmail.com, trond.myklebust@fys.uio.no, boi@boi.at, linux-kernel@vger.kernel.org MIME-Version: 1.0 References: Subject: =?ISO-8859-1?Q?Re:_blocking_file_lock_functions_(lockf,flock,fcntl)_do_no?= =?ISO-8859-1?Q?t_return_after_timer_signal?= X-Priority: 3 (Normal) X-Authenticated: #23581172 Message-ID: <16960.1129131422@www39.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > Von: "linux-os \(Dick Johnson\)" > An: "Alex Riesen" > Kopie: "Trond Myklebust" , , > "Linux kernel" > Betreff: Re: blocking file lock functions (lockf,flock,fcntl) do not > return after timer signal [...] > Datum: Wed, 12 Oct 2005 11:20:26 -0400 > As I told you, you use sigaction(). Also flock() will not block > unless there is another open on the file. The code will run to > your blocking read(), wait 10 seconds, get your "timeout" from > the signal handler, then read() will return with -1 and ERESTARTSYS > in errno as required. I was just trying to write a message to say the same ;-). > Also, using a 'C' runtime library call like write() in a signal- > handler is a bug. But this is not correct. write() is async-signal-safe (POSIX requires it). Cheers, Michael -- 10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail +++ GMX - die erste Adresse für Mail, Message, More +++