31 lines
631 B
C
31 lines
631 B
C
#ifndef _FCNTL_H
|
|
#define _FCNTL_H
|
|
|
|
/* Open for reading only. */
|
|
#define O_RDONLY 1
|
|
/* Open for writing only. */
|
|
#define O_WRONLY 2
|
|
/* Open for reading and writing. */
|
|
#define O_RDWR 3
|
|
|
|
/* Duplicate a file descriptor. */
|
|
#define F_DUPFD 0
|
|
/* Is a file descriptor a TTY? */
|
|
#define F_ISTTY 1
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
/* Opens the file specified by pathname. Returns a file descriptor on success, or -1 on error. */
|
|
int open(const char* pathname, int flags);
|
|
|
|
/* Performs an operation on the file descriptor fd determined by cmd. */
|
|
int fcntl(int fd, int cmd, ...);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif |