RTEMS 6.1-rc5
Loading...
Searching...
No Matches
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#include <rtems/termiosdevice.h>
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65struct knote;
66
87);
88
98);
99
103typedef struct {
107 const char *path;
108
112 size_t pathlen;
113
118 const char *token;
119
124 size_t tokenlen;
125
138 int flags;
139
146
155
161
168
178);
179
194 const rtems_filesystem_location_info_t *parentloc,
195 const rtems_filesystem_location_info_t *targetloc,
196 const char *name,
197 size_t namelen
198);
199
213 mode_t mode
214);
215
230 uid_t owner,
231 gid_t group
232);
233
251);
252
262);
263
282);
283
298 const void *data
299);
300
317);
318
332);
333
351);
352
370 const rtems_filesystem_location_info_t *parentloc,
371 const char *name,
372 size_t namelen,
373 mode_t mode,
374 dev_t dev
375);
376
389 const rtems_filesystem_location_info_t *parentloc,
391);
392
406 struct timespec times[2]
407);
408
424 const rtems_filesystem_location_info_t *parentloc,
425 const char *name,
426 size_t namelen,
427 const char *target
428);
429
444 char *buf,
445 size_t bufsize
446);
447
463 const rtems_filesystem_location_info_t *oldparentloc,
465 const rtems_filesystem_location_info_t *newparentloc,
466 const char *name,
467 size_t namelen
468);
469
483 struct statvfs *buf
484);
485
494 rtems_filesystem_are_nodes_equal_t are_nodes_equal_h;
503 rtems_filesystem_fsunmount_me_t fsunmount_me_h;
509};
510
516
524);
525
533);
534
543);
544
551 const rtems_filesystem_location_info_t *parentloc,
552 const rtems_filesystem_location_info_t *targetloc,
553 const char *name,
554 size_t namelen
555);
556
572);
573
580 const rtems_filesystem_location_info_t *parentloc,
581 const char *name,
582 size_t namelen,
583 mode_t mode,
584 dev_t dev
585);
586
593 const rtems_filesystem_location_info_t *parentloc,
595);
596
604 mode_t mode
605);
606
614 uid_t owner,
615 gid_t group
616);
617
625);
626
632);
633
640 rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
641);
642
649 rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
650);
651
658 rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
659);
660
668 struct timespec times[2]
669);
670
677 const rtems_filesystem_location_info_t *parentloc,
678 const char *name,
679 size_t namelen,
680 const char *target
681);
682
690 char *buf,
691 size_t bufsize
692);
693
700 const rtems_filesystem_location_info_t *oldparentloc,
702 const rtems_filesystem_location_info_t *newparentloc,
703 const char *name,
704 size_t namelen
705);
706
714 struct statvfs *buf
715);
716
742 rtems_libio_t *iop,
743 const char *path,
744 int oflag,
745 mode_t mode
746);
747
759 rtems_libio_t *iop
760);
761
776typedef ssize_t (*rtems_filesystem_read_t)(
777 rtems_libio_t *iop,
778 void *buffer,
779 size_t count
780);
781
798typedef ssize_t (*rtems_filesystem_readv_t)(
799 rtems_libio_t *iop,
800 const struct iovec *iov,
801 int iovcnt,
802 ssize_t total
803);
804
819typedef ssize_t (*rtems_filesystem_write_t)(
820 rtems_libio_t *iop,
821 const void *buffer,
822 size_t count
823);
824
841typedef ssize_t (*rtems_filesystem_writev_t)(
842 rtems_libio_t *iop,
843 const struct iovec *iov,
844 int iovcnt,
845 ssize_t total
846);
847
861 rtems_libio_t *iop,
862 ioctl_command_t request,
863 void *buffer
864);
865
881 rtems_libio_t *iop,
882 off_t offset,
883 int whence
884);
885
899 struct stat *buf
900);
901
915 rtems_libio_t *iop,
916 off_t length
917);
918
931 rtems_libio_t *iop
932);
933
946 rtems_libio_t *iop
947);
948
961 rtems_libio_t *iop,
962 int cmd
963);
964
976 rtems_libio_t *iop,
977 int events
978);
979
992 rtems_libio_t *iop,
993 struct knote *kn
994);
995
1011 rtems_libio_t *iop,
1012 void **addr,
1013 size_t len,
1014 int prot,
1015 off_t off
1016);
1017
1029 rtems_filesystem_ftruncate_t ftruncate_h;
1031 rtems_filesystem_fdatasync_t fdatasync_h;
1034 rtems_filesystem_kqfilter_t kqfilter_h;
1038};
1039
1045
1052 rtems_libio_t *iop,
1053 const char *path,
1054 int oflag,
1055 mode_t mode
1056);
1057
1064 rtems_libio_t *iop
1065);
1066
1073 rtems_libio_t *iop,
1074 void *buffer,
1075 size_t count
1076);
1077
1084 rtems_libio_t *iop,
1085 const struct iovec *iov,
1086 int iovcnt,
1087 ssize_t total
1088);
1089
1096 rtems_libio_t *iop,
1097 const void *buffer,
1098 size_t count
1099);
1100
1107 rtems_libio_t *iop,
1108 const struct iovec *iov,
1109 int iovcnt,
1110 ssize_t total
1111);
1112
1119 rtems_libio_t *iop,
1120 ioctl_command_t request,
1121 void *buffer
1122);
1123
1130 rtems_libio_t *iop,
1131 off_t offset,
1132 int whence
1133);
1134
1147 rtems_libio_t *iop,
1148 off_t offset,
1149 int whence
1150);
1151
1170 rtems_libio_t *iop,
1171 off_t offset,
1172 int whence
1173);
1174
1184 struct stat *buf
1185);
1186
1193 rtems_libio_t *iop,
1194 off_t length
1195);
1196
1203 rtems_libio_t *iop,
1204 off_t length
1205);
1206
1213 rtems_libio_t *iop
1214);
1215
1222 rtems_libio_t *iop
1223);
1224
1231 rtems_libio_t *iop,
1232 int cmd
1233);
1234
1243 rtems_libio_t *iop,
1244 int events
1245);
1246
1255 rtems_libio_t *iop,
1256 struct knote *kn
1257);
1258
1267 rtems_libio_t *iop,
1268 void **addr,
1269 size_t len,
1270 int prot,
1271 off_t off
1272);
1273
1290typedef off_t rtems_off64_t __attribute__((deprecated));
1291
1300 const char *type
1301);
1302
1307typedef struct {
1308 int link_max; /* count */
1309 int max_canon; /* max formatted input line size */
1310 int max_input; /* max input line size */
1311 int name_max; /* max name length */
1312 int path_max; /* max path */
1313 int pipe_buf; /* pipe buffer size */
1314 int posix_async_io; /* async IO supported on fs, 0=no, 1=yes */
1315 int posix_chown_restrictions; /* can chown: 0=no, 1=yes */
1316 int posix_no_trunc; /* error on names > max name, 0=no, 1=yes */
1317 int posix_prio_io; /* priority IO, 0=no, 1=yes */
1318 int posix_sync_io; /* file can be sync'ed, 0=no, 1=yes */
1319 int posix_vdisable; /* special char processing, 0=no, 1=yes */
1321
1329
1339 Atomic_Uint flags;
1340 off_t offset; /* current offset into file */
1342 uint32_t data0; /* private to "driver" */
1343 void *data1; /* ... */
1344};
1345
1352typedef struct {
1353 rtems_libio_t *iop;
1354 off_t offset;
1355 char *buffer;
1356 uint32_t count;
1357 uint32_t flags;
1358 uint32_t bytes_moved;
1360
1365 rtems_libio_t *iop;
1366 uint32_t flags;
1367 uint32_t mode;
1369
1373typedef struct {
1374 rtems_libio_t *iop;
1375 ioctl_command_t command;
1376 void *buffer;
1377 int ioctl_return;
1379
1385#define LIBIO_FLAGS_NO_DELAY 0x0001U /* return immediately if no data */
1386#define LIBIO_FLAGS_READ 0x0002U /* reading */
1387#define LIBIO_FLAGS_WRITE 0x0004U /* writing */
1388#define LIBIO_FLAGS_OPEN 0x0100U /* device is open */
1389#define LIBIO_FLAGS_APPEND 0x0200U /* all writes append */
1390#define LIBIO_FLAGS_CLOSE_ON_EXEC 0x0800U /* close on process exec() */
1391#define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
1392#define LIBIO_FLAGS_REFERENCE_INC 0x1000U
1393
1396static inline unsigned int rtems_libio_iop_flags( const rtems_libio_t *iop )
1397{
1398 return _Atomic_Load_uint( &iop->flags, ATOMIC_ORDER_RELAXED );
1399}
1400
1406static inline bool rtems_libio_iop_is_no_delay( const rtems_libio_t *iop )
1407{
1408 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_NO_DELAY ) != 0;
1409}
1410
1416static inline bool rtems_libio_iop_is_readable( const rtems_libio_t *iop )
1417{
1418 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_READ ) != 0;
1419}
1420
1426static inline bool rtems_libio_iop_is_writeable( const rtems_libio_t *iop )
1427{
1428 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_WRITE ) != 0;
1429}
1430
1436static inline bool rtems_libio_iop_is_append( const rtems_libio_t *iop )
1437{
1438 return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_APPEND ) != 0;
1439}
1440
1446typedef int (*rtems_libio_open_t)(
1447 const char *pathname,
1448 uint32_t flag,
1449 uint32_t mode
1450);
1451
1452typedef int (*rtems_libio_close_t)(
1453 int fd
1454);
1455
1456typedef ssize_t (*rtems_libio_read_t)(
1457 int fd,
1458 void *buffer,
1459 size_t count
1460);
1461
1462typedef ssize_t (*rtems_libio_write_t)(
1463 int fd,
1464 const void *buffer,
1465 size_t count
1466);
1467
1468typedef int (*rtems_libio_ioctl_t)(
1469 int fd,
1470 uint32_t command,
1471 void *buffer
1472);
1473
1474typedef off_t (*rtems_libio_lseek_t)(
1475 int fd,
1476 off_t offset,
1477 int whence
1478);
1479
1487/*
1488 * The following macros are used to build up the permissions sets
1489 * used to check permissions. These are similar in style to the
1490 * mode_t bits and should stay compatible with them.
1491 */
1492#define RTEMS_FS_PERMS_READ 0x4
1493#define RTEMS_FS_PERMS_WRITE 0x2
1494#define RTEMS_FS_PERMS_EXEC 0x1
1495#define RTEMS_FS_PERMS_RWX \
1496 (RTEMS_FS_PERMS_READ | RTEMS_FS_PERMS_WRITE | RTEMS_FS_PERMS_EXEC)
1497#define RTEMS_FS_FOLLOW_HARD_LINK 0x8
1498#define RTEMS_FS_FOLLOW_SYM_LINK 0x10
1499#define RTEMS_FS_FOLLOW_LINK \
1500 (RTEMS_FS_FOLLOW_HARD_LINK | RTEMS_FS_FOLLOW_SYM_LINK)
1501#define RTEMS_FS_MAKE 0x20
1502#define RTEMS_FS_EXCLUSIVE 0x40
1503#define RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS 0x80
1504#define RTEMS_FS_REJECT_TERMINAL_DOT 0x100
1505
1509 dev_t device;
1510 struct {
1513 } __overlay;
1514};
1515
1516static inline dev_t rtems_filesystem_make_dev_t(
1519)
1520{
1521 union __rtems_dev_t temp;
1522
1523 temp.__overlay.major = _major;
1524 temp.__overlay.minor = _minor;
1525 return temp.device;
1526}
1527
1528static inline dev_t rtems_filesystem_make_dev_t_from_pointer(
1529 const void *pointer
1530)
1531{
1532 uint64_t temp = (((uint64_t) 1) << 63) | (((uintptr_t) pointer) >> 1);
1533
1534 return rtems_filesystem_make_dev_t((uint32_t) (temp >> 32), (uint32_t) temp);
1535}
1536
1537static inline rtems_device_major_number rtems_filesystem_dev_major_t(
1538 dev_t device
1539)
1540{
1541 union __rtems_dev_t temp;
1542
1543 temp.device = device;
1544 return temp.__overlay.major;
1545}
1546
1547
1548static inline rtems_device_minor_number rtems_filesystem_dev_minor_t(
1549 dev_t device
1550)
1551{
1552 union __rtems_dev_t temp;
1553
1554 temp.device = device;
1555 return temp.__overlay.minor;
1556}
1557
1558#define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
1559 do { \
1560 (_major) = rtems_filesystem_dev_major_t ( _dev ); \
1561 (_minor) = rtems_filesystem_dev_minor_t( _dev ); \
1562 } while(0)
1563
1564/*
1565 * Prototypes for filesystem
1566 */
1567
1576void rtems_filesystem_initialize( void );
1577
1578void rtems_libio_post_driver(void);
1579
1580void rtems_libio_exit(void);
1581
1591extern int rtems_mkdir(const char *path, mode_t mode);
1592
1609#define RTEMS_FILESYSTEM_TYPE_IMFS "imfs"
1610#define RTEMS_FILESYSTEM_TYPE_FTPFS "ftpfs"
1611#define RTEMS_FILESYSTEM_TYPE_TFTPFS "tftpfs"
1612#define RTEMS_FILESYSTEM_TYPE_NFS "nfs"
1613#define RTEMS_FILESYSTEM_TYPE_DOSFS "dosfs"
1614#define RTEMS_FILESYSTEM_TYPE_RFS "rfs"
1615#define RTEMS_FILESYSTEM_TYPE_JFFS2 "jffs2"
1616
1623 rtems_chain_node mt_node;
1624 void *fs_info;
1626 const void *immutable_fs_info;
1627 rtems_chain_control location_chain;
1630 bool mounted;
1631 bool writeable;
1632 bool no_regular_file_mknod;
1633 const rtems_filesystem_limits_and_options_t *pathconf_limits_and_options;
1634
1635 /*
1636 * The target or mount point of the file system.
1637 */
1638 const char *target;
1639
1640 /*
1641 * The type of filesystem or the name of the filesystem.
1642 */
1643 const char *type;
1644
1645 /*
1646 * When someone adds a mounted filesystem on a real device,
1647 * this will need to be used.
1648 *
1649 * The lower layers can manage how this is managed. Leave as a
1650 * string.
1651 */
1652 char *dev;
1653
1661};
1662
1666typedef enum {
1667 RTEMS_FILESYSTEM_READ_ONLY,
1668 RTEMS_FILESYSTEM_READ_WRITE,
1669 RTEMS_FILESYSTEM_BAD_OPTIONS
1671
1676 const char *type;
1679
1686
1687extern rtems_chain_control rtems_filesystem_mount_table;
1688
1698 const char *type,
1700);
1701
1709 const char *type
1710);
1711
1734int unmount(
1735 const char *mount_path
1736);
1737
1785int mount(
1786 const char *source,
1787 const char *target,
1788 const char *filesystemtype,
1790 const void *data
1791);
1792
1805 const char *source,
1806 const char *target,
1807 const char *filesystemtype,
1809 const void *data
1810);
1811
1821 const rtems_filesystem_table_t *fs_entry,
1822 void *arg
1823);
1824
1840 void *routine_arg
1841);
1842
1853 void *arg
1854);
1855
1871 void *visitor_arg
1872);
1873
1874typedef struct {
1875 const char *source;
1876 const char *target;
1877 const char *filesystemtype;
1879 const void *data;
1881
1883 rtems_filesystem_root_configuration;
1884
1896struct rtems_termios_tty;
1897
1899 int (*firstOpen)(int major, int minor, void *arg);
1900 int (*lastClose)(int major, int minor, void *arg);
1901 int (*pollRead)(int minor);
1902 ssize_t (*write)(int minor, const char *buf, size_t len);
1903 int (*setAttributes)(int minor, const struct termios *t);
1904 int (*stopRemoteTx)(int minor);
1905 int (*startRemoteTx)(int minor);
1906 rtems_termios_device_mode outputUsesInterrupts;
1908
1909static inline void rtems_termios_initialize( void )
1910{
1911 /* Nothing to do, provided for backward compatibility */
1912}
1913
1914/*
1915 * CCJ: Change before opening a tty. Newer code from Eric is coming
1916 * so extra work to handle an open tty is not worth it. If the tty
1917 * is open, close then open it again.
1918 */
1919rtems_status_code rtems_termios_bufsize (
1920 size_t cbufsize, /* cooked buffer size */
1921 size_t raw_input, /* raw input buffer size */
1922 size_t raw_output /* raw output buffer size */
1923);
1924
1929typedef enum {
1937
1949
1957
1975 unsigned char c,
1976 struct rtems_termios_tty *tty
1977);
1978
1998 unsigned char c,
1999 struct rtems_termios_tty *tty
2000);
2001
2016 unsigned char c,
2017 struct rtems_termios_tty *tty
2018);
2019
2034);
2035
2036int rtems_termios_enqueue_raw_characters(
2037 void *ttyp,
2038 const char *buf,
2039 int len
2040);
2041
2042rtems_status_code rtems_termios_open (
2045 void *arg,
2046 const rtems_termios_callbacks *callbacks
2047);
2048
2049rtems_status_code rtems_termios_close(
2050 void *arg
2051);
2052
2053rtems_status_code rtems_termios_read(
2054 void *arg
2055);
2056
2057rtems_status_code rtems_termios_write(
2058 void *arg
2059);
2060
2061rtems_status_code rtems_termios_ioctl(
2062 void *arg
2063);
2064
2065int rtems_termios_dequeue_characters(
2066 void *ttyp,
2067 int len
2068);
2069
2075#define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
2076
2080#define rtems_filesystem_type(_mte) ((_mte)->type)
2081
2085#define rtems_filesystem_mount_point(_mte) ((_mte)->target)
2086
2090#define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
2091
2092#ifdef __cplusplus
2093}
2094#endif
2095
2096#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
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:1851
bool(* rtems_per_filesystem_routine)(const rtems_filesystem_table_t *fs_entry, void *arg)
Per file system type routine.
Definition: libio.h:1820
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:1666
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:860
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:975
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:776
int(* rtems_filesystem_fcntl_t)(rtems_libio_t *iop, int cmd)
File control.
Definition: libio.h:960
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:991
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:758
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:880
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:841
int(* rtems_filesystem_fstat_t)(const rtems_filesystem_location_info_t *loc, struct stat *buf)
Gets a node status.
Definition: libio.h:897
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:819
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:930
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:945
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:1010
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:798
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:914
int(* rtems_filesystem_open_t)(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
Opens a node.
Definition: libio.h:741
int(* rtems_filesystem_statvfs_t)(const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
Gets file system information.
Definition: libio.h:481
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:193
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:280
int(* rtems_filesystem_fchmod_t)(const rtems_filesystem_location_info_t *loc, mode_t mode)
Changes the mode of a node.
Definition: libio.h:211
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:330
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:176
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:315
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:388
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:462
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:249
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:442
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:369
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:348
void(* rtems_filesystem_mt_entry_unlock_t)(const rtems_filesystem_mount_table_entry_t *mt_entry)
Unlocks a file system instance.
Definition: libio.h:96
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:404
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:296
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:228
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:260
void(* rtems_filesystem_mt_entry_lock_t)(const rtems_filesystem_mount_table_entry_t *mt_entry)
Locks a file system instance.
Definition: libio.h:85
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:423
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:1974
rtems_termios_iproc_status_code
The status code returned by all Termios input processing (iproc) functions and input signal (isig) ha...
Definition: libio.h:1929
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:1955
@ RTEMS_TERMIOS_IPROC_CONTINUE
This status indicates that the input processing can continue.
Definition: libio.h:1936
@ RTEMS_TERMIOS_IPROC_INTERRUPT
This status indicates that the input processing should stop due to a signal.
Definition: libio.h:1948
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:185
File system node operations table.
Definition: libio.h:1021
File system operations table.
Definition: libio.h:489
Definition: iterateoverthreads.c:44
Path evaluation context.
Definition: libio.h:103
int recursionlevel
Definition: libio.h:145
rtems_filesystem_location_info_t currentloc
Definition: libio.h:154
const char * path
Definition: libio.h:107
size_t pathlen
Definition: libio.h:112
rtems_filesystem_global_location_t * rootloc
Definition: libio.h:160
size_t tokenlen
Definition: libio.h:124
const char * token
Definition: libio.h:118
int flags
Definition: libio.h:138
rtems_filesystem_global_location_t * startloc
Definition: libio.h:166
Global file system location.
Definition: fs.h:100
Contain file system specific information which is required to support fpathconf().
Definition: libio.h:1307
File system location.
Definition: fs.h:72
Definition: libio.h:1874
Mount table entry.
Definition: libio.h:1622
rtems_id unmount_task
Definition: libio.h:1660
File system table entry.
Definition: libio.h:1675
Parameter block for ioctl.
Definition: libio.h:1373
Parameter block for open/close.
Definition: libio.h:1364
Paramameter block for read/write.
Definition: libio.h:1352
An open file data structure.
Definition: libio.h:1338
Definition: libio.h:1898
Definition: termiostypes.h:94
Definition: statvfs.h:56
This header file provides the interfaces of the RTEMS Termios Device Support.
This union represents a chain control block.
Definition: chain.h:96
Definition: libio.h:1508