diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-11-18 06:55:43 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-11-19 16:22:00 +0100 |
commit | f3779985681baaa4ac4e33dddfabab241008376c (patch) | |
tree | 2758bb25741f90b3cd5d9266b0021a40aaf8b659 /cpukit/include/rtems/imfs.h | |
parent | Move feature macro before "config.h" include (diff) | |
download | rtems-f3779985681baaa4ac4e33dddfabab241008376c.tar.bz2 |
imfs: Add IMFS_make_linfile()
Update #3818.
Diffstat (limited to '')
-rw-r--r-- | cpukit/include/rtems/imfs.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cpukit/include/rtems/imfs.h b/cpukit/include/rtems/imfs.h index e83209508c..27105fc257 100644 --- a/cpukit/include/rtems/imfs.h +++ b/cpukit/include/rtems/imfs.h @@ -317,6 +317,11 @@ typedef struct { void *context; } IMFS_generic_t; +typedef struct { + const void *data; + size_t size; +} IMFS_linearfile_context; + static inline IMFS_directory_t *IMFS_iop_to_directory( const rtems_libio_t *iop ) @@ -592,6 +597,32 @@ static inline bool IMFS_is_imfs_instance( return loc->mt_entry->ops->clonenod_h == IMFS_node_clone; } +extern int IMFS_make_node( + const char *path, + mode_t mode, + const IMFS_node_control *node_control, + size_t node_size, + void *context +); + +/** + * @brief Makes a linear IMFS file. + * + * @param path The path to the new linear IMFS file. + * @param mode The file mode permissions. S_IFREG is set by the function. + * @param data The begin of linear file data area. + * @param size The size of the linear file data area in bytes. + * + * @retval 0 Successful operation. + * @retval -1 An error occurred. The @c errno indicates the error. + */ +extern int IMFS_make_linearfile( + const char *path, + mode_t mode, + const char *data, + size_t size +); + /** @} */ /** |