From: Anthony Liguori <aliguori@us.ibm.com>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: xen-devel@lists.xensource.com, Ewan Mellor <ewan@xensource.com>
Subject: Re: Re: [Xen-changelog] Make xenstored reopen its trace file on SIGHUP. This allows one to rotate the
Date: Mon, 07 Nov 2005 11:36:53 -0600 [thread overview]
Message-ID: <436F90B5.2040607@us.ibm.com> (raw)
In-Reply-To: <200511071124.02430.hollisb@us.ibm.com>
Hollis Blanchard wrote:
>On Monday 07 November 2005 11:15, Anthony Liguori wrote:
>
>
>>perror and strlen are not safe to call from a signal handler.
>>
>>I suggest just removing the perror call altogether and replacing strlen
>>with sizeof() - 1.
>>
>>
>
>I'm really not sure how strlen could be non-threadsafe. I don't care if it's
>not in your list; your list doesn't include strtok_r either, and that is
>explicitly thread-safe. :-P
>
>
So re-reading the manpage, the list of safe functions is a POSIX-ism.
That's perhaps why the thread-safe string functions aren't there since
those are defined by ANSI not POSIX.
Regards,
Anthony Liguori
>However, in addition to perror, another thread could try to use tracefd
>between the close and the open. You'd probably want to do something like:
> oldfd = tracefd;
> newfd = open();
> if (newfd < 0) {
> ...
> }
> tracefd = newfd;
> close(oldfd);
>
>Finally, you really should do error-checking on close(). See the close(2) man
>page...
>
>
>
prev parent reply other threads:[~2005-11-07 17:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1EZ6jH-0002pi-4u@xenbits.xensource.com>
2005-11-07 17:15 ` [Xen-changelog] Make xenstored reopen its trace file on SIGHUP. This allows one to rotate the Anthony Liguori
2005-11-07 17:23 ` Ewan Mellor
2005-11-07 17:24 ` Hollis Blanchard
2005-11-07 17:36 ` Anthony Liguori [this message]
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=436F90B5.2040607@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=ewan@xensource.com \
--cc=hollisb@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.