Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: dlong@equinox.zk3.dec.com (David Long OSG)
Subject: Re: Reentrant dir routines
Date: Thu, 17 Feb 1994 18:44:49 GMT	[thread overview]
Message-ID: <1994Feb17.184449.25422@decvax.dec.com> (raw)
In-Reply-To: 2jrb1h$ndm@bbs.pnl.gov

In article <2jrb1h$ndm@bbs.pnl.gov>, rg240@fermi.pnl.gov (Adrian Wong) writes:
|> The OSF1 manpage page lists two reentrant versions of
|> opendir and readdir. However, on AXP's and KSR's, I can
|> only find the readdir_r object (in libc_r.a). Where's
|> opendir_r?? Keeping a table of DIR * pointers open
|> I thought would not be so difficult to implement.

It's not necessary for the library function to keep such a table, you
as the invoker of this function are responsible for keeping track of
the DIR pointers it returns to you just as you are in the single-threaded
case.

|> 
|> I am sure that you need the reentrant version of opendir
|> (I've tested it). Without it, readdir_r is useless.

While the presence of an _r on the end of the function name means it is
a threadsafe function, it's absence does not imply the opposite.  Some
functions are inherently threadsafe and are found only in libc.  In your
case there is another, threadsafe, version of opendir in libc_r.  However,
in these situations the function has a different (*_r) name ONLY if the
interface to the threadsafe version is different than the interface to the
non-threadsafe version, as it is for readdir() and readdir_r().  If you
call opendir() and link your application as required for multi-threaded
applications, you will get a threadsafe version of opendir().

It bothers me that you say you've tested this.  This implies you found
something you think is not working.  If you still believe this I would
encourage you to report the problem through your support channels.

David Long
Digital Equipment Corporation


      reply	other threads:[~1994-02-17 18:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-02-15 20:24 Reentrant dir routines Adrian Wong
1994-02-17 18:44 ` David Long OSG [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox