RTEMS 6.2-rc2
Loading...
Searching...
No Matches
libio_.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * COPYRIGHT (C) 1989, 2021 On-Line Applications Research Corporation (OAR).
13 *
14 * Modifications to support reference counting in the file system are
15 * Copyright (c) 2012 embedded brains GmbH & Co. KG
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef _RTEMS_RTEMS_LIBIO__H
40#define _RTEMS_RTEMS_LIBIO__H
41
42#include <sys/uio.h>
43#include <errno.h>
44#include <limits.h>
45#include <pthread.h>
46
47#include <rtems.h>
48#include <rtems/libio.h>
49#include <rtems/seterr.h>
50#include <rtems/score/assert.h>
52
53#ifdef __cplusplus
54extern "C" {
55#endif
56
67#define RTEMS_FILESYSTEM_SYMLOOP_MAX 32
68
69/*
70 * Not defined in newlib so provide here. Users should use dup2 and
71 * not this non-portable fcntl command. Provided here to allow the
72 * RTEMS implementation to work.
73 */
74#define F_DUP2FD 20
75
76/*
77 * File descriptor Table Information
78 */
79
80extern const uint32_t rtems_libio_number_iops;
81extern rtems_libio_t rtems_libio_iops[];
82extern void *rtems_libio_iop_free_head;
83extern void **rtems_libio_iop_free_tail;
84
85extern const rtems_filesystem_file_handlers_r rtems_filesystem_null_handlers;
86
87extern rtems_filesystem_mount_table_entry_t rtems_filesystem_null_mt_entry;
88
105
106/*
107 * File Descriptor Routine Prototypes
108 */
109
115
119unsigned int rtems_libio_from_fcntl_flags( int fcntl_flags );
120
124int rtems_libio_to_fcntl_flags( unsigned int flags );
125
132 rtems_libio_t *iop
133);
134
141static inline void rtems_libio_free(
142 rtems_libio_t *iop
143)
144{
145 /*
146 * The IOP cannot be open and there can be no references held for it
147 * to be returned to the free list.
148 *
149 * Note, the open flag indicates the user owns the fd that indexes
150 * the iop so consider it an indirect reference. We cannot return
151 * the iop to the free list while the user owns the fd.
152 *
153 * Read the flags once as it is an atomic and we need to test 2
154 * flags. No convenience call as this is the only case we have.
155 */
156 const unsigned int flags = rtems_libio_iop_flags( iop );
157 if ( ( ( flags & LIBIO_FLAGS_OPEN ) == 0 )
158 && ( ( flags & LIBIO_FLAGS_REFERENCE_MASK ) == 0 ) ) {
160 }
161}
162
171static inline unsigned int rtems_libio_iop_flags_set(
172 rtems_libio_t *iop,
173 unsigned int set
174)
175{
176 return _Atomic_Fetch_or_uint( &iop->flags, set, ATOMIC_ORDER_RELAXED );
177}
178
187static inline unsigned int rtems_libio_iop_flags_clear(
188 rtems_libio_t *iop,
189 unsigned int clear
190)
191{
192 return _Atomic_Fetch_and_uint( &iop->flags, ~clear, ATOMIC_ORDER_RELAXED );
193}
194
204static inline rtems_libio_t *rtems_libio_iop( int fd )
205{
206 return &rtems_libio_iops[ fd ];
207}
208
216static inline unsigned int rtems_libio_iop_hold( rtems_libio_t *iop )
217{
218 return _Atomic_Fetch_add_uint(
219 &iop->flags,
220 LIBIO_FLAGS_REFERENCE_INC,
221 ATOMIC_ORDER_ACQUIRE
222 );
223}
224
230static inline void rtems_libio_iop_drop( rtems_libio_t *iop )
231{
232#if defined(RTEMS_DEBUG)
233 unsigned int flags;
234 bool success;
235
236 flags = _Atomic_Load_uint( &iop->flags, ATOMIC_ORDER_RELAXED );
237
238 do {
239 unsigned int desired;
240
241 _Assert( flags >= LIBIO_FLAGS_REFERENCE_INC );
242
243 desired = flags - LIBIO_FLAGS_REFERENCE_INC;
244
245 success = _Atomic_Compare_exchange_uint(
246 &iop->flags,
247 &flags,
248 desired,
249 ATOMIC_ORDER_RELEASE,
250 ATOMIC_ORDER_RELAXED
251 );
252 } while ( !success );
253#else
254 _Atomic_Fetch_sub_uint(
255 &iop->flags,
256 LIBIO_FLAGS_REFERENCE_INC,
257 ATOMIC_ORDER_RELEASE
258 );
259#endif
260 /* free the IOP is not open or held */
261 rtems_libio_free( iop );
262}
263
264/*
265 * rtems_libio_iop_to_descriptor
266 *
267 * Macro to convert an internal file descriptor pointer (iop) into
268 * the integer file descriptor used by the "section 2" system calls.
269 */
270
271#define rtems_libio_iop_to_descriptor(_iop) \
272 ((_iop) - &rtems_libio_iops[0])
273
274/*
275 * rtems_libio_check_is_open
276 *
277 * Macro to check if a file descriptor is actually open.
278 */
279
280#define rtems_libio_check_is_open(_iop) \
281 do { \
282 if (rtems_libio_iop_is_open(_iop)) { \
283 errno = EBADF; \
284 return -1; \
285 } \
286 } while (0)
287
293static inline int rtems_libio_get_iop( int fd, rtems_libio_t **iop )
294{
295 unsigned int flags;
296 if ( (uint32_t) ( fd ) >= rtems_libio_number_iops ) {
297 return EBADF;
298 }
299 *iop = rtems_libio_iop( fd );
300 flags = rtems_libio_iop_hold( *iop );
301 if ( rtems_libio_iop_flags_bad_fd( flags ) ) {
302 rtems_libio_iop_drop( *iop );
303 return EBADF;
304 }
305 return 0;
306}
307
311#define LIBIO_GET_IOP( _fd, _iop ) \
312 do { \
313 int _error = rtems_libio_get_iop( _fd, &_iop ); \
314 if ( _error != 0 ) { \
315 rtems_set_errno_and_return_minus_one( _error ); \
316 } \
317 } while ( 0 )
318
325static inline int rtems_libio_get_iop_with_access(
326 int fd, rtems_libio_t **iop, unsigned int access_flags, int access_error
327)
328{
329 const unsigned int mandatory = LIBIO_FLAGS_OPEN | access_flags ;
330 unsigned int flags;
331 if ( (uint32_t) ( fd ) >= rtems_libio_number_iops ) {
332 return EBADF;
333 }
334 *iop = rtems_libio_iop( fd );
335 flags = rtems_libio_iop_hold( *iop );
336 if ( ( flags & mandatory ) != mandatory ) {
337 rtems_libio_iop_drop( *iop );
338 *iop = NULL;
339 if ( ( flags & LIBIO_FLAGS_OPEN ) == 0 ) {
340 return EBADF;
341 } else {
342 return access_error;
343 }
344 }
345 return 0;
346}
347
352#define LIBIO_GET_IOP_WITH_ACCESS( _fd, _iop, _access_flags, _access_error ) \
353 do { \
354 int _error = rtems_libio_get_iop_with_access( \
355 _fd, &_iop, _access_flags, _access_error \
356 ); \
357 if ( _error != 0 ) { \
358 rtems_set_errno_and_return_minus_one( _error ); \
359 } \
360 } while ( 0 )
361
362/*
363 * rtems_libio_check_buffer
364 *
365 * Macro to check if a buffer pointer is valid.
366 */
367
368#define rtems_libio_check_buffer(_buffer) \
369 do { \
370 if ((_buffer) == 0) { \
371 errno = EINVAL; \
372 return -1; \
373 } \
374 } while (0)
375
376/*
377 * rtems_libio_check_count
378 *
379 * Macro to check if a count or length is valid.
380 */
381
382#define rtems_libio_check_count(_count) \
383 do { \
384 if ((_count) == 0) { \
385 return 0; \
386 } \
387 } while (0)
388
402);
403
417
418/*
419 * External structures
420 */
421#include <rtems/userenv.h>
422
423void rtems_libio_lock( void );
424
425void rtems_libio_unlock( void );
426
427static inline void rtems_filesystem_mt_lock( void )
428{
429 rtems_libio_lock();
430}
431
432static inline void rtems_filesystem_mt_unlock( void )
433{
434 rtems_libio_unlock();
435}
436
437extern rtems_interrupt_lock rtems_filesystem_mt_entry_lock_control;
438
439#define rtems_filesystem_mt_entry_declare_lock_context( ctx ) \
440 rtems_interrupt_lock_context ctx
441
442#define rtems_filesystem_mt_entry_lock( ctx ) \
443 rtems_interrupt_lock_acquire( &rtems_filesystem_mt_entry_lock_control, &ctx )
444
445#define rtems_filesystem_mt_entry_unlock( ctx ) \
446 rtems_interrupt_lock_release( &rtems_filesystem_mt_entry_lock_control, &ctx )
447
448static inline void rtems_filesystem_instance_lock(
450)
451{
452 const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
453
454 (*mt_entry->ops->lock_h)( mt_entry );
455}
456
457static inline void rtems_filesystem_instance_unlock(
459)
460{
461 const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
462
463 (*mt_entry->ops->unlock_h)( mt_entry );
464}
465
479bool rtems_filesystem_utime_tv_nsec_valid( struct timespec time );
480
497 const rtems_filesystem_location_info_t *currentloc,
498 const struct timespec times[2]
499);
500
521 const struct timespec times[2],
522 struct timespec new_times[2]
523);
524
529
530/*
531 * File System Routine Prototypes
532 */
533
535rtems_filesystem_eval_path_start(
537 const char *path,
538 int eval_flags
539);
540
542rtems_filesystem_eval_path_start_with_parent(
544 const char *path,
545 int eval_flags,
547 int parent_eval_flags
548);
549
551rtems_filesystem_eval_path_start_with_root_and_current(
553 const char *path,
554 size_t pathlen,
555 int eval_flags,
556 rtems_filesystem_global_location_t *const *global_root_ptr,
557 rtems_filesystem_global_location_t *const *global_current_ptr
558);
559
560void rtems_filesystem_eval_path_continue(
562);
563
564void rtems_filesystem_eval_path_cleanup(
566);
567
568void rtems_filesystem_eval_path_recursive(
570 const char *path,
571 size_t pathlen
572);
573
574void rtems_filesystem_eval_path_cleanup_with_parent(
577);
578
594 rtems_filesystem_global_location_t **newstartloc_ptr
595);
596
597typedef enum {
598 RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE,
599 RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE,
600 RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY
601} rtems_filesystem_eval_path_generic_status;
602
616 void *arg
617);
618
631typedef rtems_filesystem_eval_path_generic_status
634 void *arg,
635 const char *token,
636 size_t tokenlen
637);
638
639typedef struct {
643
644void rtems_filesystem_eval_path_generic(
646 void *arg,
648);
649
651
668);
669
671rtems_filesystem_location_initialize_to_null(
673)
674{
676 loc,
678 );
679}
680
682rtems_filesystem_location_transform_to_global(
684);
685
694 rtems_filesystem_global_location_t **lhs_global_loc_ptr,
696);
697
718 rtems_filesystem_global_location_t *const *global_loc_ptr
719);
720
740 bool deferred
741);
742
743void rtems_filesystem_location_detach(
745);
746
747void rtems_filesystem_location_copy_and_detach(
750);
751
753rtems_filesystem_global_location_obtain_null(void)
754{
755 rtems_filesystem_global_location_t *global_loc = NULL;
756
757 return rtems_filesystem_global_location_obtain( &global_loc );
758}
759
760static inline bool rtems_filesystem_location_is_null(
762)
763{
764 return loc->handlers == &rtems_filesystem_null_handlers;
765}
766
767static inline bool rtems_filesystem_global_location_is_null(
768 const rtems_filesystem_global_location_t *global_loc
769)
770{
771 return rtems_filesystem_location_is_null( &global_loc->location );
772}
773
774static inline void rtems_filesystem_location_error(
776 int eno
777)
778{
779 if ( !rtems_filesystem_location_is_null( loc ) ) {
780 errno = eno;
781 }
782}
783
784int rtems_filesystem_mknod(
785 const rtems_filesystem_location_info_t *parentloc,
786 const char *name,
787 size_t namelen,
788 mode_t mode,
789 dev_t dev
790);
791
792int rtems_filesystem_chdir( rtems_filesystem_location_info_t *loc );
793
794int rtems_filesystem_chmod(
796 mode_t mode
797);
798
799int rtems_filesystem_chown(
801 uid_t owner,
802 gid_t group
803);
804
805static inline bool rtems_filesystem_is_ready_for_unmount(
807)
808{
809 bool ready = !mt_entry->mounted
810 && rtems_chain_has_only_one_node( &mt_entry->location_chain )
811 && mt_entry->mt_fs_root->reference_count == 1;
812
813 if ( ready ) {
814 rtems_chain_initialize_empty( &mt_entry->location_chain );
815 }
816
817 return ready;
818}
819
820static inline void rtems_filesystem_location_add_to_mt_entry(
822)
823{
824 rtems_filesystem_mt_entry_declare_lock_context( lock_context );
825
826 rtems_filesystem_mt_entry_lock( lock_context );
827 rtems_chain_append_unprotected(
828 &loc->mt_entry->location_chain,
829 &loc->mt_entry_node
830 );
831 rtems_filesystem_mt_entry_unlock( lock_context );
832}
833
834void rtems_filesystem_location_remove_from_mt_entry(
836);
837
838void rtems_filesystem_do_unmount(
840);
841
842static inline bool rtems_filesystem_location_is_instance_root(
844)
845{
846 const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
847
848 return (*mt_entry->ops->are_nodes_equal_h)(
849 loc,
850 &mt_entry->mt_fs_root->location
851 );
852}
853
854static inline const char *rtems_filesystem_eval_path_get_path(
856)
857{
858 return ctx->path;
859}
860
861static inline size_t rtems_filesystem_eval_path_get_pathlen(
863)
864{
865 return ctx->pathlen;
866}
867
868static inline void rtems_filesystem_eval_path_set_path(
870 const char *path,
871 size_t pathlen
872)
873{
874 ctx->path = path;
875 ctx->pathlen = pathlen;
876}
877
878static inline void rtems_filesystem_eval_path_clear_path(
880)
881{
882 ctx->pathlen = 0;
883}
884
885static inline const char *rtems_filesystem_eval_path_get_token(
887)
888{
889 return ctx->token;
890}
891
892static inline size_t rtems_filesystem_eval_path_get_tokenlen(
894)
895{
896 return ctx->tokenlen;
897}
898
899static inline void rtems_filesystem_eval_path_set_token(
901 const char *token,
902 size_t tokenlen
903)
904{
905 ctx->token = token;
906 ctx->tokenlen = tokenlen;
907}
908
909static inline void rtems_filesystem_eval_path_clear_token(
911)
912{
913 ctx->tokenlen = 0;
914}
915
916static inline void rtems_filesystem_eval_path_put_back_token(
918)
919{
920 size_t tokenlen = ctx->tokenlen;
921
922 ctx->path -= tokenlen;
923 ctx->pathlen += tokenlen;
924 ctx->tokenlen = 0;
925}
926
927void rtems_filesystem_eval_path_eat_delimiter(
929);
930
931void rtems_filesystem_eval_path_next_token(
933);
934
935static inline void rtems_filesystem_eval_path_get_next_token(
937 const char **token,
938 size_t *tokenlen
939)
940{
941 rtems_filesystem_eval_path_next_token(ctx);
942 *token = ctx->token;
943 *tokenlen = ctx->tokenlen;
944}
945
947rtems_filesystem_eval_path_get_currentloc(
949)
950{
951 return &ctx->currentloc;
952}
953
954static inline bool rtems_filesystem_eval_path_has_path(
956)
957{
958 return ctx->pathlen > 0;
959}
960
961static inline bool rtems_filesystem_eval_path_has_token(
963)
964{
965 return ctx->tokenlen > 0;
966}
967
968static inline int rtems_filesystem_eval_path_get_flags(
970)
971{
972 return ctx->flags;
973}
974
975static inline void rtems_filesystem_eval_path_set_flags(
977 int flags
978)
979{
980 ctx->flags = flags;
981}
982
983static inline void rtems_filesystem_eval_path_clear_and_set_flags(
985 int clear,
986 int set
987)
988{
989 int flags = ctx->flags;
990
991 flags &= ~clear;
992 flags |= set;
993
994 ctx->flags = flags;
995}
996
997static inline void rtems_filesystem_eval_path_extract_currentloc(
1000)
1001{
1002 rtems_filesystem_location_copy_and_detach(
1003 get,
1004 &ctx->currentloc
1005 );
1006}
1007
1008void rtems_filesystem_eval_path_error(
1010 int eno
1011);
1012
1022);
1023
1044 int flags,
1045 mode_t object_mode,
1046 uid_t object_uid,
1047 gid_t object_gid
1048);
1049
1050bool rtems_filesystem_eval_path_check_access(
1052 int eval_flags,
1053 mode_t node_mode,
1054 uid_t node_uid,
1055 gid_t node_gid
1056);
1057
1058static inline bool rtems_filesystem_is_delimiter(char c)
1059{
1060 return c == '/' || c == '\\';
1061}
1062
1063static inline bool rtems_filesystem_is_current_directory(
1064 const char *token,
1065 size_t tokenlen
1066)
1067{
1068 return tokenlen == 1 && token [0] == '.';
1069}
1070
1071static inline bool rtems_filesystem_is_parent_directory(
1072 const char *token,
1073 size_t tokenlen
1074)
1075{
1076 return tokenlen == 2 && token [0] == '.' && token [1] == '.';
1077}
1078
1079typedef ssize_t ( *rtems_libio_iovec_adapter )(
1080 rtems_libio_t *iop,
1081 const struct iovec *iov,
1082 int iovcnt,
1083 ssize_t total
1084);
1085
1086static inline ssize_t rtems_libio_iovec_eval(
1087 int fd,
1088 const struct iovec *iov,
1089 int iovcnt,
1090 unsigned int flags,
1091 rtems_libio_iovec_adapter adapter
1092)
1093{
1094 ssize_t total;
1095 int v;
1096 rtems_libio_t *iop;
1097
1098 /*
1099 * Argument validation on IO vector
1100 */
1101 if ( iov == NULL )
1103
1104 if ( iovcnt <= 0 )
1106
1107 if ( iovcnt > IOV_MAX )
1109
1110 /*
1111 * OpenGroup says that you are supposed to return EINVAL if the
1112 * sum of the iov_len values in the iov array would overflow a
1113 * ssize_t.
1114 */
1115 total = 0;
1116 for ( v = 0 ; v < iovcnt ; ++v ) {
1117 size_t len = iov[ v ].iov_len;
1118
1119 if ( len > ( size_t ) ( SSIZE_MAX - total ) ) {
1121 }
1122
1123 total += ( ssize_t ) len;
1124
1125 if ( iov[ v ].iov_base == NULL && len != 0 ) {
1127 }
1128 }
1129
1130 LIBIO_GET_IOP_WITH_ACCESS( fd, iop, flags, EBADF );
1131
1132 if ( total > 0 ) {
1133 total = ( *adapter )( iop, iov, iovcnt, total );
1134 }
1135
1136 rtems_libio_iop_drop( iop );
1137 return total;
1138}
1139
1148static inline mode_t rtems_filesystem_location_type(
1150)
1151{
1152 struct stat st;
1153
1154 st.st_mode = 0;
1155 (void) ( *loc->handlers->fstat_h )( loc, &st );
1156
1157 return st.st_mode;
1158}
1159
1162#ifdef __cplusplus
1163}
1164#endif
1165
1166#endif
1167/* end of include file */
clock_t times(struct tms *ptms)
Definition: __times.c:97
This header file provides the interfaces of the Assert Handler.
#define LIBIO_GET_IOP_WITH_ACCESS(_fd, _iop, _access_flags, _access_error)
Macro to wrap the function to allow returning the IOP and using the error set and return macro.
Definition: libio_.h:352
int rtems_filesystem_utime_check_permissions(const rtems_filesystem_location_info_t *currentloc, const struct timespec times[2])
Checks for errors and if the process has write permissions to the file.
Definition: utimensat.c:75
void rtems_libio_free_iop(rtems_libio_t *iop)
Definition: libio.c:154
bool(* rtems_filesystem_eval_path_is_directory)(rtems_filesystem_eval_path_context_t *ctx, void *arg)
Tests if the current location is a directory.
Definition: libio_.h:614
void rtems_filesystem_global_location_assign(rtems_filesystem_global_location_t **lhs_global_loc_ptr, rtems_filesystem_global_location_t *rhs_global_loc)
Assigns a global file system location.
Definition: sup_fs_location.c:108
rtems_filesystem_global_location_t rtems_filesystem_global_location_null
The global null location.
Definition: __usrenv.c:246
void rtems_filesystem_eval_path_restart(rtems_filesystem_eval_path_context_t *ctx, rtems_filesystem_global_location_t **newstartloc_ptr)
Requests a path evaluation restart.
Definition: sup_fs_eval_path.c:330
bool rtems_filesystem_utime_tv_nsec_valid(struct timespec time)
Checks the tv_nsec member of a timespec struct.
Definition: utimensat.c:53
bool rtems_filesystem_check_access(int flags, mode_t object_mode, uid_t object_uid, gid_t object_gid)
Checks if access to an object is allowed for the current user.
Definition: sup_fs_check_permissions.c:102
rtems_filesystem_global_location_t * rtems_filesystem_global_location_obtain(rtems_filesystem_global_location_t *const *global_loc_ptr)
Obtains a global file system location.
Definition: sup_fs_location.c:175
void rtems_filesystem_global_location_release(rtems_filesystem_global_location_t *global_loc, bool deferred)
Releases a global file system location.
Definition: sup_fs_location.c:198
int rtems_libio_count_open_iops(void)
Definition: libio.c:184
unsigned int rtems_libio_from_fcntl_flags(int fcntl_flags)
Definition: libio.c:80
int rtems_libio_to_fcntl_flags(unsigned int flags)
Definition: libio.c:105
rtems_libio_t * rtems_libio_allocate(void)
Definition: libio.c:128
void rtems_filesystem_location_free(rtems_filesystem_location_info_t *loc)
Releases all resources of a location.
Definition: freenode.c:44
void rtems_filesystem_location_clone(rtems_filesystem_location_info_t *clone, const rtems_filesystem_location_info_t *master)
Clones a node.
Definition: clonenode.c:41
int rtems_filesystem_utime_update(const struct timespec times[2], struct timespec new_times[2])
Checks times and fills new_times with the time to be written.
Definition: utimensat.c:120
int rtems_filesystem_location_exists_in_same_instance_as(const rtems_filesystem_location_info_t *a, const rtems_filesystem_location_info_t *b)
Checks that the locations exist in the same file system instance.
Definition: sup_fs_exist_in_same_instance.c:41
void rtems_filesystem_initialize(void)
Base File System Initialization.
Definition: base_fs.c:51
rtems_filesystem_location_info_t * rtems_filesystem_location_copy(rtems_filesystem_location_info_t *dst, const rtems_filesystem_location_info_t *src)
Copies a location.
rtems_filesystem_eval_path_generic_status(* rtems_filesystem_eval_path_eval_token)(rtems_filesystem_eval_path_context_t *ctx, void *arg, const char *token, size_t tokenlen)
Evaluates a token.
Definition: libio_.h:632
char rtems_interrupt_lock
This structure represents an ISR lock.
Definition: intr.h:532
#define rtems_set_errno_and_return_minus_one(_error)
Definition: seterr.h:67
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG and static analysis runs.
Definition: assert.h:96
Basic IO API.
POSIX Threads Private Support.
This header file defines the RTEMS Classic API.
This header file provides the interfaces of the Timespec Helpers.
This header file defines macros to set errno and return minus one.
File system node operations table.
Definition: libio.h:1023
Definition: deflate.c:114
Path evaluation context.
Definition: libio.h:105
rtems_filesystem_location_info_t currentloc
Definition: libio.h:156
const char * path
Definition: libio.h:109
size_t pathlen
Definition: libio.h:114
size_t tokenlen
Definition: libio.h:126
const char * token
Definition: libio.h:120
int flags
Definition: libio.h:140
Global file system location.
Definition: fs.h:100
File system location.
Definition: fs.h:72
Mount table entry.
Definition: libio.h:1675
An open file data structure.
Definition: libio.h:1340
User Environment Support.