]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libiberty/getpwd.c
pex-common.c: New file.
[thirdparty/gcc.git] / libiberty / getpwd.c
index de6e03976483fcb86ac3f5c9cff86245cdb246d4..e57ef47e947d67fa46eda615d2ff356e2d75a48c 100644 (file)
@@ -1,5 +1,17 @@
 /* getpwd.c - get the working directory */
 
+/*
+
+@deftypefn Supplemental char* getpwd (void)
+
+Returns the current working directory.  This implementation caches the
+result on the assumption that the process will not call @code{chdir}
+between calls to @code{getpwd}.
+
+@end deftypefn
+
+*/
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -23,6 +35,9 @@ extern int errno;
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
 
 /* Prototype these in case the system headers don't provide them. */
 extern char *getpwd ();
@@ -52,7 +67,7 @@ extern char *getwd ();
    yield 0 and set errno.  */
 
 char *
-getpwd ()
+getpwd (void)
 {
   static char *pwd;
   static int failure_errno;
@@ -99,7 +114,7 @@ getpwd ()
 #endif
 
 char *
-getpwd ()
+getpwd (void)
 {
   static char *pwd = 0;