Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Macros | Functions
fcntl.h File Reference

Go to the source code of this file.

Macros

#define O_ACCMODE   0x0003
 
#define O_RDONLY   0
 
#define O_WRONLY   1
 
#define O_RDWR   2
 
#define O_APPEND   0x0008
 
#define O_CREAT   0x0200
 
#define O_TRUNC   0x0400
 
#define O_EXCL   0x0800
 
#define O_NONBLOCK   0x4000
 
#define O_NOCTTY   0x8000
 
#define O_LARGEFILE   0
 
#define O_DIRECTORY   0x200000
 
#define O_CLOEXEC   0x400000
 
#define F_DUPFD   0
 
#define F_GETFD   1
 
#define F_SETFD   2
 
#define F_GETFL   3
 
#define F_SETFL   4
 
#define F_DUPFD_CLOEXEC   1030
 
#define FD_CLOEXEC   1
 
#define AT_FDCWD   (-100)
 
#define AT_SYMLINK_NOFOLLOW   0x100
 

Functions

int open (const char *pathname, int flags,...)
 Open the file specified by the pathname. More...
 
int fcntl (int fd, int cmd,...)
 Act on an open file descriptor. More...
 

Function Documentation

◆ fcntl()

int fcntl ( int  fd,
int  cmd,
  ... 
)

Act on an open file descriptor.

Parameters
fdThe file descriptor to provide.
cmdF_DUPFD, F_GETFD, F_SETFD, F_GETFL or F_SETFL.
argThe lowest descriptor to duplicate onto, or the flags to set.
Return values
intThe answer of the command on success and -1 on error, with the reason left in errno.

◆ open()

int open ( const char *  pathname,
int  flags,
  ... 
)

Open the file specified by the pathname.

Parameters
pathnameThe pathname of the file.
flagsFlags for opening the file.
modeThe permission bits of the file, when O_CREAT is given and the file has to be created. Ignored otherwise.
Return values
intThe file descriptor of the file on success and -1 on error, with the reason left in errno.