mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Merge from gnulib.
This commit is contained in:
parent
4073e53749
commit
69d9a57ddc
1 changed files with 10 additions and 6 deletions
|
|
@ -22,10 +22,9 @@
|
||||||
|
|
||||||
#include "careadlinkat.h"
|
#include "careadlinkat.h"
|
||||||
|
|
||||||
#include "allocator.h"
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
@ -38,15 +37,20 @@
|
||||||
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
|
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "allocator.h"
|
||||||
|
|
||||||
#if ! HAVE_READLINKAT
|
#if ! HAVE_READLINKAT
|
||||||
/* Ignore FD. Get the symbolic link value of FILENAME and put it into
|
/* Get the symbolic link value of FILENAME and put it into BUFFER, with
|
||||||
BUFFER, with size BUFFER_SIZE. This function acts like readlink
|
size BUFFER_SIZE. This function acts like readlink but has
|
||||||
but has readlinkat's signature. */
|
readlinkat's signature. */
|
||||||
ssize_t
|
ssize_t
|
||||||
careadlinkatcwd (int fd, char const *filename, char *buffer,
|
careadlinkatcwd (int fd, char const *filename, char *buffer,
|
||||||
size_t buffer_size)
|
size_t buffer_size)
|
||||||
{
|
{
|
||||||
(void) fd;
|
/* FD must be AT_FDCWD here, otherwise the caller is using this
|
||||||
|
function in contexts for which it was not meant for. */
|
||||||
|
if (fd != AT_FDCWD)
|
||||||
|
abort ();
|
||||||
return readlink (filename, buffer, buffer_size);
|
return readlink (filename, buffer, buffer_size);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue