Luna/libs/libc/include/fcntl.h

35 lines
763 B
C
Raw Normal View History

#ifndef _FCNTL_H
#define _FCNTL_H
2022-10-12 09:57:49 +00:00
/* Open for reading only. */
#define O_RDONLY 1
2022-10-12 09:57:49 +00:00
/* Open for writing only. */
#define O_WRONLY 2
2022-10-12 09:57:49 +00:00
/* Open for reading and writing. */
#define O_RDWR 3
2022-10-21 19:51:03 +00:00
/* Open without blocking. */
#define O_NONBLOCK 4
2022-10-22 08:28:02 +00:00
/* Close the opened file descriptor on a call to execve(). */
#define O_CLOEXEC 8
/* Duplicate a file descriptor. */
#define F_DUPFD 0
/* Is a file descriptor a TTY? */
#define F_ISTTY 1
#ifdef __cplusplus
extern "C"
{
#endif
2022-10-12 09:57:49 +00:00
/* 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