Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
fcntl.h
Go to the documentation of this file.
1 
4 #ifndef __FCNTL_H__
5 #define __FCNTL_H__
6 
7 #define O_ACCMODE 0x0003
8 #define O_RDONLY 0
9 #define O_WRONLY 1
10 #define O_RDWR 2
11 #define O_APPEND 0x0008
12 #define O_CREAT 0x0200
13 #define O_TRUNC 0x0400
14 #define O_EXCL 0x0800
15 #define O_NONBLOCK 0x4000
16 /* Tenok has no controlling terminal for a file to become */
17 #define O_NOCTTY 0x8000
18 /* An off_t of Tenok already reaches as far as a file can */
19 #define O_LARGEFILE 0
20 /* Refuses what is not a directory, Tenok refuses one either way */
21 #define O_DIRECTORY 0x200000
22 #define O_CLOEXEC 0x400000
23 
24 /* Commands of fcntl(), with the numbers Linux gives them */
25 #define F_DUPFD 0
26 #define F_GETFD 1
27 #define F_SETFD 2
28 #define F_GETFL 3
29 #define F_SETFL 4
30 #define F_DUPFD_CLOEXEC 1030
31 
32 /* Tenok has no exec() for this to act on, it is stored and read back */
33 #define FD_CLOEXEC 1
34 
35 /* Tenok resolves every path from the directory the task is in */
36 #define AT_FDCWD (-100)
37 #define AT_SYMLINK_NOFOLLOW 0x100
38 
48 int open(const char *pathname, int flags, ...);
49 
58 int fcntl(int fd, int cmd, ...);
59 
60 #endif
int open(const char *pathname, int flags,...)
Open the file specified by the pathname.
Definition: file.c:36
int fcntl(int fd, int cmd,...)
Act on an open file descriptor.
Definition: file.c:78