Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2001 17:43:25 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        Warner Losh <imp@harmony.village.org>, Garrett Wollman <wollman@khavrinen.lcs.mit.edu>, Kris Kennaway <kris@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/lib/libc/sys sigaction.2
Message-ID:  <20010808173808.V5910-100000@besplex.bde.org>
In-Reply-To: <xzpk80fee5q.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7 Aug 2001, Dag-Erling Smorgrav wrote:

> Bruce Evans <bde@zeta.org.au> writes:
> > On Wed, 25 Jul 2001, Warner Losh wrote:
> > > Strcpy isn't atomic.  So if the source string changes in a signal
> > > handler, unpredictable results will ensue.
> > That doesn't make it signal-unsafe any more than the possibility of
> > open(2)'s string arg changing makes open(2) signal-unsafe.
>
> No, but open(2) is uninterruptible while strcpy(3) isn't.  If a signal
> occurs while strcpy(3) is running, and it modifies the source string,
> the consequences may be very unpleasant.

But open(2) is interruptible.  If a signal occurs before open(2) enters
the kernel, and it modifies the source string, the consequences may
be very unpleasant :-).  Similarly if a signal occurs after open leaves
the kernel, and it modifies errno, or modifies or unmodifies the source
string so that it is harder to see what was opened.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010808173808.V5910-100000>