Cleanup in elf.c with .bss section clean; adm command mounts cdrom instead of floppy...
[ZeXOS.git] / libc / include / sys / stat.h
blob4c1f45e8194bba5fbfde3dfeeb81fd072478c22d
1 /*
2 * ZeX/OS
3 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _STAT_H
20 #define _STAT_H
22 #include <sys/types.h>
24 struct stat {
25 dev_t st_dev;
26 ino_t st_ino;
27 umode_t st_mode;
28 nlink_t st_nlink;
29 uid_t st_uid;
30 gid_t st_gid;
31 dev_t st_rdev;
32 off_t st_size;
33 time_t st_atime;
34 time_t st_mtime;
35 time_t st_ctime;
38 #define S_IFMT 00170000
39 #define S_IFREG 0100000
40 #define S_IFBLK 0060000
41 #define S_IFDIR 0040000
42 #define S_IFCHR 0020000
43 #define S_IFIFO 0010000
44 #define S_ISUID 0004000
45 #define S_ISGID 0002000
46 #define S_ISVTX 0001000
48 #define S_IRWXU 00700
49 #define S_IRUSR 00400
50 #define S_IWUSR 00200
51 #define S_IXUSR 00100
53 #define S_IRWXG 00070
54 #define S_IRGRP 00040
55 #define S_IWGRP 00020
56 #define S_IXGRP 00010
58 #define S_IRWXO 00007
59 #define S_IROTH 00004
60 #define S_IWOTH 00002
61 #define S_IXOTH 00001
63 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
64 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
65 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
66 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
67 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
69 extern int chmod (const char *path, mode_t mode);
70 extern int fstat (int fd, struct stat *stat_buf);
71 extern int mkdir (const char *pathname, mode_t mode);
72 extern int rmdir (const char *pathname);
73 extern int mkfifo (const char *path, mode_t mode);
74 extern int creat (const char *pathname, mode_t mode);
75 extern mode_t umask (mode_t mask);
76 extern int stat (const char *path, struct stat *buf);
77 extern int lstat (const char *path, struct stat *buf);
78 extern mode_t umask (mode_t mask);
79 extern int chmod (const char *path, mode_t mode);
81 #endif