Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.sys.sgi Subject: "getcwd" vs. "getwd" (was Re: Re GNU emacs 18.55) Message-ID: <3997@auspex.auspex.com> Date: 1 Sep 90 20:27:55 GMT References: <9008291653.AA10471@dinorah.wustl.edu> Organization: Auspex Systems, Santa Clara Lines: 18 >It used to be (pre 3.3 days) that the current working directory was >obtained by the system call getcwd. Now, to be POSIX conformant, the >system call is getwd, and getcwd is a subroutine which is implemented >by calling getwd. Were it not for the fact that IRIX started out as an S5 derivative, I'd assume you'd reversed "getcwd" and "getwd" in the preceding paragraph, as the POSIX call to get the current working directory is "getcwd", not "getwd". However, given that IRIX *did* start out as S5, I'd expect the call to get the current working directory to be "getcwd", as that's the S5 call; "getwd" is the BSD call. If IRIX's "getcwd()" calls "getwd()", somebody got something backwards, as "getwd()" doesn't take a "maximum size of buffer" argument but "getcwd()" does. Given that, a "getcwd()" that calls "getwd()" would have to throw said argument away, and would run the risk of having "getwd()" overrun the buffer if the string for the current working directory is too long....