Date: Wed, 30 Aug 2000 11:25:19 -0400 (EDT) From: Rajesh Vaidheeswarran <rv@freebsd.org> To: Robert Watson <rwatson@freebsd.org> Cc: Sheldon Hearn <sheldonh@uunet.co.za>, Ruslan Ermilov <ru@sunbay.com>, "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: <200008301525.LAA16587@mailman.pit.comms.marconi.com> In-Reply-To: Message from Robert Watson <rwatson@freebsd.org> of "Wed, 30 Aug 2000 11:20:18 -0400." <Pine.NEB.3.96L.1000830111221.12020C-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
FWIW, From Solaris 7's strtok manpage. NOTES The strtok_r() function is as proposed in the POSIX.4a Draft #6 document, and is subject to change to be compliant to the standard when it is accepted. When compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should only be used in multithreaded applications. All of these functions assume the default locale ``C.'' For some locales, strxfrm() should be applied to the strings before they are passed to the functions. The strcasecmp(), strcat(), strchr(), strcmp(), strcpy(), strcspn(), strdup(), strlen(), strncasecmp(), strncat(),strncmp(), strncpy(), strpbrk(),strrchr(), strspn(), and strstr() functions are MT-Safe in mul- tithreaded applications. The strtok() function is Unsafe in multithreaded applica- tions. The strtok_r() function should be used instead. In a previous message, Robert Watson writes: > > On Wed, 30 Aug 2000, Sheldon Hearn wrote: > > > Looking at the manual page, strtok() is implicitly defined as > > non-reentrant when strtok_r is explicitly defined as reentrant. > > > > I wouldn't feel comfortable with adding to the manual page of every > > non-reentrant function, a warning against its use in library code. > > > > To me, that feels like adding to every manual page for a utility that > > produces output, a warning that redirecting the output to a file with > > the shell ">" operator will destroy the existing contents of the file. > > Solaris explicitely documents the thread safety of each function in each > man page, and I think that's actually a good idea, especially given that > we'll have multiple threading models in the future. We already include > thread implementation information in syscall manpages for the same reason. > Call the new section "THREAD SAFETY" or something. > > (Or maybe that was IRIX, in any case, it's very useful) > > > Robert N M Watson > > robert@fledge.watson.org http://www.watson.org/~robert/ > PGP key fingerprint: AF B5 5F FF A6 4A 79 37 ED 5F 55 E9 58 04 6A B1 > TIS Labs at Network Associates, Safeport Network Services > > 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?200008301525.LAA16587>