From owner-freebsd-hackers Fri Feb 27 08:38:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA15110 for freebsd-hackers-outgoing; Fri, 27 Feb 1998 08:38:03 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from postman.opengroup.org (postman.opengroup.org [130.105.1.152]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA15042 for ; Fri, 27 Feb 1998 08:37:56 -0800 (PST) (envelope-from k.keithley@opengroup.org) Received: from benway (benway.camb.opengroup.org [130.105.9.33]) by postman.opengroup.org (8.8.6/8.8.6) with SMTP id LAA01337 for ; Fri, 27 Feb 1998 11:37:19 -0500 (EST) Message-ID: <34F6EC08.F6@opengroup.org> Date: Fri, 27 Feb 1998 11:38:32 -0500 From: "Kaleb S. KEITHLEY" Organization: The Open Group X-Mailer: Mozilla 3.04Gold (X11; I; HP-UX B.10.20 9000/715) MIME-Version: 1.0 To: hackers@FreeBSD.ORG Subject: Re: _POSIX_THREAD_SAFE_FUNCTIONS and *_r functions Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Someone (who I can't cite because I inadvertantly deleted their email) said: POSIX 1003.1 2.9.3 says if _POSIX_THREADS is defined, then _POSIX_THREAD_SAFE_FUNCTIONS must also be defined. It's true that that's what POSIX says, but it's a simplistic answer, and doesn't really address *everything* that POSIX says Table 2.10 in 2.9.3 says "...if _POSIX_THREAD_SAFE_FUNCTIONS is defined then the implementation supports the Thread Safe Functions option. Section 4.2.4.2 says: If _POSIX_THREAD_SAFE_FUNCTIONS is defined: The getlogin_r()... Section 4.7.2.2 says: If _POSIX_THREAD_SAFE_FUNCTIONS is defined: The ttyname_r()... Section 5.1.2.2 says: If _POSIX_THREAD_SAFE_FUNCTIONS is defined: The readdir_r()... Section 8.3.3.2 says: If _POSIX_THREAD_SAFE_FUNCTIONS is defined: The strtok_r()... And so on for getpwnam_r, etc. That means that if you don't have the Thread Safe Functions, then you can't define _POSIX_THREAD_SAFE_FUNCTIONS. (And therefore you can't define _POSIX_THREADS, which is sort of the reverse of the claim that if you define _POSIX_THREADS then you must define _POSIX_THREAD_SAFE_FUNCTIONS.) -- Kaleb To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message