Go to the source code of this file.
|
|
#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 |
| |
|
| 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...
|
| |
◆ fcntl()
| int fcntl |
( |
int |
fd, |
|
|
int |
cmd, |
|
|
|
... |
|
) |
| |
Act on an open file descriptor.
- Parameters
-
| fd | The file descriptor to provide. |
| cmd | F_DUPFD, F_GETFD, F_SETFD, F_GETFL or F_SETFL. |
| arg | The lowest descriptor to duplicate onto, or the flags to set. |
- Return values
-
| int | The 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
-
| pathname | The pathname of the file. |
| flags | Flags for opening the file. |
| mode | The permission bits of the file, when O_CREAT is given and the file has to be created. Ignored otherwise. |
- Return values
-
| int | The file descriptor of the file on success and -1 on error, with the reason left in errno. |