From owner-freebsd-arch Wed Nov 24 10:16:50 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 02F2014BFF for ; Wed, 24 Nov 1999 10:16:46 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id TAA08261 for ; Wed, 24 Nov 1999 19:16:45 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id TAA34796 for freebsd-arch@freebsd.org; Wed, 24 Nov 1999 19:16:44 +0100 (MET) Received: from ind.alcatel.com (postal.xylan.com [208.8.0.248]) by hub.freebsd.org (Postfix) with ESMTP id ECC6115180 for ; Wed, 24 Nov 1999 10:16:31 -0800 (PST) (envelope-from wes@softweyr.com) Received: from mailhub.xylan.com (mailhub [198.206.181.70]) by ind.alcatel.com (8.9.3+Sun/8.9.1 (ind.alcatel.com 3.0 [OUT])) with SMTP id VAA27220 for ; Tue, 23 Nov 1999 21:59:21 -0800 (PST) X-Origination-Site: Received: from omni.xylan.com by mailhub.xylan.com (SMI-8.6/SMI-SVR4 (mailhub 2.1 [HUB])) id VAA26148; Tue, 23 Nov 1999 21:59:20 -0800 Received: from softweyr.com ([204.68.178.39]) by omni.xylan.com (4.1/SMI-4.1 (xylan engr [SPOOL])) id AA16886; Tue, 23 Nov 99 21:59:17 PST Message-Id: <383B7EB4.6497E65@softweyr.com> Date: Tue, 23 Nov 1999 22:59:16 -0700 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.1-RELEASE i386) X-Accept-Language: en Mime-Version: 1.0 To: freebsd-arch@freebsd.org Subject: Reentrant library to-do list Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Pedro Giffuni called me on some belated deliveries on my work on the _r routines this afternoon. ;^) In the ensuing pleasant conversation, I sent him my to-do list and he suggested it would be a good idea to share it here. I snarfed a list of all the _r routines from a recent Solaris release, then categorized them in categories of "I need it now", "Lord, spare me", etc. Here's the list, including what I've already done: Already done: x asctime_r ctime (3c) - convert date and time to string x ctime_r ctime (3c) - convert date and time to string x gmtime_r ctime (3c) - convert date and time to string x localtime_r ctime (3c) - convert date and time to string x strtok_r string (3c) - string operations x tmpnam_r tmpnam (3s) - create a name for a temporary file x rand_r rand (3c) - simple random-number generator Relatively simple: gamma_r lgamma (3m) - log gamma function lgamma_r lgamma (3m) - log gamma function (IIRC, these are already *in* the library, and I have man pages ready on a system that is currently stuffed in a closet. Ignore these unless you really need them NOW). ctermid_r ctermid (3s) - generate path name for controlling terminal ttyname_r ttyname (3c) - find name of a terminal Probably simple: readdir_r directory (3c) - directory operations gethostbyaddr_r gethostbyname (3n) - get network host entry gethostbyname_r gethostbyname (3n) - get network host entry gethostent_r gethostbyname (3n) - get network host entry getnetbyaddr_r getnetbyname (3n) - get network entry getnetbyname_r getnetbyname (3n) - get network entry getnetent_r getnetbyname (3n) - get network entry getnetgrent_r getnetgrent (3n) - get network group entry getprotobyname_r getprotobyname (3n) - get protocol entry getprotobynumber_r getprotobyname (3n) - get protocol entry getprotoent_r getprotobyname (3n) - get protocol entry getrpcbyname_r getrpcbyname (3n) - get RPC entry getrpcbynumber_r getrpcbyname (3n) - get RPC entry getrpcent_r getrpcbyname (3n) - get RPC entry getservbyname_r getservbyname (3n) - get service entry getservbyport_r getservbyname (3n) - get service entry getservent_r getservbyname (3n) - get service entry fgetgrent_r getgrnam (3c) - get group entry getgrent_r getgrnam (3c) - get group entry getgrgid_r getgrnam (3c) - get group entry getgrnam_r getgrnam (3c) - get group entry getlogin_r getlogin (3c) - get login name This one looked so simple, I did it tonight just to prove I still can. I'll test it tomorrow and commit it then. ;^) Difficult due to non-reentrant dbm library: fgetpwent_r getpwnam (3c) - get password entry fgetspent_r getspnam (3c) - get password entry getspent_r getspnam (3c) - get password entry getspnam_r getspnam (3c) - get password entry getpwent_r getpwnam (3c) - get password entry getpwnam_r getpwnam (3c) - get password entry getpwuid_r getpwnam (3c) - get password entry I think we can probably take care of these by using a semaphore to serialize access to the password db. I haven't looked into it at all; I've been putting this off until the last because it's the messiest. Of course, it's usually the one that comes up first, too. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message