From: "Michael Kerrisk" <mtk-lkml@gmx.net>
To: "linux-os \(Dick Johnson\)" <linux-os@analogic.com>
Cc: raa.lkml@gmail.com, trond.myklebust@fys.uio.no, boi@boi.at,
linux-kernel@vger.kernel.org
Subject: Re: blocking file lock functions (lockf,flock,fcntl) do not return after timer signal
Date: Wed, 12 Oct 2005 18:05:12 +0200 (MEST) [thread overview]
Message-ID: <26148.1129133112@www39.gmx.net> (raw)
In-Reply-To: Pine.LNX.4.61.0510121138450.4391@chaos.analogic.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1122 bytes --]
> >> 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().
Nevertheless, it is not so. The problem that some may
complain about is not C RTL code, but perhaps using
printf() (wrong) instead of write()
From:
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04
The following table defines a set of functions that shall
be either reentrant or non-interruptible by signals and
shall be async-signal-safe. Therefore applications may
invoke them, without restriction, from signal-catching
functions:
[...]
write()
Cheers,
Michael
--
NEU: Telefon-Flatrate fürs dt. Festnetz! GMX Phone_Flat: 9,99 Euro/Mon.*
Für DSL-Nutzer. Ohne Providerwechsel! http://www.gmx.net/de/go/telefonie
next prev parent reply other threads:[~2005-10-12 16:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-12 7:54 blocking file lock functions (lockf,flock,fcntl) do not return after timer signal "Dieter Müller (BOI GmbH)"
2005-10-12 12:48 ` Alex Riesen
2005-10-12 13:09 ` linux-os (Dick Johnson)
2005-10-12 14:39 ` Trond Myklebust
2005-10-12 15:10 ` Alex Riesen
2005-10-12 15:20 ` linux-os (Dick Johnson)
2005-10-12 15:37 ` Michael Kerrisk
2005-10-12 15:43 ` linux-os (Dick Johnson)
2005-10-12 16:05 ` Michael Kerrisk [this message]
2005-10-12 16:06 ` Mark Lord
2005-10-12 21:15 ` Alex Riesen
2005-10-12 16:36 ` Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26148.1129133112@www39.gmx.net \
--to=mtk-lkml@gmx.net \
--cc=boi@boi.at \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-os@analogic.com \
--cc=raa.lkml@gmail.com \
--cc=trond.myklebust@fys.uio.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).