Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2000 18:13:16 +0300
From:      Ruslan Ermilov <ru@sunbay.com>
To:        Sheldon Hearn <sheldonh@uunet.co.za>
Cc:        "Andrey A. Chernov" <ache@freebsd.org>, cvs-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/lib/libalias alias_proxy.c
Message-ID:  <20000830181316.B82227@sunbay.com>
In-Reply-To: <83666.967647763@axl.fw.uunet.co.za>; from sheldonh@uunet.co.za on Wed, Aug 30, 2000 at 05:02:43PM %2B0200
References:  <20000830173420.A80504@sunbay.com> <83666.967647763@axl.fw.uunet.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Aug 30, 2000 at 05:02:43PM +0200, Sheldon Hearn wrote:
> 
> 
> On Wed, 30 Aug 2000 17:34:20 +0300, Ruslan Ermilov wrote:
> 
> > Would be nice if the reason was documented in strtok.3 and/or style.9.
> > (such a reason was given in a commitlog for libc_gen/fstab.c,v 1.3).
> 
> Looking at the manual page, strtok() is implicitly defined as
> non-reentrant when strtok_r is explicitly defined as reentrant.
> 
Threads reentrancy is not an issue here.  strtok() in libc_r case is
as much unsafe as its counterpart in standard libc.

The problem is when a program and library use strtok() simultaneously:
1. you call strtok() from your main code
2. you call a library function
3. library function calls strtok()
4. you call strtok() from your main code again (poof!)


-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age


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?20000830181316.B82227>