POSIX / C stdio backend implementation of the osal_file module.
More...
#include "internal/osal_file_internal.h"#include "osal/file/osal_file_ops.h"#include "osal/mem/osal_mem_ops.h"#include "osal/mem/osal_mem.h"#include "policy/lexleo_cstd_lib.h"#include "policy/lexleo_cstd_io.h"#include "policy/lexleo_cstd_errno.h"#include "policy/lexleo_assert.h"
Go to the source code of this file.
Functions | |
| static osal_file_status_t | osal_file_map_errno (int errnum) |
Map a platform errno value to an osal_file_status_t. | |
| static osal_file_status_t | osal_file_open (OSAL_FILE **out, const char *pathname, const char *mode, const osal_mem_ops_t *mem_ops) |
| Open a file resource through the POSIX / C stdio backend. | |
| static size_t | osal_file_read (void *ptr, size_t size, size_t nmemb, OSAL_FILE *stream, osal_file_status_t *st) |
Read elements from an open OSAL_FILE. | |
| static size_t | osal_file_write (const void *ptr, size_t size, size_t nmemb, OSAL_FILE *stream, osal_file_status_t *st) |
Write elements to an open OSAL_FILE. | |
| static osal_file_status_t | osal_file_flush (OSAL_FILE *stream) |
Flush buffered output associated with an open OSAL_FILE. | |
| static osal_file_status_t | osal_file_close (OSAL_FILE *stream) |
Close an open OSAL_FILE and release its associated wrapper. | |
| const osal_file_ops_t * | osal_file_default_ops (void) |
| Return the default POSIX / C stdio OSAL file operations table. | |
This translation unit provides the active low-level osal_file operations for POSIX-like platforms through the C standard I/O runtime.
It implements:
errno,fopen(),fread() and fwrite(),fflush(),fclose(),osal_file_ops_t table for this backend. Definition in file osal_file_posix.c.
|
static |
This private callback implements the public osal_file_ops_t::close contract for the active POSIX-like backend.
| stream | Open OSAL_FILE handle to close. |
OSAL_FILE_STATUS_OK on success, or an error status on failure. Definition at line 379 of file osal_file_posix.c.
| const osal_file_ops_t * osal_file_default_ops | ( | void | ) |
Return the default OSAL file operations for the active platform.
osal_file_ops_t table for this backend. Definition at line 401 of file osal_file_posix.c.
|
static |
This private callback implements the public osal_file_ops_t::flush contract for the active POSIX-like backend.
| stream | Open OSAL_FILE handle. |
OSAL_FILE_STATUS_OK on success, or an error status on failure. Definition at line 353 of file osal_file_posix.c.
|
static |
| errnum | Platform error value to translate. |
OSAL_FILE_STATUS_IO. Definition at line 47 of file osal_file_posix.c.
|
static |
This private callback implements the public osal_file_ops_t::open contract for the active POSIX-like backend.
| [out] | out | Receives the acquired OSAL_FILE handle on success. |
| pathname | Pathname of the file resource to open. | |
| mode | Portable file access mode string. | |
| mem_ops | Memory operations table used to allocate the OSAL file wrapper. |
OSAL_FILE_STATUS_OK on success, or an error status on failure. Definition at line 190 of file osal_file_posix.c.
|
static |
This private callback implements the public osal_file_ops_t::read contract for the active POSIX-like backend.
| ptr | Destination buffer. | |
| size | Size in bytes of each element. | |
| nmemb | Number of elements to read. | |
| stream | Open OSAL_FILE handle. | |
| [out] | st | Receives the operation status. |
Definition at line 259 of file osal_file_posix.c.
|
static |
This private callback implements the public osal_file_ops_t::write contract for the active POSIX-like backend.
| ptr | Source buffer. | |
| size | Size in bytes of each element. | |
| nmemb | Number of elements to write. | |
| stream | Open OSAL_FILE handle. | |
| [out] | st | Receives the operation status. |
Definition at line 312 of file osal_file_posix.c.