1
#pragma once
2
3
#include <sys/types.h>
4
5
#define O_ACCMODE 00000003
6
#define O_RDONLY 00000000
7
#define O_WRONLY 00000001
8
#define O_RDWR 00000002
9
10
#define O_CREAT 00000100
11
#define O_EXCL 00000200
12
#define O_NOCTTY 00000400
13
#define O_TRUNC 00001000
14
#define O_APPEND 00002000
15
#define O_NONBLOCK 00004000
16
#define O_SYNC 00010000
17
#define O_DIRECTORY 00020000
18
#define O_CLOEXEC 00040000
19
#define O_NOFOLLOW 00100000
20
21
#define FD_CLOEXEC 1
22
23
#define F_DUPFD 0
24
#define F_GETFD 1
25
#define F_SETFD 2
26
#define F_GETFL 3
27
#define F_SETFL 4
28
#define F_DUPFD_CLOEXEC 1030
29
30
#define AT_FDCWD (-100)
31
#define AT_SYMLINK_NOFOLLOW 0x100
32
#define AT_REMOVEDIR 0x200
33
#define AT_SYMLINK_FOLLOW 0x400
34
#define AT_EACCESS 0x200
35
36
#define SEEK_SET 0
37
#define SEEK_CUR 1
38
#define SEEK_END 2
39
40
#ifndef _KERNEL
41
int fcntl(int fd, int cmd, ...);
42
#endif