Re: symlink.2 clarification of ENOENT
From: Michael Kerrisk (man-pages) <hidden>
Date: 2015-04-12 07:57:01
Hello Jonny, On 9 October 2014 at 13:22, Jonny Grant [off-list ref] wrote:
Hi Michael http://man7.org/linux/man-pages/man2/symlink.2.html I saw that [linkpath] being the empty string "" also returns ENOENT. I feel worth clariying: Current text: "ENOENT A directory component in linkpath does not exist or is a dangling symbolic link, or target is the empty string." Proposed new text: "ENOENT target or linkpath are empty strings. Or a directory component in linkpath does not exist or is a dangling symbolic link."
Thanks. Yes, POSIX actually explicitly notes that ENOENT occurs if the second argument is an empty string. I added this point to the man page. Cheers, Michael
I tested with
result = symlink("", NULL);
printf("symlink: '' NULL: %d, %d, '%s'\n", result, errno, strerror(errno));
Output:
symlink: '' NULL: -1, 2, 'No such file or directory'
--
Jonny jg-hus3n9K41k0@public.gmane.org-- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html