On Wed, Aug 24, 2005 at 06:05:31PM +0000, Eric Blake wrote: >I'm having a problem with the 20050824 snapshot. execl() and friends >are in violation of POSIX, which requires EACCESS (pathname is not >regular file and cannot be executed) or ENOEXEC (pathname is not >executable image, although it has execute permissions), rather than >ENOENT, when passed a directory. ENOENT is only allowed for path >resolution failures. Solaris 8 returns EACCESS on directories. > >The invalid errno from exec*() breaks, among others, xargs(1), which >mistakenly exits with 127 instead of 126 (caught by the findutils >testsuite, since I am waiting to package findutils-4.2.25 once it >is released upstream). > >$ cat foo.c >#include <unistd.h> >#include <stdio.h> >#include <string.h> >#include <errno.h> > >int >main (int argc, char** argv) >{ > int err; > if (argc != 2) > { > printf("Usage: foo <name>\n"); > return 1; > } > err = execl(argv[1], argv[1], NULL); > printf("execl failed with %d, errno %d:%s\n", err, errno, strerror(errno)); > return 0; >} >$ ./foo / >execl failed with -1, errno 2:No such file or directory >$ ./foo . >execl failed with -1, errno 2:No such file or directory >$ ./foo '' >execl failed with -1, errno 2:No such file or directory >$ xargs / < /dev/null; echo $? >xargs: /: No such file or directory >127 > ># on solaris 8: >% ./foo / >execl failed with -1, errno 13:Permission denied >% ./foo . >execl failed with -1, errno 13:Permission denied >% ./foo '' >execl failed with -1, errno 2:No such file or directory >% xargs / < /dev/null; echo $? >xargs: /: Permission denied >126
This isn't really a snapshot regression. 1.5.18 works the same way, AFAICT. The latest snapshot should rectify this behavior, however. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/