Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!ziploc!eps From: eps@toaster.SFSU.EDU (Eric P. Scott) Newsgroups: comp.sys.next Subject: Re: getcwd.o Message-ID: <251@toaster.SFSU.EDU> Date: 12 Jan 90 03:38:25 GMT References: <8492@fsg.UUCP> Reply-To: eps@cs.SFSU.EDU (Eric P. Scott) Organization: San Francisco State University Lines: 30 [I have expanded Distribution: from usa to world] In article <8492@fsg.UUCP> treed@mapes.UUCP (Timothy Reed) writes: >I'm trying to build the Reactive Keyboard on the next, and need a >copy of getcwd() or a workalike to complete the compile. Does anyone >out there have such a beast? The first thing I did was check in the compat-sys5 directory in the BSD sources. No dice. Well, it's not hard to simulate. The "real" one popens pwd (ick!). Here's a replacement expressed in terms of getwd(). As is, no warranty. The following is hereby placed in the public domain: #include #include char *getcwd(buf, size) char *buf; int size; { char *getwd(), *malloc(), *strcpy(); register char *v; char pathname[MAXPATHLEN]; return (((v=getwd(pathname))&&strlen(v)