diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-08-20 09:04:16 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-09-02 09:16:05 -0300 |
commit | fcdbd910679997f257de70e9e49801dc4db93222 (patch) | |
tree | a025ab7a3ac968496152fc2842c19c56d33cca64 /sysdeps/unix/sysv/linux/getcwd.c | |
parent | 23af890b3f04e80da783ba64e6b6d94822e01d54 (diff) | |
download | glibc-fcdbd910679997f257de70e9e49801dc4db93222.zip glibc-fcdbd910679997f257de70e9e49801dc4db93222.tar.gz glibc-fcdbd910679997f257de70e9e49801dc4db93222.tar.bz2 |
Sync getcwd with gnulib
This is the first of a series of patches to sync with Gnulib commit
615b43e1f9. This patch adopts most of the changes of Gnulib, except it
retains GETCWD_RETURN_TYPE and does not always use a 64-bit internal
API. These remaining discrepancies will be addressed in later patches
in this series.
Checked on x86_64-linux-gnu and i686-linux-gnu.
Diffstat (limited to 'sysdeps/unix/sysv/linux/getcwd.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/getcwd.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c index fabc4bb..c5886f5 100644 --- a/sysdeps/unix/sysv/linux/getcwd.c +++ b/sysdeps/unix/sysv/linux/getcwd.c @@ -40,7 +40,10 @@ named `cwd'. Reading the content of this link immediate gives us the information. But we have to take care for systems which do not have the proc filesystem mounted. Use the POSIX implementation in this case. */ -static char *generic_getcwd (char *buf, size_t size); + +/* Get the code for the generic version. */ +#define GETCWD_RETURN_TYPE static char * +#include <sysdeps/posix/getcwd.c> char * __getcwd (char *buf, size_t size) @@ -105,7 +108,7 @@ __getcwd (char *buf, size_t size) } #endif - result = generic_getcwd (path, size); + result = __getcwd_generic (path, size); #ifndef NO_ALLOCATION if (result == NULL && buf == NULL && size != 0) @@ -129,8 +132,3 @@ __getcwd (char *buf, size_t size) } libc_hidden_def (__getcwd) weak_alias (__getcwd, getcwd) - -/* Get the code for the generic version. */ -#define GETCWD_RETURN_TYPE static char * -#define __getcwd generic_getcwd -#include <sysdeps/posix/getcwd.c> |