summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/base_fs.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-05-20Update company nameSebastian Huber1-1/+1
The embedded brains GmbH & Co. KG is the legal successor of embedded brains GmbH.
2022-04-01cpukit/libcsupport/src/[a-f]*: Change license to BSD-2Joel Sherrill1-3/+22
Updates #3053.
2020-04-16Canonicalize config.h includeSebastian Huber1-1/+1
Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
2014-11-20Ensure security of default user environmentSebastian Huber1-4/+1
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2012-12-11libcsupport: GCI Doxygen Task #7Alex Ivanov1-12/+7
http://www.google-melange.com/gci/task/view/google/gci2012/7975223
2012-05-11Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill1-2/+0
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-03-13Filesystem: Reference counting for locationsSebastian Huber1-56/+17
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.
2010-08-022010-08-02 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill1-2/+0
* libcsupport/src/base_fs.c, libcsupport/src/rtems_mkdir.c: Formatting.
2010-05-312010-05-31 Chris Johns <chrisj@rtems.org>Chris Johns1-7/+1
* libcsupport/Makefile.am: Add mount-mgr.c. * libcsupport/src/mount-mgr.c: New. * include/rtems/fs.h: Added rtems_filesystem_location_mount. * libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New mount interface. It is similar to Linux. * libcsupport/include/rtems/libio_.h: Remove the init_fs_mount_table call. * libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use the new mount call. Remove setting the root node in the global pathloc. Mount does this now. * libcsupport/src/privateenv.c: Remove the hack to set the root mount table entry in the environment. * libcsupport/src/unmount.cL Free the target string. * libblock/src/bdpart-mount.c: New mount API. * libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c, libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c, libfs/src/imfs/miniimfs_init.c, libfs/src/nfsclient/src/librtemsNfs.h, libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h, libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h, libnetworking/rtems/tftp.h: New mount_h API. * libfs/src/devfs/devfs_eval.c: Local include of extern ops. * libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount me call and fixed the initialisation to happen when mounting. * libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount filesystem files. * libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to the new mount table values. * libmisc/shell/main_mount_ftp.c, libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c, libmisc/shell/main_mount_tftp.c: Removed. * libmisc/shell/main_mount.c: Use the new mount API. Also access the file system table for the file system types. * libnetworking/lib/tftpDriver.c: Updated to the new mount API. Fixed to allow mounting from any mount point. Also can now have more than file system mounted. * sapi/include/confdefs.h: Add file system configuration support.
2009-10-142009-10-14 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius1-3/+0
* libcsupport/src/base_fs.c: Eliminate RTEMS_UNIX.
2009-06-122009-06-12 Chris Johns <chrisj@rtems.org>Chris Johns1-2/+2
* libblock/src/bdbuf.c: Update comments. * libblock/src/bdpart.c, libblock/src/ide_part_table.c: Get the device from the rdev field of the stat buf. * libcsupport/include/rtems/libio.h: Add a path length to evalpath handler. Add parent locations to rmmod and unlink handlers. * libcsupport/include/rtems/libio_.h: Add a path length to rtems_filesystem_evaluate_path. Add rtems_filesystem_evaluate_relative_path, rtems_filesystem_dirname, and rtems_filesystem_prefix_separators. Remove rtems_filesystem_evaluate_parent. * libcsupport/src/base_fs.c, libcsupport/src/chdir.c, libcsupport/src/chmod.c, libcsupport/src/chown.c, libcsupport/src/chroot.c, libcsupport/src/fchdir.c, libcsupport/src/link.c, libcsupport/src/mount.c, libcsupport/src/open.c, libcsupport/src/privateenv.c, libcsupport/src/readlink.c, libcsupport/src/unmount.c, libcsupport/src/utime.c, libcsupport/src/unmount.c, libcsupport/src/utime.c, libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devstat.c, libfs/src/dosfs/msdos_create.c, libfs/src/dosfs/msdos_misc.c, libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_load_tar.c, libfs/src/imfs/ioman.c, libfs/src/pipe/pipe.c, libmisc/fsmount/fsmount.c, libnetworking/lib/ftpfs.c: Add the length parameter to the eval call. * libcsupport/src/eval.c: Add rtems_filesystem_prefix_separators, rtems_filesystem_dirname, rtems_filesystem_evaluate_relative_path. Add the length parameter to the eval call. * libcsupport/src/rmdir.c: Find the parent pathloc then the node pathloc from that node. Remove the call to find the parent given the node pathloc. * libcsupport/src/stat.c: Add the length parameter to the eval call. Set the device into the rdev field. * libcsupport/src/unlink.c: Find the parent pathloc then the node pathloc from that node. Remove the call to find the parent given the node pathloc. * libfs/src/dosfs/fat.c, libfs/src/dosfs/msdos_format.c: Get the disk device number from the stat rdev field. * libfs/src/dosfs/msdos.h: Add the length parameter to the eval call. Add the parent pathloc to the rmnod handler. * libfs/src/dosfs/msdos_dir.c: Add the parent pathloc to the rmnod handler. * libfs/src/dosfs/msdos_eval.c: Add the length parameter to the eval and token call. * libfs/src/imfs/imfs_directory.c: Add the parent pathloc to the rmnod handler. * libfs/src/imfs/imfs_fchmod.c: Do not test the mode flags for only the allowed flags. Add the missing flags spec'ed in the POSIX standard. * libfs/src/imfs/imfs_fsunmount.c, libfs/src/imfs/imfs_rmnod.c, libfs/src/imfs/imfs_unlink.c, libfs/src/imfs/memfile.c: Add the parent node. Currently ignored in the IMFS. * libfs/src/imfs/imfs_stat.c: Return the device number in the rdev field. * libfs/src/imfs/imfs_mknod.c, libfs/src/imfs/imfs_symlink.c : Add the length parameter to the token call. * libfs/src/nfsclient/src/nfs.c: Add the length parameter to the eval call and parent node to the rmnod and unlink command. * libmisc/shell/internal.h: Remove the libc mounter decl to make public. * libmisc/shell/main_mount.c: Add support for hooking external mount support for new file systems. * libmisc/shell/shell.h: Add helper functions for the mount command.
2008-09-172008-09-17 Miao Yan <yanmiaobest@gmail.com>Joel Sherrill1-8/+1
* Makefile.am, preinstall.am, libcsupport/Makefile.am, libcsupport/include/rtems/libcsupport.h, libcsupport/include/rtems/libio.h, libcsupport/src/base_fs.c, libcsupport/src/libio_init.c, libcsupport/src/newlibc_exit.c, libcsupport/src/newlibc_init.c, libcsupport/src/sync.c, libfs/Makefile.am, libfs/src/imfs/deviceio.c, sapi/include/confdefs.h: Merge GSOC project code to add simple device only filesystem (devfs), optionally completely drop out filesystem, and to clean up disabling newlib reentrancy support. This dropped 17K from the minimum.exe for sparc/sis and arm/rtl22xx_t now has a 15K code space. * libcsupport/src/__usrenv.c, libcsupport/src/newlibc_reent.c, libfs/src/devfs/devclose.c, libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_eval.c, libfs/src/devfs/devfs_init.c, libfs/src/devfs/devfs_mknod.c, libfs/src/devfs/devfs_node_type.c, libfs/src/devfs/devfs_show.c, libfs/src/devfs/devioctl.c, libfs/src/devfs/devopen.c, libfs/src/devfs/devread.c, libfs/src/devfs/devstat.c, libfs/src/devfs/devwrite.c, libfs/src/imfs/deviceerrno.c: New files. * libcsupport/src/newlibc.c: Removed.
2008-05-27Added const qualifier to various pointers and data tables toThomas Doerfler1-2/+2
reduce size of data area. IMFS: Fixed creation of symbolic links to avoid a compiler warning. DOSFS: Use LibBlock instead of read() to read the boot record.
2006-06-22 PR 1101/rtemsJoel Sherrill1-1/+0
* libcsupport/src/base_fs.c: Remove extra endif.
2006-06-222006-06-22 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-21/+4
PR 1101/rtems * libcsupport/src/base_fs.c, rtems/src/taskcreate.c, rtems/src/tasks.c, score/src/coremutex.c: Remove dead code.
2004-04-18Remove stray white spaces.Ralf Corsepius1-4/+4
2003-09-042003-09-04 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-1/+1
* include/chain.h, include/clockdrv.h, include/console.h, include/iosupp.h, include/rtc.h, include/spurious.h, include/timerdrv.h, include/vmeintr.h, include/motorola/mc68230.h, include/rtems/libcsupport.h, include/rtems/libio.h, include/rtems/libio_.h, include/rtems/termiostypes.h, include/sys/termios.h, include/zilog/z8036.h, include/zilog/z8530.h, include/zilog/z8536.h, src/__brk.c, src/__gettod.c, src/__sbrk.c, src/__times.c, src/access.c, src/base_fs.c, src/cfgetispeed.c, src/cfgetospeed.c, src/cfsetispeed.c, src/cfsetospeed.c, src/chdir.c, src/chmod.c, src/chown.c, src/chroot.c, src/close.c, src/ctermid.c, src/dup.c, src/dup2.c, src/eval.c, src/fchdir.c, src/fchmod.c, src/fcntl.c, src/fdatasync.c, src/fpathconf.c, src/fs_null_handlers.c, src/fstat.c, src/fsync.c, src/ftruncate.c, src/getdents.c, src/getpwent.c, src/hosterr.c, src/ioctl.c, src/isatty.c, src/libio.c, src/libio_sockets.c, src/link.c, src/lseek.c, src/lstat.c, src/malloc.c, src/mallocfreespace.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mount.c, src/newlibc.c, src/no_libc.c, src/no_posix.c, src/open.c, src/pathconf.c, src/pipe.c, src/privateenv.c, src/read.c, src/readlink.c, src/rewinddir.c, src/rmdir.c, src/seekdir.c, src/stat.c, src/symlink.c, src/sync.c, src/tcdrain.c, src/tcflow.c, src/tcflush.c, src/tcgetattr.c, src/tcgetprgrp.c, src/tcsendbreak.c, src/tcsetattr.c, src/tcsetpgrp.c, src/telldir.c, src/termios.c, src/termiosinitialize.c, src/truncate.c, src/umask.c, src/unixlibc.c, src/unlink.c, src/unmount.c, src/utime.c, src/write.c: URL for license changed.
2003-01-032003-01-03 Till Straumann <strauman@slac.stanford.edu>Jennifer Averett1-1/+32
* ChangeLog, base_fs.c, getpwent.c, privateenv.c Per PR303, Fix violation of node_access copy syemantics
2001-05-252001-05-25 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-4/+2
* libc/base_fs.c: Deleted chmod() now that IMFS creates the root node with the desired permissions. chmod() is also not supported by the miniIMFS so this is not allowable.
2001-05-242000-05-24 Fernando Ruiz Casas <fernando.ruiz@ctv.es>Joel Sherrill1-2/+7
* libc/ttyname.c (ttyname_r): Removed duplicate call to closedir(). * libc/getpwent.c: Create a more robust /etc/passwd and /etc/group. * libc/base_fs.c: Change permissions of files and directories. Now uses octal constants.
2001-01-252001-01-25 Fernando Ruiz <fernando.ruiz@ctv.es>Joel Sherrill1-4/+2
* Alternate email is correo@fernando-ruiz.com * libc/privateenv.c: New file. * include/rtems/libio_.h, libc/Makefile.am, libc/base_fs.c, libc/unmount.c: Moved default umask, current working directory, root, and links followed count into a structure "user environment" that can then be treated as a unit. This enable giving unique copies of these to individual threads or collection of threads.
2001-01-082001-01-08 Ralf Corsepius <corsepiu@faw.uni-ulm.de>Joel Sherrill1-0/+4
* configure.in: Add libc/config.h * libc/Makefile.am: Add INCLUDES += -I. to pickup config.h * libc/.cvsignore: Add config.h and stamp-h * libc/*.c: Add config.h support.
2000-11-012000-11-01 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-1/+1
* include/Makefile.am, include/rtems/libio_.h, libc/Makefile.am, libc/assoc.c, libc/assocnamebad.c, libc/base_fs.c, libc/cfsetispeed.c, libc/cfsetospeed.c, libc/chdir.c, libc/chmod.c, libc/chown.c, libc/close.c, libc/closedir.c, libc/dup2.c, libc/error.c, libc/eval.c, libc/fchdir.c, libc/fchmod.c, libc/fcntl.c, libc/fdatasync.c, libc/fpathconf.c, libc/fstat.c, libc/fsync.c, libc/ftruncate.c, libc/getdents.c, libc/ioctl.c, libc/libio.c, libc/libio_sockets.c, libc/link.c, libc/lseek.c, libc/malloc.c, libc/mallocfreespace.c, libc/mknod.c, libc/mount.c, libc/newlibc.c, libc/no_libc.c, libc/open.c, libc/read.c, libc/readlink.c, libc/rmdir.c, libc/stat.c, libc/symlink.c, libc/tcsetattr.c, libc/telldir.c, libc/ttyname.c, libc/ttyname_r.c, libc/umask.c, libc/unlink.c, libc/unmount.c, libc/utime.c, libc/write.c: assoc.h, error.h, libio_.h, libio.h, and libcsupport.h moved from libc to lib/include/rtems and now must be referenced as <rtems/XXX.h>. * include/rtems/Makefile.am, include/rtems/.cvsignore: New file. * include/rtems/assoc.h, include/rtems/error.h, include/rtems/libcsupport.h, include/rtems/libio.h, include/rtems/libio_.h: New/moved files.
2000-10-252000-10-24 Joel Sherrill <joel@OARcorp.com>Joel Sherrill1-3/+4
* libc/ioman.c: Moved to libfs. * libc/Makefile.am: Removed ioman.c as part of moving it to libfs. * libc/base_fs.c: Removed include of imfs.h and reworded comment to avoid being IMFS specific. * libc/libio.h: Removed prototype of IMFS_ops since it should not be in this file. * libc/mount.c: Removed IMFS specific configuration information. * libc/unmount.c: Removed include of imfs.h and reworded comment to avoid being IMFS specific.
1999-11-17Updated copyright notice.Joel Sherrill1-2/+1
1999-11-02Added support for configuring base filesystem. First attempt atJoel Sherrill1-17/+41
a full mount table at initialization. This is the wrong place to mount filesystems 2-n since no device drivers are initialized yet.
1999-10-26Added initial cut at miniIMFS which leaves out memfile and directoryJoel Sherrill1-0/+7
readdir support. The next step is to add a mount table and configure either the miniIMFS or the full IMFS at the application level.
1999-06-15After comments D. V. Henkel-Wallace <gumby@zembu.com>, the interface toJoel Sherrill1-1/+1
mount() was changed to avoid the use of a string as the options.
1998-12-03Modifications for RTEMS_UNIX.Jennifer Averett1-0/+2
1998-11-23Added base version of file system infrastructure. This includes a majorJoel Sherrill1-0/+81
overhaul of the RTEMS system call interface. This base file system is the "In-Memory File System" aka IMFS. The design and implementation was done by the following people: + Joel Sherrill (joel@OARcorp.com) + Jennifer Averett (jennifer@OARcorp.com) + Steve "Mr Mount" Salitasc (salitasc@OARcorp.com) + Kerwin Wade (wade@OARcorp.com) PROBLEMS ======== + It is VERY likely that merging this will break the UNIX port. This can/will be fixed. + There is likely some reentrancy/mutual exclusion needed. + Eventually, there should be a "mini-IMFS" description table to eliminate links, symlinks, etc to save memory. All you need to have "classic RTEMS" functionality is technically directories and device IO. All the rest could be left out to save memory.