11 #define S_IFMT 0170000
12 #define S_IFIFO 0010000
13 #define S_IFCHR 0020000
14 #define S_IFDIR 0040000
15 #define S_IFBLK 0060000
16 #define S_IFREG 0100000
17 #define S_IFLNK 0120000
18 #define S_IFSOCK 0140000
20 #define S_ISFIFO(m) (((m) &S_IFMT) == S_IFIFO)
21 #define S_ISCHR(m) (((m) &S_IFMT) == S_IFCHR)
22 #define S_ISDIR(m) (((m) &S_IFMT) == S_IFDIR)
23 #define S_ISBLK(m) (((m) &S_IFMT) == S_IFBLK)
24 #define S_ISREG(m) (((m) &S_IFMT) == S_IFREG)
25 #define S_ISLNK(m) (((m) &S_IFMT) == S_IFLNK)
26 #define S_ISSOCK(m) (((m) &S_IFMT) == S_IFSOCK)
29 #define S_ISUID 0004000
30 #define S_ISGID 0002000
31 #define S_ISVTX 0001000
32 #define S_IRWXU 0000700
33 #define S_IRUSR 0000400
34 #define S_IWUSR 0000200
35 #define S_IXUSR 0000100
36 #define S_IRWXG 0000070
37 #define S_IRGRP 0000040
38 #define S_IWGRP 0000020
39 #define S_IXGRP 0000010
40 #define S_IRWXO 0000007
41 #define S_IROTH 0000004
42 #define S_IWOTH 0000002
43 #define S_IXOTH 0000001
63 #define st_atime st_atim.tv_sec
64 #define st_mtime st_mtim.tv_sec
65 #define st_ctime st_ctim.tv_sec
82 int mknod(
const char *pathname, mode_t mode, dev_t dev);
90 int mkfifo(
const char *pathname, mode_t mode);
98 int mkdir(
const char *pathname, mode_t mode);
105 mode_t
umask(mode_t mask);
108 #define UTIME_TO_NOW ((uint32_t) -1)
111 #define UTIME_NOW ((1l << 30) - 1l)
112 #define UTIME_OMIT ((1l << 30) - 2l)
120 int utime(
const char *pathname, uint32_t mtime);
128 int chmod(
const char *pathname, mode_t mode);
137 int stat(
const char *pathname,
struct stat *statbuf);
147 int lstat(
const char *pathname,
struct stat *statbuf);
int mkfifo(const char *pathname, mode_t mode)
Makes a FIFO special file with name pathname.
Definition: file.c:294
int utime(const char *pathname, uint32_t mtime)
Replace the time the contents of a file were last written.
Definition: file.c:321
int chmod(const char *pathname, mode_t mode)
Replace the permission bits of a file.
Definition: file.c:331
int fstat(int fd, struct stat *statbuf)
Return information about a file, in the buffer pointed to by statbuf.
Definition: file.c:178
int futimens(int fd, const struct timespec times[2])
Stamp the file a descriptor is open on with the times given. Tenok keeps no way back from a descripto...
Definition: wrapper.c:457
int stat(const char *pathname, struct stat *statbuf)
Return information about the file specified by the pathname, in the buffer pointed to by statbuf.
Definition: file.c:366
mode_t umask(mode_t mask)
Set the permission bits withheld from the files the task creates.
Definition: file.c:310
int mknod(const char *pathname, mode_t mode, dev_t dev)
Create a filesystem node (file, device special file, or named pipe) named pathname,...
Definition: file.c:284
int mkdir(const char *pathname, mode_t mode)
Create a directory named pathname.
Definition: file.c:304
int lstat(const char *pathname, struct stat *statbuf)
Return information about the file specified by the pathname, the way stat() does. Tenok gives a file ...
Definition: file.c:377