Commit Graph

548 Commits

Author SHA1 Message Date
Joel Sherrill
46cce26f70 2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/libio_sockets.c: Use
	rtems_set_errno_and_return_minus_one() where it was missed before.
2010-06-28 23:12:10 +00:00
Joel Sherrill
45fcb767c3 2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/__brk.c, libcsupport/src/__gettod.c,
	libcsupport/src/__times.c, libcsupport/src/fchdir.c,
	libcsupport/src/ftrylockfile.c, libcsupport/src/getpwent.c,
	libcsupport/src/gxx_wrappers.c, libcsupport/src/libio_sockets.c,
	libcsupport/src/pipe.c: Use rtems_set_errno_and_return_minus_one()
	where it was missed before.
2010-06-28 22:14:35 +00:00
Joel Sherrill
1d33ecab00 2010-06-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/include/rtems/error.h, libcsupport/src/error.c: Clean up
	so rtems_panic() can be a noreturn method. This eliminates some
	unreachable and thus untestable code.
2010-06-28 22:13:55 +00:00
Joel Sherrill
6cc69f188b 2010-06-28 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libcsupport/src/termios.c: Formatting.
2010-06-28 18:48:32 +00:00
Joel Sherrill
a9ea7088e3 2010-06-24 Joel Sherrill <joel.sherrilL@OARcorp.com>
* libcsupport/src/read.c, libcsupport/src/write.c: read(2) and write(2)
	should return 0 when passed a count of 0 after verifying other
	possible errors.
2010-06-24 21:48:52 +00:00
Jennifer Averett
e525f66b09 2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* libcsupport/Makefile.am, libcsupport/include/rtems/libio_.h: Moved
	method to free a node from a define to an external method.
	* libcsupport/src/freenode.c: New file.
2010-06-22 20:03:41 +00:00
Sebastian Huber
da361aa97d 2010-06-22 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/mount.c: Fixed string assignment in mount entry
	allocation.
2010-06-22 14:20:49 +00:00
Sebastian Huber
0378b47884 2010-06-22 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/mount.c: Fixed string assignment in mount entry
	allocation.
2010-06-22 13:31:13 +00:00
Sebastian Huber
2144d18754 2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/unmount.c: Removed obsolete declarations.  Fixed
	invalid memory free.
2010-06-10 10:12:28 +00:00
Sebastian Huber
b813d632b0 2010-06-10 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/mount-mktgt.c: New file.
	* libcsupport/Makefile.am: Reflect change above.
	* libcsupport/include/rtems/libio.h: Declare
	mount_and_make_target_path().
2010-06-10 09:07:28 +00:00
Sebastian Huber
74fbb7f303 2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/mount.c: Fixed NULL pointer access.
2010-06-09 09:15:50 +00:00
Sebastian Huber
b81c8a697c 2010-06-08 Sebastian Huber <sebastian.huber@embedded-brains.de>
PR 1524/filesystem
	* libcsupport/src/rtems_mkdir.c: New file.
	* libcsupport/src/Makefile.am: Reflect change above.
	* libcsupport/include/rtems/libio.h: Added rtems_mkdir().
	* libmisc/fsmount/fsmount.h, libmisc/fsmount/fsmount.c,
	libblock/src/bdpart-mount.c, libnetworking/rtems/mkrootfs.h,
	libnetworking/rtems/mkrootfs.c, libfs/src/pipe/pipe.c: Use
	rtems_mkdir().  Removed rtems_fsmount_create_mount_point() and
	rtems_rootfs_mkdir().
2010-06-08 13:05:11 +00:00
Joel Sherrill
fab27e479a 2010-06-07 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/tcflow.c, libcsupport/src/tcflush.c: Add switches
	to detect bad input.
	* libcsupport/src/tcsetpgrp.c: Fix typo.
