44 #include <sys/errno.h>
45 #include <sys/fcntl.h>
46 #include <sys/pathname.h>
47 #include <sys/stat.h>
48 #include <sys/vfs.h>
49 #include <sys/vnode.h>
50 #include <sys/mode.h>
51 #include <sys/file.h>
52 #include <sys/proc.h>
53 #include <sys/uio.h>
54 #include <sys/debug.h>
55 #include <sys/cmn_err.h>
56 #include <c2/audit.h>
57 #include <fs/fs_subr.h>
58
59 /*
60 * Get the vp to be stated and the cred to be used for the call
61 * to VOP_GETATTR
62 */
63
64 static int
65 cstatat_getvp(int fd, char *name, int follow, vnode_t **vp, cred_t **cred)
66 {
67 vnode_t *startvp;
68 file_t *fp;
69 int error;
70 cred_t *cr;
71 int estale_retry = 0;
72
73 *vp = NULL;
74
75 /*
76 * Only return EFAULT for fstatat when fd == AT_FDCWD && name == NULL
77 */
78
79 if (fd == AT_FDCWD) {
80 startvp = NULL;
81 cr = CRED();
82 crhold(cr);
83 } else {
84 char startchar;
|
44 #include <sys/errno.h>
45 #include <sys/fcntl.h>
46 #include <sys/pathname.h>
47 #include <sys/stat.h>
48 #include <sys/vfs.h>
49 #include <sys/vnode.h>
50 #include <sys/mode.h>
51 #include <sys/file.h>
52 #include <sys/proc.h>
53 #include <sys/uio.h>
54 #include <sys/debug.h>
55 #include <sys/cmn_err.h>
56 #include <c2/audit.h>
57 #include <fs/fs_subr.h>
58
59 /*
60 * Get the vp to be stated and the cred to be used for the call
61 * to VOP_GETATTR
62 */
63
64 int
65 cstatat_getvp(int fd, char *name, int follow, vnode_t **vp, cred_t **cred)
66 {
67 vnode_t *startvp;
68 file_t *fp;
69 int error;
70 cred_t *cr;
71 int estale_retry = 0;
72
73 *vp = NULL;
74
75 /*
76 * Only return EFAULT for fstatat when fd == AT_FDCWD && name == NULL
77 */
78
79 if (fd == AT_FDCWD) {
80 startvp = NULL;
81 cr = CRED();
82 crhold(cr);
83 } else {
84 char startchar;
|