RTEMS 6.1-rc1
libio.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
15/*
16 * COPYRIGHT (C) 1989, 2021 On-Line Applications Research Corporation (OAR).
17 *
18 * Modifications to support reference counting in the file system are
19 * Copyright (C) 2012 embedded brains GmbH & Co. KG
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
23 * are met:
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
34 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 * POSSIBILITY OF SUCH DAMAGE.
41 */
42
43#ifndef _RTEMS_RTEMS_LIBIO_H
44#define _RTEMS_RTEMS_LIBIO_H
45
46#include <sys/types.h>
47#include <sys/stat.h>
48#include <sys/ioccom.h>
49#include <sys/statvfs.h>
50#include <sys/uio.h>
51
52#include <unistd.h>
53#include <termios.h>
54
55#include <rtems.h>
56#include <rtems/fs.h>
57#include <rtems/chain.h>
58#include <rtems/score/atomic.h>
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64struct knote;
65
86);
87
97);
98
102typedef struct {
106 const char *path;
107
111 size_t pathlen;
112
117 const char *token;
118
123 size_t tokenlen;
124
137 int flags;
138
145
154
160
167
177);
178
193 const rtems_filesystem_location_info_t *parentloc,
194 const rtems_filesystem_location_info_t *targetloc,
195 const char *name,
196 size_t namelen
197);
198
212 mode_t mode
213);
214
229 uid_t owner,
230 gid_t group
231);
232
250);
251
261);
262
281);
282
297 const void *data
298);
299
316);
317
331);
332
350);
351
369 const rtems_filesystem_location_info_t *parentloc,
370 const char *name,
371 size_t namelen,
372 mode_t mode,
373 dev_t dev
374);
375
388 const rtems_filesystem_location_info_t *parentloc,
390);
391
405 struct timespec times[2]
406);
407
423 const rtems_filesystem_location_info_t *parentloc,
424 const char *name,
425 size_t namelen,
426 const char *target
427);
428
443 char *buf,
444 size_t bufsize
445);
446
462 const rtems_filesystem_location_info_t *oldparentloc,
464 const rtems_filesystem_location_info_t *newparentloc,
465 const char *name,
466 size_t namelen
467);
468
482 struct statvfs *buf
483);
484
493 rtems_filesystem_are_nodes_equal_t are_nodes_equal_h;
502 rtems_filesystem_fsunmount_me_t fsunmount_me_h;
508};
509
515
523);
524
532);
533
542);
543
550 const rtems_filesystem_location_info_t *parentloc,
551 const rtems_filesystem_location_info_t *targetloc,
552 const char *name,
553 size_t namelen
554);
555
571);
572
579 const rtems_filesystem_location_info_t *parentloc,
580 const char *name,
581 size_t namelen,
582 mode_t mode,
583 dev_t dev
584);
585
592 const rtems_filesystem_location_info_t *parentloc,
594);
595
603 mode_t mode
604);
605
613 uid_t owner,
614 gid_t group
615);
616
624);
625
631);
632
639 rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
640);
641
648 rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
649);
650
657 rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
658);
659
667 struct timespec times[2]
668);
669
676 const rtems_filesystem_location_info_t *parentloc,
677 const char *name,
678 size_t namelen,
679 const char *target
680);
681
689 char *buf,
690 size_t bufsize
691);
692
699 const rtems_filesystem_location_info_t *oldparentloc,
701 const rtems_filesystem_location_info_t *newparentloc,
702 const char *name,
703 size_t namelen
704);
705
713 struct statvfs *buf
714);
715
741 rtems_libio_t *iop,
742 const char *path,
743 int oflag,
744 mode_t mode
745);
746
758 rtems_libio_t *iop
759);
760
775typedef ssize_t (*rtems_filesystem_read_t)(
776 rtems_libio_t *iop,
777 void *buffer,
778 size_t count
779);
780
797typedef ssize_t (*rtems_filesystem_readv_t)(
798 rtems_libio_t *iop,
799 const struct iovec *iov,
800 int iovcnt,
801 ssize_t total
802);
803
818typedef ssize_t (*rtems_filesystem_write_t)(
819 rtems_libio_t *iop,
820 const void *buffer,
821 size_t count
822);
823
840typedef ssize_t (*rtems_filesystem_writev_t)(
841 rtems_libio_t *iop,
842 const struct iovec *iov,
843 int iovcnt,
844 ssize_t total
845);
846
860 rtems_libio_t *iop,
861 ioctl_command_t request,
862 void *buffer
863);
864
880 rtems_libio_t *iop,
881 off_t offset,
882 int whence
883);
884
898 struct stat *buf
899);
900
914 rtems_libio_t *iop,
915 off_t length
916);
917
930 rtems_libio_t *iop
931);
932
945 rtems_libio_t *iop
946);
947
960 rtems_libio_t *iop,
961 int cmd
962);
963
975 rtems_libio_t *iop,
976 int events
977);
978
991 rtems_libio_t *iop,
992 struct knote *kn
993);
994
1010 rtems_libio_t *iop,
1011 void **addr,
1012 size_t len,
1013 int prot,
1014 off_t off
1015);
1016
1028 rtems_filesystem_ftruncate_t ftruncate_h;
1030 rtems_filesystem_fdatasync_t fdatasync_h;
1033 rtems_filesystem_kqfilter_t kqfilter_h;
1037};
1038
1044
1051 rtems_libio_t *iop,
1052 const char *path,
1053 int oflag,
1054 mode_t mode
1055);
1056
1063 rtems_libio_t *iop
1064);
1065
1072 rtems_libio_t *iop,
1073 void *buffer,
1074 size_t count
1075);
1076
1083 rtems_libio_t *iop,
1084 const struct iovec *iov,
1085 int iovcnt,
1086 ssize_t total
1087);
1088
1095 rtems_libio_t *iop,
1096 const void *buffer,
1097 size_t count
1098);
1099
1106 rtems_libio_t *iop,
1107 const struct iovec *iov,
1108 int iovcnt,
1109 ssize_t total
1110);
1111
1118 rtems_libio_t *iop,
1119 ioctl_command_t request,
1120 void *buffer
1121);
1122
1129 rtems_libio_t *iop,
1130 off_t offset,
1131 int whence
1132);
1133
1146 rtems_libio_t *iop,
1147 off_t offset,
1148 int whence
1149);
1150
1169 rtems_libio_t *iop,
1170 off_t offset,
1171 int whence
1172);
1173
1183 struct stat *buf
1184);
1185
1192 rtems_libio_t *iop,
1193 off_t length
1194);
1195
1202 rtems_libio_t *iop,
1203 off_t length
1204);
1205
1212 rtems_libio_t *iop
1213);
1214
1221 rtems_libio_t *iop
1222);
1223
1230 rtems_libio_t *iop,
1231 int cmd
1232);
1233
1242 rtems_libio_t *iop,
1243 int events
1244);
1245
1254 rtems_libio_t *iop,
1255 struct knote *kn
1256);
1257
1266 rtems_libio_t *iop,
1267 void **addr,
1268 size_t len,
1269 int prot,
1270 off_t off
1271);
1272
1289typedef off_t rtems_off64_t __attribute__((deprecated));
1290
1299 const char *type
1300);
1301
1306typedef struct {
1307 int link_max; /* count */
1308 int max_canon; /* max formatted input line size */
1309 int max_input; /* max input line size */
1310 int name_max; /* max name length */
1311 int path_max; /* max path */
1312 int pipe_buf; /* pipe buffer size */
1313 int posix_async_io; /* async IO supported on fs, 0=no, 1=yes */
1314 int posix_chown_restrictions; /* can chown: 0=no, 1=yes */
1315 int posix_no_trunc; /* error on names > max name, 0=no, 1=yes */
1316 int posix_prio_io; /* priority IO, 0=no, 1=yes */
1317 int posix_sync_io; /* file can be sync'ed, 0=no, 1=yes */
1318 int posix_vdisable; /* special char processing, 0=no, 1=yes */
1320
1328
1338 Atomic_Uint flags;
1339 off_t offset; /* current offset into file */
1341 uint32_t data0; /* private to "driver" */
1342 void *data1; /* ... */
1343};
1344
1351typedef struct {
1352 rtems_libio_t *iop;
1353 off_t offset;
1354 char *buffer;
1355 uint32_t count;
1356 uint32_t flags;
1357 uint32_t bytes_moved;
1359
1364 rtems_libio_t *iop;
1365 uint32_t flags;
1366 uint32_t mode;
1368
1372typedef struct {
1373 rtems_libio_t *iop;
1374 ioctl_command_t command;
1375 void *buffer;
1376 int ioctl_return;
1378
1384#define LIBIO_FLAGS_NO_DELAY 0x0001U /* return immediately if no data */
1385#define LIBIO_FLAGS_READ 0x0002U /* reading */
1386#define LIBIO_FLAGS_WRITE 0x0004U /* writing */
1387#define LIBIO_FLAGS_OPEN 0x0100U /* device is open */
1388#define LIBIO_FLAGS_APPEND 0x0200U /* all writes append */
1389#define LIBIO_FLAGS_CLOSE_ON_EXEC 0x0800U /* close on process exec() */
1390#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
1391#define LIBIO_FLAGS_REFERENCE_INC 0x1000U
1392
1395static inline unsigned int rtems_libio_iop_flags( const rtems_libio_t *iop )
1396{
1397 return _Atomic_Load_uint( &iop->flags, ATOMIC_ORDER_RELAXED );
1398}
1399
1405static inline bool rtems_libio_iop_is_no_delay( const rtems_libio_t *iop )
1406{
1407 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_NO_DELAY ) != 0;
1408}
1409
1415static inline bool rtems_libio_iop_is_readable( const rtems_libio_t *iop )
1416{
1417 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_READ ) != 0;
1418}
1419
1425static inline bool rtems_libio_iop_is_writeable( const rtems_libio_t *iop )
1426{
1427 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_WRITE ) != 0;
1428}
1429
1435static inline bool rtems_libio_iop_is_append( const rtems_libio_t *iop )
1436{
1437 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_APPEND ) != 0;
1438}
1439
1445typedef int (*rtems_libio_open_t)(
1446 const char *pathname,
1447 uint32_t flag,
1448 uint32_t mode
1449);
1450
1451typedef int (*rtems_libio_close_t)(
1452 int fd
1453);
1454
1455typedef ssize_t (*rtems_libio_read_t)(
1456 int fd,
1457 void *buffer,
1458 size_t count
1459);
1460
1461typedef ssize_t (*rtems_libio_write_t)(
1462 int fd,
1463 const void *buffer,
1464 size_t count
1465);
1466
1467typedef int (*rtems_libio_ioctl_t)(
1468 int fd,
1469 uint32_t command,
1470 void *buffer
1471);
1472
1473typedef off_t (*rtems_libio_lseek_t)(
1474 int fd,
1475 off_t offset,
1476 int whence
1477);
1478
1486/*
1487 * The following macros are used to build up the permissions sets
1488 * used to check permissions. These are similar in style to the
1489 * mode_t bits and should stay compatible with them.
1490 */
1491#define RTEMS_FS_PERMS_READ 0x4
1492#define RTEMS_FS_PERMS_WRITE 0x2
1493#define RTEMS_FS_PERMS_EXEC 0x1
1494#define RTEMS_FS_PERMS_RWX \
1495 (RTEMS_FS_PERMS_READ | RTEMS_FS_PERMS_WRITE | RTEMS_FS_PERMS_EXEC)
1496#define RTEMS_FS_FOLLOW_HARD_LINK 0x8
1497#define RTEMS_FS_FOLLOW_SYM_LINK 0x10
1498#define RTEMS_FS_FOLLOW_LINK \
1499 (RTEMS_FS_FOLLOW_HARD_LINK | RTEMS_FS_FOLLOW_SYM_LINK)
1500#define RTEMS_FS_MAKE 0x20
1501#define RTEMS_FS_EXCLUSIVE 0x40
1502#define RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS 0x80
1503#define RTEMS_FS_REJECT_TERMINAL_DOT 0x100
1504
1508 dev_t device;
1509 struct {
1512 } __overlay;
1513};
1514
1515static inline dev_t rtems_filesystem_make_dev_t(
1518)
1519{
1520 union __rtems_dev_t temp;
1521
1522 temp.__overlay.major = _major;
1523 temp.__overlay.minor = _minor;
1524 return temp.device;
1525}
1526
1527static inline dev_t rtems_filesystem_make_dev_t_from_pointer(
1528 const void *pointer
1529)
1530{
1531 uint64_t temp = (((uint64_t) 1) << 63) | (((uintptr_t) pointer) >> 1);
1532
1533 return rtems_filesystem_make_dev_t((uint32_t) (temp >> 32), (uint32_t) temp);
1534}
1535
1536static inline rtems_device_major_number rtems_filesystem_dev_major_t(
1537 dev_t device
1538)
1539{
1540 union __rtems_dev_t temp;
1541
1542 temp.device = device;
1543 return temp.__overlay.major;
1544}
1545
1546
1547static inline rtems_device_minor_number rtems_filesystem_dev_minor_t(
1548 dev_t device
1549)
1550{
1551 union __rtems_dev_t temp;
1552
1553 temp.device = device;
1554 return temp.__overlay.minor;
1555}
1556
1557#define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
1558 do { \
1559 (_major) = rtems_filesystem_dev_major_t ( _dev ); \
1560 (_minor) = rtems_filesystem_dev_minor_t( _dev ); \
1561 } while(0)
1562
1563/*
1564 * Prototypes for filesystem
1565 */
1566
1575void rtems_filesystem_initialize( void );
1576
1577void rtems_libio_post_driver(void);
1578
1579void rtems_libio_exit(void);
1580
1590extern int rtems_mkdir(const char *path, mode_t mode);
1591
1608#define RTEMS_FILESYSTEM_TYPE_IMFS "imfs"
1609#define RTEMS_FILESYSTEM_TYPE_FTPFS "ftpfs"
1610#define RTEMS_FILESYSTEM_TYPE_TFTPFS "tftpfs"
1611#define RTEMS_FILESYSTEM_TYPE_NFS "nfs"
1612#define RTEMS_FILESYSTEM_TYPE_DOSFS "dosfs"
1613#define RTEMS_FILESYSTEM_TYPE_RFS "rfs"
1614#define RTEMS_FILESYSTEM_TYPE_JFFS2 "jffs2"
1615
1622 rtems_chain_node mt_node;
1623 void *fs_info;
1625 const void *immutable_fs_info;
1626 rtems_chain_control location_chain;
1629 bool mounted;
1630 bool writeable;
1631 bool no_regular_file_mknod;
1632 const rtems_filesystem_limits_and_options_t *pathconf_limits_and_options;
1633
1634 /*
1635 * The target or mount point of the file system.
1636 */
1637 const char *target;
1638
1639 /*
1640 * The type of filesystem or the name of the filesystem.
1641 */
1642 const char *type;
1643
1644 /*
1645 * When someone adds a mounted filesystem on a real device,
1646 * this will need to be used.
1647 *
1648 * The lower layers can manage how this is managed. Leave as a
1649 * string.
1650 */
1651 char *dev;
1652
1660};
1661
1665typedef enum {
1666 RTEMS_FILESYSTEM_READ_ONLY,
1667 RTEMS_FILESYSTEM_READ_WRITE,
1668 RTEMS_FILESYSTEM_BAD_OPTIONS
1670
1675 const char *type;
1678
1685
1686extern rtems_chain_control rtems_filesystem_mount_table;
1687
1697 const char *type,
1699);
1700
1708 const char *type
1709);
1710
1733int unmount(
1734 const char *mount_path
1735);
1736
1784int mount(
1785 const char *source,
1786 const char *target,
1787 const char *filesystemtype,
1789 const void *data
1790);
1791
1804 const char *source,
1805 const char *target,
1806 const char *filesystemtype,
1808 const void *data
1809);
1810
1820 const rtems_filesystem_table_t *fs_entry,
1821 void *arg
1822);
1823
1839 void *routine_arg
1840);
1841
1852 void *arg
1853);
1854
1870 void *visitor_arg
1871);
1872
1873typedef struct {
1874 const char *source;
1875 const char *target;
1876 const char *filesystemtype;
1878 const void *data;
1880
1882 rtems_filesystem_root_configuration;
1883
1895struct rtems_termios_tty;
1896
1898 int (*firstOpen)(int major, int minor, void *arg);
1899 int (*lastClose)(int major, int minor, void *arg);
1900 int (*pollRead)(int minor);
1901 ssize_t (*write)(int minor, const char *buf, size_t len);
1902 int (*setAttributes)(int minor, const struct termios *t);
1903 int (*stopRemoteTx)(int minor);
1904 int (*startRemoteTx)(int minor);
1905 int outputUsesInterrupts;
1907
1908static inline void rtems_termios_initialize( void )
1909{
1910 /* Nothing to do, provided for backward compatibility */
1911}
1912
1913/*
1914 * CCJ: Change before opening a tty. Newer code from Eric is coming
1915 * so extra work to handle an open tty is not worth it. If the tty
1916 * is open, close then open it again.
1917 */
1918rtems_status_code rtems_termios_bufsize (
1919 size_t cbufsize, /* cooked buffer size */
1920 size_t raw_input, /* raw input buffer size */
1921 size_t raw_output /* raw output buffer size */
1922);
1923
1928typedef enum {
1936
1948
1956
1974 unsigned char c,
1975 struct rtems_termios_tty *tty
1976);
1977
1997 unsigned char c,
1998 struct rtems_termios_tty *tty
1999);
2000
2015 unsigned char c,
2016 struct rtems_termios_tty *tty
2017);
2018
2033);
2034
2035int rtems_termios_enqueue_raw_characters(
2036 void *ttyp,
2037 const char *buf,
2038 int len
2039);
2040
2041rtems_status_code rtems_termios_open (
2044 void *arg,
2045 const rtems_termios_callbacks *callbacks
2046);
2047
2048rtems_status_code rtems_termios_close(
2049 void *arg
2050);
2051
2052rtems_status_code rtems_termios_read(
2053 void *arg
2054);
2055
2056rtems_status_code rtems_termios_write(
2057 void *arg
2058);
2059
2060rtems_status_code rtems_termios_ioctl(
2061 void *arg
2062);
2063
2064int rtems_termios_dequeue_characters(
2065 void *ttyp,
2066 int len
2067);
2068
2074#define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
2075
2079#define rtems_filesystem_type(_mte) ((_mte)->type)
2080
2084#define rtems_filesystem_mount_point(_mte) ((_mte)->target)
2085
2089#define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
2090
2091#ifdef __cplusplus
2092}
2093#endif
2094
2095#endif /* _RTEMS_LIBIO_H */
clock_t times(struct tms *ptms)
Definition: __times.c:97
This header file provides the Chains API.
bool rtems_filesystem_mount_iterate(rtems_filesystem_mt_entry_visitor visitor, void *visitor_arg)
Iterates over all file system mount entries.
Definition: sup_fs_mount_iterate.c:42
int mount_and_make_target_path(const char *source, const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data)
Mounts a file system and makes the target path.
Definition: mount-mktgt.c:44
bool rtems_filesystem_iterate(rtems_per_filesystem_routine routine, void *routine_arg)
Iterates over all file system types.
Definition: mount-mgr.c:58
struct rtems_filesystem_table_t rtems_filesystem_table_t
File system table entry.
int unmount(const char *mount_path)
Unmounts the file system instance at the specified mount path.
Definition: unmount.c:62
int rtems_filesystem_unregister(const char *type)
Unregisters a file system type.
Definition: mount-mgr.c:160
const rtems_filesystem_table_t rtems_filesystem_table[]
Static table of file systems.
bool(* rtems_filesystem_mt_entry_visitor)(const rtems_filesystem_mount_table_entry_t *mt_entry, void *arg)
Mount table entry visitor.
Definition: libio.h:1850
bool(* rtems_per_filesystem_routine)(const rtems_filesystem_table_t *fs_entry, void *arg)
Per file system type routine.
Definition: libio.h:1819
int rtems_filesystem_register(const char *type, rtems_filesystem_fsmount_me_t mount_h)
Registers a file system type.
Definition: mount-mgr.c:126
rtems_filesystem_options_t
File system options.
Definition: libio.h:1665
int mount(const char *source, const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data)
Mounts a file system instance at the specified target path.
Definition: mount.c:197
int(* rtems_filesystem_ioctl_t)(rtems_libio_t *iop, ioctl_command_t request, void *buffer)
IO control of a node.
Definition: libio.h:859
int rtems_filesystem_default_fcntl(rtems_libio_t *iop, int cmd)
Definition: default_fcntl.c:41
int(* rtems_filesystem_poll_t)(rtems_libio_t *iop, int events)
Poll and select support.
Definition: libio.h:974
int rtems_filesystem_default_ftruncate(rtems_libio_t *iop, off_t length)
Definition: default_ftruncate.c:44
int rtems_filesystem_default_ftruncate_directory(rtems_libio_t *iop, off_t length)
Definition: default_ftruncate_directory.c:43
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.
Definition: default_lseek_directory.c:42
ssize_t(* rtems_filesystem_read_t)(rtems_libio_t *iop, void *buffer, size_t count)
Reads from a node.
Definition: libio.h:775
int(* rtems_filesystem_fcntl_t)(rtems_libio_t *iop, int cmd)
File control.
Definition: libio.h:959
int rtems_filesystem_default_ioctl(rtems_libio_t *iop, ioctl_command_t request, void *buffer)
Definition: default_ioctl.c:43
int rtems_filesystem_default_poll(rtems_libio_t *iop, int events)
Default poll handler.
Definition: default_poll.c:44
int rtems_filesystem_default_fsync_or_fdatasync(rtems_libio_t *iop)
Definition: default_fsync.c:43
const rtems_filesystem_file_handlers_r rtems_filesystem_handlers_default
File system node handler table with default node handlers.
Definition: default_handlers.c:38
off_t rtems_filesystem_default_lseek_file(rtems_libio_t *iop, off_t offset, int whence)
Default lseek() handler for files.
Definition: default_lseek_file.c:42
int(* rtems_filesystem_kqfilter_t)(rtems_libio_t *iop, struct knote *kn)
Kernel event filter support.
Definition: libio.h:990
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.
Definition: default_fstat.c:43
int rtems_filesystem_default_fsync_or_fdatasync_success(rtems_libio_t *iop)
Definition: default_fsync_success.c:42
int rtems_filesystem_default_kqfilter(rtems_libio_t *iop, struct knote *kn)
Default kernel event filter handler.
Definition: default_kqfilter.c:42
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.
Definition: default_writev.c:45
int(* rtems_filesystem_close_t)(rtems_libio_t *iop)
Closes a node.
Definition: libio.h:757
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.
Definition: default_readv.c:45
off_t(* rtems_filesystem_lseek_t)(rtems_libio_t *iop, off_t offset, int whence)
Moves the read/write file offset.
Definition: libio.h:879
off_t rtems_filesystem_default_lseek(rtems_libio_t *iop, off_t offset, int whence)
Definition: default_lseek.c:43
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.
Definition: libio.h:840
int(* rtems_filesystem_fstat_t)(const rtems_filesystem_location_info_t *loc, struct stat *buf)
Gets a node status.
Definition: libio.h:896
int rtems_filesystem_default_mmap(rtems_libio_t *iop, void **addr, size_t len, int prot, off_t off)
Default MMAP handler.
Definition: default_mmap.c:42
ssize_t(* rtems_filesystem_write_t)(rtems_libio_t *iop, const void *buffer, size_t count)
Writes to a node.
Definition: libio.h:818
int rtems_filesystem_default_close(rtems_libio_t *iop)
Definition: default_close.c:37
int(* rtems_filesystem_fsync_t)(rtems_libio_t *iop)
Synchronizes changes to a file.
Definition: libio.h:929
ssize_t rtems_filesystem_default_read(rtems_libio_t *iop, void *buffer, size_t count)
Definition: default_read.c:39
int(* rtems_filesystem_fdatasync_t)(rtems_libio_t *iop)
Synchronizes the data of a file.
Definition: libio.h:944
int rtems_filesystem_default_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
Definition: default_open.c:43
int(* rtems_filesystem_mmap_t)(rtems_libio_t *iop, void **addr, size_t len, int prot, off_t off)
MMAP support.
Definition: libio.h:1009
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.
Definition: libio.h:797
ssize_t rtems_filesystem_default_write(rtems_libio_t *iop, const void *buffer, size_t count)
Definition: default_write.c:41
int(* rtems_filesystem_ftruncate_t)(rtems_libio_t *iop, off_t length)
Truncates a file to a specified length.
Definition: libio.h:913
int(* rtems_filesystem_open_t)(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
Opens a node.
Definition: libio.h:740
int(* rtems_filesystem_statvfs_t)(const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
Gets file system information.
Definition: libio.h:480
int rtems_filesystem_default_unmount(rtems_filesystem_mount_table_entry_t *mt_entry)
Definition: default_unmount.c:41
int(* rtems_filesystem_link_t)(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
Creates a new link for the existing file.
Definition: libio.h:192
int(* rtems_filesystem_mount_t)(rtems_filesystem_mount_table_entry_t *mt_entry)
Mounts a file system instance in a mount point (directory).
Definition: libio.h:279
int(* rtems_filesystem_fchmod_t)(const rtems_filesystem_location_info_t *loc, mode_t mode)
Changes the mode of a node.
Definition: libio.h:210
void rtems_filesystem_default_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Obtains the IO library mutex.
Definition: default_lock_and_unlock.c:42
int rtems_filesystem_default_rename(const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)
Definition: default_rename.c:44
void(* rtems_filesystem_fsunmount_me_t)(rtems_filesystem_mount_table_entry_t *mt_entry)
Destroys a file system instance.
Definition: libio.h:329
int rtems_filesystem_default_mknod(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
Definition: default_mknod.c:44
int rtems_filesystem_default_fchmod(const rtems_filesystem_location_info_t *loc, mode_t mode)
Definition: default_fchmod.c:42
void(* rtems_filesystem_eval_path_t)(rtems_filesystem_eval_path_context_t *ctx)
Path evaluation.
Definition: libio.h:175
int(* rtems_filesystem_unmount_t)(rtems_filesystem_mount_table_entry_t *mt_entry)
Unmounts a file system instance in a mount point (directory).
Definition: libio.h:314
int rtems_filesystem_default_clonenode(rtems_filesystem_location_info_t *loc)
Definition: default_clone.c:42
void rtems_filesystem_default_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Releases the IO library mutex.
Definition: default_lock_and_unlock.c:49
bool rtems_filesystem_default_are_nodes_equal(const rtems_filesystem_location_info_t *a, const rtems_filesystem_location_info_t *b)
Tests if the node access pointer of one location is equal to the node access pointer of the other loc...
Definition: default_are_nodes_equal.c:42
int(* rtems_filesystem_rmnod_t)(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
Removes a node.
Definition: libio.h:387
int rtems_filesystem_default_rmnod(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
Definition: default_rmnod.c:44
int(* rtems_filesystem_rename_t)(const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)
Renames a node.
Definition: libio.h:461
int rtems_filesystem_default_mount(rtems_filesystem_mount_table_entry_t *mt_entry)
Definition: default_mount.c:41
int(* rtems_filesystem_clonenode_t)(rtems_filesystem_location_info_t *loc)
Clones a location.
Definition: libio.h:248
void rtems_filesystem_default_freenode(const rtems_filesystem_location_info_t *loc)
Definition: default_freenode.c:43
ssize_t(* rtems_filesystem_readlink_t)(const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
Reads the contents of a symbolic link.
Definition: libio.h:441
void rtems_filesystem_default_fsunmount(rtems_filesystem_mount_table_entry_t *mt_entry)
Definition: default_fsunmount.c:39
int(* rtems_filesystem_mknod_t)(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
Creates a new node.
Definition: libio.h:368
bool(* rtems_filesystem_are_nodes_equal_t)(const rtems_filesystem_location_info_t *a, const rtems_filesystem_location_info_t *b)
Tests if the node of one location is equal to the node of the other location.
Definition: libio.h:347
void(* rtems_filesystem_mt_entry_unlock_t)(const rtems_filesystem_mount_table_entry_t *mt_entry)
Unlocks a file system instance.
Definition: libio.h:95
void rtems_filesystem_default_eval_path(rtems_filesystem_eval_path_context_t *ctx)
Terminates the path evaluation and replaces the current location with the null location.
Definition: default_eval_path.c:42
int rtems_filesystem_default_symlink(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
Definition: default_symlink.c:44
int rtems_filesystem_default_statvfs(const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
Definition: default_statvfs.c:42
int(* rtems_filesystem_utimens_t)(const rtems_filesystem_location_info_t *loc, struct timespec times[2])
Set node access and modification times.
Definition: libio.h:403
int(* rtems_filesystem_fsmount_me_t)(rtems_filesystem_mount_table_entry_t *mt_entry, const void *data)
Initializes a file system instance.
Definition: libio.h:295
int(* rtems_filesystem_chown_t)(const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
Changes owner and group of a node.
Definition: libio.h:227
const rtems_filesystem_operations_table rtems_filesystem_operations_default
File system operations table with default operations.
Definition: default_ops.c:38
void(* rtems_filesystem_freenode_t)(const rtems_filesystem_location_info_t *loc)
Frees the location of a node.
Definition: libio.h:259
void(* rtems_filesystem_mt_entry_lock_t)(const rtems_filesystem_mount_table_entry_t *mt_entry)
Locks a file system instance.
Definition: libio.h:84
int rtems_filesystem_default_chown(const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
Definition: default_chown.c:42
ssize_t rtems_filesystem_default_readlink(const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
Definition: default_readlink.c:44
int(* rtems_filesystem_symlink_t)(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
Makes a symbolic link to a node.
Definition: libio.h:422
int rtems_filesystem_default_link(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
Definition: default_link.c:42
int rtems_filesystem_default_utimens(const rtems_filesystem_location_info_t *loc, struct timespec times[2])
Definition: default_utimens.c:43
struct rtems_libio_open_close_args rtems_libio_open_close_args_t
Parameter block for open/close.
rtems_filesystem_fsmount_me_t rtems_filesystem_get_mount_handler(const char *type)
Gets the mount handler for the file system type.
Definition: mount-mgr.c:109
int rtems_mkdir(const char *path, mode_t mode)
Creates a directory and all its parent directories according to path.
Definition: rtems_mkdir.c:130
void rtems_filesystem_initialize(void)
Base File System Initialization.
Definition: base_fs.c:51
const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf
Default pathconf settings.
Definition: mount.c:49
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition: io.h:103
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition: io.h:115
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
rtems_termios_iproc_status_code rtems_termios_default_isig_handler(unsigned char c, struct rtems_termios_tty *tty)
Default handler for ISIG (VINTR/VKILL)
Definition: termios.c:1312
rtems_termios_iproc_status_code(* rtems_termios_isig_handler)(unsigned char c, struct rtems_termios_tty *tty)
Type for ISIG (VINTR/VKILL) handler.
Definition: libio.h:1973
rtems_termios_iproc_status_code
The status code returned by all Termios input processing (iproc) functions and input signal (isig) ha...
Definition: libio.h:1928
rtems_status_code rtems_termios_register_isig_handler(rtems_termios_isig_handler handler)
Register handler for ISIG (VINTR/VKILL)
Definition: termios.c:1324
rtems_termios_iproc_status_code rtems_termios_posix_isig_handler(unsigned char c, struct rtems_termios_tty *tty)
POSIX handler for ISIG (VINTR/VKILL)
Definition: termios_posix_isig_handler.c:23
@ RTEMS_TERMIOS_IPROC_DONE
This status indicates that the input processing is done.
Definition: libio.h:1954
@ RTEMS_TERMIOS_IPROC_CONTINUE
This status indicates that the input processing can continue.
Definition: libio.h:1935
@ RTEMS_TERMIOS_IPROC_INTERRUPT
This status indicates that the input processing should stop due to a signal.
Definition: libio.h:1947
rtems_termios_device_handler handler
The device handler.
Definition: termiostypes.h:166
Basic Filesystem Types.
This header file provides the interfaces of the Atomic Operations.
This header file defines the RTEMS Classic API.
This header file provides the statvfs() and fstatvfs() interfaces.
This structure represents a chain node.
Definition: chain.h:78
Definition: xnandpsu_onfi.h:181
File system node operations table.
Definition: libio.h:1020
File system operations table.
Definition: libio.h:488
Definition: iterateoverthreads.c:44
Path evaluation context.
Definition: libio.h:102
int recursionlevel
Definition: libio.h:144
rtems_filesystem_location_info_t currentloc
Definition: libio.h:153
const char * path
Definition: libio.h:106
size_t pathlen
Definition: libio.h:111
rtems_filesystem_global_location_t * rootloc
Definition: libio.h:159
size_t tokenlen
Definition: libio.h:123
const char * token
Definition: libio.h:117
int flags
Definition: libio.h:137
rtems_filesystem_global_location_t * startloc
Definition: libio.h:165
Global file system location.
Definition: fs.h:100
Contain file system specific information which is required to support fpathconf().
Definition: libio.h:1306
File system location.
Definition: fs.h:72
Definition: libio.h:1873
Mount table entry.
Definition: libio.h:1621
rtems_id unmount_task
Definition: libio.h:1659
File system table entry.
Definition: libio.h:1674
Parameter block for ioctl.
Definition: libio.h:1372
Parameter block for open/close.
Definition: libio.h:1363
Paramameter block for read/write.
Definition: libio.h:1351
An open file data structure.
Definition: libio.h:1337
Definition: libio.h:1897
Definition: termiostypes.h:94
Definition: statvfs.h:56
This union represents a chain control block.
Definition: chain.h:96
Definition: libio.h:1507