Home
last modified time | relevance | path

Searched refs:st (Results 1 – 25 of 31) sorted by relevance

12

/coreutils/gl/lib/
Dtargetdir.c61 target_directory_operand (char const *file, struct stat *st) in target_directory_operand() argument
74 stat_result = stat (file, st); in target_directory_operand()
77 try_to_open = S_ISDIR (st->st_mode); in target_directory_operand()
97 errno = (((O_DIRECTORY ? stat (file, st) : stat_result) == 0 in target_directory_operand()
98 && !S_ISDIR (st->st_mode)) in target_directory_operand()
107 if (fstat (fd, st) == 0 in target_directory_operand()
108 ? !S_ISDIR (st->st_mode) && (err = ENOTDIR, true) in target_directory_operand()
Dtargetdir.h34 extern int target_directory_operand (char const *file, struct stat *st);
/coreutils/src/
Dioblksize.h76 io_blksize (struct stat const *st) in io_blksize() argument
79 idx_t blocksize = STP_BLKSIZE (st) <= 0 ? IO_BUFSIZE : STP_BLKSIZE (st); in io_blksize()
91 if (S_ISREG (st->st_mode) && blocksize & (blocksize - 1)) in io_blksize()
Dfind-mount-point.c79 struct stat st; in find_mount_point() local
80 if (stat ("..", &st) < 0) in find_mount_point()
85 if (st.st_dev != last_stat.st_dev || st.st_ino == last_stat.st_ino) in find_mount_point()
93 last_stat = st; in find_mount_point()
Dremove.c59 cache_fstatat (int fd, char const *file, struct stat *st, int flag) in cache_fstatat() argument
65 if (0 <= st->st_atim.tv_nsec) in cache_fstatat()
67 if (st->st_atim.tv_nsec == -1) in cache_fstatat()
69 if (fstatat (fd, file, st, flag) == 0) in cache_fstatat()
71 st->st_atim.tv_nsec = -2; in cache_fstatat()
72 st->st_ino = errno; in cache_fstatat()
74 errno = st->st_ino; in cache_fstatat()
77 return fstatat (fd, file, st, flag); in cache_fstatat()
83 cache_stat_init (struct stat *st) in cache_stat_init() argument
86 st->st_atim.tv_nsec = -1; in cache_stat_init()
[all …]
Dshred.c353 dorewind (int fd, struct stat const *st) in dorewind() argument
355 if (S_ISCHR (st->st_mode)) in dorewind()
393 dopass (int fd, struct stat const *st, char const *qname, off_t *sizep, in dopass() argument
430 if (! dorewind (fd, st)) in dopass()
818 struct stat st; in do_wipefd() local
830 if (fstat (fd, &st)) in do_wipefd()
839 if ((S_ISCHR (st.st_mode) && isatty (fd)) in do_wipefd()
840 || S_ISFIFO (st.st_mode) in do_wipefd()
841 || S_ISSOCK (st.st_mode)) in do_wipefd()
846 else if (S_ISREG (st.st_mode) && st.st_size < 0) in do_wipefd()
[all …]
Drmdir.c263 struct stat st; in main() local
264 int ret = stat (dir, &st); in main()
267 || (ret == 0 && S_ISDIR (st.st_mode))) in main()
272 ret = lstat (dir, &st); in main()
273 if (ret == 0 && S_ISLNK (st.st_mode)) in main()
Diopoll.c152 struct stat st; in iopoll_input_ok() local
153 bool always_ready = fstat (fdin, &st) == 0 in iopoll_input_ok()
154 && (S_ISREG (st.st_mode) in iopoll_input_ok()
155 || S_ISBLK (st.st_mode)); in iopoll_input_ok()
Dwc.c90 struct stat st; member
347 fstatus->failed = fstat (fd, &fstatus->st); in wc()
352 if (! fstatus->failed && usable_st_size (&fstatus->st) in wc()
353 && 0 <= fstatus->st.st_size) in wc()
355 off_t end_pos = fstatus->st.st_size; in wc()
378 - end_pos % (STP_BLKSIZE (&fstatus->st) + 1)); in wc()
677 ? fstat (STDIN_FILENO, &fstatus[i].st) in get_input_fstatus()
678 : stat (file[i], &fstatus[i].st)); in get_input_fstatus()
702 if (!S_ISREG (fstatus[i].st.st_mode)) in compute_number_width()
705 fstatus[i].st.st_size)) in compute_number_width()
[all …]
Dhead.c466 struct stat const *st, off_t current_pos) in elide_tail_bytes_file() argument
468 off_t size = st->st_size; in elide_tail_bytes_file()
469 if (presume_input_pipe || current_pos < 0 || size <= STP_BLKSIZE (st)) in elide_tail_bytes_file()
756 struct stat const *st, off_t current_pos) in elide_tail_lines_file() argument
758 off_t size = st->st_size; in elide_tail_lines_file()
759 if (presume_input_pipe || current_pos < 0 || size <= STP_BLKSIZE (st)) in elide_tail_lines_file()
825 struct stat st; in head_lines() local
826 if (fstat (fd, &st) != 0 || S_ISREG (st.st_mode)) in head_lines()
846 struct stat st; in head() local
847 if (fstat (fd, &st) != 0) in head()
[all …]
Dcp.c52 struct stat st; member
330 timespec[0] = get_stat_atime (&p->st); in re_protect()
331 timespec[1] = get_stat_mtime (&p->st); in re_protect()
343 if (lchownat (dst_dirfd, relname, p->st.st_uid, p->st.st_gid) in re_protect()
354 ignore_value (lchownat (dst_dirfd, relname, -1, p->st.st_gid)); in re_protect()
360 if (copy_acl (src_name, -1, dst_name, -1, p->st.st_mode) != 0) in re_protect()
365 if (lchmodat (dst_dirfd, relname, p->st.st_mode) != 0) in re_protect()
469 new->st = src_st; in make_dir_parents_private()
478 missing_dir ? new->st.st_mode : 0, in make_dir_parents_private()
494 src_mode = new->st.st_mode; in make_dir_parents_private()
[all …]
Dln.c534 struct stat st; in main() local
535 if (stat (optarg, &st) != 0) in main()
538 if (! S_ISDIR (st.st_mode)) in main()
617 struct stat st; in main() local
618 err = (fstat (destdir_fd, &st) != 0 ? errno in main()
619 : S_ISDIR (st.st_mode) ? 0 : ENOTDIR); in main()
Dchown-core.c235 struct stat st; in restricted_chown() local
256 if (fstat (fd, &st) != 0) in restricted_chown()
258 else if (! psame_inode (orig_st, &st)) in restricted_chown()
260 else if ((required_uid == (uid_t) -1 || required_uid == st.st_uid) in restricted_chown()
261 && (required_gid == (gid_t) -1 || required_gid == st.st_gid)) in restricted_chown()
Dtouch.c184 struct stat st; in touch() local
188 && stat (file, &st) == 0 && S_ISDIR (st.st_mode)))) in touch()
Dls.c1097 get_stat_btime (struct stat const *st) in get_stat_btime() argument
1102 btimespec = get_stat_mtime (st); in get_stat_btime()
1104 btimespec = get_stat_birthtime (st); in get_stat_btime()
1173 do_statx (int fd, char const *name, struct stat *st, int flags, in do_statx() argument
1181 statx_to_stat (&stx, st); in do_statx()
1187 st->st_mtim = statx_timestamp_to_timespec (stx.stx_btime); in do_statx()
1189 st->st_mtim.tv_sec = st->st_mtim.tv_nsec = -1; in do_statx()
1197 do_stat (char const *name, struct stat *st) in do_stat() argument
1199 return do_statx (AT_FDCWD, name, st, 0, calc_req_mask ()); in do_stat()
1203 do_lstat (char const *name, struct stat *st) in do_lstat() argument
[all …]
Drm.c110 struct stat st; in diagnose_leading_hyphen() local
112 if (arg[0] == '-' && arg[1] && lstat (arg, &st) == 0) in diagnose_leading_hyphen()
Ddd.c1307 ifstat (int fd, struct stat *st) in ifstat() argument
1314 ret = fstat (fd, st); in ifstat()
1809 struct stat st; in skip() local
1810 if (ifstat (STDIN_FILENO, &st) != 0) in skip()
1812 if (usable_st_size (&st) && 0 <= input_offset in skip()
1813 && st.st_size - input_offset < offset) in skip()
1818 records = ( offset - st.st_size ) / blocksize; in skip()
1819 offset = st.st_size - input_offset; in skip()
2066 struct stat st; in set_fd_flags() local
2067 if (ifstat (fd, &st) != 0) in set_fd_flags()
[all …]
Dpathchk.c288 struct stat st; in validate_file_name() local
289 if (lstat (file, &st) == 0) in validate_file_name()
Dstat.c1282 struct stat *st; member
1372 struct stat st; in do_stat() local
1376 pa.st = &st; in do_stat()
1410 statx_to_stat (&stx, &st); in do_stat()
1421 get_birthtime (int fd, char const *filename, struct stat const *st) in get_birthtime() argument
1423 struct timespec ts = get_stat_birthtime (st); in get_birthtime()
1462 pa.st = &statbuf; in do_stat()
1507 struct stat *statbuf = parg->st; in print_stat()
Dtail.c379 off_t size, struct stat const *st, in record_open_fd() argument
384 f->mtime = get_stat_mtime (st); in record_open_fd()
385 f->dev = st->st_dev; in record_open_fd()
386 f->ino = st->st_ino; in record_open_fd()
387 f->mode = st->st_mode; in record_open_fd()
1346 struct stat st; in any_symlinks() local
1348 if (lstat (f[i].name, &st) == 0 && S_ISLNK (st.st_mode)) in any_symlinks()
Dinstall.c325 struct stat st; in setdefaultfilecon() local
333 if (lstat (file, &st) != 0) in setdefaultfilecon()
339 if (selabel_lookup (hnd, &scontext, file, st.st_mode) != 0) in setdefaultfilecon()
Dcopy.c201 follow_fstatat (int dirfd, char const *filename, struct stat *st, int flags) in follow_fstatat() argument
203 int result = fstatat (dirfd, filename, st, flags); in follow_fstatat()
206 && S_ISCHR (st->st_mode)) in follow_fstatat()
222 if (0 < stdin_rdev_status && major (stdin_rdev) == major (st->st_rdev)) in follow_fstatat()
223 result = fstat (minor (st->st_rdev), st); in follow_fstatat()
/coreutils/tests/cp/
Dnfs-removal-race.sh50 __xstat (int ver, const char *path, struct stat *st)
52 static int (*real_stat)(int ver, const char *path, struct stat *st) = NULL;
58 return real_stat (ver, *path == 'd' && path[1] == 0 ? "d2" : path, st);
Dfail-perm.sh26 chmod u=rx,go=,-st D || framework_failure_
/coreutils/
Dcfg.mk105 st=0; diff -u $$t1 $$t2 || st=1; \
107 exit $$st

12