Article View: news.software.readers
Article #4976Re: tin1.2PL1 patch for BSD-based systems
From: Greg Earle
Date: Sun, 18 Jul 1993 00:20
Date: Sun, 18 Jul 1993 00:20
40 lines
2681 bytes
2681 bytes
In article <1993Jul15.204306.1377@ohm.york.ac.uk> csp@ohm.york.ac.uk (Colin Perkins) writes:
>Leila Burrell-Davis (leilabd@syma.sussex.ac.uk) wrote:
>>Colin Perkins (csp@ohm.york.ac.uk) wrote:
>>[ patch deleted ]
>>A slightly more general patch is:
>
>[slightly more general (?) patch deleted]
>
>Except that changing the getcwd to get_cwd as I did calls Iain's
>routine which has the #ifdefs built in. This has the advantage of
>localising the machine dependant code into a single function, instead
>of spreading it around the program ... That said, the two patches have
>the same effect, so who cares? (Except perhaps Iain who has to
>maintain it...)
I don't use TIN so I can't comment on the "get_cwd()" function use, but to
answer the person who said they didn't have this problem on SunOS, that is
for a very simple reason - getcwd(3v) is provided as a System V compatibility
function. However, it is provided for compatbility only, and it should not
be used (compiled in) under SunOS. The getwd(3) function is preferred. See
the BUGS section of getcwd(3v):
..
BUGS
Since this function uses popen() to create a pipe to the pwd
command, it is slower than getwd() and gives poorer error
diagnostics. getcwd() is provided only for compatibility
with other UNIX operating systems.
If "get_cwd()" is some general function that uses "getwd()" if this
DONT_HAVE_GETCWD #define exists, and it is used a lot in the code, then I
would say Colin's patch is preferrable. If not (i.e., an actual use of
"getcwd()" is not done very often), then inlining the "getwd()" #ifdef would
be better.
--
- Greg Earle
Phone: (818) 353-8695 FAX: (818) 353-1877
Internet: earle@isolar.Tujunga.CA.US
UUCP: isolar!earle@elroy.JPL.NASA.GOV a.k.a. ...!elroy!isolar!earle
Technical Details
Message-ID:
<22a4vm$est@isolar.Tujunga.CA.US>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!Germany.EU.net!news.dfn.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!isolar!isolar!not-for-mailReferences:
<1993Jul14.161530.17744@ohm.york.ac.uk> <1993Jul15.111056.14780@syma.sussex.ac.uk> <1993Jul15.204306.1377@ohm.york.ac.uk>Show Full Headers
Complete Article Headers
Message-ID: <22a4vm$est@isolar.Tujunga.CA.US> Subject: Re: tin1.2PL1 patch for BSD-based systems Date: Sun, 18 Jul 1993 00:20:06 +0000 From: earle@isolar.Tujunga.CA.US (Greg Earle) References: <1993Jul14.161530.17744@ohm.york.ac.uk> <1993Jul15.111056.14780@syma.sussex.ac.uk> <1993Jul15.204306.1377@ohm.york.ac.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!Germany.EU.net!news.dfn.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!isolar!isolar!not-for-mail Newsgroups: news.software.readers Followup-To: news.software.readers Organization: Personal Usenet site, Tujunga, CA USA Lines: 40 Distribution: world