Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Nov 1999 22:59:16 -0700
From:      Wes Peters <wes@softweyr.com>
To:        freebsd-arch@freebsd.org
Subject:   Reentrant library to-do list
Message-ID:  <383B7EB4.6497E65@softweyr.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?383B7EB4.6497E65>