diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1999-08-31 01:01:15 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1999-08-31 01:01:15 +0000 |
commit | a2957e1d3ededa4abbfc4bca373d23dd810b6783 (patch) | |
tree | 8d509220d6b6c409cf1939316b4b61035650fc6f /gcc/getpwd.c | |
parent | 1fdf491e50ef88d9bcca2cbe6054b27fd1e701e5 (diff) | |
download | gcc-a2957e1d3ededa4abbfc4bca373d23dd810b6783.zip gcc-a2957e1d3ededa4abbfc4bca373d23dd810b6783.tar.gz gcc-a2957e1d3ededa4abbfc4bca373d23dd810b6783.tar.bz2 |
Makefile.in (OBJS, PROTO_OBJS): Remove getpwd.o.
* Makefile.in (OBJS, PROTO_OBJS): Remove getpwd.o.
(getpwd.o): Remove target.
* getpwd.c: Delete file. Its in libiberty now.
* dbxout.c (getpwd): Don't prototype.
* dwarf2out.c (getpwd): Likewise
* dwarfout.c (getpwd): Likewise
* final.c (getpwd): Likewise.
* protoize.c (getpwd): Likewise.
From-SVN: r28999
Diffstat (limited to 'gcc/getpwd.c')
-rw-r--r-- | gcc/getpwd.c | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/gcc/getpwd.c b/gcc/getpwd.c deleted file mode 100644 index c3d155e..0000000 --- a/gcc/getpwd.c +++ /dev/null @@ -1,90 +0,0 @@ -/* getpwd.c - get the working directory */ - -#include "config.h" -#include "system.h" - -/* Virtually every UN*X system now in common use (except for pre-4.3-tahoe - BSD systems) now provides getcwd as called for by POSIX. Allow for - the few exceptions to the general rule here. */ - -#if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD) -#define getcwd(buf,len) getwd(buf) -#ifdef MAXPATHLEN -#define GUESSPATHLEN (MAXPATHLEN + 1) -#else -#define GUESSPATHLEN 100 -#endif -#else /* (defined (USG) || defined (VMS)) */ -/* We actually use this as a starting point, not a limit. */ -#define GUESSPATHLEN 100 -#endif /* (defined (USG) || defined (VMS)) */ - -#if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__))) - -/* Get the working directory. Use the PWD environment variable if it's - set correctly, since this is faster and gives more uniform answers - to the user. Yield the working directory if successful; otherwise, - yield 0 and set errno. */ - -char * -getpwd () -{ - static char *pwd; - static int failure_errno; - - char *p = pwd; - size_t s; - struct stat dotstat, pwdstat; - - if (!p && !(errno = failure_errno)) - { - if (! ((p = getenv ("PWD")) != 0 - && *p == '/' - && stat (p, &pwdstat) == 0 - && stat (".", &dotstat) == 0 - && dotstat.st_ino == pwdstat.st_ino - && dotstat.st_dev == pwdstat.st_dev)) - - /* The shortcut didn't work. Try the slow, ``sure'' way. */ - for (s = GUESSPATHLEN; ! getcwd (p = xmalloc (s), s); s *= 2) - { - int e = errno; - free (p); -#ifdef ERANGE - if (e != ERANGE) -#endif - { - errno = failure_errno = e; - p = 0; - break; - } - } - - /* Cache the result. This assumes that the program does - not invoke chdir between calls to getpwd. */ - pwd = p; - } - return p; -} - -#else /* VMS || _WIN32 && !__CYGWIN__ */ - -#ifndef MAXPATHLEN -#define MAXPATHLEN 255 -#endif - -char * -getpwd () -{ - static char *pwd = 0; - - if (!pwd) - pwd = getcwd (xmalloc (MAXPATHLEN + 1), MAXPATHLEN + 1 -#ifdef VMS - , 0 -#endif - ); - return pwd; -} - -#endif /* VMS || _WIN32 && !__CYGWIN__ */ |