Commit Graph
40 Commits
Author SHA1 Message Date
Marçal Comajoan Cara 0446f68056 Spelling and grammar fixes in source code comments (GCI 2018) 2018-12-04 15:12:53 -06:00
Kevin Kirspel c6bb1c33bc posix/mmap: Add support for file handler and MAP_ANON
Added a mmap file handler to struct _rtems_filesystem_file_handlers_r.
Updated each file handler object to support the default mmap handler.
Updated mmap() to call the mmap handler for MAP_SHARED.
Added a mmap file handler for shm

Added support for MAP_ANON in mmap().

Updates #2859
2017-07-14 16:04:05 -04:00
Sebastian Huber 5bfeddc0c2 termios: Add kqueue() and poll() support
Real implementation is provided by libbsd.
2017-02-23 07:27:43 +01:00
Sebastian Huber 194eb0074b Filesystem: Use ENOTSUP for default mount/unmount 2015-02-12 20:53:34 +01:00
Sebastian Huber eb7753437f Filesystem: Delete unused fsmountme_h handler 2015-02-09 15:38:48 +01:00
Sebastian Huber c625a64121 Filesystem: Delete node type operation
Use the fstat handler instead.
2015-01-22 07:52:40 +01:00
Chris Johns c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber c1d8ee4cdc libcsupport: Accept NULL for zero-length entries 2013-12-20 10:31:53 +01:00
Sebastian Huber 56bea4339f Filesystem: Use default kqfilter and poll handler 2013-12-20 10:31:53 +01:00
Sebastian Huber 2f68778f08 Filesystem: Add readv/writev handlers
The readv() and writev() support was implemented in terms of multiple
calls to the read and write handlers.  This imposes a problem on device
files which use an IO vector as single request entity.  For example a
low-level network device (e.g. BPF(4)) may use an IO vector to create
one frame from multiple protocol layers each with its own IO vector
entry.
2013-12-20 10:31:53 +01:00
Joel Sherrill 03e54614a3 statvfs filesystem handlers: Remove restrict 2013-11-27 13:06:16 -06:00
Daniel Ramirez bb81e04ae3 statvfs and ALL filesystem handlers: Add restrict keyword. 2013-11-21 16:56:48 -06:00
Sebastian Huber 8cb28826ff Filesystem: Add kernel event filter handler
This handler is necessary to implement the KQUEUE(2) system calls.

Add <sys/event.h> from FreeBSD 8.4.
2013-11-04 15:22:48 +01:00
Sebastian Huber 1682946057 Filesystem: Add poll() handler
This handler is necessary to implement the SELECT(2) and POLL(2) system
calls.

Add <sys/poll.h> from FreeBSD 8.4.
2013-11-04 15:22:47 +01:00
Sebastian Huber ba120d1aaa Filesystem: Use ENOTTY for default ioctl() handler
This is in line with Linux and FreeBSD.
2013-10-31 14:32:25 +01:00
Sebastian Huber 3c2bb2238a Return EINVAL in default ftruncate() handler
According to POSIX this case is implementation defined.  Linux and
FreeBSD return EINVAL.
2013-10-11 16:22:00 +02:00
Sebastian Huber 630365b927 Filesystem: Avoid usage of uninitialized variable
This is a cosmetic fix.  There was no bug.
2013-08-23 10:06:34 +02:00
Ayush Awasthi 8587b018b9 libfs: Doxygen Enhancement Task #4 2012-12-28 08:26:30 -06:00
Mathew Kallada 4e592763cb libfs: Doxygen Enhancement Task #5 2012-12-28 08:05:20 -06:00
Alex Ivanov 36f3207b27 libfs: Doxygen Enhancement Task #3 2012-12-28 07:51:07 -06:00
Sebastian Huber acec386c75 Filesystem: PR1619: Use ENOSYS for default statvfs
POSIX does not specify an error number in case the file system does not
support this call.  Use the Linux value.
2012-11-22 17:33:13 +01:00
Sebastian Huber 7666afc97a Filesystem: Add const qualifier to lock/unlock 2012-05-15 10:01:43 +02:00
Sebastian Huber df01da6707 Filesystem: Use ioctl_command_t 2012-05-15 10:01:42 +02:00
Joel Sherrill 9b4422a251 Remove All CVS Id Strings Possible Using a Script
Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines
  next to each other after Id string line removed.
+ remove entire comment blocks which only exited to
  contain CVS Ids
+ If the processing left a blank line at the top of
  a file, it was removed.
2012-05-11 08:44:13 -05:00
Sebastian Huber 30d412469c Filesystem: PR1398: Fix lseek() mechanic
According to POSIX the lseek() function shall not, by itself, extend the
size of a file.

Remove the size field of rtems_libio_t.  A file has only one size but
may have multiple open file descriptors.  Thus a file size field in the
file descriptor may lead to inconsistencies.

New default handlers rtems_filesystem_default_lseek_file() and
rtems_filesystem_default_lseek_directory().
2012-05-11 13:58:43 +02:00
Sebastian Huber 4116fce629 Filesystem: New defaults fsync_h and fdatasync_h
New defaults rtems_filesystem_default_fsync_or_fdatasync() and
rtems_filesystem_default_fsync_or_fdatasync_success() for fsync_h and
fdatasync_h.  The rtems_filesystem_default_fsync_or_fdatasync() sets now
errno to EINVAL according to POSIX.
2012-03-13 12:23:45 +01:00
Sebastian Huber a76c23738b Filesystem: Change error indication
Change error indication to ESPIPE in rtems_filesystem_default_lseek().
2012-03-13 12:23:45 +01:00
Sebastian Huber adef4e4696 Filesystem: New function
New function rtems_filesystem_default_lseek_success().
2012-03-13 12:23:45 +01:00
Sebastian Huber 3b7c123c8d Filesystem: Reference counting for locations
o A new data structure rtems_filesystem_global_location_t was
   introduced to be used for
    o the mount point location in the mount table entry,
    o the file system root location in the mount table entry,
    o the root directory location in the user environment, and
    o the current directory location in the user environment.
   During the path evaluation global start locations are obtained to
   ensure that the current file system instance will be not unmounted in
   the meantime.
 o The user environment uses now reference counting and is protected
   from concurrent access.
 o The path evaluation process was completely rewritten and simplified.
   The IMFS, RFS, NFS, and DOSFS use now a generic path evaluation
   method.  Recursive calls in the path evaluation have been replaced
   with iteration to avoid stack overflows.  Only the evaluation of
   symbolic links is recursive.  No dynamic memory allocations and
   intermediate buffers are used in the high level path evaluation.  No
   global locks are held during the file system instance specific path
   evaluation process.
 o Recursive symbolic link evaluation is now limited by
   RTEMS_FILESYSTEM_SYMLOOP_MAX.  Applications can retrieve this value
   via sysconf().
 o The device file system (devFS) uses now no global variables and
   allocation from the workspace.  Node names are allocated from the
   heap.
 o The upper layer lseek() performs now some parameter checks.
 o The upper layer ftruncate() performs now some parameter checks.
 o unmask() is now restricted to the RWX flags and protected from
   concurrent access.
 o The fchmod_h and rmnod_h file system node handlers are now a file
   system operation.
 o The unlink_h operation has been removed.  All nodes are now destroyed
   with the rmnod_h operation.
 o New lock_h, unlock_h, clonenod_h, and are_nodes_equal_h file system
   operations.
 o The path evaluation and file system operations are now protected by
   per file system instance lock and unlock operations.
 o Fix and test file descriptor duplicate in fcntl().
 o New test fstests/fsnofs01.
2012-03-13 12:23:37 +01:00
Sebastian Huber 1052242d23 Removed fpathconf file system node handler.
There existed no calling function for this handler.
2012-02-02 15:55:33 +01:00
Ralf Corsepius e4c0a04bd3 2011-11-06 Ralf Corsépius <ralf.corsepius@rtems.org>
PR1945/cpukit
	* libfs/src/defaults/default_ftruncate.c,
	libfs/src/defaults/default_lseek.c:
	Replace rtems_off64_t with off_t.
2011-11-06 11:52:45 +00:00
Sebastian Huber d62711f290 2010-09-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libfs/src/defaults/default_close.c: Return 0 instead of an error
	status.
2010-09-27 12:32:40 +00:00
Sebastian Huber 225216358a 2010-08-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libfs/src/defaults/default_evalpath.c,
	libfs/src/defaults/default_evaluate_link.c: Removed superfluous
	assignment.
2010-08-27 06:42:46 +00:00
Sebastian Huber 9788279237 2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libfs/src/imfs/imfs_fcntl.c: Removed file.
	* libfs/Makefile.am: Reflect change from above.
	* libfs/src/defaults/default_fcntl.c: Return 0 instead of -1 and errno.
	* libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_fifo.c,
	libfs/src/imfs/imfs_handlers_directory.c,
	libfs/src/imfs/imfs_handlers_memfile.c, libfs/src/nfsclient/src/nfs.c,
	libfs/src/rfs/rtems-rfs-rtems-dir.c,
	libfs/src/rfs/rtems-rfs-rtems-file.c, libfs/src/rfs/rtems-rfs-rtems.c,
	libfs/src/rfs/rtems-rfs-rtems.h: Use default file system handlers.
2010-08-25 09:37:49 +00:00
Sebastian Huber 1e01385ff0 2010-07-16 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio.h: Changed
	rtems_filesystem_node_types_t to an enum.  Declare
	rtems_filesystem_handlers_default,
	rtems_filesystem_operations_default,
	rtems_filesystem_default_evalpath(),
	rtems_filesystem_default_evalformake, and
	rtems_filesystem_default_node_type().
	* libfs/src/dosfs/msdos.h: Fixed msdos_node_type() prototype.
	* libfs/src/defaults/default_evalformake.c,
	libfs/src/defaults/default_handlers.c,
	libfs/src/defaults/default_node_type.c,
	libfs/src/defaults/default_ops.c: New files.
	* libfs/Makefile.am: Reflect changes above.
