FreeBSD Bugzilla – Attachment 49591 Details for
Bug 75711
[patch] opendir(3) missing ERRORS section
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
libc-gen-directory.3.diff
libc-gen-directory.3.diff (text/x-diff; charset=us-ascii), 2.45 KB, created by
Jeroen Ruigrok van der Werven
on 2007-05-17 09:56:51 UTC
(
hide
)
Description:
libc-gen-directory.3.diff
Filename:
MIME Type:
Creator:
Jeroen Ruigrok van der Werven
Created:
2007-05-17 09:56:51 UTC
Size:
2.45 KB
patch
obsolete
>Index: directory.3 >=================================================================== >RCS file: /usr/ncvs/FreeBSD/src/lib/libc/gen/directory.3,v >retrieving revision 1.16 >diff -u -r1.16 directory.3 >--- directory.3 9 Jan 2007 00:27:53 -0000 1.16 >+++ directory.3 17 May 2007 08:42:44 -0000 >@@ -47,7 +47,7 @@ > .In sys/types.h > .In dirent.h > .Ft DIR * >-.Fn opendir "const char *filename" >+.Fn opendir "const char *dirname" > .Ft struct dirent * > .Fn readdir "DIR *dirp" > .Ft int >@@ -67,7 +67,7 @@ > .Fn opendir > function > opens the directory named by >-.Fa filename , >+.Fa dirname , > associates a > .Em directory stream > with it >@@ -75,13 +75,6 @@ > returns a pointer to be used to identify the > .Em directory stream > in subsequent operations. >-The pointer >-.Dv NULL >-is returned if >-.Fa filename >-cannot be accessed, or if it cannot >-.Xr malloc 3 >-enough memory to hold the whole thing. > .Pp > The > .Fn readdir >@@ -184,12 +177,56 @@ > (void)closedir(dirp); > return NOT_FOUND; > .Ed >+.Sh RETURN VALUES >+Upon successful completion, >+.Fn opendir >+shall return a pointer to an object of type DIR. >+Otherwise, a null pointer shall be returned and >+.Va errno >+set to indicate the error. >+.Sh ERRORS >+The >+.Fn opendir >+function shall fail if: >+.Bl -tag -width Er >+.It Bq Er EACCESS >+Search permission is denied for the component of the path prefix of >+.Fa dirname >+or read permission is denied for >+.Fa dirname . >+.It Bq Er ELOOP >+A loop exists in symbolic links encountered during resolution of the >+.Fa dirname >+argument. >+.It Bq Er ENAMETOOLONG >+The length of the >+.Fa dirname >+argument exceeds >+.Brq Dv PATH_MAX >+or >+a pathname component is longer than >+.Brq Dv NAME_MAX . >+.It Bq Er ENOENT >+A component of >+.Fa dirname >+does not name an existing directory or >+.Fa dirname >+is an empty string. >+.It Bq Er ENOTDIR >+A component of >+.Fa dirname >+is not a directory. > .Sh SEE ALSO > .Xr close 2 , > .Xr lseek 2 , > .Xr open 2 , > .Xr read 2 , > .Xr dir 5 >+.Sh STANDARDS >+The function >+.Fn opendir >+is believed to conform to >+.St -p1003.1-2004 . > .Sh HISTORY > The > .Fn opendir , >Index: opendir.c >=================================================================== >RCS file: /usr/ncvs/FreeBSD/src/lib/libc/gen/opendir.c,v >retrieving revision 1.23 >diff -u -r1.23 opendir.c >--- opendir.c 9 Jan 2007 00:27:54 -0000 1.23 >+++ opendir.c 17 May 2007 08:53:25 -0000 >@@ -54,6 +54,10 @@ > opendir(name) > const char *name; > { >+ if (name == NULL) { >+ errno = ENOENT; >+ return (NULL); >+ } > > return (__opendir2(name, DTF_HIDEW|DTF_NODUP)); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 75711
: 49591