+2025-08-14 Bruno Haible <bruno@clisp.org>
+
+ unlinkat: Use issymlinkat.
+ * lib/unlinkat.c (rpl_unlinkat): Use issymlinkat instead of readlinkat.
+ * modules/unlinkat (Depends-on): Remove readlinkat. Add issymlinkat.
+
2025-08-14 Bruno Haible <bruno@clisp.org>
unlink: Use issymlink.
memcpy (short_name, name, len);
while (len && ISSLASH (short_name[len - 1]))
short_name[--len] = '\0';
- char linkbuf[1];
- if (len && ! (readlinkat (fd, short_name, linkbuf, 1) < 0
- && errno == EINVAL))
+ if (len && issymlinkat (fd, short_name) != 0)
{
free (short_name);
errno = EPERM;
fcntl-h [test $HAVE_UNLINKAT = 0 || test $REPLACE_UNLINKAT = 1]
openat-h [test $HAVE_UNLINKAT = 0 || test $REPLACE_UNLINKAT = 1]
sys_stat-h [test $HAVE_UNLINKAT = 0 || test $REPLACE_UNLINKAT = 1]
+fstatat [test $REPLACE_UNLINKAT = 1]
+issymlinkat [test $REPLACE_UNLINKAT = 1]
at-internal [test $HAVE_UNLINKAT = 0]
errno-h [test $HAVE_UNLINKAT = 0]
fchdir [test $HAVE_UNLINKAT = 0]
rmdir [test $HAVE_UNLINKAT = 0]
save-cwd [test $HAVE_UNLINKAT = 0]
unlink [test $HAVE_UNLINKAT = 0]
-fstatat [test $REPLACE_UNLINKAT = 1]
-readlinkat [test $REPLACE_UNLINKAT = 1]
configure.ac:
gl_FUNC_UNLINKAT