2010-06-07 18:37:16 +00:00
Sebastian Huber
7d01d244d7 2010-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio_.h: Declare
	rtems_filesystem_mount_table_control.
	* libcsupport/include/rtems/libio.h: Removed
	rtems_filesystem_table_first(), rtems_filesystem_table_next() and
	rtems_filesystem_table_node_t declarations.  Declare
	rtems_per_filesystem_routine, rtems_filesystem_iterate() and
	rtems_filesystem_get_mount_handler().
	* libcsupport/src/mount.c: Added rtems_filesystem_mounts_first() and
	rtems_filesystem_mounts_next().  Simplify mount().  Removed
	rtems_filesystem_mount_table_control_init.  Use
	rtems_filesystem_get_mount_handler().
	* libcsupport/src/mount-mgr.c: Removed rtems_filesystem_mounts_first() and
	rtems_filesystem_mounts_next().  Added rtems_filesystem_iterate() and
	rtems_filesystem_get_mount_handler().  Use rtems_libio_lock() and
	rtems_libio_unlock();
	* sapi/include/confdefs.h, libmisc/shell/main_mount.c: Update for
	mount API changes.
2010-06-07 15:35:24 +00:00
Jennifer Averett
452fdc106b 2010-06-07 Bharath Suri <bharath.s.jois@gmail.com>
* libcsupport/include/rtems/libio_.h: Removed macros
	rtems_filesystem_is_separator
	rtems_filesystem_get_start_loc
	rtems_filesystem_get_sym_start_loc
	and added them as files under libcsupport/src/

	* libcsupport/src/: Added new files
	libcsupport/src/sup_fs_get_start_loc.c
	libcsupport/src/sup_fs_get_sym_start_loc.c
	libcsupport/src/sup_fs_is_separator.c

	* libcsupport/Makefile.am: Changes to accommodate new
	files under libcsupport/src/
2010-06-07 15:07:39 +00:00
Ralf Corsepius
8f67ada48a 2010-06-01 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/rtems/libio.h, libcsupport/src/mount-mgr.c:
	Add missing 'const'.
2010-06-01 10:42:52 +00:00
Chris Johns
14724574d9 2010-05-31 Chris Johns <chrisj@rtems.org>
* 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.
2010-05-31 14:03:41 +00:00
Chris Johns
29e92b090c 2010-05-31 Chris Johns <chrisj@rtems.org>
* 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.
2010-05-31 13:56:37 +00:00
Ralf Corsepius
a794000d0f 2010-05-27 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/include/rtems/libio_.h, libcsupport/src/eval.c:
	Use size_t instead of int for pathnamelen.
2010-05-27 16:29:37 +00:00
Ralf Corsepius
16fef9bbce 2010-05-23 Ralf Corsépius <ralf.corsepius@rtems.org>
PR 1528/cpukit
	* libcsupport/src/malloc_boundary.c: Cast to intptr_t* instead of
	int32_t* for 16 bit target compliance.
2010-05-23 06:30:23 +00:00
Chris Johns
ce92a825c4 2010-05-20 Bharath Suri <bharath.s.jois@gmail.com>
* libcsupport/src/_rename_r.c: Avoid overwriting of errno by
        _rename_r to invalid values.
2010-05-20 03:10:41 +00:00
Chris Johns
ff861b9dd0 Whitespace clean up. 2010-05-14 04:04:25 +00:00
Ralf Corsepius
c7989fe7c1 2010-05-01 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/Makefile.am: Add libcsupport/src/flockfile.c,
	libcsupport/src/ftrylockfile.c, libcsupport/src/funlockfile.c.
	* libcsupport/src/flockfile.c, libcsupport/src/ftrylockfile.c,
	libcsupport/src/funlockfile.c: New (stub functions).
2010-05-01 04:19:00 +00:00
Sebastian Huber
068a8240c6 2010-04-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio_.h, libcsupport/src/envlock.c,
	libcsupport/src/libio.c: Added and use rtems_libio_lock() and
	rtems_libio_unlock().  Cleaned up includes and declarations.  Do not
	use RTEMS_NO_PRIORITY for unused ceiling priority in
	rtems_semaphore_create().
