Hi, When an empty path argument is passed to the readlinkat() function, POSIX:2018 specifies that the function fails with error ENOENT:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlinkat.html "These functions shall fail if: ... [ENOENT] A component of path does not name an existing file or path is an empty string." In Cygwin 3.4.6, readlinkat() fails with error EBADF instead. How to reproduce: ============================== foo.c =================================== #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <unistd.h> int main () { char buf[80]; int ret = readlinkat (AT_FDCWD, "", buf, sizeof (buf)); int err = errno; printf ("ret = %d, errno = %d = \"%s\"\n", ret, err, strerror (err)); return 0; } ======================================================================== $ gcc -Wall foo.c $ ./a.exe Expected output: ret = -1, errno = 2 = "No such file or directory" Actual output: ret = -1, errno = 9 = "Bad file descriptor" Bruno -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple