lkml.org 
[lkml]   [2005]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: blocking file lock functions (lockf,flock,fcntl) do not return after timer signal
Date
From

On Wed, 12 Oct 2005, Michael Kerrisk wrote:

>> Von: "linux-os \(Dick Johnson\)" <linux-os@analogic.com>
>> An: "Alex Riesen" <raa.lkml@gmail.com>
>> Kopie: "Trond Myklebust" <trond.myklebust@fys.uio.no>, <boi@boi.at>,
>> "Linux kernel" <linux-kernel@vger.kernel.org>
>> 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).
>

Then tell it to the doom-sayers who always excoriate me when
I use a 'C' runtime library call in test signal code. I have
been told that the __only__ thing you can do in a signal handler
is access global memory and/or execute siglongjmp().

> Cheers,
>
> Michael
>
> --
> 10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail
> +++ GMX - die erste Adresse für Mail, Message, More +++
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.56 BogoMips).
Warning : 98.36% of all statistics are fiction.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-12 17:46    [W:0.057 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site