2010-04-30 08:55:41 +00:00
Joel Sherrill
cbe57ec919 2010-04-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/chdir.c: Check for NULL pointer.
2010-04-28 15:01:31 +00:00
Joel Sherrill
124800adcd 2010-04-25 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/readv.c: Check for < 0 on iov_len, not <= 0. A
	readv() with all iov_len equal to 0 should have no effect.
2010-04-25 19:50:05 +00:00
Ralf Corsepius
eb09d64daa #include <unistd.h>. 2010-04-02 07:05:32 +00:00
Ralf Corsepius
a26ced8181 Add HAVE_CONFIG_H support to let files receive configure defines. 2010-03-27 05:36:47 +00:00
Joel Sherrill
69b1322b02 2010-03-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/sleep_noposix.c: Fix warning and bug.
2010-03-22 13:38:04 +00:00
Joel Sherrill
e137f0e944 2010-03-11 Ken Peters <kptrs@yahoo.com>
PR 1456/cpukit
	* libcsupport/src/ttyname.c: ttyname_r() when called directly (not via
	ttyname()) does not prefix the caller provided buffer with the
	predefined _PATH_DEV string (/dev/). Thus the directory search fails
	and no tty name is returned to the caller.
2010-03-11 19:14:41 +00:00
Chris Johns
8ec7abb551 010-03-04 Chris Johns <chrisj@rtems.org>
* libcsupport/include/rtems/libio.h, libcsupport/src/_rename_r.c:
        Add a rename file op and have rename use it.

        * libfs/Makefile.am, libfs/src/dosfs/msdos_rename.c,
        libfs/src/imfs/imfs_rename.c: New files to support the rename file
        op.

        * libfs/src/imfs/imfs.h: Add rename interface.

        * libfs/src/imfs/imfs_init.c: Add rename handler.

        * libfs/src/imfs/miniimfs_init.c: Fix up ops struct.

        * libfs/src/dosfs/msdos.h: Add msdos_rename and remove
        msdos_file_link.

        * libfs/src/dosfs/msdos_create.c: Remove the link call.

        * libfs/src/dosfs/msdos_eval.c: Fix a path parsing bug.

        * libfs/src/dosfs/msdos_init.c: Add rename handler and clean up
        the struct naming.

        * libfs/src/rfs/rtems-rfs-link.c, libfs/src/rfs/rtems-rfs-link.h:
        Change the link call to allow linking of directories if told to
        and change the unlink to handle unlink directories that are not
        empty so rename can be supported.

        * libfs/src/rfs/rtems-rfs-rtems-dir.c: Fix the link/unlink calls.

        * libfs/src/rfs/rtems-rfs-rtems.c: Add a rename handler. Fix the
        link/unlink calls.

        * libfs/src/dosfs/msdos_dir.c, libfs/src/dosfs/msdos_format.c,
        libfs/src/dosfs/msdos_misc.c, httpd/asp.c,
        libfs/src/nfsclient/src/nfs.c: Work around a newlib warning when
        using the is*() family of calls.
2010-03-04 06:36:51 +00:00
Chris Johns
b3b8add4b4 2010-02-16 Chris Johns <chrisj@rtems.org>
* libcsupport/src/open.c: Tighten the open handler check.

2010-02-16      Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libcsupport/src/rmdir.c, libcsupport/src/unlink.c: Free the
        allocated pathloc.
2010-02-16 01:47:46 +00:00
Joel Sherrill
e00381a574 2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
Coverity Id 28
	* libcsupport/src/termios.c: Set then unconditionally to avoid
	potential paths where it might be used uninitialized. Recommended by
	Eric Norum.
2010-01-19 23:03:24 +00:00
Joel Sherrill
27643e0336 2009-12-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/termios.c, libfs/src/dosfs/msdos_format.c,
	libfs/src/nfsclient/src/nfs.c, libfs/src/pipe/fifo.c,
	libnetworking/lib/rtems_bsdnet_ntp.c, libnetworking/lib/tftpDriver.c,
	libnetworking/rtems/rtems_glue.c, libnetworking/rtems/rtems_select.c:
	Eliminate uses of deprecated rtems_clock_get() and replace with
	properly typed routine.
