From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,926374546ef4c3cd X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-02-17 10:44:49 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!world!mv!chillon!decvax.dec.com!equinox.zk3.dec.com!dlong From: dlong@equinox.zk3.dec.com (David Long OSG) Subject: Re: Reentrant dir routines Message-ID: <1994Feb17.184449.25422@decvax.dec.com> Sender: usenet@decvax.dec.com (Usenet News System) Nntp-Posting-Host: equinox.zk3.dec.com Organization: Digital Equipment Corporation - Nashua, NH References: <2jrb1h$ndm@bbs.pnl.gov> Date: Thu, 17 Feb 1994 18:44:49 GMT 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