Thread View: comp.bugs.sys5
4 messages
4 total messages
Started by L. Mark Larsen
Wed, 29 Mar 1989 18:36
libPW.a(curdir.o) [SVR3.0+]
Author: L. Mark Larsen
Date: Wed, 29 Mar 1989 18:36
Date: Wed, 29 Mar 1989 18:36
19 lines
1147 bytes
1147 bytes
With SVR3.0, libPW.a(curdir.o) uses a new algorithm that doesn't chdir().
Unfortunately, a small bug was introduced which causes each invocation
of curdir() to leave open an extra file descriptor. If you use something
like build, which calls curdir() twice and usually is fork'd several
levels deep, you quickly run out of file descriptors for the real work.
For those with source, the solution is to add a call to closedir() just
before the return when identical() returns true:
if( identical( &cdirectory, sbp ) ) {
closedir( cdp ); /* missing call in original source */
stradd( str, "/" );
return str;
}
For those without source, you could always use a pre-SVR3.0 version with
the old algorithm - it worked fine.
L. Mark Larsen
att!atlas!lml
lml@atlas.ATT.COM
Re: libPW.a(curdir.o) [SVR3.0+]
Author: Daniel A. Graifer
Date: Thu, 30 Mar 1989 16:39
Date: Thu, 30 Mar 1989 16:39
14 lines
1030 bytes
1030 bytes
In article <5226@cbnews.ATT.COM> lml@cbnews.ATT.COM (L. Mark Larsen) writes: >With SVR3.0, libPW.a(curdir.o) uses a new algorithm that doesn't chdir(). >Unfortunately, a small bug was introduced >...[discussion of bug, and source patch to fix] >L. Mark Larsen >att!atlas!lml >lml@atlas.ATT.COM Has this been fixed in more recent releases? I don't have source but we are about to move from SVR3.0 to 3.1. It would be nice if this were fixed. I am also about to buy a new 386 machine with 3.2. What about that release? Thanks in advance... Dan
Re: libPW.a(curdir.o) [SVR3.0+]
Author: Guy Harris
Date: Thu, 30 Mar 1989 19:35
Date: Thu, 30 Mar 1989 19:35
25 lines
1130 bytes
1130 bytes
>For those without source, you could always use a pre-SVR3.0 version with >the old algorithm - it worked fine. Or else: 1) Use the implementation of "getcwd" that comes with S5R3 (or R2, or...) if you're willing to put up with a "fork" and "exec" of "/bin/pwd" per access or 2) grab the source to "getwd" from 4.3BSD and modify it slightly to have the interface of "getcwd" (and not to use "lstat", if you don't have it). This: 1) helps remove dependencies on the undocumented "-lPW" library, and helps move that library towards the Elephant's Graveyard and 2) helps move your code towards being a SVID-compliant application. "-lPW - just say no!"
Re: libPW.a(curdir.o) [SVR3.0+]
Author: L. Mark Larsen
Date: Sun, 02 Apr 1989 07:00
Date: Sun, 02 Apr 1989 07:00
19 lines
1431 bytes
1431 bytes
In article <461@fciva.FRANKLIN.COM> dag@fciva.UUCP (Daniel A. Graifer) writes: #Has this been fixed in more recent releases? I don't have source but we are #about to move from SVR3.0 to 3.1. It would be nice if this were fixed. I am #also about to buy a new 386 machine with 3.2. What about that release? (I tried mailing this but it bounced.) As near as I can determine, SVR3.1 has the same bug. I don't have the SVR3.2 source although I do have the source for the compiler (4.2) that comes with 3.2 and it has the bug too (sources for libraries are part of the compiler package). So, I wouldn't count on it being fixed anytime soon. Of course, as was pointed out, there are other alternatives. If you are writing something that would use this function, I suppose you could work around the bug by explicitly closing the (n + 1)th file descriptor known to be in use, right after the call to curdir(). cheers, L. Mark Larsen lml@atlas.ATT.COM att!atlas!lml
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads