7#if defined(__cplusplus)
45#define STDOUT_FILENO 1
46#define STDERR_FILENO 2
300#define POLL_SPECIAL (POLLERR | POLLHUP | POLLNVAL)
375static_assert(
sizeof(
stat_t) == 168,
"invalid stat_t size");
538#if defined(__cplusplus)
#define MAX_NAME
Maximum length of names.
#define MAX_PATH
Maximum length of filepaths.
fd_t dup2(fd_t oldFd, fd_t newFd)
System call for duplicating file descriptors, with a destination.
uint64_t stat(const char *path, stat_t *stat)
System call for retrieving info about a file or directory.
uint64_t writef(fd_t fd, const char *_RESTRICT format,...)
Wrapper for writing a formatted string to a file.
uint64_t getdents(fd_t fd, dirent_t *buffer, uint64_t count)
System call for reading directory entires.
#define KEY_SIZE
Size of keys in bytes.
uint64_t readf(fd_t fd, const char *_RESTRICT format,...)
Wrapper for reading a formatted string from a file.
fd_t open(const char *path)
System call for opening files.
inode_type_t
Inode type enum.
uint64_t vreadfilef(const char *path, const char *_RESTRICT format, va_list args)
Wrapper for reading a formatted string from a file directly using a path with a va_list.
fd_t claim(key_t *key)
System call for claiming a shared file descriptor.
poll_events_t poll1(fd_t fd, poll_events_t events, clock_t timeout)
Wrapper for polling one file.
uint64_t inode_number_t
Inode number enum.
uint64_t close(fd_t fd)
System call for closing files.
uint64_t seek(fd_t fd, int64_t offset, seek_origin_t origin)
System call for changing the file offset.
uint64_t ioctl(fd_t fd, uint64_t request, void *argp, uint64_t size)
System call for extended driver behaviour.
uint64_t vwritef(fd_t fd, const char *_RESTRICT format, va_list args)
Wrapper for writing a formatted string to a file with a va_list.
fd_t dup(fd_t oldFd)
System call for duplicating file descriptors.
fd_t vopenf(const char *_RESTRICT format, va_list args)
Wrapper for opening files with a formatted path, using a va_list.
uint64_t mkdir(const char *path)
Wrapper for creating a directory.
uint64_t readfile(const char *path, void *buffer, uint64_t count, uint64_t offset)
Wrapper for reading a file directly using a path.
uint64_t poll(pollfd_t *fds, uint64_t amount, clock_t timeout)
System call for polling files.
fd_t openf(const char *_RESTRICT format,...)
Wrapper for opening files with a formatted path.
uint64_t removef(const char *format,...)
Wrapper for removing a file with a formatted path.
uint64_t chdir(const char *path)
System call for changing the cwd.
uint64_t unlink(const char *path)
Wrapper for removing a file.
uint64_t bind(fd_t source, const char *mountpoint)
System call for binding a file descriptor to a mountpoint.
uint64_t vreadf(fd_t fd, const char *_RESTRICT format, va_list args)
Wrapper for reading a formatted string from a file with a va_list.
uint64_t vwritefilef(const char *path, const char *_RESTRICT format, va_list args)
Wrapper for writing a formatted string to a file directly using a path with a va_list.
uint8_t seek_origin_t
Type for the seek() origin argument.
uint64_t read(fd_t fd, void *buffer, uint64_t count)
System call for reading from files.
poll_events_t
Poll events type.
uint64_t open2(const char *path, fd_t fd[2])
System call for opening 2 file descriptors from one file.
uint64_t writefilef(const char *path, const char *_RESTRICT format,...)
Wrapper for writing a formatted string to a file directly using a path.
uint64_t vremovef(const char *format, va_list args)
Wrapper for removing a file with a formatted path, using a va_list.
uint64_t share(key_t *key, fd_t fd, clock_t timeout)
System call for sharing a file descriptor with another process.
uint64_t write(fd_t fd, const void *buffer, uint64_t count)
System call for writing to files.
uint64_t readfilef(const char *path, const char *_RESTRICT format,...)
Wrapper for reading a formatted string from a file directly using a path.
uint64_t rmdir(const char *path)
Wrapper for removing a directory.
uint64_t link(const char *oldPath, const char *newPath)
System call for creating a hardlink.
uint64_t writefile(const char *path, const void *buffer, uint64_t count, uint64_t offset)
Wrapper for writing a file directly using a path.
@ INODE_DIR
Is a directory.
@ POLLIN
File descriptor is ready to read.
@ POLLHUP
Stream socket peer closed connection, or shut down writing of connection.
@ POLLNVAL
Invalid file descriptor.
@ POLLOUT
File descriptor is ready to write.
@ POLLERR
File descriptor caused an error.
__UINT64_TYPE__ fd_t
A file descriptor.
__UINT64_TYPE__ clock_t
A nanosecond time.
EFI_PHYSICAL_ADDRESS buffer
__builtin_va_list va_list
inode_type_t type
The type of the entries inode.
inode_number_t number
The number of the entries inode.
Poll file descriptor structure.
poll_events_t revents
The events that occurred.
poll_events_t events
The events to wait for.
fd_t fd
The file descriptor to poll.
time_t accessTime
Unix time stamp for the last inode access.
uint64_t linkAmount
The amount of times the inode appears in dentries.
inode_number_t number
The number of the entries inode.
uint64_t size
The size of the file that is visible outside the filesystem.
inode_type_t type
The type of the entries inode.
time_t modifyTime
Unix time stamp for last file content alteration.
time_t changeTime
Unix time stamp for the last file metadata alteration.
uint64_t blocks
The amount of blocks used on disk to store the file.
time_t createTime
Unix time stamp for the creation of the inode.
long long unsigned time_t