Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
compat: readlinkat is available everywhere
Baptiste Daroussin committed 3 months ago
commit 1aba64a30db87b6460c529fd96ae96faaeafd13e
parent 1909d50
3 files changed +1 -22
modified auto.def
@@ -180,7 +180,7 @@ cc-check-includes stdint.h inttypes.h
cc-check-functions arc4random arc4random_stir chflagsat \
	closefrom fopencookie funopen getprogname \
	strtofflags strtonum utimensat __res_setservers \
-
	readlinkat fflagstostr reallocarray strchrnul \
+
	fflagstostr reallocarray strchrnul \
	copy_file_range

cc-with { -includes { libutil.h }} {
modified compat/bsd_compat.h
@@ -104,10 +104,6 @@ void closefrom(int lowfd);
#define	AT_SYMLINK_NOFOLLOW	0x200
#endif

-
#if !HAVE_READLINKAT
-
ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf, size_t bufsize);
-
#endif
-

#if !HAVE_STRTONUM
long long strtonum(const char *, long long, long long, const char **);
#endif
modified compat/file_at.c
@@ -91,20 +91,3 @@ file_chdir_unlock(int dfd)
	pthread_mutex_unlock(&file_at_lock);
}
#endif
-

-
#if !HAVE_READLINKAT
-
ssize_t
-
readlinkat(int fd, const char *restrict path, char *restrict buf,
-
	   size_t bufsize)
-
{
-
	int ret;
-

-
	if ((ret = file_chdir_lock(fd) != 0))
-
		return ret;
-

-
	ret = readlink(path, buf, bufsize);
-

-
	file_chdir_unlock(fd);
-
	return ret;
-
}
-
#endif