* Reentrant dir routines
@ 1994-02-15 20:24 Adrian Wong
1994-02-17 18:44 ` David Long OSG
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Wong @ 1994-02-15 20:24 UTC (permalink / raw)
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.
I am sure that you need the reentrant version of opendir
(I've tested it). Without it, readdir_r is useless.
--
-------------------------------------------------------------------
Adrian Wong | MSIN K1-90, Molecular Science Research Center
| Pacific Northwest Laboratory, PO Box 999
at_wong@pnl.gov | Richland, WA 99352
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Reentrant dir routines
1994-02-15 20:24 Reentrant dir routines Adrian Wong
@ 1994-02-17 18:44 ` David Long OSG
0 siblings, 0 replies; 2+ messages in thread
From: David Long OSG @ 1994-02-17 18:44 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1994-02-17 18:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-02-15 20:24 Reentrant dir routines Adrian Wong
1994-02-17 18:44 ` David Long OSG
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox