# fcntl.h ## **Overview** **Related Modules:** [FS](FS.md) **Description:** Declares structures and functions used for file and directory operations such as opening a file, creating a file, and allocating space. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Macros

Macro Name and Value

Description

O_ACCMODE   (03|O_SEARCH)

Access mode.

O_RDONLY   00

Read-only.

O_WRONLY   01

Write-only.

O_RDWR   02

Read and write.

fallocate64   fallocate

Pre-allocates space to a file. See fallocate.

## Functions

Function Name

Description

creat (const char *path, mode_t mode)

int 

Creates a file or rewrites an existing file.

open (const char *path, int oflags,...)

int 

Opens a file.

fallocate (int fd, int mode, off_t offset, off_t len)

int 

Pre-allocates space to a file.

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

int 

Manipulates a specified file descriptor.