RTEMS CPU Kit with SuperCore  4.11.99.0
libio.h
Go to the documentation of this file.
1 
13 /*
14  * COPYRIGHT (c) 1989-2008.
15  * On-Line Applications Research Corporation (OAR).
16  *
17  * Modifications to support reference counting in the file system are
18  * Copyright (c) 2012 embedded brains GmbH.
19  *
20  * The license and distribution terms for this file may be
21  * found in the file LICENSE in this distribution or at
22  * http://www.rtems.org/license/LICENSE.
23  */
24 
25 #ifndef _RTEMS_RTEMS_LIBIO_H
26 #define _RTEMS_RTEMS_LIBIO_H
27 
28 #include <sys/types.h>
29 #include <sys/stat.h>
30 #include <sys/ioctl.h>
31 #include <sys/statvfs.h>
32 #include <sys/uio.h>
33 
34 #include <unistd.h>
35 #include <termios.h>
36 
37 #include <rtems.h>
38 #include <rtems/fs.h>
39 #include <rtems/chain.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 struct knote;
46 
67 );
68 
78 );
79 
83 typedef struct {
87  const char *path;
88 
92  size_t pathlen;
93 
98  const char *token;
99 
104  size_t tokenlen;
105 
118  int flags;
119 
126 
135 
141 
148 
158 );
159 
173 typedef int (*rtems_filesystem_link_t)(
174  const rtems_filesystem_location_info_t *parentloc,
175  const rtems_filesystem_location_info_t *targetloc,
176  const char *name,
177  size_t namelen
178 );
179 
193  mode_t mode
194 );
195 
210  uid_t owner,
211  gid_t group
212 );
213 
231 );
232 
242 );
243 
260 typedef int (*rtems_filesystem_mount_t) (
262 );
263 
278  const void *data
279 );
280 
297 );
298 
312 );
313 
331 );
332 
350  const rtems_filesystem_location_info_t *parentloc,
351  const char *name,
352  size_t namelen,
353  mode_t mode,
354  dev_t dev
355 );
356 
369  const rtems_filesystem_location_info_t *parentloc,
371 );
372 
387  time_t actime,
388  time_t modtime
389 );
390 
406  const rtems_filesystem_location_info_t *parentloc,
407  const char *name,
408  size_t namelen,
409  const char *target
410 );
411 
424 typedef ssize_t (*rtems_filesystem_readlink_t)(
426  char *buf,
427  size_t bufsize
428 );
429 
445  const rtems_filesystem_location_info_t *oldparentloc,
446  const rtems_filesystem_location_info_t *oldloc,
447  const rtems_filesystem_location_info_t *newparentloc,
448  const char *name,
449  size_t namelen
450 );
451 
465  struct statvfs *buf
466 );
467 
474  rtems_filesystem_eval_path_t eval_path_h;
476  rtems_filesystem_are_nodes_equal_t are_nodes_equal_h;
477  rtems_filesystem_mknod_t mknod_h;
478  rtems_filesystem_rmnod_t rmnod_h;
479  rtems_filesystem_fchmod_t fchmod_h;
480  rtems_filesystem_chown_t chown_h;
481  rtems_filesystem_clonenode_t clonenod_h;
482  rtems_filesystem_freenode_t freenod_h;
483  rtems_filesystem_mount_t mount_h;
484  rtems_filesystem_unmount_t unmount_h;
485  rtems_filesystem_fsunmount_me_t fsunmount_me_h;
486  rtems_filesystem_utime_t utime_h;
487  rtems_filesystem_symlink_t symlink_h;
488  rtems_filesystem_readlink_t readlink_h;
489  rtems_filesystem_rename_t rename_h;
490  rtems_filesystem_statvfs_t statvfs_h;
491 };
492 
498 
506 );
507 
515 );
516 
525 );
526 
533  const rtems_filesystem_location_info_t *parentloc,
534  const rtems_filesystem_location_info_t *targetloc,
535  const char *name,
536  size_t namelen
537 );
538 
554 );
555 
562  const rtems_filesystem_location_info_t *parentloc,
563  const char *name,
564  size_t namelen,
565  mode_t mode,
566  dev_t dev
567 );
568 
575  const rtems_filesystem_location_info_t *parentloc,
577 );
578 
586  mode_t mode
587 );
588 
596  uid_t owner,
597  gid_t group
598 );
599 
607 );
608 
614 );
615 
622  rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
623 );
624 
631  rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
632 );
633 
640  rtems_filesystem_mount_table_entry_t *mt_entry /* IN */
641 );
642 
650  time_t actime,
651  time_t modtime
652 );
653 
660  const rtems_filesystem_location_info_t *parentloc,
661  const char *name,
662  size_t namelen,
663  const char *target
664 );
665 
673  char *buf,
674  size_t bufsize
675 );
676 
683  const rtems_filesystem_location_info_t *oldparentloc,
684  const rtems_filesystem_location_info_t *oldloc,
685  const rtems_filesystem_location_info_t *newparentloc,
686  const char *name,
687  size_t namelen
688 );
689 
697  struct statvfs *buf
698 );
699 
724 typedef int (*rtems_filesystem_open_t)(
725  rtems_libio_t *iop,
726  const char *path,
727  int oflag,
728  mode_t mode
729 );
730 
742  rtems_libio_t *iop
743 );
744 
759 typedef ssize_t (*rtems_filesystem_read_t)(
760  rtems_libio_t *iop,
761  void *buffer,
762  size_t count
763 );
764 
781 typedef ssize_t (*rtems_filesystem_readv_t)(
782  rtems_libio_t *iop,
783  const struct iovec *iov,
784  int iovcnt,
785  ssize_t total
786 );
787 
802 typedef ssize_t (*rtems_filesystem_write_t)(
803  rtems_libio_t *iop,
804  const void *buffer,
805  size_t count
806 );
807 
824 typedef ssize_t (*rtems_filesystem_writev_t)(
825  rtems_libio_t *iop,
826  const struct iovec *iov,
827  int iovcnt,
828  ssize_t total
829 );
830 
844  rtems_libio_t *iop,
845  ioctl_command_t request,
846  void *buffer
847 );
848 
863 typedef off_t (*rtems_filesystem_lseek_t)(
864  rtems_libio_t *iop,
865  off_t offset,
866  int whence
867 );
868 
882  struct stat *buf
883 );
884 
898  rtems_libio_t *iop,
899  off_t length
900 );
901 
914  rtems_libio_t *iop
915 );
916 
929  rtems_libio_t *iop
930 );
931 
944  rtems_libio_t *iop,
945  int cmd
946 );
947 
958 typedef int (*rtems_filesystem_poll_t)(
959  rtems_libio_t *iop,
960  int events
961 );
962 
975  rtems_libio_t *iop,
976  struct knote *kn
977 );
978 
984  rtems_filesystem_close_t close_h;
986  rtems_filesystem_write_t write_h;
987  rtems_filesystem_ioctl_t ioctl_h;
988  rtems_filesystem_lseek_t lseek_h;
989  rtems_filesystem_fstat_t fstat_h;
990  rtems_filesystem_ftruncate_t ftruncate_h;
991  rtems_filesystem_fsync_t fsync_h;
992  rtems_filesystem_fdatasync_t fdatasync_h;
993  rtems_filesystem_fcntl_t fcntl_h;
995  rtems_filesystem_kqfilter_t kqfilter_h;
996  rtems_filesystem_readv_t readv_h;
997  rtems_filesystem_writev_t writev_h;
998 };
999 
1005 
1012  rtems_libio_t *iop,
1013  const char *path,
1014  int oflag,
1015  mode_t mode
1016 );
1017 
1024  rtems_libio_t *iop
1025 );
1026 
1033  rtems_libio_t *iop,
1034  void *buffer,
1035  size_t count
1036 );
1037 
1044  rtems_libio_t *iop,
1045  const struct iovec *iov,
1046  int iovcnt,
1047  ssize_t total
1048 );
1049 
1056  rtems_libio_t *iop,
1057  const void *buffer,
1058  size_t count
1059 );
1060 
1067  rtems_libio_t *iop,
1068  const struct iovec *iov,
1069  int iovcnt,
1070  ssize_t total
1071 );
1072 
1079  rtems_libio_t *iop,
1080  ioctl_command_t request,
1081  void *buffer
1082 );
1083 
1090  rtems_libio_t *iop,
1091  off_t offset,
1092  int whence
1093 );
1094 
1107  rtems_libio_t *iop,
1108  off_t offset,
1109  int whence
1110 );
1111 
1130  rtems_libio_t *iop,
1131  off_t offset,
1132  int whence
1133 );
1134 
1144  struct stat *buf
1145 );
1146 
1153  rtems_libio_t *iop,
1154  off_t length
1155 );
1156 
1163  rtems_libio_t *iop,
1164  off_t length
1165 );
1166 
1173  rtems_libio_t *iop
1174 );
1175 
1182  rtems_libio_t *iop
1183 );
1184 
1191  rtems_libio_t *iop,
1192  int cmd
1193 );
1194 
1203  rtems_libio_t *iop,
1204  int events
1205 );
1206 
1215  rtems_libio_t *iop,
1216  struct knote *kn
1217 );
1218 
1233 typedef off_t rtems_off64_t __attribute__((deprecated));
1234 
1243  const char *type
1244 );
1245 
1250 typedef struct {
1251  int link_max; /* count */
1252  int max_canon; /* max formatted input line size */
1253  int max_input; /* max input line size */
1254  int name_max; /* max name length */
1255  int path_max; /* max path */
1256  int pipe_buf; /* pipe buffer size */
1257  int posix_async_io; /* async IO supported on fs, 0=no, 1=yes */
1258  int posix_chown_restrictions; /* can chown: 0=no, 1=yes */
1259  int posix_no_trunc; /* error on names > max name, 0=no, 1=yes */
1260  int posix_prio_io; /* priority IO, 0=no, 1=yes */
1261  int posix_sync_io; /* file can be sync'ed, 0=no, 1=yes */
1262  int posix_vdisable; /* special char processing, 0=no, 1=yes */
1264 
1272 
1282  rtems_driver_name_t *driver;
1283  off_t offset; /* current offset into file */
1284  uint32_t flags;
1286  uint32_t data0; /* private to "driver" */
1287  void *data1; /* ... */
1288 };
1289 
1296 typedef struct {
1297  rtems_libio_t *iop;
1298  off_t offset;
1299  char *buffer;
1300  uint32_t count;
1301  uint32_t flags;
1302  uint32_t bytes_moved;
1304 
1308 typedef struct {
1309  rtems_libio_t *iop;
1310  uint32_t flags;
1311  uint32_t mode;
1313 
1317 typedef struct {
1318  rtems_libio_t *iop;
1319  ioctl_command_t command;
1320  void *buffer;
1321  int ioctl_return;
1323 
1329 #define LIBIO_FLAGS_NO_DELAY 0x0001U /* return immediately if no data */
1330 #define LIBIO_FLAGS_READ 0x0002U /* reading */
1331 #define LIBIO_FLAGS_WRITE 0x0004U /* writing */
1332 #define LIBIO_FLAGS_OPEN 0x0100U /* device is open */
1333 #define LIBIO_FLAGS_APPEND 0x0200U /* all writes append */
1334 #define LIBIO_FLAGS_CREATE 0x0400U /* create file */
1335 #define LIBIO_FLAGS_CLOSE_ON_EXEC 0x0800U /* close on process exec() */
1336 #define LIBIO_FLAGS_READ_WRITE (LIBIO_FLAGS_READ | LIBIO_FLAGS_WRITE)
1337 
1345 void rtems_libio_init(void);
1346 
1352 typedef int (*rtems_libio_open_t)(
1353  const char *pathname,
1354  uint32_t flag,
1355  uint32_t mode
1356 );
1357 
1358 typedef int (*rtems_libio_close_t)(
1359  int fd
1360 );
1361 
1362 typedef ssize_t (*rtems_libio_read_t)(
1363  int fd,
1364  void *buffer,
1365  size_t count
1366 );
1367 
1368 typedef ssize_t (*rtems_libio_write_t)(
1369  int fd,
1370  const void *buffer,
1371  size_t count
1372 );
1373 
1374 typedef int (*rtems_libio_ioctl_t)(
1375  int fd,
1376  uint32_t command,
1377  void *buffer
1378 );
1379 
1380 typedef off_t (*rtems_libio_lseek_t)(
1381  int fd,
1382  off_t offset,
1383  int whence
1384 );
1385 
1393 /*
1394  * The following macros are used to build up the permissions sets
1395  * used to check permissions. These are similar in style to the
1396  * mode_t bits and should stay compatible with them.
1397  */
1398 #define RTEMS_FS_PERMS_READ 0x4
1399 #define RTEMS_FS_PERMS_WRITE 0x2
1400 #define RTEMS_FS_PERMS_EXEC 0x1
1401 #define RTEMS_FS_PERMS_RWX \
1402  (RTEMS_FS_PERMS_READ | RTEMS_FS_PERMS_WRITE | RTEMS_FS_PERMS_EXEC)
1403 #define RTEMS_FS_FOLLOW_HARD_LINK 0x8
1404 #define RTEMS_FS_FOLLOW_SYM_LINK 0x10
1405 #define RTEMS_FS_FOLLOW_LINK \
1406  (RTEMS_FS_FOLLOW_HARD_LINK | RTEMS_FS_FOLLOW_SYM_LINK)
1407 #define RTEMS_FS_MAKE 0x20
1408 #define RTEMS_FS_EXCLUSIVE 0x40
1409 #define RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS 0x80
1410 #define RTEMS_FS_REJECT_TERMINAL_DOT 0x100
1411 
1415  dev_t device;
1416  struct {
1417  rtems_device_major_number major;
1418  rtems_device_minor_number minor;
1419  } __overlay;
1420 };
1421 
1422 static inline dev_t rtems_filesystem_make_dev_t(
1423  rtems_device_major_number _major,
1424  rtems_device_minor_number _minor
1425 )
1426 {
1427  union __rtems_dev_t temp;
1428 
1429  temp.__overlay.major = _major;
1430  temp.__overlay.minor = _minor;
1431  return temp.device;
1432 }
1433 
1434 static inline dev_t rtems_filesystem_make_dev_t_from_pointer(
1435  const void *pointer
1436 )
1437 {
1438  uint64_t temp = (((uint64_t) 1) << 63) | (((uintptr_t) pointer) >> 1);
1439 
1440  return rtems_filesystem_make_dev_t((uint32_t) (temp >> 32), (uint32_t) temp);
1441 }
1442 
1443 static inline rtems_device_major_number rtems_filesystem_dev_major_t(
1444  dev_t device
1445 )
1446 {
1447  union __rtems_dev_t temp;
1448 
1449  temp.device = device;
1450  return temp.__overlay.major;
1451 }
1452 
1453 
1454 static inline rtems_device_minor_number rtems_filesystem_dev_minor_t(
1455  dev_t device
1456 )
1457 {
1458  union __rtems_dev_t temp;
1459 
1460  temp.device = device;
1461  return temp.__overlay.minor;
1462 }
1463 
1464 #define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
1465  do { \
1466  (_major) = rtems_filesystem_dev_major_t ( _dev ); \
1467  (_minor) = rtems_filesystem_dev_minor_t( _dev ); \
1468  } while(0)
1469 
1470 /*
1471  * Prototypes for filesystem
1472  */
1473 
1482 void rtems_filesystem_initialize( void );
1483 
1484 typedef void (*rtems_libio_helper)(void);
1485 
1486 extern const rtems_libio_helper rtems_libio_init_helper;
1487 
1488 extern const rtems_libio_helper rtems_libio_post_driver_helper;
1489 
1490 extern const rtems_libio_helper rtems_libio_exit_helper;
1491 
1492 extern const rtems_libio_helper rtems_fs_init_helper;
1493 
1494 void rtems_libio_helper_null(void);
1495 
1496 void rtems_libio_post_driver(void);
1497 
1498 void rtems_libio_exit(void);
1499 
1509 extern int rtems_mkdir(const char *path, mode_t mode);
1510 
1527 #define RTEMS_FILESYSTEM_TYPE_IMFS "imfs"
1528 #define RTEMS_FILESYSTEM_TYPE_MINIIMFS "mimfs"
1529 #define RTEMS_FILESYSTEM_TYPE_DEVFS "devfs"
1530 #define RTEMS_FILESYSTEM_TYPE_FTPFS "ftpfs"
1531 #define RTEMS_FILESYSTEM_TYPE_TFTPFS "tftpfs"
1532 #define RTEMS_FILESYSTEM_TYPE_NFS "nfs"
1533 #define RTEMS_FILESYSTEM_TYPE_DOSFS "dosfs"
1534 #define RTEMS_FILESYSTEM_TYPE_RFS "rfs"
1535 #define RTEMS_FILESYSTEM_TYPE_JFFS2 "jffs2"
1536 
1543  rtems_chain_node mt_node;
1544  void *fs_info;
1546  const void *immutable_fs_info;
1547  rtems_chain_control location_chain;
1548  rtems_filesystem_global_location_t *mt_point_node;
1550  bool mounted;
1551  bool writeable;
1552  const rtems_filesystem_limits_and_options_t *pathconf_limits_and_options;
1553 
1554  /*
1555  * The target or mount point of the file system.
1556  */
1557  const char *target;
1558 
1559  /*
1560  * The type of filesystem or the name of the filesystem.
1561  */
1562  const char *type;
1563 
1564  /*
1565  * When someone adds a mounted filesystem on a real device,
1566  * this will need to be used.
1567  *
1568  * The lower layers can manage how this is managed. Leave as a
1569  * string.
1570  */
1571  char *dev;
1572 
1580 };
1581 
1585 typedef enum {
1586  RTEMS_FILESYSTEM_READ_ONLY,
1587  RTEMS_FILESYSTEM_READ_WRITE,
1588  RTEMS_FILESYSTEM_BAD_OPTIONS
1590 
1595  const char *type;
1598 
1605 
1606 extern rtems_chain_control rtems_filesystem_mount_table;
1607 
1617  const char *type,
1619 );
1620 
1628  const char *type
1629 );
1630 
1653 int unmount(
1654  const char *mount_path
1655 );
1656 
1708 int mount(
1709  const char *source,
1710  const char *target,
1711  const char *filesystemtype,
1713  const void *data
1714 );
1715 
1728  const char *source,
1729  const char *target,
1730  const char *filesystemtype,
1732  const void *data
1733 );
1734 
1744  const rtems_filesystem_table_t *fs_entry,
1745  void *arg
1746 );
1747 
1763  void *routine_arg
1764 );
1765 
1775  const rtems_filesystem_mount_table_entry_t *mt_entry,
1776  void *arg
1777 );
1778 
1794  void *visitor_arg
1795 );
1796 
1797 typedef struct {
1798  const char *source;
1799  const char *target;
1800  const char *filesystemtype;
1802  const void *data;
1804 
1806  rtems_filesystem_root_configuration;
1807 
1819 typedef struct rtems_termios_callbacks {
1820  int (*firstOpen)(int major, int minor, void *arg);
1821  int (*lastClose)(int major, int minor, void *arg);
1822  int (*pollRead)(int minor);
1823  ssize_t (*write)(int minor, const char *buf, size_t len);
1824  int (*setAttributes)(int minor, const struct termios *t);
1825  int (*stopRemoteTx)(int minor);
1826  int (*startRemoteTx)(int minor);
1827  int outputUsesInterrupts;
1829 
1830 void rtems_termios_initialize (void);
1831 
1832 /*
1833  * CCJ: Change before opening a tty. Newer code from Eric is coming
1834  * so extra work to handle an open tty is not worth it. If the tty
1835  * is open, close then open it again.
1836  */
1837 rtems_status_code rtems_termios_bufsize (
1838  size_t cbufsize, /* cooked buffer size */
1839  size_t raw_input, /* raw input buffer size */
1840  size_t raw_output /* raw output buffer size */
1841 );
1842 
1843 rtems_status_code rtems_termios_open (
1844  rtems_device_major_number major,
1845  rtems_device_minor_number minor,
1846  void *arg,
1847  const rtems_termios_callbacks *callbacks
1848 );
1849 
1850 rtems_status_code rtems_termios_close(
1851  void *arg
1852 );
1853 
1854 rtems_status_code rtems_termios_read(
1855  void *arg
1856 );
1857 
1858 rtems_status_code rtems_termios_write(
1859  void *arg
1860 );
1861 
1862 rtems_status_code rtems_termios_ioctl(
1863  void *arg
1864 );
1865 
1866 int rtems_termios_enqueue_raw_characters(
1867  void *ttyp,
1868  const char *buf,
1869  int len
1870 );
1871 
1872 int rtems_termios_dequeue_characters(
1873  void *ttyp,
1874  int len
1875 );
1876 
1882 #define rtems_filesystem_pathconf(_mte) ((_mte)->pathconf_limits_and_options)
1883 
1887 #define rtems_filesystem_type(_mte) ((_mte)->type)
1888 
1892 #define rtems_filesystem_mount_point(_mte) ((_mte)->target)
1893 
1897 #define rtems_filesystem_mount_device(_mte) ((_mte)->dev)
1898 
1899 #ifdef __cplusplus
1900 }
1901 #endif
1902 
1903 #endif /* _RTEMS_LIBIO_H */
Parameter block for open/close.
Definition: libio.h:1308
void rtems_filesystem_initialize(void)
Base File System Initialization.
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.
int rtems_filesystem_default_utime(const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)
This is used to manage each element (node) which is placed on a chain.
Definition: chain.h:65
Contain file system specific information which is required to support fpathconf().
Definition: libio.h:1250
Interface to the statvfs() Set of API Methods.
Definition: termios.h: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:368
bool rtems_filesystem_iterate(rtems_per_filesystem_routine routine, void *routine_arg)
Iterates over all file system types.
const char * token
The contents of the token to be evaluated with respect to the current location.
Definition: libio.h:98
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...
const rtems_filesystem_operations_table rtems_filesystem_operations_default
File system operations table with default operations.
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)
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:405
int(* rtems_filesystem_fstat_t)(const rtems_filesystem_location_info_t *loc, struct stat *buf)
Gets a node status.
Definition: libio.h:880
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:80
int(* rtems_filesystem_close_t)(rtems_libio_t *iop)
Closes a node.
Definition: libio.h:741
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.
const rtems_filesystem_table_t rtems_filesystem_table[]
Static table of file systems.
int rtems_filesystem_default_unmount(rtems_filesystem_mount_table_entry_t *mt_entry)
int rtems_filesystem_default_open(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
rtems_filesystem_global_location_t * rootloc
The location of the root directory of the user environment during the evaluation start.
Definition: libio.h:140
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:349
int flags
The path evaluation is controlled by the following flags.
Definition: libio.h:118
void(* rtems_filesystem_mt_entry_unlock_t)(const rtems_filesystem_mount_table_entry_t *mt_entry)
Unlocks a file system instance.
Definition: libio.h:76
void rtems_filesystem_default_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Releases the IO library mutex.
rtems_filesystem_options_t
File system options.
Definition: libio.h:1585
void(* rtems_filesystem_eval_path_t)(rtems_filesystem_eval_path_context_t *ctx)
Path evaluation.
Definition: libio.h:156
Definition: libio.h:1414
int(* rtems_filesystem_utime_t)(const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)
Set node access and modification times.
Definition: libio.h:385
Basic Filesystem Types.
This is used to manage a chain.
Definition: chain.h:83
File system table entry.
Definition: libio.h:1594
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.
ssize_t rtems_filesystem_default_readlink(const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
Parameter block for ioctl.
Definition: libio.h:1317
int(* rtems_filesystem_fchmod_t)(const rtems_filesystem_location_info_t *loc, mode_t mode)
Changes the mode of a node.
Definition: libio.h:191
Paramameter block for read/write.
Definition: libio.h:1296
int rtems_filesystem_default_fchmod(const rtems_filesystem_location_info_t *loc, mode_t mode)
int rtems_filesystem_default_fcntl(rtems_libio_t *iop, int cmd)
int(* rtems_filesystem_fcntl_t)(rtems_libio_t *iop, int cmd)
File control.
Definition: libio.h:943
int(* rtems_filesystem_poll_t)(rtems_libio_t *iop, int events)
Poll and select support.
Definition: libio.h:958
int rtems_filesystem_register(const char *type, rtems_filesystem_fsmount_me_t mount_h)
Registers a file system type.
Definition: io.h:238
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:824
struct rtems_filesystem_table_t rtems_filesystem_table_t
File system table entry.
size_t tokenlen
The length of the token to be evaluated with respect to the current location.
Definition: libio.h:104
int rtems_filesystem_default_kqfilter(rtems_libio_t *iop, struct knote *kn)
Default kernel event filter handler.
File system node operations table.
Definition: libio.h:982
void(* rtems_filesystem_fsunmount_me_t)(rtems_filesystem_mount_table_entry_t *mt_entry)
Destroys a file system instance.
Definition: libio.h:310
const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf
Default pathconf settings.
int rtems_filesystem_default_poll(rtems_libio_t *iop, int events)
Default poll handler.
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:276
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.
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:444
POSIX Termios Implementation for RTEMS Console Device Driver.
off_t(* rtems_filesystem_lseek_t)(rtems_libio_t *iop, off_t offset, int whence)
Moves the read/write file offset.
Definition: libio.h:863
Definition: libio.h:1819
ssize_t(* rtems_filesystem_write_t)(rtems_libio_t *iop, const void *buffer, size_t count)
Writes to a node.
Definition: libio.h:802
rtems_status_code
Classic API Status.
Definition: status.h:46
void(* rtems_filesystem_freenode_t)(const rtems_filesystem_location_info_t *loc)
Frees the location of a node.
Definition: libio.h:240
rtems_filesystem_location_info_t currentloc
This is the current file system location of the evaluation process.
Definition: libio.h:134
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:328
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.
bool(* rtems_per_filesystem_routine)(const rtems_filesystem_table_t *fs_entry, void *arg)
Per file system type routine.
Definition: libio.h:1743
void rtems_filesystem_default_freenode(const rtems_filesystem_location_info_t *loc)
int rtems_filesystem_default_symlink(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
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:260
int unmount(const char *mount_path)
Unmounts the file system instance at the specified mount path.
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:781
int rtems_filesystem_default_rmnod(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
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.
int rtems_filesystem_default_ftruncate(rtems_libio_t *iop, off_t length)
rtems_filesystem_global_location_t * startloc
The start location of the evaluation process.
Definition: libio.h:146
int rtems_filesystem_default_close(rtems_libio_t *iop)
rtems_filesystem_fsmount_me_t rtems_filesystem_get_mount_handler(const char *type)
Gets the mount handler for the file system type.
void rtems_libio_init(void)
RTEMS LibIO Initialization.
int rtems_filesystem_default_fsync_or_fdatasync_success(rtems_libio_t *iop)
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.
Chain API.
int(* rtems_filesystem_ioctl_t)(rtems_libio_t *iop, ioctl_command_t request, void *buffer)
IO control of a node.
Definition: libio.h:843
int(* rtems_filesystem_fsync_t)(rtems_libio_t *iop)
Synchronizes changes to a file.
Definition: libio.h:913
Mount table entry.
Definition: libio.h:1542
File system operations table.
Definition: libio.h:471
int rtems_filesystem_default_ftruncate_directory(rtems_libio_t *iop, off_t length)
Definition: libio.h:1797
int rtems_filesystem_default_mount(rtems_filesystem_mount_table_entry_t *mt_entry)
Path evaluation context.
Definition: libio.h:83
void(* rtems_filesystem_mt_entry_lock_t)(const rtems_filesystem_mount_table_entry_t *mt_entry)
Locks a file system instance.
Definition: libio.h:65
int(* rtems_filesystem_ftruncate_t)(rtems_libio_t *iop, off_t length)
Truncates a file to a specified length.
Definition: libio.h:897
const rtems_filesystem_file_handlers_r rtems_filesystem_handlers_default
File system node handler table with default node handlers.
off_t rtems_filesystem_default_lseek(rtems_libio_t *iop, off_t offset, int whence)
ssize_t rtems_filesystem_default_read(rtems_libio_t *iop, void *buffer, size_t count)
void rtems_filesystem_default_fsunmount(rtems_filesystem_mount_table_entry_t *mt_entry)
bool(* rtems_filesystem_mt_entry_visitor)(const rtems_filesystem_mount_table_entry_t *mt_entry, void *arg)
Mount table entry visitor.
Definition: libio.h:1774
int(* rtems_filesystem_clonenode_t)(rtems_filesystem_location_info_t *loc)
Clones a location.
Definition: libio.h:229
int rtems_mkdir(const char *path, mode_t mode)
Creates a directory and all its parent directories according to path.
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:173
int rtems_filesystem_default_statvfs(const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
int(* rtems_filesystem_statvfs_t)(const rtems_filesystem_location_info_t *loc, struct statvfs *buf)
Gets file system information.
Definition: libio.h:463
int rtems_filesystem_default_clonenode(rtems_filesystem_location_info_t *loc)
ssize_t rtems_filesystem_default_write(rtems_libio_t *iop, const void *buffer, size_t count)
An open file data structure.
Definition: libio.h:1281
bool rtems_filesystem_mount_iterate(rtems_filesystem_mt_entry_visitor visitor, void *visitor_arg)
Iterates over all file system mount entries.
rtems_id unmount_task
The task that initiated the unmount process.
Definition: libio.h:1579
off_t rtems_filesystem_default_lseek_file(rtems_libio_t *iop, off_t offset, int whence)
Default lseek() handler for files.
const char * path
The contents of the remaining path to be evaluated.
Definition: libio.h:87
Definition: statvfs.h:35
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)
int rtems_filesystem_unregister(const char *type)
Unregisters a file system type.
size_t pathlen
The length of the remaining path to be evaluated.
Definition: libio.h:92
int(* rtems_filesystem_kqfilter_t)(rtems_libio_t *iop, struct knote *kn)
Kernel event filter support.
Definition: libio.h:974
int(* rtems_filesystem_fdatasync_t)(rtems_libio_t *iop)
Synchronizes the data of a file.
Definition: libio.h:928
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: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:208
int rtems_filesystem_default_mknod(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
int rtems_filesystem_default_ioctl(rtems_libio_t *iop, ioctl_command_t request, void *buffer)
int rtems_filesystem_default_chown(const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
int recursionlevel
Symbolic link evaluation is a recursive operation.
Definition: libio.h:125
ssize_t(* rtems_filesystem_read_t)(rtems_libio_t *iop, void *buffer, size_t count)
Reads from a node.
Definition: libio.h:759
void rtems_filesystem_default_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
Obtains the IO library mutex.
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:424
int rtems_filesystem_default_fsync_or_fdatasync(rtems_libio_t *iop)
Global file system location.
Definition: fs.h:81
File system location.
Definition: fs.h:53
int(* rtems_filesystem_open_t)(rtems_libio_t *iop, const char *path, int oflag, mode_t mode)
Opens a node.
Definition: libio.h:724