PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
file_table.c File Reference
Include dependency graph for file_table.c:

Go to the source code of this file.

Functions

void file_table_init (file_table_t *table)
 Initialize a file table.
 
void file_table_deinit (file_table_t *table)
 Deinitialize a file table.
 
file_tfile_table_get (file_table_t *table, fd_t fd)
 Get a file from its file descriptor.
 
fd_t file_table_alloc (file_table_t *table, file_t *file)
 Allocate a new file descriptor for a file.
 
uint64_t file_table_free (file_table_t *table, fd_t fd)
 Free a file descriptor.
 
uint64_t file_table_free_range (file_table_t *table, fd_t min, fd_t max)
 Free a range of file descriptors.
 
fd_t file_table_set (file_table_t *table, fd_t fd, file_t *file)
 Set a specific file descriptor to a file.
 
fd_t file_table_dup (file_table_t *table, fd_t oldFd)
 Duplicate a file descriptor.
 
fd_t file_table_dup2 (file_table_t *table, fd_t oldFd, fd_t newFd)
 Duplicate a file descriptor to a specific file descriptor.
 
uint64_t file_table_copy (file_table_t *dest, file_table_t *src, fd_t min, fd_t max)
 Copy a file table, closing any overlapping file descriptors.
 
void file_table_close_all (file_table_t *table)
 Close all files in the file table.
 
 SYSCALL_DEFINE (SYS_CLOSE, uint64_t, fd_t fd)
 
 SYSCALL_DEFINE (SYS_DUP, uint64_t, fd_t oldFd)
 
 SYSCALL_DEFINE (SYS_DUP2, uint64_t, fd_t oldFd, fd_t newFd)
 

Function Documentation

◆ SYSCALL_DEFINE() [1/3]

SYSCALL_DEFINE ( SYS_CLOSE  ,
uint64_t  ,
fd_t  fd 
)

Definition at line 255 of file file_table.c.

Here is the call graph for this function:

◆ SYSCALL_DEFINE() [2/3]

SYSCALL_DEFINE ( SYS_DUP  ,
uint64_t  ,
fd_t  oldFd 
)

Definition at line 260 of file file_table.c.

Here is the call graph for this function:

◆ SYSCALL_DEFINE() [3/3]

SYSCALL_DEFINE ( SYS_DUP2  ,
uint64_t  ,
fd_t  oldFd,
fd_t  newFd 
)

Definition at line 265 of file file_table.c.

Here is the call graph for this function: