Iros
 
Loading...
Searching...
No Matches
stat.h
Go to the documentation of this file.
1#pragma once
2
3#include <ccpp/bits/off_t.h>
4#include <ccpp/bits/stat.h>
5
7// NOTE: These constants are chosen to align with the values used by the Linux kernel.
8#define S_IFMT 00170000
9#define S_IFBLK 0060000
10#define S_IFCHR 0020000
11#define S_IFIFO 0010000
12#define S_IFREG 0100000
13#define S_IFDIR 0040000
14#define S_IFLNK 0120000
15#define S_IFSOCK 0140000
16
17#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
18#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
19#define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
20#define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
21#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
22#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
23#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
24
25#define S_IRWXU 0700
26#define S_IRUSR 0400
27#define S_IWUSR 0200
28#define S_IXUSR 0100
29
30#define S_IRWXG 070
31#define S_IRGRP 040
32#define S_IWGRP 020
33#define S_IXGRP 010
34
35#define S_IRWXO 07
36#define S_IROTH 04
37#define S_IWOTH 02
38#define S_IXOTH 01
39
40#define S_ISUID 04000
41#define S_ISGID 02000
42#define S_ISVTX 01000
43
44int stat(char const* __CCPP_RESTRICT __path, struct stat* __CCPP_RESTRICT __info);
45int lstat(char const* __CCPP_RESTRICT __path, struct stat* __CCPP_RESTRICT __info);
46int fstat(int __fd, struct stat* __info);
47
48int chmod(char const* __path, mode_t mode);
49int fchmod(int __fd, mode_t mode);
50
51int mkdir(char const* __path, mode_t mode);
52
#define __CCPP_RESTRICT
Definition config.h:62
#define __CCPP_END_DECLARATIONS
Definition config.h:8
#define __CCPP_BEGIN_DECLARATIONS
Definition config.h:7
__CCPP_BEGIN_DECLARATIONS typedef __UINT32_TYPE__ mode_t
Definition mode_t.h:7
Definition stat.h:16
int mkdir(char const *__path, mode_t mode)
int stat(char const *__CCPP_RESTRICT __path, struct stat *__CCPP_RESTRICT __info)
int fchmod(int __fd, mode_t mode)
int lstat(char const *__CCPP_RESTRICT __path, struct stat *__CCPP_RESTRICT __info)
int chmod(char const *__path, mode_t mode)
int fstat(int __fd, struct stat *__info)