RTEMS 6.1-rc1
|
File system node handler. More...
Files | |
file | default_fcntl.c |
RTEMS Default Filesystem - Default FCNTL. | |
file | default_freenode.c |
RTEMS Default Filesystem - Default Freenode. | |
file | default_ftruncate_directory.c |
RTEMS Default Filesystem - Default Ftruncate Directory. | |
file | default_kqfilter.c |
Default Kernel Event Filter Handler. | |
file | default_mmap.c |
Default MMAP Handler. | |
file | default_open.c |
RTEMS Default Filesystem - Default Open. | |
file | default_poll.c |
Default Poll Handler. | |
file | default_readv.c |
Default Read IO Vector Handler. | |
file | default_writev.c |
Default Read IO Vector Handler. | |
Data Structures | |
struct | _rtems_filesystem_file_handlers_r |
File system node operations table. More... | |
Typedefs | |
typedef int(* | rtems_filesystem_open_t) (rtems_libio_t *iop, const char *path, int oflag, mode_t mode) |
Opens a node. More... | |
typedef int(* | rtems_filesystem_close_t) (rtems_libio_t *iop) |
Closes a node. More... | |
typedef ssize_t(* | rtems_filesystem_read_t) (rtems_libio_t *iop, void *buffer, size_t count) |
Reads from a node. More... | |
typedef ssize_t(* | rtems_filesystem_readv_t) (rtems_libio_t *iop, const struct iovec *iov, int iovcnt, ssize_t total) |
Reads an IO vector from a node. More... | |
typedef ssize_t(* | rtems_filesystem_write_t) (rtems_libio_t *iop, const void *buffer, size_t count) |
Writes to a node. More... | |
typedef ssize_t(* | rtems_filesystem_writev_t) (rtems_libio_t *iop, const struct iovec *iov, int iovcnt, ssize_t total) |
Writes an IO vector to a node. More... | |
typedef int(* | rtems_filesystem_ioctl_t) (rtems_libio_t *iop, ioctl_command_t request, void *buffer) |
IO control of a node. More... | |
typedef off_t(* | rtems_filesystem_lseek_t) (rtems_libio_t *iop, off_t offset, int whence) |
Moves the read/write file offset. More... | |
typedef int(* | rtems_filesystem_fstat_t) (const rtems_filesystem_location_info_t *loc, struct stat *buf) |
Gets a node status. More... | |
typedef int(* | rtems_filesystem_ftruncate_t) (rtems_libio_t *iop, off_t length) |
Truncates a file to a specified length. More... | |
typedef int(* | rtems_filesystem_fsync_t) (rtems_libio_t *iop) |
Synchronizes changes to a file. More... | |
typedef int(* | rtems_filesystem_fdatasync_t) (rtems_libio_t *iop) |
Synchronizes the data of a file. More... | |
typedef int(* | rtems_filesystem_fcntl_t) (rtems_libio_t *iop, int cmd) |
File control. More... | |
typedef int(* | rtems_filesystem_poll_t) (rtems_libio_t *iop, int events) |
Poll and select support. More... | |
typedef int(* | rtems_filesystem_kqfilter_t) (rtems_libio_t *iop, struct knote *kn) |
Kernel event filter support. More... | |
typedef int(* | rtems_filesystem_mmap_t) (rtems_libio_t *iop, void **addr, size_t len, int prot, off_t off) |
MMAP support. More... | |
Functions | |
int | rtems_filesystem_default_open (rtems_libio_t *iop, const char *path, int oflag, mode_t mode) |
int | rtems_filesystem_default_close (rtems_libio_t *iop) |
ssize_t | rtems_filesystem_default_read (rtems_libio_t *iop, void *buffer, size_t count) |
ssize_t | rtems_filesystem_default_readv (rtems_libio_t *iop, const struct iovec *iov, int iovcnt, ssize_t total) |
Calls the read handler for each IO vector entry. More... | |
ssize_t | rtems_filesystem_default_write (rtems_libio_t *iop, const void *buffer, size_t count) |
ssize_t | rtems_filesystem_default_writev (rtems_libio_t *iop, const struct iovec *iov, int iovcnt, ssize_t total) |
Calls the write handler for each IO vector entry. More... | |
int | rtems_filesystem_default_ioctl (rtems_libio_t *iop, ioctl_command_t request, void *buffer) |
off_t | rtems_filesystem_default_lseek (rtems_libio_t *iop, off_t offset, int whence) |
off_t | rtems_filesystem_default_lseek_directory (rtems_libio_t *iop, off_t offset, int whence) |
An offset 0 with a whence of SEEK_SET will perform a directory rewind operation. More... | |
off_t | rtems_filesystem_default_lseek_file (rtems_libio_t *iop, off_t offset, int whence) |
Default lseek() handler for files. More... | |
int | rtems_filesystem_default_fstat (const rtems_filesystem_location_info_t *loc, struct stat *buf) |
Sets the mode to S_IRWXU | S_IRWXG | S_IRWXO. More... | |
int | rtems_filesystem_default_ftruncate (rtems_libio_t *iop, off_t length) |
int | rtems_filesystem_default_ftruncate_directory (rtems_libio_t *iop, off_t length) |
int | rtems_filesystem_default_fsync_or_fdatasync (rtems_libio_t *iop) |
int | rtems_filesystem_default_fsync_or_fdatasync_success (rtems_libio_t *iop) |
int | rtems_filesystem_default_fcntl (rtems_libio_t *iop, int cmd) |
int | rtems_filesystem_default_poll (rtems_libio_t *iop, int events) |
Default poll handler. More... | |
int | rtems_filesystem_default_kqfilter (rtems_libio_t *iop, struct knote *kn) |
Default kernel event filter handler. More... | |
int | rtems_filesystem_default_mmap (rtems_libio_t *iop, void **addr, size_t len, int prot, off_t off) |
Default MMAP handler. More... | |
Variables | |
const rtems_filesystem_file_handlers_r | rtems_filesystem_handlers_default |
File system node handler table with default node handlers. | |
File system node handler.
typedef int(* rtems_filesystem_close_t) (rtems_libio_t *iop) |
Closes a node.
[in,out] | iop | The IO pointer. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_fcntl_t) (rtems_libio_t *iop, int cmd) |
File control.
[in,out] | iop | The IO pointer. |
[in] | cmd | Control command. |
0 | Successful operation. |
errno | An error occurred. This value is assigned to errno. |
typedef int(* rtems_filesystem_fdatasync_t) (rtems_libio_t *iop) |
Synchronizes the data of a file.
[in,out] | iop | The IO pointer. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_fstat_t) (const rtems_filesystem_location_info_t *loc, struct stat *buf) |
Gets a node status.
[in,out] | iop | The IO pointer. |
[out] | stat | The buffer to status information. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_fsync_t) (rtems_libio_t *iop) |
Synchronizes changes to a file.
[in,out] | iop | The IO pointer. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_ftruncate_t) (rtems_libio_t *iop, off_t length) |
Truncates a file to a specified length.
[in,out] | iop | The IO pointer. |
[in] | length | The new length in characters. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_ioctl_t) (rtems_libio_t *iop, ioctl_command_t request, void *buffer) |
IO control of a node.
[in,out] | iop | The IO pointer. |
[in] | request | The IO control request. |
[in,out] | buffer | The buffer for IO control request data. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_kqfilter_t) (rtems_libio_t *iop, struct knote *kn) |
Kernel event filter support.
[in,out] | iop | The IO pointer. |
[in] | kn | The kernel event note. |
0 | Successful operation. |
error | An error occurred. This is usually EINVAL. |
typedef off_t(* rtems_filesystem_lseek_t) (rtems_libio_t *iop, off_t offset, int whence) |
Moves the read/write file offset.
[in,out] | iop | The IO pointer. |
[in] | offset | The offset. |
[in] | whence | The reference position for the offset. |
non-negative | The new offset from the beginning of the file. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_mmap_t) (rtems_libio_t *iop, void **addr, size_t len, int prot, off_t off) |
MMAP support.
[in,out] | iop | The IO pointer. |
[in,out] | addr | The starting address of the mapped memory. |
[in] | len | The maximum number of bytes to map. |
[in] | prot | The desired memory protection. |
[in] | off | The offset within the file descriptor to map. |
0 | Successful operation. |
error | An error occurred. This is usually EINVAL. |
typedef int(* rtems_filesystem_open_t) (rtems_libio_t *iop, const char *path, int oflag, mode_t mode) |
Opens a node.
[in,out] | iop | The IO pointer. |
[in] | path | The path. |
[in] | oflag | The open flags. |
[in] | mode | Optional mode for node creation. |
0 | Successful operation. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef int(* rtems_filesystem_poll_t) (rtems_libio_t *iop, int events) |
Poll and select support.
[in,out] | iop | The IO pointer. |
[in] | events | The poll events. |
typedef ssize_t(* rtems_filesystem_read_t) (rtems_libio_t *iop, void *buffer, size_t count) |
Reads from a node.
This handler is responsible to update the offset field of the IO descriptor.
[in,out] | iop | The IO pointer. |
[out] | buffer | The buffer for read data. |
[in] | count | The size of the buffer in characters. |
non-negative | Count of read characters. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef ssize_t(* rtems_filesystem_readv_t) (rtems_libio_t *iop, const struct iovec *iov, int iovcnt, ssize_t total) |
Reads an IO vector from a node.
This handler is responsible to update the offset field of the IO descriptor.
[in,out] | iop | The IO pointer. |
[in] | iov | The IO vector with buffer for read data. The caller must ensure that the IO vector values are valid. |
[in] | iovcnt | The count of buffers in the IO vector. |
[in] | total | The total count of bytes in the buffers in the IO vector. |
non-negative | Count of read characters. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef ssize_t(* rtems_filesystem_write_t) (rtems_libio_t *iop, const void *buffer, size_t count) |
Writes to a node.
This handler is responsible to update the offset field of the IO descriptor.
[in,out] | iop | The IO pointer. |
[out] | buffer | The buffer for write data. |
[in] | count | The size of the buffer in characters. |
non-negative | Count of written characters. |
-1 | An error occurred. The errno is set to indicate the error. |
typedef ssize_t(* rtems_filesystem_writev_t) (rtems_libio_t *iop, const struct iovec *iov, int iovcnt, ssize_t total) |
Writes an IO vector to a node.
This handler is responsible to update the offset field of the IO descriptor.
[in,out] | iop | The IO pointer. |
[in] | iov | The IO vector with buffer for write data. The caller must ensure that the IO vector values are valid. |
[in] | iovcnt | The count of buffers in the IO vector. |
[in] | total | The total count of bytes in the buffers in the IO vector. |
non-negative | Count of written characters. |
-1 | An error occurred. The errno is set to indicate the error. |
int rtems_filesystem_default_close | ( | rtems_libio_t * | iop | ) |
0 | Always. |
int rtems_filesystem_default_fcntl | ( | rtems_libio_t * | iop, |
int | cmd | ||
) |
0 | Always. |
int rtems_filesystem_default_fstat | ( | const rtems_filesystem_location_info_t * | loc, |
struct stat * | buf | ||
) |
Sets the mode to S_IRWXU | S_IRWXG | S_IRWXO.
0 | Always. |
int rtems_filesystem_default_fsync_or_fdatasync | ( | rtems_libio_t * | iop | ) |
-1 | Always. The errno is set to EINVAL. |
int rtems_filesystem_default_fsync_or_fdatasync_success | ( | rtems_libio_t * | iop | ) |
0 | Always. |
int rtems_filesystem_default_ftruncate | ( | rtems_libio_t * | iop, |
off_t | length | ||
) |
-1 | Always. The errno is set to EINVAL. |
int rtems_filesystem_default_ftruncate_directory | ( | rtems_libio_t * | iop, |
off_t | length | ||
) |
-1 | Always. The errno is set to EISDIR. |
int rtems_filesystem_default_ioctl | ( | rtems_libio_t * | iop, |
ioctl_command_t | request, | ||
void * | buffer | ||
) |
-1 | Always. The errno is set to ENOTTY. |
int rtems_filesystem_default_kqfilter | ( | rtems_libio_t * | iop, |
struct knote * | kn | ||
) |
Default kernel event filter handler.
EINVAL | Always. |
off_t rtems_filesystem_default_lseek | ( | rtems_libio_t * | iop, |
off_t | offset, | ||
int | whence | ||
) |
-1 | Always. The errno is set to ESPIPE. |
off_t rtems_filesystem_default_lseek_directory | ( | rtems_libio_t * | iop, |
off_t | offset, | ||
int | whence | ||
) |
An offset 0 with a whence of SEEK_SET will perform a directory rewind operation.
This function has no protection against concurrent access.
-1 | The offset is not zero or the whence is not SEEK_SET. |
0 | Successful rewind operation. |
off_t rtems_filesystem_default_lseek_file | ( | rtems_libio_t * | iop, |
off_t | offset, | ||
int | whence | ||
) |
Default lseek() handler for files.
The fstat() handler will be used to obtain the file size in case whence is SEEK_END.
This function has no protection against concurrent access.
-1 | An error occurred. In case an integer overflow occurred, then the errno will be set to EOVERFLOW. In case the new offset is negative, then the errno will be set to EINVAL. In case the whence is SEEK_END and the fstat() handler to obtain the current file size returned an error status, then the errno will be set by the fstat() handler. |
offset | The new offset. |
int rtems_filesystem_default_mmap | ( | rtems_libio_t * | iop, |
void ** | addr, | ||
size_t | len, | ||
int | prot, | ||
off_t | off | ||
) |
int rtems_filesystem_default_open | ( | rtems_libio_t * | iop, |
const char * | path, | ||
int | oflag, | ||
mode_t | mode | ||
) |
0 | Always. |
int rtems_filesystem_default_poll | ( | rtems_libio_t * | iop, |
int | events | ||
) |
ssize_t rtems_filesystem_default_read | ( | rtems_libio_t * | iop, |
void * | buffer, | ||
size_t | count | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
ssize_t rtems_filesystem_default_readv | ( | rtems_libio_t * | iop, |
const struct iovec * | iov, | ||
int | iovcnt, | ||
ssize_t | total | ||
) |
Calls the read handler for each IO vector entry.
ssize_t rtems_filesystem_default_write | ( | rtems_libio_t * | iop, |
const void * | buffer, | ||
size_t | count | ||
) |
-1 | Always. The errno is set to ENOTSUP. |
ssize_t rtems_filesystem_default_writev | ( | rtems_libio_t * | iop, |
const struct iovec * | iov, | ||
int | iovcnt, | ||
ssize_t | total | ||
) |
Calls the write handler for each IO vector entry.