Lines Matching refs:mode

198 int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid) {  in chmod_and_chown()  argument
208 return fchmod_and_chown(fd, mode, uid, gid); in chmod_and_chown()
211 int fchmod_and_chown_with_fallback(int fd, const char *path, mode_t mode, uid_t uid, gid_t gid) { in fchmod_and_chown_with_fallback() argument
237 ((mode != MODE_INVALID && ((st.st_mode ^ mode) & 07777) != 0) || in fchmod_and_chown_with_fallback()
241 if (mode == MODE_INVALID) in fchmod_and_chown_with_fallback()
242mode = st.st_mode; /* If we only shall do a chown(), save original mode, since chown() might break… in fchmod_and_chown_with_fallback()
243 else if ((mode & S_IFMT) != 0 && ((mode ^ st.st_mode) & S_IFMT) != 0) in fchmod_and_chown_with_fallback()
247 mode_t minimal = st.st_mode & mode; /* the subset of the old and the new mask */ in fchmod_and_chown_with_fallback()
267 r = fchmod_opath(fd, mode & 07777); in fchmod_and_chown_with_fallback()
273 if (chmod(path, mode & 07777) < 0) in fchmod_and_chown_with_fallback()
353 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode) { in touch_file() argument
377 … fd = open(path, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, IN_SET(mode, 0, MODE_INVALID) ? 0644 : mode); in touch_file()
385 ret = fchmod_and_chown(fd, mode, uid, gid); in touch_file()
467 int mknod_atomic(const char *path, mode_t mode, dev_t dev) { in mknod_atomic() argument
477 if (mknod(t, mode, dev) < 0) in mknod_atomic()
488 int mkfifo_atomic(const char *path, mode_t mode) { in mkfifo_atomic() argument
498 if (mkfifo(t, mode) < 0) in mkfifo_atomic()
509 int mkfifoat_atomic(int dirfd, const char *path, mode_t mode) { in mkfifoat_atomic() argument
516 return mkfifo_atomic(path, mode); in mkfifoat_atomic()
523 if (mkfifoat(dirfd, t, mode) < 0) in mkfifoat_atomic()
671 int access_fd(int fd, int mode) { in access_fd() argument
674 if (access(FORMAT_PROC_FD_PATH(fd), mode) < 0) { in access_fd()
809 int open_parent(const char *path, int flags, mode_t mode) { in open_parent() argument
825 return RET_NERRNO(open(parent, flags, mode)); in open_parent()
1013 int open_mkdir_at(int dirfd, const char *path, int flags, mode_t mode) { in open_mkdir_at() argument
1056 r = RET_NERRNO(mkdirat(dirfd, path, mode)); in open_mkdir_at()
1087 int openat_report_new(int dirfd, const char *pathname, int flags, mode_t mode, bool *ret_newly_crea… in openat_report_new() argument
1096 return RET_NERRNO(openat(dirfd, pathname, flags, mode)); in openat_report_new()
1099 fd = openat(dirfd, pathname, flags, mode); in openat_report_new()
1109 fd = openat(dirfd, pathname, flags & ~(O_CREAT | O_EXCL), mode); in openat_report_new()
1118 fd = openat(dirfd, pathname, flags | O_CREAT | O_EXCL, mode); in openat_report_new()