1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

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.
This commit is contained in:
Adhemerval Zanella
2020-08-20 09:04:16 -03:00
parent 23af890b3f
commit fcdbd91067
2 changed files with 377 additions and 422 deletions

View File

@ -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>