2010-07-15 07:36:37 +00:00
Joel Sherrill b637dbbf21 2010-07-03 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/include/rtems/libio.h, libfs/src/defaults/default_read.c,
	libfs/src/defaults/default_readlink.c,
	libfs/src/rfs/rtems-rfs-rtems.c: Correct types and prototypes to
	eliminate warnings.
2010-07-03 19:13:25 +00:00
Jennifer Averett 6683a58d6e 2010-06-30 Jennifer.Averett <Jennifer.Averett@OARcorp.com>
* libcsupport/include/rtems/libio.h, libfs/Makefile.am: Added
	filesystem default mknod method.
	* libfs/src/defaults/default_mknod.c: New file.
2010-06-30 13:58:56 +00:00
Jennifer Averett dace9ed18b 2010-06-29 Jennifer.Averett <Jennifer.Averett@OARcorp.com>
* libcsupport/include/rtems/libio.h, libfs/Makefile.am,
	libfs/src/defaults/default_chown.c,
	libfs/src/defaults/default_evalpath.c,
	libfs/src/defaults/default_freenode.c,
	libfs/src/defaults/default_fsmount.c,
	libfs/src/defaults/default_link.c,
	libfs/src/defaults/default_mount.c,
	libfs/src/defaults/default_rename.c,
	libfs/src/defaults/default_statvfs.c,
	libfs/src/defaults/default_symlink.c,
	libfs/src/defaults/default_unlink.c,
	libfs/src/defaults/default_utime.c, libfs/src/devfs/devfs_init.c,
	libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs_init.c,
	libfs/src/nfsclient/src/nfs.c, libfs/src/rfs/rtems-rfs-rtems.c,
	wrapup/Makefile.am: Fixed typo in default names. Added default
	methods into filesystem tables.
	* libfs/src/defaults/default_close.c,
	libfs/src/defaults/default_evaluate_link.c,
	libfs/src/defaults/default_fpathconf.c,
	libfs/src/defaults/default_fsunmount.c,
	libfs/src/defaults/default_open.c,
	libfs/src/defaults/default_unmount.c: New files.
2010-06-29 19:37:28 +00:00
Joel Sherrill 76950a6f48 2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* libfs/src/defaults/default_chown.c,
	libfs/src/defaults/default_evalpath.c,
	libfs/src/defaults/default_fchmod.c,
	libfs/src/defaults/default_fcntl.c,
	libfs/src/defaults/default_fdatasync.c,
	libfs/src/defaults/default_freenode.c,
	libfs/src/defaults/default_fsmount.c,
	libfs/src/defaults/default_fstat.c,
	libfs/src/defaults/default_fsync.c,
	libfs/src/defaults/default_ftruncate.c,
	libfs/src/defaults/default_ioctl.c,
	libfs/src/defaults/default_link.c,
	libfs/src/defaults/default_lseek.c,
	libfs/src/defaults/default_mount.c,
	libfs/src/defaults/default_read.c,
	libfs/src/defaults/default_readlink.c,
	libfs/src/defaults/default_rename.c,
	libfs/src/defaults/default_rmnod.c,
	libfs/src/defaults/default_statvfs.c,
	libfs/src/defaults/default_symlink.c,
	libfs/src/defaults/default_unlink.c,
	libfs/src/defaults/default_utime.c,
	libfs/src/defaults/default_write.c: Add include of rtems/seterr.h
2010-06-29 01:53:18 +00:00
Jennifer Averett f9a4e80f86 2010-06-25 Jennifer Averett <Jennifer.Averett@OARcorp.com
* libcsupport/include/rtems/libio.h, libfs/Makefile.am: Added default
	filesystem handlers.
	* libfs/src/defaults/default_chown.c,
	libfs/src/defaults/default_evalpath.c,
	libfs/src/defaults/default_fchmod.c,
	libfs/src/defaults/default_fcntl.c,
	libfs/src/defaults/default_fdatasync.c,
	libfs/src/defaults/default_freenode.c,
	libfs/src/defaults/default_fsmount.c,
	libfs/src/defaults/default_fstat.c,
	libfs/src/defaults/default_fsync.c,
	libfs/src/defaults/default_ftruncate.c,
	libfs/src/defaults/default_ioctl.c,
	libfs/src/defaults/default_link.c,
	libfs/src/defaults/default_lseek.c,
	libfs/src/defaults/default_mount.c,
	libfs/src/defaults/default_read.c,
	libfs/src/defaults/default_readlink.c,
	libfs/src/defaults/default_rename.c,
	libfs/src/defaults/default_rmnod.c,
	libfs/src/defaults/default_statvfs.c,
	libfs/src/defaults/default_symlink.c,
	libfs/src/defaults/default_unlink.c,
	libfs/src/defaults/default_utime.c,
	libfs/src/defaults/default_write.c: New files.
2010-06-25 14:23:48 +00:00