From owner-cvs-all Wed Aug 8 0:52:32 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 99C3F37B405; Wed, 8 Aug 2001 00:52:26 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id RAA26059; Wed, 8 Aug 2001 17:45:54 +1000 Date: Wed, 8 Aug 2001 17:43:25 +1000 (EST) From: Bruce Evans X-X-Sender: To: Dag-Erling Smorgrav Cc: Warner Losh , Garrett Wollman , Kris Kennaway , , Subject: Re: cvs commit: src/lib/libc/sys sigaction.2 In-Reply-To: Message-ID: <20010808173808.V5910-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 7 Aug 2001, Dag-Erling Smorgrav wrote: > Bruce Evans 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