AquilaOS documentation
How it works, and its code
Toggle main menu visibility
Loading...
Searching...
No Matches
posix.h
Go to the documentation of this file.
1
#ifndef __FS_POSIX_H
2
#define __FS_POSIX_H
3
4
#include <
fs/vfs.h
>
5
6
/* The usual file operations (fs/posix/), which most filesystems and
7
* devices use: they call the vnode's operations. */
8
9
int
posix_file_open
(
struct
file
*
file
);
10
int
posix_file_close
(
struct
file
*
file
);
11
ssize_t
posix_file_read
(
struct
file
*
file
,
struct
iobuf
*io);
12
ssize_t
posix_file_write
(
struct
file
*
file
,
struct
iobuf
*io);
13
ssize_t
posix_file_readdir
(
struct
file
*
file
,
struct
dirent *dirent);
14
int
posix_file_ioctl
(
struct
file
*
file
,
int
request,
void
*argp);
15
off_t
posix_file_lseek
(
struct
file
*
file
,
off_t
offset,
int
whence);
16
int
posix_file_trunc
(
struct
file
*
file
,
off_t
len);
17
18
int
posix_file_eof
(
struct
file
*
file
);
19
20
#endif
/* ! __FS_POSIX_H */
posix_file_eof
int posix_file_eof(struct file *file)
Says whether a file's offset is at or past its end, so that a read returns nothing.
Definition
helpers.c:17
posix_file_lseek
off_t posix_file_lseek(struct file *file, off_t offset, int whence)
Moves an open file's offset: to offset (SEEK_SET), by offset from where it is (SEEK_CUR),...
Definition
lseek.c:22
posix_file_open
int posix_file_open(struct file *file)
Finishes opening a file: with O_TRUNC, a regular file is truncated to 0 bytes.
Definition
open.c:17
posix_file_close
int posix_file_close(struct file *file)
Closes an open file by dropping its reference to its vnode.
Definition
close.c:15
posix_file_ioctl
int posix_file_ioctl(struct file *file, int request, void *argp)
Passes an ioctl() request on to the file's vnode (a device's, or its filesystem's).
Definition
ioctl.c:19
posix_file_read
ssize_t posix_file_read(struct file *file, struct iobuf *io)
Reads from an open file at its offset, and moves the offset past what was read.
Definition
read.c:29
posix_file_readdir
ssize_t posix_file_readdir(struct file *file, struct dirent *dirent)
Reads the directory entry at an open directory's offset, and moves the offset past it.
Definition
readdir.c:22
posix_file_trunc
int posix_file_trunc(struct file *file, off_t len)
Truncates (or extends) an open file to a new length.
Definition
trunc.c:16
posix_file_write
ssize_t posix_file_write(struct file *file, struct iobuf *io)
Writes to an open file at its offset, and moves the offset past what was written.
Definition
write.c:25
file
An open file (POSIX's "open file description", fs/file.c).
Definition
vfs.h:157
iobuf
An iobuf.
Definition
iobuf.h:35
ssize_t
long int ssize_t
Definition
types.h:12
off_t
long int off_t
Definition
types.h:10
vfs.h
kernel
include
fs
posix.h
Generated by
1.18.0