From owner-cvs-all Wed Aug 30 8:25:34 2000 Delivered-To: cvs-all@freebsd.org Received: from mailgate.pit.comms.marconi.com (mailgate.pit.comms.marconi.com [169.144.68.6]) by hub.freebsd.org (Postfix) with ESMTP id 8C10837B423; Wed, 30 Aug 2000 08:25:27 -0700 (PDT) Received: from mailman.pit.comms.marconi.com (mailman.pit.comms.marconi.com [169.144.2.12]) by mailgate.pit.comms.marconi.com (8.9.3/8.9.3) with ESMTP id LAA16464; Wed, 30 Aug 2000 11:25:18 -0400 (EDT) Received: from fore.com (tejas.pit.comms.marconi.com [169.144.86.36]) by mailman.pit.comms.marconi.com (8.9.3/8.9.3) with ESMTP id LAA16587; Wed, 30 Aug 2000 11:25:20 -0400 (EDT) Message-Id: <200008301525.LAA16587@mailman.pit.comms.marconi.com> Received: by agastya.eng.fore.com with BradMail(MH 6.8.4); Wed, 30 Aug 2000 11:25:19 -0400 (EDT) To: Robert Watson Cc: Sheldon Hearn , Ruslan Ermilov , "Andrey A. Chernov" , cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libalias alias_proxy.c In-reply-to: Message from Robert Watson of "Wed, 30 Aug 2000 11:20:18 -0400." From: Rajesh Vaidheeswarran Reply-To: cvs-committers@freebsd.org X-Loop-Detect: rv@freebsd.org Date: Wed, 30 Aug 2000 11:25:19 -0400 (EDT) Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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