Lines Matching refs:dirfd

144 static int creat_lnk(int dirfd, char *name1_p, char *name2_p);
145 static int creat_spec(int dirfd);
162 static int openout(int dirfd);
167 static void rstfiles(int over, int dirfd);
170 static void set_tym(int dirfd, char *nam_p, time_t atime, time_t mtime);
1722 creat_lnk(int dirfd, char *name1_p, char *name2_p) in creat_lnk() argument
1769 else if (unlinkat(dirfd, get_component(name2_p), 0) < 0) in creat_lnk()
1821 creat_spec(int dirfd) in creat_spec() argument
1847 if (fchownat(dirfd, ".", Rpw_p->pw_uid, in creat_spec()
1854 } else if ((fchownat(dirfd, ".", G_p->g_uid, in creat_spec()
1861 if (fchmod(dirfd, G_p->g_mode) != 0) { in creat_spec()
1869 if (facl_set(dirfd, aclp) < 0) { in creat_spec()
1934 rstfiles(U_KEEP, dirfd); in creat_spec()
2015 rstfiles(U_OVER, dirfd); in creat_spec()
2023 rstfiles(U_KEEP, dirfd); in creat_spec()
2036 rstfiles(U_KEEP, dirfd); in creat_spec()
3931 int dirfd; in retry_open_attr() local
3955 if ((dirfd = openat(cwd, (pattr == NULL) ? fullname : pattr, in retry_open_attr()
3959 if (fstat(dirfd, &parentstat) == -1) { in retry_open_attr()
3963 (void) close(dirfd); in retry_open_attr()
3966 if ((error = facl_get(dirfd, ACL_NO_TRIVIAL, &aclp)) != 0) { in retry_open_attr()
3970 (void) close(dirfd); in retry_open_attr()
3975 if (fchmod(dirfd, newmode) == -1) { in retry_open_attr()
3981 (void) close(dirfd); in retry_open_attr()
4003 if (fchmod(dirfd, parentstat.st_mode) == -1) { in retry_open_attr()
4010 error = facl_set(dirfd, aclp); in retry_open_attr()
4030 (void) close(dirfd); in retry_open_attr()
5505 openout(int dirfd) in openout() argument
5535 if (LSTAT(dirfd, nam_p, &DesSt) == 0) { in openout()
5602 (void) unlinkat(dirfd, in openout()
5615 rstfiles(U_KEEP, dirfd); in openout()
5623 (void) unlinkat(dirfd, in openout()
5635 rstfiles(U_KEEP, dirfd); in openout()
5653 (void) unlinkat(dirfd, in openout()
5666 rstfiles(U_KEEP, dirfd); in openout()
5673 if ((result = openat(dirfd, get_component(nam_p), in openout()
5677 result = retry_open_attr(dirfd, in openout()
5692 rstfiles(U_KEEP, dirfd); in openout()
5725 if (fchownat(dirfd, in openout()
5742 } else if ((fchownat(dirfd, get_component(nam_p), in openout()
6088 rstfiles(int over, int dirfd) in rstfiles() argument
6138 (void) unlinkat(dirfd, get_component(nam_p), 0); in rstfiles()
6169 if (unlinkat(dirfd, get_component(Over_p), 0)) { in rstfiles()
6190 (void) renameat(dirfd, get_component(nam_p), in rstfiles()
6191 dirfd, get_component(Over_p)); in rstfiles()
6215 if (unlinkat(dirfd, get_component(Over_p), 0) < 0) { in rstfiles()
6253 if (fchownat(dirfd, get_component(onam_p), in rstfiles()
6265 if ((fchownat(dirfd, get_component(onam_p), in rstfiles()
6279 set_tym(dirfd, get_component(onam_p), in rstfiles()
6746 set_tym(int dirfd, char *nam_p, time_t atime, time_t mtime) in set_tym() argument
6755 if (futimesat(dirfd, nam_p, times) < 0) { in set_tym()
9292 int dirfd; in preview_attrs() local
9346 dirfd = attropen(filename, ".", O_RDONLY); in preview_attrs()
9347 if (dirfd == -1) in preview_attrs()
9350 tmpfd = dup(dirfd); in preview_attrs()
9352 (void) close(dirfd); in preview_attrs()
9357 (void) close(dirfd); in preview_attrs()
9376 if (fstatat(dirfd, dp->d_name, &sb, in preview_attrs()
9390 if (fstatat(dirfd, dp->d_name, in preview_attrs()
9405 (void) fchdir(dirfd); in preview_attrs()
9411 (void) close(dirfd); in preview_attrs()
9718 unlinkat(int dirfd, char *path, int flag) in unlinkat() argument