2009-12-17 20:26:09 +00:00
Glenn Humphrey
dca9a825e4 2009-12-02 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* libcsupport/src/__times.c, libmisc/cpuuse/cpuusagedata.c,
	libmisc/cpuuse/cpuusagereport.c, libmisc/cpuuse/cpuusagereset.c,
	rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c,
	rtems/src/ratemonreportstatistics.c, score/src/threaddispatch.c,
	score/src/threadinitialize.c, score/src/threadtickletimeslice.c:
	Updated copyright line.
2009-12-02 18:22:19 +00:00
Glenn Humphrey
c6f7e060ea 2009-12-02 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* configure.ac, libcsupport/src/__times.c,
	libmisc/cpuuse/cpuusagedata.c, libmisc/cpuuse/cpuusagereport.c,
	libmisc/cpuuse/cpuusagereset.c, rtems/include/rtems/rtems/ratemon.h,
	rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c,
	rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c,
	rtems/src/ratemonreportstatistics.c,
	score/include/rtems/score/thread.h, score/src/threaddispatch.c,
	score/src/threadinitialize.c, score/src/threadtickletimeslice.c:
	Changed the configuration of statistics granularity to use just one
	define.
2009-12-02 18:15:16 +00:00
Joel Sherrill
1eb97ad840 2009-12-01 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/Makefile.am: Split no_posix.c so using sleep() does not
	pull in kill() stubs.
	* libcsupport/src/kill_noposix.c, libcsupport/src/sleep_noposix.c:
	New files.
	* libcsupport/src/no_posix.c: Removed.
2009-12-01 14:22:58 +00:00
Thomas Doerfler
0b0485ae7f Fixed usage of va_arg(). 2009-12-01 10:12:55 +00:00
Thomas Doerfler
42836e3f85 Obtain output semaphore before drain output during close to prevent an infinite output drain loop 2009-11-30 13:23:58 +00:00
Thomas Doerfler
9224a751b1 Changed base implementation of protected heap allocations to use _Heap_Allocate_aligned_with_boundary(). 2009-11-30 13:06:21 +00:00
Thomas Doerfler
2feeb261d0 Fixed output of unsigned integers.
Changed type of boolean variables to bool.  Use unsigned integer type
for radix and width parameters.
2009-11-30 12:47:44 +00:00
Ralf Corsepius
18daff9b95 Whitespace removal. 2009-11-29 13:35:32 +00:00
Ralf Corsepius
88db141a5d 2009-11-19 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/malloc_boundary.c: Avoid implicit type cast
	(https://www.rtems.org/bugzilla/show_bug.cgi?id=1472#c1).
2009-11-19 13:51:40 +00:00
Joel Sherrill
0c116189aa 2009-11-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h,
	libcsupport/src/rtems_malloc.c: New function rtems_malloc().
2009-11-11 20:36:44 +00:00
Joel Sherrill
eecf752dc3 2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/open_dev_console.c: Use constant numbers to avoid
	overflow when shifting on 16-bit targets.
2009-11-09 15:19:57 +00:00
Ralf Corsepius
4de1c9b731 2009-10-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/no_libc.c: Remove.
	* libcsupport/Makefile.am: Remove no_libc.c.
2009-10-14 16:30:39 +00:00
Ralf Corsepius
f0ae08cf87 2009-10-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/newlibc_reent.c: Eliminate RTEMS_UNIX.
2009-10-14 16:27:54 +00:00
Ralf Corsepius
435cf5a26b 2009-10-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/newlibc_exit.c: Eliminate RTEMS_UNIX.
2009-10-14 16:26:22 +00:00
Ralf Corsepius
9839023a9b 2009-10-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/base_fs.c: Eliminate RTEMS_UNIX.
2009-10-14 16:21:28 +00:00
Ralf Corsepius
c906b1ac9b 2009-10-14 Ralf Corsépius <ralf.corsepius@rtems.org>
* libcsupport/src/stat.c: Eliminate RTEMS_UNIX.
2009-10-14 16:19:47 +00:00