Stubbed out some more libc functions.
[planlOS.git] / programs / include / sys / stat.h
blobc714d525d6d06f2c1ac2774ba848bd3dde76ad3c
1 /*
2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef SYS_STAT_H_INCLUDED
23 #define SYS_STAT_H_INCLUDED
25 #include <sys/types.h>
27 #define S_IRWXO 0007
28 #define S_IROTH 0001
29 #define S_IWOTH 0002
30 #define S_IXOTH 0004
32 #define S_IRWXG 0070
33 #define S_IRGRP 0010
34 #define S_IWGRP 0020
35 #define S_IXGRP 0040
37 #define S_IRWXU 0700
38 #define S_IRUSR 0100
39 #define S_IWUSR 0200
40 #define S_IXUSR 0400
42 #define S_ISUID 01000
43 #define S_ISGID 02000
45 #define S_ISVTX 04000
47 #define S_IFMT 0xF00
48 #define S_IFBLK 0x100
49 #define S_IFCHR 0x200
50 #define S_IFIFO 0x300
51 #define S_IFREG 0x400
52 #define S_IFDIR 0x500
53 #define S_IFLNK 0x600
54 #define S_IFSOCK 0x700
56 #define S_ISBLK(m) ((m & S_IFMT) == S_IFBLK)
57 #define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR)
58 #define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
59 #define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO)
60 #define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
61 #define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
63 struct stat
65 dev_t st_dev;
66 ino_t st_ino;
67 mode_t st_mode;
68 nlink_t st_nlink;
69 uid_t st_uid;
70 gid_t st_gid;
71 dev_t st_rdev;
72 off_t st_size;
73 time_t st_atime;
74 time_t st_mtime;
75 time_t st_ctime;
76 blksize_t st_blksize;
77 blkcnt_t st_blocks;
79 struct stat64
81 dev_t st_dev;
82 ino64_t st_ino;
83 mode_t st_mode;
84 nlink_t st_nlink;
85 uid_t st_uid;
86 gid_t st_gid;
87 dev_t st_rdev;
88 off64_t st_size;
89 time_t st_atime;
90 time_t st_mtime;
91 time_t st_ctime;
92 blksize64_t st_blksize;
93 blkcnt_t st_blocks;
95 int mknod(const char *path, mode_t mode, dev_t dev);
96 int mkdir(const char *path, mode_t mode);
98 int chmod(const char *path, mode_t mode);
99 int fchmod(int fd, mode_t mode);
100 int fstat(int fd, struct stat *s);
101 int lstat(const char *path, struct stat *s);
102 int stat(const char *path, struct stat *s);
103 int fstat64(int fd, struct stat64 *s);
104 int stat64(const char *path, struct stat64 *s);
106 #endif