Re: blocking file lock functions (lockf,flock,fcntl) do not return after timer signal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 12 Oct 2005, Michael Kerrisk wrote:

>> Von: "linux-os \(Dick Johnson\)" <[email protected]>
>> An: "Alex Riesen" <[email protected]>
>> Kopie: "Trond Myklebust" <[email protected]>, <[email protected]>,
>> "Linux kernel" <[email protected]>
>> 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 [email protected] - 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux