Index: cpukit/libcsupport/src/CASES
===================================================================
--- cpukit/libcsupport/src/CASES	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,19 +1,0 @@
-This is a list of cases to consider when implementing a file system:
-
-
-+ Given a tree of this form:
-
-        a ----- b
-               /
-             c
-
-  Where a and b are directories and c is a link to directory b.  Consider
-  this sequence:
-
-    - rmdir a/b
-    - mknod c/b/x
-    - unlink c
-
-
-
-
Index: cpukit/libcsupport/src/README
===================================================================
--- cpukit/libcsupport/src/README	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ cpukit/libcsupport/src/README	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,2 +1,4 @@
+--
+--  $Id$
 --
 
@@ -11,5 +13,5 @@
 
     When a task is "started" (in RTEMS sense) the reentrancy structure
-    is allocated.
+    is allocated.  Its address is stored in notepad[NOTEPAD_LAST].
 
     When task is switched to, the value of global variable _impure_ptr
Index: cpukit/libcsupport/src/TODO
===================================================================
--- cpukit/libcsupport/src/TODO	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,10 +1,0 @@
-+ newlib 1.8.0 has the wrong prototype for at least read() and write().
-
-+ There should be a "eat it" stub for all system calls which are
-  available to make filling out an operations table easier.  
-  See device_lseek() for an example of where this would be nice.
-
-+ Fix strerror() so it prints all error numbers.
-
-+ Check the node allocation coment in the fchdir call.
-+ Add an interface somewhere for this call.
Index: cpukit/libcsupport/src/__assert.c
===================================================================
--- cpukit/libcsupport/src/__assert.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Evaluate Assertion
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 2007-2013.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/bspIo.h>
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE___ASSERT_FUNC)
-#include <assert.h>
-
-/**
- * Newlib 1.16.0 added this method.  Together these provide an
- * RTEMS safe, low memory implementation.
- */
-void __assert_func(
-  const char *file,
-  int         line,
-  const char *func,
-  const char *failedexpr
-)
-{
-  rtems_assert_context assert_context = {
-    .file = file,
-    .line = line,
-    .function = func,
-    .failed_expression = failedexpr
-  };
-
-  printk("assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
-    failedexpr,
-    file,
-    line,
-    (func) ? ", function: " : "",
-    (func) ? func : ""
-  );
-  rtems_fatal( RTEMS_FATAL_SOURCE_ASSERT, (rtems_fatal_code) &assert_context );
-}
-#endif
Index: cpukit/libcsupport/src/__brk.c
===================================================================
--- cpukit/libcsupport/src/__brk.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/libcsupport/src/__brk.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,40 @@
+/*
+ *  RTEMS "Broken" __brk/__sbrk Implementation
+ *
+ *  NOTE: sbrk is BSP provided.
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+
+#include <signal.h>
+#include <errno.h>
+#include <sys/types.h>
+#ifdef RTEMS_NEWLIB
+#include <reent.h>
+#endif
+#include <unistd.h>
+
+/* we use RTEMS for memory management.  We don't need sbrk */
+
+void * __sbrk(int incr)
+{
+  errno = EINVAL;
+  return (void *)0;
+}
+
+int __brk( const void *endds )
+{
+  errno = EINVAL;
+  return -1;
+}
Index: cpukit/libcsupport/src/__getpid.c
===================================================================
--- cpukit/libcsupport/src/__getpid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get Process Id
- *
- *  @ingroup libcsupport
- */
-
-/*
- * Copyright (C) 1999 Eric Norum <eric@norum.ca>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-/*
- *  Prototype to avoid warning
- */
-pid_t __getpid(void);
-
-/**
- *  Some C Libraries reference this routine since they think getpid is
- *  a real system call.
- */
-pid_t __getpid(void)
-{
-  return getpid();
-}
Index: cpukit/libcsupport/src/__gettod.c
===================================================================
--- cpukit/libcsupport/src/__gettod.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ cpukit/libcsupport/src/__gettod.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,102 +1,84 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
+#if !defined(RTEMS_UNIX)
+/*
+ *  RTEMS gettimeofday Implementation
  *
- *  @brief Get the Date and Time
- *  @ingroup libcsupport
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
  */
 
+#include <rtems.h>
+
+#ifdef RTEMS_NEWLIB
+#include <sys/reent.h>
+#endif
+#include <time.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <assert.h>
+
 /*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ *  NOTE:  The solaris gettimeofday does not have a second parameter.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
+int gettimeofday(
+   struct timeval  *tp,
+   struct timezone *tzp
+)
+{
+  rtems_status_code      status;
+  rtems_clock_time_value time;
+
+  if ( !tp || !tzp ) {
+    errno = EFAULT;
+    return -1;
+  }
+
+  /* "POSIX" does not seem to allow for not having a TOD */
+  status = rtems_clock_get( RTEMS_CLOCK_GET_TIME_VALUE, &time );
+  if ( status != RTEMS_SUCCESSFUL ) {
+    assert( 0 );
+    return -1;
+  }
+
+  tp->tv_sec  = time.seconds;
+  tp->tv_usec = time.microseconds;
+
+#if 0
+  tzp->minuteswest = timezone / 60; /* from seconds to minutes */
+  tzp->dsttime = daylight;
 #endif
 
-#if defined(RTEMS_NEWLIB)
+  /*
+   * newlib does not have timezone and daylight savings time
+   * yet.  When it does this needs to be fixed.
+   */
+
+  tzp->tz_minuteswest = 0;  /* at UTC */
+  tzp->tz_dsttime = 0;      /* no daylight savings */
+  return 0;
+}
+
 /*
- *  Needed to get the prototype for the newlib helper method
+ *  "Reentrant" versions of the above routines implemented above.
  */
-#define _LIBC
 
-#include <sys/time.h>
-#include <reent.h>
-#include <errno.h>
-#include <rtems/score/todimpl.h>
-#include <rtems/seterr.h>
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_GETTIMEOFDAY)
-
-/** 
- *  SVR4 and BSD4.3 extension required by Newlib
- * 
- *  @note The solaris gettimeofday does not have a second parameter.
- */
-int gettimeofday(
-  struct timeval *__restrict tp,
-  void *__restrict __tz RTEMS_UNUSED
+#if 0
+int _gettimeofday_r(
+   struct _reent   *ignored_reentrancy_stuff,
+   struct timeval  *tp,
+   struct timezone *tzp
 )
 {
-  /* struct timezone* tzp = (struct timezone*) __tz; */
-  if ( !tp )
-    rtems_set_errno_and_return_minus_one( EFAULT );
-
-  /*
-   *  POSIX does not seem to allow for not having a TOD so we just
-   *  grab the time of day.
-   */
-  _TOD_Get_timeval( tp );
-
-  /*
-   *  Timezone information ignored by the OS proper.   Per email
-   *  with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X
-   *  do it.  This puts us in good company.
-   */
-
-  return 0;
-}
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__GETTIMEOFDAY_R)
-
-#include <sys/reent.h>
-
-/**
- *  "Reentrant" version
- */
-int _gettimeofday_r(
-  struct _reent   *ignored_reentrancy_stuff RTEMS_UNUSED,
-  struct timeval  *tp,
-  void           *__tz
-)
-{
-  struct timezone *tzp = __tz;
   return gettimeofday( tp, tzp );
 }
 #endif
 
-#endif /* defined(RTEMS_NEWLIB) */
+#endif
Index: cpukit/libcsupport/src/__times.c
===================================================================
--- cpukit/libcsupport/src/__times.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ cpukit/libcsupport/src/__times.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,98 +1,60 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
+/*
+ *  RTEMS _times Implementation
  *
- *  @brief Get Process Times
- *  @ingroup libcsupport
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
  */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/*
- *  Needed to get the prototype for this libc helper method
- */
-#define _LIBC
 
 #include <rtems.h>
 
 #include <sys/times.h>
+#include <time.h>
 #include <sys/time.h>
+#include <errno.h>
+#include <assert.h>
 
-#include <string.h>
-#include <time.h>
-
-#include <rtems/seterr.h>
-#include <rtems/score/todimpl.h>
-#include <rtems/score/timestamp.h>
-#include <rtems/score/threadimpl.h>
-
-/**
- *  POSIX 1003.1b 4.5.2 - Get Process Times
- */
 clock_t _times(
    struct tms  *ptms
 )
 {
-  uint32_t   tick_interval;
-  sbintime_t uptime;
-  sbintime_t cpu_time_used;
+  rtems_status_code      status;
+  rtems_interval         ticks_since_boot;
 
-  if ( !ptms )
-    rtems_set_errno_and_return_minus_one( EFAULT );
+  if ( !ptms ) {
+    errno = EFAULT;
+    return -1;
+  }
 
-  tick_interval = (uint32_t)
-    (SBT_1US * rtems_configuration_get_microseconds_per_tick());
-
-  ptms = memset( ptms, 0, sizeof( *ptms ) );
-
-  _TOD_Get_zero_based_uptime( &uptime );
-  ptms->tms_stime = ((clock_t) uptime) / tick_interval;
+  /* "POSIX" does not seem to allow for not having a TOD */
+  status = rtems_clock_get(
+    RTEMS_CLOCK_GET_TICKS_SINCE_BOOT,
+    &ticks_since_boot
+  );
+  if ( status != RTEMS_SUCCESSFUL ) {
+    assert( 0 );
+    return -1;
+  }
 
   /*
-   *  RTEMS technically has no notion of system versus user time
-   *  since there is no separation of OS from application tasks.
-   *  But we can at least make a distinction between the number
-   *  of ticks since boot and the number of ticks executed by this
-   *  this thread.
+   *  RTEMS has no notion of system versus user time and does
+   *  not (as of 3.2.0) keep track of CPU usage on a per task basis.
    */
-  cpu_time_used =
-    _Thread_Get_CPU_time_used_after_last_reset( _Thread_Get_executing() );
-  ptms->tms_utime = ((clock_t) cpu_time_used) / tick_interval;
 
-  return ptms->tms_stime;
+  ptms->tms_utime  = ticks_since_boot;
+  ptms->tms_stime  = 0;
+  ptms->tms_cutime = 0;
+  ptms->tms_cstime = 0;
+
+  return 0;
 }
 
-/**
- *  times() system call wrapper for _times() above.
- */
 clock_t times(
    struct tms  *ptms
@@ -102,17 +64,2 @@
 }
 
-#if defined(RTEMS_NEWLIB)
-
-#include <reent.h>
-
-/**
- *  This is the Newlib dependent reentrant version of times().
- */
-clock_t _times_r(
-   struct _reent *ptr RTEMS_UNUSED,
-   struct tms  *ptms
-)
-{
-  return _times( ptms );
-}
-#endif
Index: cpukit/libcsupport/src/__usrenv.c
===================================================================
--- cpukit/libcsupport/src/__usrenv.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,281 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS File System Location Support
- *  @ingroup LibIOInternal
- */
-
-/*
- * COPYRIGHT (C) 2021 On-Line Applications Research Corporation (OAR).
- *
- * Modifications to support reference counting in the file system are
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-
-#include <rtems/libio_.h>
-#include <rtems/score/percpu.h>
-#include <rtems/score/thread.h>
-
-static int null_handler_open(
-  rtems_libio_t *iop,
-  const char *path,
-  int oflag,
-  mode_t mode
-)
-{
-  return -1;
-}
-
-static int null_handler_fstat(
-  const rtems_filesystem_location_info_t *pathloc,
-  struct stat *buf
-)
-{
-  return -1;
-}
-
-const rtems_filesystem_file_handlers_r rtems_filesystem_null_handlers = {
-  .open_h = null_handler_open,
-  .close_h = rtems_filesystem_default_close,
-  .read_h = rtems_filesystem_default_read,
-  .write_h = rtems_filesystem_default_write,
-  .ioctl_h = rtems_filesystem_default_ioctl,
-  .lseek_h = rtems_filesystem_default_lseek,
-  .fstat_h = null_handler_fstat,
-  .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
-  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
-  .fcntl_h = rtems_filesystem_default_fcntl,
-  .kqfilter_h = rtems_filesystem_default_kqfilter,
-  .mmap_h = rtems_filesystem_default_mmap,
-  .poll_h = rtems_filesystem_default_poll,
-  .readv_h = rtems_filesystem_default_readv,
-  .writev_h = rtems_filesystem_default_writev
-};
-
-static void null_op_lock_or_unlock(
-  const rtems_filesystem_mount_table_entry_t *mt_entry
-)
-{
-  /* Do nothing */
-}
-
-static int null_op_mknod(
-  const rtems_filesystem_location_info_t *parentloc,
-  const char *name,
-  size_t namelen,
-  mode_t mode,
-  dev_t dev
-)
-{
-  return -1;
-}
-
-static int null_op_rmnod(
-  const rtems_filesystem_location_info_t *parentloc,
-  const rtems_filesystem_location_info_t *loc
-)
-{
-  return -1;
-}
-
-static int null_op_link(
-  const rtems_filesystem_location_info_t *parentloc,
-  const rtems_filesystem_location_info_t *targetloc,
-  const char *name,
-  size_t namelen
-)
-{
-  return -1;
-}
-
-static int null_op_fchmod(
-  const rtems_filesystem_location_info_t *pathloc,
-  mode_t mode
-)
-{
-  return -1;
-}
-
-static int null_op_chown(
-  const rtems_filesystem_location_info_t *loc,
-  uid_t owner,
-  gid_t group
-)
-{
-  return -1;
-}
-
-static int null_op_clonenode(
-  rtems_filesystem_location_info_t *loc
-)
-{
-  return -1;
-}
-
-static int null_op_mount(
-  rtems_filesystem_mount_table_entry_t *mt_entry
-)
-{
-  return -1;
-}
-
-static int null_op_unmount(
-  rtems_filesystem_mount_table_entry_t *mt_entry
-)
-{
-  return -1;
-}
-
-static void null_op_fsunmount_me(
-  rtems_filesystem_mount_table_entry_t *mt_entry
-)
-{
-  /* Do nothing */
-}
-
-static int null_op_utimens(
-  const rtems_filesystem_location_info_t *loc,
-  struct timespec times[2]
-)
-{
-  return -1;
-}
-
-static int null_op_symlink(
-  const rtems_filesystem_location_info_t *parentloc,
-  const char *name,
-  size_t namelen,
-  const char *target
-)
-{
-  return -1;
-}
-
-static ssize_t null_op_readlink(
-  const rtems_filesystem_location_info_t *loc,
-  char *buf,
-  size_t bufsize
-)
-{
-  return -1;
-}
-
-static int null_op_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
-)
-{
-  return -1;
-}
-
-static int null_op_statvfs(
-  const rtems_filesystem_location_info_t *__restrict loc,
-  struct statvfs *__restrict buf
-)
-{
-  return -1;
-}
-
-static const rtems_filesystem_operations_table null_ops = {
-  .lock_h = null_op_lock_or_unlock,
-  .unlock_h = null_op_lock_or_unlock,
-  .eval_path_h = rtems_filesystem_default_eval_path,
-  .link_h = null_op_link,
-  .are_nodes_equal_h = rtems_filesystem_default_are_nodes_equal,
-  .mknod_h = null_op_mknod,
-  .rmnod_h = null_op_rmnod,
-  .fchmod_h = null_op_fchmod,
-  .chown_h = null_op_chown,
-  .clonenod_h = null_op_clonenode,
-  .freenod_h = rtems_filesystem_default_freenode,
-  .mount_h = null_op_mount,
-  .unmount_h = null_op_unmount,
-  .fsunmount_me_h = null_op_fsunmount_me,
-  .utimens_h = null_op_utimens,
-  .symlink_h = null_op_symlink,
-  .readlink_h = null_op_readlink,
-  .rename_h = null_op_rename,
-  .statvfs_h = null_op_statvfs
-};
-
-rtems_filesystem_mount_table_entry_t rtems_filesystem_null_mt_entry = {
-  .location_chain = RTEMS_CHAIN_INITIALIZER_ONE_NODE(
-    &rtems_filesystem_global_location_null.location.mt_entry_node
-  ),
-  .ops = &null_ops,
-  .mt_point_node = &rtems_filesystem_global_location_null,
-  .mt_fs_root = &rtems_filesystem_global_location_null,
-  .mounted = false,
-  .writeable = false,
-  .type = ""
-};
-
-rtems_filesystem_global_location_t rtems_filesystem_global_location_null = {
-  .location = {
-    .mt_entry_node = RTEMS_CHAIN_NODE_INITIALIZER_ONE_NODE_CHAIN(
-      &rtems_filesystem_null_mt_entry.location_chain
-    ),
-    .handlers = &rtems_filesystem_null_handlers,
-    .mt_entry = &rtems_filesystem_null_mt_entry
-  },
-
-  /*
-   * The initial reference count accounts for the following references
-   *  o the root directory of the user environment,
-   *  o the current directory of the user environment,
-   *  o the root node of the null file system instance, and
-   *  o the mount point node of the null file system instance.
-   */
-  .reference_count = 4
-};
-
-rtems_user_env_t rtems_global_user_env = {
-  .current_directory = &rtems_filesystem_global_location_null,
-  .root_directory = &rtems_filesystem_global_location_null,
-  .umask = S_IWGRP | S_IWOTH
-};
-
-rtems_user_env_t *rtems_current_user_env_get(void)
-{
-  Thread_Control *executing = _Thread_Get_executing();
-  rtems_user_env_t *env = executing->user_environment;
-
-  if (env == NULL) {
-    return &rtems_global_user_env;
-  }
-
-  return env;
-}
Index: cpukit/libcsupport/src/_calloc_r.c
===================================================================
--- cpukit/libcsupport/src/_calloc_r.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Allocate Space for Array in Memory
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__CALLOC_R)
-#include <sys/reent.h>
-#include <stdlib.h>
-
-void *_calloc_r(
-  struct _reent *ignored,
-  size_t         elements,
-  size_t         size
-)
-{
-  (void) ignored;
-  return calloc( elements, size );
-}
-#endif
Index: cpukit/libcsupport/src/_free_r.c
===================================================================
--- cpukit/libcsupport/src/_free_r.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Allocate and Free Dynamic Memory 
- *  @ingroup libcsupport
- */
-
-/* 
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__FREE_R)
-#include <sys/reent.h>
-#include <stdlib.h>
-
-void _free_r(
-  struct _reent *ignored,
-  void          *ptr
-)
-{
-  (void) ignored;
-  free( ptr );
-}
-#endif
Index: cpukit/libcsupport/src/_malloc_r.c
===================================================================
--- cpukit/libcsupport/src/_malloc_r.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  _malloc_r Implementation
- *
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__MALLOC_R)
-#include <sys/reent.h>
-#include <stdlib.h>
-
-void *_malloc_r(
-  struct _reent *ignored,
-  size_t         size
-)
-{
-  (void) ignored;
-  return malloc( size );
-}
-#endif
Index: cpukit/libcsupport/src/_realloc_r.c
===================================================================
--- cpukit/libcsupport/src/_realloc_r.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief  _realloc_r Implementation
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__REALLOC_R)
-#include <sys/reent.h>
-#include <stdlib.h>
-
-void *_realloc_r(
-  struct _reent *ignored,
-  void          *ptr,
-  size_t         size
-)
-{
-  (void) ignored;
-  return realloc( ptr, size );
-}
-#endif
Index: cpukit/libcsupport/src/_rename_r.c
===================================================================
--- cpukit/libcsupport/src/_rename_r.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,101 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Rename a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Modifications to support reference counting in the file system are
- *  Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__RENAME_R)
-
-#include <stdio.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  POSIX 1003.1b - 5.3.4 - Rename a file
- */
-int _rename_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  const char    *old,
-  const char    *new
-)
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t old_ctx;
-  int old_eval_flags = 0;
-  rtems_filesystem_location_info_t old_parentloc;
-  int old_parent_eval_flags = RTEMS_FS_PERMS_WRITE
-    | RTEMS_FS_FOLLOW_HARD_LINK;
-  const rtems_filesystem_location_info_t *old_currentloc =
-    rtems_filesystem_eval_path_start_with_parent(
-      &old_ctx,
-      old,
-      old_eval_flags,
-      &old_parentloc,
-      old_parent_eval_flags
-    );
-  rtems_filesystem_eval_path_context_t new_ctx;
-
-  /* FIXME: This is not POSIX conform */
-  int new_eval_flags = RTEMS_FS_FOLLOW_HARD_LINK
-    | RTEMS_FS_MAKE
-    | RTEMS_FS_EXCLUSIVE;
-
-  const rtems_filesystem_location_info_t *new_currentloc =
-    rtems_filesystem_eval_path_start( &new_ctx, new, new_eval_flags );
-
-  rv = rtems_filesystem_location_exists_in_same_instance_as(
-    old_currentloc,
-    new_currentloc
-  );
-  if ( rv == 0 ) {
-    rv = (*new_currentloc->mt_entry->ops->rename_h)(
-      &old_parentloc,
-      old_currentloc,
-      new_currentloc,
-      rtems_filesystem_eval_path_get_token( &new_ctx ),
-      rtems_filesystem_eval_path_get_tokenlen( &new_ctx )
-    );
-  }
-
-  rtems_filesystem_eval_path_cleanup_with_parent( &old_ctx, &old_parentloc );
-  rtems_filesystem_eval_path_cleanup( &new_ctx );
-
-  return rv;
-}
-#endif
Index: cpukit/libcsupport/src/access.c
===================================================================
--- cpukit/libcsupport/src/access.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief access() - POSIX 1003.1b 5.6.3 - File Accessibility
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-int access(
-  const char *path,
-  int         amode
-)
-{
-  struct stat statbuf;
-
-  if ( stat(path, &statbuf) )
-    return -1;
-
-  if ( amode & R_OK ) {
-    if (!( statbuf.st_mode & S_IREAD ))
-      return -1;
-  }
-
-  if ( amode & W_OK ) {
-    if ( !( statbuf.st_mode & S_IWRITE ) )
-      return -1;
-  }
-
-  if ( amode & X_OK ) {
-    if ( !( statbuf.st_mode & S_IEXEC ) )
-      return -1;
-  }
-
-  return 0;
-}
Index: cpukit/libcsupport/src/alignedalloc.c
===================================================================
--- cpukit/libcsupport/src/alignedalloc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-
-#include <rtems/malloc.h>
-
-void *aligned_alloc( size_t alignment, size_t size )
-{
-  if ( size == 0 ) {
-    return NULL;
-  }
-
-  return rtems_heap_allocate_aligned_with_boundary( size, alignment, 0 );
-}
-
-void *memalign( size_t, size_t ) RTEMS_ALIAS( aligned_alloc ) __malloc_like
-  __alloc_align(1) __alloc_size(2) __result_use_check
-  __attribute__((__nothrow__));
Index: cpukit/libcsupport/src/arc4random_getentropy_fail.c
===================================================================
--- cpukit/libcsupport/src/arc4random_getentropy_fail.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2017 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/_arc4random.h>
-#include <rtems/score/interr.h>
-
-void _arc4random_getentropy_fail( void )
-{
-  _Internal_error( INTERNAL_ERROR_ARC4RANDOM_GETENTROPY_FAIL );
-}
Index: cpukit/libcsupport/src/assoc32tostring.c
===================================================================
--- cpukit/libcsupport/src/assoc32tostring.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/assoc.h>
-
-#include <stdbool.h>
-#include <string.h>
-
-static size_t space( size_t buffer_size, size_t len )
-{
-  if ( len < buffer_size ) {
-    return buffer_size - len;
-  } else {
-    return 0;
-  }
-}
-
-size_t rtems_assoc_32_to_string(
-  uint32_t                   value,
-  char                      *buffer,
-  size_t                     buffer_size,
-  const rtems_assoc_32_pair *pairs,
-  size_t                     pair_count,
-  const char                *separator,
-  const char                *fallback
-)
-{
-  size_t len;
-  size_t i;
-
-  len = 0;
-
-  for ( i = 0; i < pair_count ; ++i ) {
-    const rtems_assoc_32_pair *p;
-
-    p = &pairs[ i ];
-
-    if ( ( value & p->bits ) != 0 ) {
-      if ( len > 0 ) {
-        len += strlcpy( &buffer[ len ], separator, space( buffer_size, len ) );
-      }
-
-      len += strlcpy( &buffer[ len ], p->name, space( buffer_size, len ) );
-    }
-  }
-
-  if ( len == 0 ) {
-    len += strlcpy( buffer, fallback, buffer_size );
-  }
-
-  return len;
-}
Index: cpukit/libcsupport/src/assoclocalbyname.c
===================================================================
--- cpukit/libcsupport/src/assoclocalbyname.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup Associativity Routines
- *
- * @brief RTEMS Associate Local by Name
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-uint32_t rtems_assoc_local_by_name(
-  const rtems_assoc_t *ap,
-  const char          *name
-)
-{
-  const rtems_assoc_t *nap;
-
-  nap = rtems_assoc_ptr_by_name(ap, name);
-  if (nap)
-    return nap->local_value;
-
-  return 0;
-}
Index: cpukit/libcsupport/src/assoclocalbyremote.c
===================================================================
--- cpukit/libcsupport/src/assoclocalbyremote.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Local by Remote
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-uint32_t rtems_assoc_local_by_remote(
-  const rtems_assoc_t *ap,
-  uint32_t             remote_value
-)
-{
-  const rtems_assoc_t *nap;
-
-  nap = rtems_assoc_ptr_by_remote(ap, remote_value);
-  if (nap)
-    return nap->local_value;
-
-  return 0;
-}
Index: cpukit/libcsupport/src/assoclocalbyremotebitfield.c
===================================================================
--- cpukit/libcsupport/src/assoclocalbyremotebitfield.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Local by Remote Bitfield
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-
-uint32_t   rtems_assoc_local_by_remote_bitfield(
-    const rtems_assoc_t *ap,
-    uint32_t       remote_value
-)
-{
-  uint32_t   b;
-  uint32_t   local_value = 0;
-
-  for (b = 1; b; b <<= 1) {
-    if (b & remote_value)
-      local_value |= rtems_assoc_local_by_remote(ap, b);
-  }
-
-  return local_value;
-}
Index: cpukit/libcsupport/src/assocnamebad.c
===================================================================
--- cpukit/libcsupport/src/assocnamebad.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Bad Name
- *
- *  @ingroup SET
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <inttypes.h>
-#include <stdio.h>              /* sprintf */
-
-const char *
-rtems_assoc_name_bad(
-#ifdef RTEMS_DEBUG
-    uint32_t   bad_value
-#else
-    uint32_t   bad_value RTEMS_UNUSED
-#endif
-)
-{
-#ifdef RTEMS_DEBUG
-    static char bad_buffer[32];
-
-    sprintf(bad_buffer, "< %" PRId32 "[0x%" PRIx32 " ] >", bad_value, bad_value);
-#else
-    static char bad_buffer[40] = "<assocnamebad.c: : BAD NAME>";
-#endif
-    return bad_buffer;
-}
Index: cpukit/libcsupport/src/assocnamebylocal.c
===================================================================
--- cpukit/libcsupport/src/assocnamebylocal.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Name by Local
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-const char *rtems_assoc_name_by_local(
-  const rtems_assoc_t *ap,
-  uint32_t             local_value
-)
-{
-  const rtems_assoc_t *nap;
-
-  nap = rtems_assoc_ptr_by_local(ap, local_value);
-  if (nap)
-    return nap->name;
-
-  return rtems_assoc_name_bad(local_value);
-}
Index: cpukit/libcsupport/src/assocnamebylocalbitfield.c
===================================================================
--- cpukit/libcsupport/src/assocnamebylocalbitfield.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Name by Local Bitfield
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-char *rtems_assoc_name_by_local_bitfield(
-  const rtems_assoc_t *ap,
-  uint32_t             value,
-  char                *buffer
-)
-{
-  uint32_t   b;
-
-  *buffer = 0;
-
-  for (b = 1; b; b <<= 1) {
-    if (b & value) {
-      if (*buffer)
-        strcat(buffer, " ");
-      strcat(buffer, rtems_assoc_name_by_local(ap, b));
-    }
-  }
-
-  return buffer;
-}
Index: cpukit/libcsupport/src/assocnamebyremote.c
===================================================================
--- cpukit/libcsupport/src/assocnamebyremote.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Name by Remote
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-
-const char *rtems_assoc_name_by_remote(
-  const rtems_assoc_t *ap,
-  uint32_t             remote_value
-)
-{
-  const rtems_assoc_t *nap;
-  nap = rtems_assoc_ptr_by_remote(ap, remote_value);
-
-  if (nap)
-    return nap->name;
-
-  return rtems_assoc_name_bad(remote_value);
-}
Index: cpukit/libcsupport/src/assocnamebyremotebitfield.c
===================================================================
--- cpukit/libcsupport/src/assocnamebyremotebitfield.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Name by Remote Bitfield
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-
-char *rtems_assoc_name_by_remote_bitfield(
-  const rtems_assoc_t *ap,
-  uint32_t             value,
-  char                *buffer
-)
-{
-  uint32_t   b;
-
-  *buffer = 0;
-
-  for (b = 1; b; b <<= 1) {
-    if (b & value) {
-      if (*buffer)
-	strcat(buffer, " ");
-      strcat(buffer, rtems_assoc_name_by_remote(ap, b));
-    }
-  }
-
-  return buffer;
-}
Index: cpukit/libcsupport/src/assocptrbylocal.c
===================================================================
--- cpukit/libcsupport/src/assocptrbylocal.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Pointer by Local
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-const rtems_assoc_t *rtems_assoc_ptr_by_local(
-  const rtems_assoc_t *ap,
-  uint32_t             local_value
-)
-{
-  const rtems_assoc_t *default_ap = 0;
-
-  if (rtems_assoc_is_default(ap))
-    default_ap = ap++;
-
-  for ( ; ap->name; ap++)
-    if (ap->local_value == local_value)
-      return ap;
-
-  return default_ap;
-}
Index: cpukit/libcsupport/src/assocptrbyname.c
===================================================================
--- cpukit/libcsupport/src/assocptrbyname.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Pointer by Name
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-
-const rtems_assoc_t *rtems_assoc_ptr_by_name(
-  const rtems_assoc_t *ap,
-  const char          *name
-)
-{
-  const rtems_assoc_t *default_ap = 0;
-
-  if (rtems_assoc_is_default(ap))
-    default_ap = ap++;
-
-  for ( ; ap->name; ap++)
-    if (strcmp(ap->name, name) == 0)
-	return ap;
-
-  return default_ap;
-}
Index: cpukit/libcsupport/src/assocptrbyremote.c
===================================================================
--- cpukit/libcsupport/src/assocptrbyremote.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Pointer by Remote
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-const rtems_assoc_t *rtems_assoc_ptr_by_remote(
-  const rtems_assoc_t *ap,
-  uint32_t       remote_value
-)
-{
-  const rtems_assoc_t *default_ap = 0;
-
-  if (rtems_assoc_is_default(ap))
-    default_ap = ap++;
-
-  for ( ; ap->name; ap++)
-    if (ap->remote_value == remote_value)
-      return ap;
-
-  return default_ap;
-}
Index: cpukit/libcsupport/src/assocremotebylocal.c
===================================================================
--- cpukit/libcsupport/src/assocremotebylocal.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Remote by Local
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-uint32_t rtems_assoc_remote_by_local(
-  const rtems_assoc_t *ap,
-  uint32_t       local_value
-)
-{
-  const rtems_assoc_t *nap;
-
-  nap = rtems_assoc_ptr_by_local(ap, local_value);
-  if (nap)
-    return nap->remote_value;
-
-  return 0;
-}
Index: cpukit/libcsupport/src/assocremotebylocalbitfield.c
===================================================================
--- cpukit/libcsupport/src/assocremotebylocalbitfield.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup Associativity Routines
- *
- * @brief RTEMS Assoc Routines
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-
-uint32_t   rtems_assoc_remote_by_local_bitfield(
-    const rtems_assoc_t *ap,
-    uint32_t             local_value
-)
-{
-  uint32_t   b;
-  uint32_t   remote_value = 0;
-
-  for (b = 1; b; b <<= 1)
-    if (b & local_value)
-      remote_value |= rtems_assoc_remote_by_local(ap, b);
-
-  return remote_value;
-}
Index: cpukit/libcsupport/src/assocremotebyname.c
===================================================================
--- cpukit/libcsupport/src/assocremotebyname.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Associate Remote by Name
- *
- *  @ingroup Associativity
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define INSIDE_ASSOC
-
-#include <rtems.h>
-#include <rtems/assoc.h>
-
-#include <string.h>             /* strcat, strcmp */
-
-uint32_t rtems_assoc_remote_by_name(
-  const rtems_assoc_t *ap,
-  const char          *name
-)
-{
-  const rtems_assoc_t *nap;
-
-  nap = rtems_assoc_ptr_by_name(ap, name);
-  if (nap)
-    return nap->remote_value;
-
-  return 0;
-}
Index: cpukit/libcsupport/src/assocthreadstatestostring.c
===================================================================
--- cpukit/libcsupport/src/assocthreadstatestostring.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/assoc.h>
-#include <rtems/score/statesimpl.h>
-
-static const rtems_assoc_32_pair state_pairs[] = {
-  { STATES_WAITING_FOR_MUTEX,              "MTX" },
-  { STATES_WAITING_FOR_SEMAPHORE,          "SEM" },
-  { STATES_WAITING_FOR_EVENT,              "EV" },
-  { STATES_WAITING_FOR_SYSTEM_EVENT,       "SYSEV" },
-  { STATES_WAITING_FOR_MESSAGE,            "MSG" },
-  { STATES_WAITING_FOR_CONDITION_VARIABLE, "CV" },
-  { STATES_WAITING_FOR_FUTEX,              "FTX" },
-  { STATES_WAITING_FOR_BSD_WAKEUP,         "WK" },
-  { STATES_WAITING_FOR_TIME,               "TIME" },
-  { STATES_WAITING_FOR_PERIOD,             "PER" },
-  { STATES_WAITING_FOR_SIGNAL,             "SIG" },
-  { STATES_WAITING_FOR_BARRIER,            "BAR" },
-  { STATES_WAITING_FOR_RWLOCK,             "RW" },
-  { STATES_WAITING_FOR_JOIN_AT_EXIT,       "JATX" },
-  { STATES_WAITING_FOR_JOIN,               "JOIN" },
-  { STATES_SUSPENDED,                      "SUSP" },
-  { STATES_WAITING_FOR_SEGMENT,            "SEG" },
-  { STATES_LIFE_IS_CHANGING,               "LIFE" },
-  { STATES_DEBUGGER,                       "DBG" },
-  { STATES_INTERRUPTIBLE_BY_SIGNAL,        "IS" },
-  { STATES_WAITING_FOR_RPC_REPLY,          "RPC" },
-  { STATES_ZOMBIE,                         "ZOMBI" },
-  { STATES_DORMANT,                        "DORM" }
-};
-
-size_t rtems_assoc_thread_states_to_string(
-  uint32_t  states,
-  char     *buffer,
-  size_t    buffer_size
-)
-{
-  return rtems_assoc_32_to_string(
-    states,
-    buffer,
-    buffer_size,
-    state_pairs,
-    RTEMS_ARRAY_SIZE( state_pairs ),
-    ":",
-    "READY"
-  );
-}
Index: cpukit/libcsupport/src/base_fs.c
===================================================================
--- cpukit/libcsupport/src/base_fs.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Base File System Initialization
- *  @ingroup LibIO
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Modifications to support reference counting in the file system are
- *  Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/libio_.h>
-
-/*
- *  Default mode for created files.
- */
-
-void rtems_filesystem_initialize( void )
-{
-  int rv = 0;
-  const rtems_filesystem_mount_configuration *root_config =
-    &rtems_filesystem_root_configuration;
-
-  rv = mount(
-    root_config->source,
-    root_config->target,
-    root_config->filesystemtype,
-    root_config->options,
-    root_config->data
-  );
-  if ( rv != 0 )
-    rtems_fatal_error_occurred( 0xABCD0002 );
-
-  /*
-   *  Traditionally RTEMS devices are under "/dev" so install this directory.
-   *
-   *  If the mkdir() fails, we can't print anything so just fatal error.
-   */
-
-  rv = mkdir( "/dev", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH );
-  if ( rv != 0 )
-    rtems_fatal_error_occurred( 0xABCD0003 );
-
-  /*
-   *  You can't mount another filesystem properly until the mount point
-   *  it will be mounted onto is created.  Moreover, if it is going to
-   *  use a device, then it is REALLY unfair to attempt this
-   *  before device drivers are initialized.  So we return via a base
-   *  filesystem image and nothing auto-mounted at this point.
-   */
-}
Index: cpukit/libcsupport/src/cachealignedalloc.c
===================================================================
--- cpukit/libcsupport/src/cachealignedalloc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- * @brief RTEMS Cache Aligned Malloc
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <rtems.h>
-#include <rtems/malloc.h>
-
-void *rtems_cache_aligned_malloc( size_t nbytes )
-{
-  size_t line_size = rtems_cache_get_maximal_line_size();
-
-  if ( line_size > 0 ) {
-    /* Assume that the cache line size is a power of two */
-    size_t m = line_size - 1;
-
-    nbytes = (nbytes + m) & ~m;
-  }
-
-  return rtems_heap_allocate_aligned_with_boundary( nbytes, line_size, 0 );
-}
Index: cpukit/libcsupport/src/cachecoherentalloc.c
===================================================================
--- cpukit/libcsupport/src/cachecoherentalloc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,141 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup ClassicCache
- */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/malloc.h>
-#include <rtems/score/apimutex.h>
-#include <rtems/score/heapimpl.h>
-#include <rtems/score/sysstate.h>
-
-static Heap_Control cache_coherent_heap_instance;
-
-static Heap_Control *cache_coherent_heap;
-
-void *rtems_cache_coherent_allocate(
-  size_t size,
-  uintptr_t alignment,
-  uintptr_t boundary
-)
-{
-  void *ptr;
-  Heap_Control *heap;
-
-  _RTEMS_Lock_allocator();
-
-  heap = cache_coherent_heap;
-  if ( heap == NULL ) {
-    heap = RTEMS_Malloc_Heap;
-  }
-
-  ptr = _Heap_Allocate_aligned_with_boundary(
-    heap,
-    size,
-    alignment,
-    boundary
-  );
-
-  _RTEMS_Unlock_allocator();
-
-  return ptr;
-}
-
-void rtems_cache_coherent_free( void *ptr )
-{
-  Heap_Control *heap;
-
-  _RTEMS_Lock_allocator();
-
-  heap = cache_coherent_heap;
-  if ( heap != NULL ) {
-    if ( _Heap_Free( heap, ptr ) ) {
-      heap = NULL;
-    } else {
-      heap = RTEMS_Malloc_Heap;
-    }
-  } else {
-    heap = RTEMS_Malloc_Heap;
-  }
-
-  if ( heap != NULL ) {
-    _Heap_Free( heap, ptr );
-  }
-
-  _RTEMS_Unlock_allocator();
-}
-
-static rtems_status_code add_area(
-  void *area_begin,
-  uintptr_t area_size
-)
-{
-  Heap_Control *heap = cache_coherent_heap;
-
-  if ( heap == NULL ) {
-    heap = &cache_coherent_heap_instance;
-
-    if ( _Heap_Initialize( heap, area_begin, area_size, 0 ) == 0 ) {
-      return RTEMS_UNSATISFIED;
-    }
-    cache_coherent_heap = heap;
-  } else {
-    if (_Heap_Extend( heap, area_begin, area_size, 0 ) == 0) {
-      return RTEMS_UNSATISFIED;
-    }
-  }
-  return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code rtems_cache_coherent_add_area(
-  void *area_begin,
-  uintptr_t area_size
-)
-{
-  rtems_status_code sc;
-  bool needs_locking = _System_state_Is_up( _System_state_Get());
-
-  if ( needs_locking ) {
-    _RTEMS_Lock_allocator();
-  }
-
-  sc = add_area( area_begin, area_size );
-
-  if ( needs_locking ) {
-    _RTEMS_Unlock_allocator();
-  }
-
-  return sc;
-}
Index: cpukit/libcsupport/src/calloc.c
===================================================================
--- cpukit/libcsupport/src/calloc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Allocate Space for Array in Memory
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_CALLOC)
-#include <stdlib.h>
-
-#include <errno.h>
-#include <string.h>
-
-#include <rtems/score/basedefs.h>
-
-void *calloc(
-  size_t nelem,
-  size_t elsize
-)
-{
-  void   *cptr;
-  size_t  length;
-
-  if ( nelem == 0 ) {
-    return NULL;
-  }
-
-  if ( elsize > SIZE_MAX / nelem ) {
-    errno = ENOMEM;
-    return NULL;
-  }
-
-  length = nelem * elsize;
-  cptr = malloc( length );
-  RTEMS_OBFUSCATE_VARIABLE( cptr );
-  if ( RTEMS_PREDICT_FALSE( cptr == NULL ) ) {
-    return cptr;
-  }
-
-  return memset( cptr, 0, length );
-}
-#endif
Index: cpukit/libcsupport/src/cfgetispeed.c
===================================================================
--- cpukit/libcsupport/src/cfgetispeed.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Baud Rate Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-speed_t cfgetispeed(
-  const struct termios *tp
-)
-{
-  return tp->c_ispeed;
-}
-#endif
Index: cpukit/libcsupport/src/cfgetospeed.c
===================================================================
--- cpukit/libcsupport/src/cfgetospeed.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Baud Rate Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-/**
- *  POSIX 1003.1b 7.1.3 - Baud Rate Functions
- */
-speed_t cfgetospeed(
-  const struct termios *tp
-)
-{
-  return tp->c_ospeed;
-}
-#endif
Index: cpukit/libcsupport/src/cfmakeraw.c
===================================================================
--- cpukit/libcsupport/src/cfmakeraw.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*  @file
- *
- *  @brief Baud Rate Functions
- *  @ingroup Termios
- */
-
-/*
- * Copyright (c) 1989, 1993
- *  The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-
-/*
- * Make a pre-existing termios structure into "raw" mode: character-at-a-time
- * mode with no characters interpreted, 8-bit data path.
- */
-void
-cfmakeraw(
-  struct termios *tp
-)
-{
-  tp->c_iflag &= ~(IMAXBEL|IXOFF|INPCK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IGNPAR);
-  tp->c_iflag |= IGNBRK;
-  tp->c_oflag &= ~OPOST;
-  tp->c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|ICANON|ISIG|IEXTEN|NOFLSH|TOSTOP|PENDIN);
-  tp->c_cflag &= ~(CSIZE|PARENB);
-  tp->c_cflag |= CS8|CREAD;
-  tp->c_cc[VMIN] = 1;
-  tp->c_cc[VTIME] = 0;
-}
-#endif
Index: cpukit/libcsupport/src/cfmakesane.c
===================================================================
--- cpukit/libcsupport/src/cfmakesane.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/*  @file
- *
- *  @brief Baud Rate Functions
- *  @ingroup Termios
- */
-
-/*
- * Copyright (c) 1989, 1993
- *  The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#define TTYDEFCHARS
-#include <termios.h>
-
-/*
- * Obtain a termios structure which is similar to the one provided by
- * the kernel.
- */
-void
-cfmakesane(
-  struct termios *tp
-)
-{
-  tp->c_cflag = TTYDEF_CFLAG;
-  tp->c_iflag = TTYDEF_IFLAG;
-  tp->c_lflag = TTYDEF_LFLAG;
-  tp->c_oflag = TTYDEF_OFLAG;
-  tp->c_ispeed = TTYDEF_SPEED;
-  tp->c_ospeed = TTYDEF_SPEED;
-  memcpy(&tp->c_cc, ttydefchars, sizeof ttydefchars);
-}
-#endif
Index: cpukit/libcsupport/src/cfsetispeed.c
===================================================================
--- cpukit/libcsupport/src/cfsetispeed.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Baud Rate Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-#include <rtems/termiostypes.h>
-#include <rtems/seterr.h>
-
-/**
- *  POSIX 1003.1b 7.1.3 - Baud Rate Functions
- */
-int cfsetispeed(
-  struct termios *tp,
-  speed_t         speed
-)
-{
-  if ( rtems_termios_baud_to_index( speed ) == -1 )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
-  tp->c_ispeed = speed;
-  return 0;
-}
-#endif
Index: cpukit/libcsupport/src/cfsetospeed.c
===================================================================
--- cpukit/libcsupport/src/cfsetospeed.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Baud Rate Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-#include <rtems/termiostypes.h>
-#include <rtems/seterr.h>
-
-/**
- *  POSIX 1003.1b 7.1.3 - Baud Rate Functions
- */
-int cfsetospeed(
-  struct termios *tp,
-  speed_t         speed
-)
-{
-  if ( rtems_termios_baud_to_index( speed ) == -1 )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
-  tp->c_ospeed = speed;
-  return 0;
-}
-#endif
Index: cpukit/libcsupport/src/cfsetspeed.c
===================================================================
--- cpukit/libcsupport/src/cfsetspeed.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*  @file
- *
- *  @brief Baud Rate Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-2014.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-#include <rtems/termiostypes.h>
-#include <rtems/seterr.h>
-
-int cfsetspeed(
-  struct termios *tp,
-  speed_t speed
-)
-{
-  if ( rtems_termios_baud_to_index( speed ) == -1 )
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
-  cfsetispeed( tp, speed );
-  cfsetospeed( tp, speed );
-  return 0;
-}
-#endif
Index: cpukit/libcsupport/src/chdir.c
===================================================================
--- cpukit/libcsupport/src/chdir.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,83 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libio Internal Interface
- *
- * @brief POSIX 1003.1b - 5.2.1 - Change Current Working Directory
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Modifications to support reference counting in the file system are
- *  Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-int rtems_filesystem_chdir( rtems_filesystem_location_info_t *loc )
-{
-  int rv = 0;
-  rtems_filesystem_global_location_t *global_loc =
-    rtems_filesystem_location_transform_to_global( loc );
-  mode_t type = rtems_filesystem_location_type( &global_loc->location );
-
-  if ( S_ISDIR( type ) ) {
-    rtems_filesystem_global_location_assign(
-      &rtems_filesystem_current,
-      global_loc
-    );
-  } else {
-    rtems_filesystem_location_error( &global_loc->location, ENOTDIR );
-    rtems_filesystem_global_location_release( global_loc, true );
-    rv = -1;
-  }
-
-  return rv;
-}
-
-int chdir( const char *path )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_PERMS_EXEC
-    | RTEMS_FS_FOLLOW_LINK;
-  rtems_filesystem_location_info_t pathloc;
-
-  rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-  rtems_filesystem_eval_path_extract_currentloc( &ctx, &pathloc );
-  rv = rtems_filesystem_chdir( &pathloc );
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/chmod.c
===================================================================
--- cpukit/libcsupport/src/chmod.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Change File Modes
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  POSIX 1003.1b 5.6.4 - Change File Modes
- */
-int chmod( const char *path, mode_t mode )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  rv = rtems_filesystem_chmod( currentloc, mode );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/chown.c
===================================================================
--- cpukit/libcsupport/src/chown.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Change Owner and Group of a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Modifications to support reference counting in the file system are
- *  Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
- */
-int chown( const char *path, uid_t owner, gid_t group )
-{
-  int rv;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  rv = rtems_filesystem_chown( currentloc, owner, group );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/chroot.c
===================================================================
--- cpukit/libcsupport/src/chroot.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,117 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief Change Root Directory
- */
-
-/*
- * Copyright (c) 2001 Fernando Ruiz Casas <fruizcasas@gmail.com>
- *
- * COPYRIGHT (c) 1989-2008.
- * On-Line Applications Research Corporation (OAR).
- *
- * Modifications to support reference counting in the file system are
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-int chroot( const char *path )
-{
-  int rv = 0;
-  rtems_status_code sc = RTEMS_SUCCESSFUL;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_PERMS_EXEC
-    | RTEMS_FS_FOLLOW_LINK;
-  rtems_filesystem_location_info_t loc;
-  rtems_filesystem_global_location_t *new_current_loc;
-
-  /*
-   * We use the global environment for path evaluation.  This makes it possible
-   * to escape from a chroot environment referencing an unmounted file system.
-   */
-  rtems_filesystem_eval_path_start_with_root_and_current(
-    &ctx,
-    path,
-    strlen( path ),
-    eval_flags,
-    &rtems_global_user_env.root_directory,
-    &rtems_global_user_env.current_directory
-  );
-
-  rtems_filesystem_eval_path_extract_currentloc( &ctx, &loc );
-  new_current_loc = rtems_filesystem_location_transform_to_global( &loc );
-  if ( !rtems_filesystem_global_location_is_null( new_current_loc ) ) {
-    rtems_filesystem_global_location_t *new_root_loc =
-      rtems_filesystem_global_location_obtain( &new_current_loc );
-    mode_t type = rtems_filesystem_location_type( &new_root_loc->location );
-
-    if ( S_ISDIR( type ) ) {
-      sc = rtems_libio_set_private_env();
-      if (sc == RTEMS_SUCCESSFUL) {
-        rtems_filesystem_global_location_assign(
-          &rtems_filesystem_root,
-          new_root_loc
-        );
-        rtems_filesystem_global_location_assign(
-          &rtems_filesystem_current,
-          new_current_loc
-        );
-      } else {
-        if (sc != RTEMS_UNSATISFIED) {
-          errno = ENOMEM;
-        }
-        rv = -1;
-      }
-    } else {
-      rtems_filesystem_location_error( &new_root_loc->location, ENOTDIR );
-      rv = -1;
-    }
-
-    if ( rv != 0 ) {
-      rtems_filesystem_global_location_release( new_root_loc, true );
-    }
-  } else {
-    rv = -1;
-  }
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  if ( rv != 0 ) {
-    rtems_filesystem_global_location_release( new_current_loc, false );
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/clock.c
===================================================================
--- cpukit/libcsupport/src/clock.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2017 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <time.h>
-
-#include <rtems/score/basedefs.h>
-#include <rtems/score/timecounter.h>
-
-RTEMS_STATIC_ASSERT( CLOCKS_PER_SEC == 1000000, clocks_per_sec );
-
-clock_t clock( void )
-{
-  struct timeval tv;
-
-  _Timecounter_Microuptime( &tv );
-
-  return (clock_t) (tv.tv_sec - 1) * CLOCKS_PER_SEC + tv.tv_usec;
-}
Index: cpukit/libcsupport/src/clonenode.c
===================================================================
--- cpukit/libcsupport/src/clonenode.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Clones a Node
- *  @ingroup LibIOInternal
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-void rtems_filesystem_location_clone(
-  rtems_filesystem_location_info_t *clone,
-  const rtems_filesystem_location_info_t *master
-)
-{
-  int rv = 0;
-
-  clone = rtems_filesystem_location_copy( clone, master );
-  rv = (*clone->mt_entry->ops->clonenod_h)( clone );
-  if ( rv != 0 ) {
-    rtems_filesystem_location_remove_from_mt_entry( clone );
-    rtems_filesystem_location_initialize_to_null( clone );
-  }
-}
Index: cpukit/libcsupport/src/close.c
===================================================================
--- cpukit/libcsupport/src/close.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,111 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief POSIX 1003.1b 6.3.1 - Close a File
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-int close(
-  int  fd
-)
-{
-  rtems_libio_t *iop;
-  unsigned int   flags;
-  int            rc;
-
-  if ( (uint32_t) fd >= rtems_libio_number_iops ) {
-    rtems_set_errno_and_return_minus_one( EBADF );
-  }
-
-  iop = rtems_libio_iop( fd );
-  flags = rtems_libio_iop_flags( iop );
-
-  while ( true ) {
-    unsigned int desired;
-    bool         success;
-
-    if ( ( flags & LIBIO_FLAGS_OPEN ) == 0 ) {
-      rtems_set_errno_and_return_minus_one( EBADF );
-    }
-
-    /* The expected flags */
-    flags &= LIBIO_FLAGS_REFERENCE_INC - 1U;
-
-    desired = flags & ~LIBIO_FLAGS_OPEN;
-    success = _Atomic_Compare_exchange_uint(
-      &iop->flags,
-      &flags,
-      desired,
-      ATOMIC_ORDER_ACQ_REL,
-      ATOMIC_ORDER_RELAXED
-    );
-
-    if ( success ) {
-      break;
-    }
-
-    if ( ( flags & ~( LIBIO_FLAGS_REFERENCE_INC - 1U ) ) != 0 ) {
-      rtems_set_errno_and_return_minus_one( EBUSY );
-    }
-  }
-
-  rc = (*iop->pathinfo.handlers->close_h)( iop );
-
-  rtems_libio_free( iop );
-
-  return rc;
-}
-
-/*
- *  _close_r
- *
- *  This is the Newlib dependent reentrant version of close().
- */
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__CLOSE_R)
-
-#include <reent.h>
-
-int _close_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  int            fd
-)
-{
-  return close( fd );
-}
-#endif
Index: cpukit/libcsupport/src/consolesimple.c
===================================================================
--- cpukit/libcsupport/src/consolesimple.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (C) 2017, 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/console.h>
-#include <rtems/bspIo.h>
-#include <rtems/imfs.h>
-
-#include "consolesimple.h"
-
-static ssize_t _Console_simple_Write(
-  rtems_libio_t *iop,
-  const void    *buffer,
-  size_t         count
-)
-{
-  const char *buf;
-  ssize_t     i;
-  ssize_t     n;
-
-  buf = buffer;
-  n = (ssize_t) count;
-
-  for ( i = 0; i < n; ++i ) {
-    rtems_putc( buf[ i ] );
-  }
-
-  return n;
-}
-
-static const rtems_filesystem_file_handlers_r _Console_simple_Handlers = {
-  .open_h = rtems_filesystem_default_open,
-  .close_h = rtems_filesystem_default_close,
-  .read_h = _Console_simple_Read,
-  .write_h = _Console_simple_Write,
-  .ioctl_h = rtems_filesystem_default_ioctl,
-  .lseek_h = rtems_filesystem_default_lseek,
-  .fstat_h = IMFS_stat,
-  .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
-  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
-  .fcntl_h = rtems_filesystem_default_fcntl,
-  .readv_h = rtems_filesystem_default_readv,
-  .writev_h = rtems_filesystem_default_writev,
-  .mmap_h = rtems_filesystem_default_mmap
-};
-
-static const IMFS_node_control
-_Console_simple_Node_control = IMFS_NODE_CONTROL_INITIALIZER(
-  &_Console_simple_Handlers,
-  IMFS_node_initialize_default,
-  IMFS_do_nothing_destroy
-);
-
-static const char _Console_simple_Name[] = "console";
-
-static IMFS_jnode_t _Console_simple_Node = IMFS_NODE_INITIALIZER(
-  &_Console_simple_Node_control,
-  _Console_simple_Name,
-  sizeof( _Console_simple_Name ) - 1,
-  S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO
-);
-
-void _Console_simple_Initialize( void )
-{
-  IMFS_add_node( "/dev", &_Console_simple_Node, NULL );
-}
Index: cpukit/libcsupport/src/consolesimple.h
===================================================================
--- cpukit/libcsupport/src/consolesimple.h	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2018 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-ssize_t _Console_simple_Read(
-  rtems_libio_t *iop,
-  void          *buffer,
-  size_t         count
-);
Index: cpukit/libcsupport/src/consolesimpleread.c
===================================================================
--- cpukit/libcsupport/src/consolesimpleread.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2017 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <rtems/bspIo.h>
-#include <rtems/libio.h>
-
-#include "consolesimple.h"
-
-ssize_t _Console_simple_Read(
-  rtems_libio_t *iop,
-  void          *buffer,
-  size_t         count
-)
-{
-  char    *buf;
-  ssize_t  i;
-  ssize_t  n;
-
-  buf = buffer;
-  n = (ssize_t) count;
-
-  for ( i = 0; i < n; ++i ) {
-    int c;
-
-    while ( true ) {
-      c = getchark();
-      if ( c != -1 ) {
-        break;
-      }
-
-      (void) rtems_task_wake_after( 1 );
-    }
-
-    buf[ i ] = (char) c;
-  }
-
-  return n;
-}
Index: cpukit/libcsupport/src/consolesimpletask.c
===================================================================
--- cpukit/libcsupport/src/consolesimpletask.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,253 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (C) 2018, 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/console.h>
-#include <rtems/bspIo.h>
-#include <rtems/imfs.h>
-#include <rtems/thread.h>
-
-#include "consolesimple.h"
-
-#define CONSOLE_SIMPLE_TASK_BUFFER_SIZE 2048
-
-#define CONSOLE_SIMPLE_TASK_MAX_JUNK_SIZE 80
-
-typedef struct {
-  IMFS_jnode_t Node;
-  RTEMS_INTERRUPT_LOCK_MEMBER( buf_lock )
-  rtems_mutex output_mutex;
-  rtems_id task;
-  size_t head;
-  size_t tail;
-  char buf[ CONSOLE_SIMPLE_TASK_BUFFER_SIZE ];
-} Console_simple_task_Control;
-
-static Console_simple_task_Control _Console_simple_task_Instance;
-
-static size_t _Console_simple_task_Capacity(
-  const Console_simple_task_Control *cons
-)
-{
-  return ( cons->tail - cons->head - 1 ) % CONSOLE_SIMPLE_TASK_BUFFER_SIZE;
-}
-
-static size_t _Console_simple_task_Available(
-  const Console_simple_task_Control *cons
-)
-{
-  return ( cons->head - cons->tail ) % CONSOLE_SIMPLE_TASK_BUFFER_SIZE;
-}
-
-static Console_simple_task_Control *_Console_simple_task_Iop_to_control(
-  const rtems_libio_t *iop
-)
-{
-  return (Console_simple_task_Control *) IMFS_iop_to_node( iop );
-}
-
-static ssize_t _Console_simple_task_Write(
-  rtems_libio_t *iop,
-  const void    *buffer,
-  size_t         count
-)
-{
-  Console_simple_task_Control *cons;
-  const char                  *buf;
-  size_t                       todo;
-
-  cons = _Console_simple_task_Iop_to_control( iop );
-  buf = buffer;
-  todo = count;
-
-  while ( todo > 0 ) {
-    rtems_interrupt_lock_context lock_context;
-    size_t                       junk;
-    size_t                       head;
-    size_t                       i;
-
-    rtems_interrupt_lock_acquire( &cons->buf_lock, &lock_context );
-
-    junk = _Console_simple_task_Capacity( cons );
-
-    if ( junk > todo ) {
-      junk = todo;
-    }
-
-    if ( junk > CONSOLE_SIMPLE_TASK_MAX_JUNK_SIZE ) {
-      junk = CONSOLE_SIMPLE_TASK_MAX_JUNK_SIZE;
-    }
-
-    head = cons->head;
-
-    for ( i = 0; i < junk; ++i ) {
-      cons->buf[ head ] = *buf;
-      head = ( head + 1 ) % CONSOLE_SIMPLE_TASK_BUFFER_SIZE;
-      --todo;
-      ++buf;
-    }
-
-    cons->head = head;
-
-    rtems_interrupt_lock_release( &cons->buf_lock, &lock_context );
-
-    if ( junk == 0 ) {
-      break;
-    }
-  }
-
-  rtems_event_system_send( cons->task, RTEMS_EVENT_SYSTEM_SERVER );
-
-  return (ssize_t) ( count - todo );
-}
-
-static void _Console_simple_task_Put_chars( Console_simple_task_Control *cons )
-{
-  rtems_interrupt_lock_context lock_context;
-  size_t                       available;
-  size_t                       tail;
-  size_t                       i;
-
-  rtems_mutex_lock( &cons->output_mutex );
-
-  rtems_interrupt_lock_acquire( &cons->buf_lock, &lock_context );
-
-  available = _Console_simple_task_Available( cons );
-  tail = cons->tail;
-
-  rtems_interrupt_lock_release( &cons->buf_lock, &lock_context );
-
-  for ( i = 0; i < available; ++i) {
-    rtems_putc( cons->buf[ tail ] );
-    tail = ( tail + 1 ) % CONSOLE_SIMPLE_TASK_BUFFER_SIZE;
-  }
-
-  rtems_interrupt_lock_acquire( &cons->buf_lock, &lock_context );
-
-  cons->tail = tail;
-
-  rtems_interrupt_lock_release( &cons->buf_lock, &lock_context );
-
-  rtems_mutex_unlock( &cons->output_mutex );
-}
-
-static int _Console_simple_task_Fsync( rtems_libio_t *iop )
-{
-  Console_simple_task_Control *cons;
-
-  cons = _Console_simple_task_Iop_to_control( iop );
-  _Console_simple_task_Put_chars( cons );
-
-  return 0;
-}
-
-static const rtems_filesystem_file_handlers_r _Console_simple_task_Handlers = {
-  .open_h = rtems_filesystem_default_open,
-  .close_h = rtems_filesystem_default_close,
-  .read_h = _Console_simple_Read,
-  .write_h = _Console_simple_task_Write,
-  .ioctl_h = rtems_filesystem_default_ioctl,
-  .lseek_h = rtems_filesystem_default_lseek,
-  .fstat_h = IMFS_stat,
-  .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = _Console_simple_task_Fsync,
-  .fdatasync_h = _Console_simple_task_Fsync,
-  .fcntl_h = rtems_filesystem_default_fcntl,
-  .readv_h = rtems_filesystem_default_readv,
-  .writev_h = rtems_filesystem_default_writev,
-  .mmap_h = rtems_filesystem_default_mmap
-};
-
-static const IMFS_node_control
-_Console_simple_task_Node_control = IMFS_NODE_CONTROL_INITIALIZER(
-  &_Console_simple_task_Handlers,
-  IMFS_node_initialize_default,
-  IMFS_do_nothing_destroy
-);
-
-static void _Console_simple_task_Task( rtems_task_argument arg )
-{
-  Console_simple_task_Control *cons;
-
-  cons = (Console_simple_task_Control *) arg;
-
-  while ( true ) {
-    rtems_event_set events;
-
-    rtems_event_system_receive(
-      RTEMS_EVENT_SYSTEM_SERVER,
-      RTEMS_WAIT | RTEMS_EVENT_ALL,
-      RTEMS_NO_TIMEOUT,
-      &events
-    );
-
-    _Console_simple_task_Put_chars( cons );
-  }
-}
-
-static const char _Console_simple_task_Name[] = "console";
-
-void _Console_simple_task_Initialize( void )
-{
-  Console_simple_task_Control *cons;
-  rtems_status_code status;
-
-  cons = &_Console_simple_task_Instance;
-
-  IMFS_node_preinitialize(
-    &cons->Node,
-    &_Console_simple_task_Node_control,
-    _Console_simple_task_Name,
-    sizeof( _Console_simple_task_Name ) - 1,
-    S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO
-  );
-
-  rtems_interrupt_lock_initialize( &cons->buf_lock, "Console" );
-  rtems_mutex_init( &cons->output_mutex, "Console" );
-
-  IMFS_add_node( "/dev", &cons->Node, NULL );
-
-  status = rtems_task_create(
-    rtems_build_name('C', 'O', 'N', 'S'),
-    RTEMS_MAXIMUM_PRIORITY - 1,
-    RTEMS_MINIMUM_STACK_SIZE,
-    RTEMS_DEFAULT_ATTRIBUTES,
-    RTEMS_DEFAULT_MODES,
-    &cons->task
-  );
-  _Assert_Unused_variable_equals(status, RTEMS_SUCCESSFUL);
-
-  status = rtems_task_start(
-    cons->task,
-    _Console_simple_task_Task,
-    (rtems_task_argument) cons
-  );
-  _Assert_Unused_variable_equals(status, RTEMS_SUCCESSFUL);
-}
Index: cpukit/libcsupport/src/ctermid.c
===================================================================
--- cpukit/libcsupport/src/ctermid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Generate Terminal Pathname
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/unistd.h>
-
-static char *ctermid_name = "/dev/console";
-
-/**
- *  ctermid() - POSIX 1003.1b 4.7.1 - Generate Terminal Pathname
- */
-char *ctermid(
-  char *s
-)
-{
-  if ( !s )
-    return ctermid_name;
-
-  /*
-   *  We have no way of knowing the length of the user provided buffer.
-   *  It may not be large enough but there is no way to know that. :(
-   *  So this is a potential buffer owerrun that we can do nothing about.
-   */
-  strcpy( s, ctermid_name );
-  return s;
-}
-
-#endif
Index: cpukit/libcsupport/src/dup.c
===================================================================
--- cpukit/libcsupport/src/dup.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief POSIX 1003.1b 6.2.1 Duplicate an Open File Descriptor
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <fcntl.h>
-
-int dup(
-  int fildes
-)
-{
-  return fcntl( fildes, F_DUPFD, 0 );
-}
Index: cpukit/libcsupport/src/dup2.c
===================================================================
--- cpukit/libcsupport/src/dup2.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Duplicate an Open File Descriptor
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  POSIX 1003.1b 6.2.1 Duplicate an Open File Descriptor
- */
-int dup2(
-  int fildes,
-  int fildes2
-)
-{
-  int          status;
-  struct stat  buf;
-
-  /*
-   *  If fildes is not valid, then fildes2 should not be closed.
-   */
-
-  status = fstat( fildes, &buf );
-  if ( status == -1 )
-    return -1;
-
-  /*
-   *  If fildes2 is not valid, then we should not do anything either.
-   */
-
-  status = fstat( fildes2, &buf );
-  if ( status == -1 )
-    return -1;
-
-  /*
-   *  This fcntl handles everything else.
-   */
-
-  return fcntl( fildes, F_DUP2FD, fildes2 );
-}
Index: cpukit/libcsupport/src/error.c
===================================================================
--- cpukit/libcsupport/src/error.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,126 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief
- */
-
-/*
- * Copyright (C) 1995 Tony Bennett <tbennett@divnc.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/error.h>
-#include <rtems/assoc.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/threadimpl.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>     /* _exit() */
-
-int          rtems_panic_in_progress;
-
-int rtems_verror(
-  rtems_error_code_t  error_flag,
-  const char         *printf_format,
-  va_list             arglist
-)
-{
-  int               local_errno = 0;
-  int               chars_written = 0;
-  rtems_status_code status;
-
-  if (error_flag & RTEMS_ERROR_PANIC) {
-    if (rtems_panic_in_progress++)
-      _Thread_Dispatch_disable();       /* disable task switches */
-
-    /* don't aggravate things */
-    if (rtems_panic_in_progress > 2)
-      return 0;
-  }
-
-  (void) fflush(stdout);            /* in case stdout/stderr same */
-
-  status = error_flag & ~RTEMS_ERROR_MASK;
-  if (error_flag & RTEMS_ERROR_ERRNO)     /* include errno? */
-    local_errno = errno;
-
-  #if defined(RTEMS_MULTIPROCESSING)
-    if (_System_state_Is_multiprocessing)
-      fprintf(stderr, "[%" PRIu16 "] ", rtems_object_get_local_node());
-  #endif
-
-  chars_written += vfprintf(stderr, printf_format, arglist);
-
-  if (status)
-    chars_written +=
-      fprintf(stderr, " (status: %s)", rtems_status_text(status));
-
-  if (local_errno) {
-    if ((local_errno > 0) && *strerror(local_errno))
-      chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
-    else
-      chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
-  }
-
-  chars_written += fprintf(stderr, "\n");
-
-  (void) fflush(stderr);
-
-  return chars_written;
-}
-
-int rtems_error(
-  rtems_error_code_t error_flag,
-  const char *printf_format,
-  ...
-)
-{
-  va_list arglist;
-  int chars_written;
-
-  va_start(arglist, printf_format);
-  chars_written = rtems_verror(error_flag, printf_format, arglist);
-  va_end(arglist);
-
-  if (error_flag & RTEMS_ERROR_PANIC) {
-    rtems_error(0, "fatal error, exiting");
-    _exit(errno);
-  }
-  if (error_flag & RTEMS_ERROR_ABORT) {
-    rtems_error(0, "fatal error, aborting");
-    abort();
-  }
-
-  return chars_written;
-}
Index: cpukit/libcsupport/src/fchdir.c
===================================================================
--- cpukit/libcsupport/src/fchdir.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Change Directory
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Modifications to support reference counting in the file system are
- *  Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  compatible with SVr4, 4.4BSD and X/OPEN - Change Directory
- */
-int fchdir( int fd )
-{
-  int rv = 0;
-  rtems_libio_t *iop;
-  struct stat st;
-  rtems_filesystem_location_info_t loc;
-
-  st.st_mode = 0;
-  st.st_uid = 0;
-  st.st_gid = 0;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  rtems_filesystem_instance_lock( &iop->pathinfo );
-  rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, &st );
-  if ( rv == 0 ) {
-    bool access_ok = rtems_filesystem_check_access(
-      RTEMS_FS_PERMS_EXEC,
-      st.st_mode,
-      st.st_uid,
-      st.st_gid
-    );
-
-    if ( access_ok ) {
-      rtems_filesystem_location_clone( &loc, &iop->pathinfo );
-    } else {
-      errno = EACCES;
-      rv = -1;
-    }
-  }
-  rtems_filesystem_instance_unlock( &iop->pathinfo );
-  rtems_libio_iop_drop( iop );
-
-  if ( rv == 0 ) {
-    rv = rtems_filesystem_chdir( &loc );
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/fchmod.c
===================================================================
--- cpukit/libcsupport/src/fchmod.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,100 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Change File Modes
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-#include <string.h>
-
-#include <rtems/libio_.h>
-
-int rtems_filesystem_chmod(
-  const rtems_filesystem_location_info_t *loc,
-  mode_t mode
-)
-{
-  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
-  int rv;
-
-  if ( mt_entry->writeable || rtems_filesystem_location_is_null( loc ) ) {
-    struct stat st;
-
-    memset( &st, 0, sizeof(st) );
-
-    rv = (*loc->handlers->fstat_h)( loc, &st );
-    if ( rv == 0 ) {
-      uid_t uid = geteuid();
-
-      if ( uid == 0 || st.st_uid == uid ) {
-        mode_t mask = S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX;
-
-        mode = (st.st_mode & ~mask) | (mode & mask);
-
-        rv = (*mt_entry->ops->fchmod_h)( loc, mode );
-      } else {
-        errno = EPERM;
-        rv = -1;
-      }
-    }
-  } else {
-    errno = EROFS;
-    rv = -1;
-  }
-
-  return rv;
-}
-
-/**
- *  POSIX 1003.1b 5.6.4 - Change File Modes
- */
-int fchmod( int fd, mode_t mode )
-{
-  int rv;
-  rtems_libio_t *iop;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  rtems_filesystem_instance_lock( &iop->pathinfo );
-
-  rv = rtems_filesystem_chmod( &iop->pathinfo, mode );
-
-  rtems_filesystem_instance_unlock( &iop->pathinfo );
-
-  rtems_libio_iop_drop( iop );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/fchown.c
===================================================================
--- cpukit/libcsupport/src/fchown.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,97 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Change Owner and Group of a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-int rtems_filesystem_chown(
-  const rtems_filesystem_location_info_t *loc,
-  uid_t owner,
-  gid_t group
-)
-{
-  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
-  int rv;
-
-  if ( mt_entry->writeable || rtems_filesystem_location_is_null( loc ) ) {
-    struct stat st;
-
-    memset( &st, 0, sizeof(st) );
-
-    rv = (*loc->handlers->fstat_h)( loc, &st );
-    if ( rv == 0 ) {
-      uid_t uid = geteuid();
-
-      if ( uid == 0 || st.st_uid == uid ) {
-        rv = (*mt_entry->ops->chown_h)( loc, owner, group );
-      } else {
-        errno = EPERM;
-        rv = -1;
-      }
-    }
-  } else {
-    errno = EROFS;
-    rv = -1;
-  }
-
-  return rv;
-}
-
-/**
- *  POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
- */
-int fchown( int fd, uid_t owner, gid_t group )
-{
-  int rv;
-  rtems_libio_t *iop;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  rtems_filesystem_instance_lock( &iop->pathinfo );
-
-  rv = rtems_filesystem_chown( &iop->pathinfo, owner, group );
-
-  rtems_filesystem_instance_unlock( &iop->pathinfo );
-
-  rtems_libio_iop_drop( iop );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/fcntl.c
===================================================================
--- cpukit/libcsupport/src/fcntl.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,275 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief POSIX 1003.1b 6.5.2 - File Control
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <rtems/libio_.h>
-
-static int duplicate_iop( rtems_libio_t *iop )
-{
-  int            rv;
-  int            oflag;
-  rtems_libio_t *diop;
-
-  oflag = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
-  diop = rtems_libio_allocate();
-
-  if (diop != NULL) {
-    rtems_filesystem_instance_lock( &iop->pathinfo );
-    rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo );
-    rtems_filesystem_instance_unlock( &iop->pathinfo );
-
-    /*
-     * XXX: We call the open handler here to have a proper open and close pair.
-     *
-     * FIXME: What to do with the path?
-     */
-    rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 );
-    if ( rv == 0 ) {
-      rtems_libio_iop_flags_set(
-        diop,
-        LIBIO_FLAGS_OPEN | rtems_libio_fcntl_flags( oflag )
-      );
-      rv = rtems_libio_iop_to_descriptor( diop );
-    } else {
-      rtems_libio_free( diop );
-    }
-  } else {
-    rv = -1;
-  }
-
-  return rv;
-}
-
-static int duplicate2_iop( rtems_libio_t *iop, int fd2 )
-{
-  rtems_libio_t *iop2;
-  int            rv = 0;
-
-  if ( (uint32_t) fd2 >= rtems_libio_number_iops ) {
-    rtems_set_errno_and_return_minus_one( EBADF );
-  }
-
-  iop2 = rtems_libio_iop( fd2 );
-
-  if (iop != iop2)
-  {
-    int oflag;
-
-    if ((rtems_libio_iop_flags( iop2 ) & LIBIO_FLAGS_OPEN) != 0) {
-      rv = (*iop2->pathinfo.handlers->close_h)( iop2 );
-    }
-
-    if (rv == 0) {
-      oflag = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
-      rtems_libio_iop_flags_set( iop2, rtems_libio_fcntl_flags( oflag ) );
-
-      rtems_filesystem_instance_lock( &iop->pathinfo );
-      rtems_filesystem_location_clone( &iop2->pathinfo, &iop->pathinfo );
-      rtems_filesystem_instance_unlock( &iop->pathinfo );
-
-      /*
-       * XXX: We call the open handler here to have a proper open and close
-       *      pair.
-       *
-       * FIXME: What to do with the path?
-       */
-      rv = (*iop2->pathinfo.handlers->open_h)( iop2, NULL, oflag, 0 );
-      if ( rv == 0 ) {
-        rv = fd2;
-      }
-    }
-  }
-
-  return rv;
-}
-
-static int vfcntl(
-  int fd,
-  int cmd,
-  va_list ap
-)
-{
-  rtems_libio_t *iop;
-  int            fd2;
-  int            flags;
-  int            mask;
-  int            ret = 0;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  /*
-   *  Now process the fcntl().
-   */
-
-  /*
-   *  This switch should contain all the cases from POSIX.
-   */
-
-  switch ( cmd ) {
-    case F_DUPFD:        /* dup */
-      ret = duplicate_iop( iop );
-      break;
-
-    case F_DUP2FD:       /* dup2 */
-      fd2 = va_arg( ap, int );
-      ret = duplicate2_iop( iop, fd2 );
-      break;
-
-    case F_GETFD:        /* get f_flags */
-      ret = ((rtems_libio_iop_flags(iop) & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0);
-      break;
-
-    case F_SETFD:        /* set f_flags */
-      /*
-       *  Interpret the third argument as the "close on exec()" flag.
-       *  If this argument is 1, then the file descriptor is to be closed
-       *  if a new process is exec()'ed.  Since RTEMS does not support
-       *  processes, then we can ignore this one except to make
-       *  F_GETFD work.
-       */
-
-      if ( va_arg( ap, int ) )
-        rtems_libio_iop_flags_set( iop, LIBIO_FLAGS_CLOSE_ON_EXEC );
-      else
-        rtems_libio_iop_flags_clear( iop, LIBIO_FLAGS_CLOSE_ON_EXEC );
-      break;
-
-    case F_GETFL:        /* more flags (cloexec) */
-      ret = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
-      break;
-
-    case F_SETFL:
-      flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
-      mask = LIBIO_FLAGS_NO_DELAY | LIBIO_FLAGS_APPEND;
-
-      /*
-       *  XXX If we are turning on append, should we seek to the end?
-       */
-
-      rtems_libio_iop_flags_clear( iop, mask );
-      rtems_libio_iop_flags_set( iop, flags & mask );
-      break;
-
-    case F_GETLK:
-      errno = ENOTSUP;
-      ret = -1;
-      break;
-
-    case F_SETLK:
-      errno = ENOTSUP;
-      ret = -1;
-      break;
-
-    case F_SETLKW:
-      errno = ENOTSUP;
-      ret = -1;
-      break;
-
-    case F_SETOWN:       /*  for sockets. */
-      errno = ENOTSUP;
-      ret = -1;
-      break;
-
-    case F_GETOWN:       /*  for sockets. */
-      errno = ENOTSUP;
-      ret = -1;
-      break;
-
-    default:
-      errno = EINVAL;
-      ret = -1;
-      break;
-  }
-
-  /*
-   *  If we got this far successfully, then we give the optional
-   *  filesystem specific handler a chance to process this.
-   */
-
-  if (ret >= 0) {
-    int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd );
-    if (err) {
-      errno = err;
-      ret = -1;
-    }
-  }
-
-  rtems_libio_iop_drop( iop );
-  return ret;
-}
-
-int fcntl(
-  int fd,
-  int cmd,
-  ...
-)
-{
-  int            ret;
-  va_list        ap;
-  va_start( ap, cmd );
-  ret = vfcntl(fd,cmd,ap);
-  va_end(ap);
-  return ret;
-}
-
-
-/*
- *  _fcntl_r
- *
- *  This is the Newlib dependent reentrant version of fcntl().
- */
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_FCNTL_R)
-
-#include <reent.h>
-
-int _fcntl_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  int fd,
-  int cmd,
-  int arg
-)
-{
-  return fcntl( fd, cmd, arg );
-}
-#endif
Index: cpukit/libcsupport/src/fdatasync.c
===================================================================
--- cpukit/libcsupport/src/fdatasync.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief POSIX 1003.1b 6.6.2 - Synchronize the Data of a File
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-int fdatasync(
-  int     fd
-)
-{
-  rtems_libio_t *iop;
-  int            rv;
-
-  LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EBADF );
-
-  /*
-   *  Now process the fdatasync().
-   */
-
-  rv = (*iop->pathinfo.handlers->fdatasync_h)( iop );
-  rtems_libio_iop_drop( iop );
-  return rv;
-}
Index: cpukit/libcsupport/src/flockfile.c
===================================================================
--- cpukit/libcsupport/src/flockfile.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/**
- *  @file
- *
- *  @brief Lock File for Stdio
- *  @ingroup SET
- */
-/*
- * Copyright (c) 2009 by
- * Ralf CorsÃ©pius, Ulm, Germany. All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * is freely granted, provided that this notice is preserved.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_FLOCKFILE)
-
-#include <stdio.h>
-
-/**
- *  This is a non-functional stub 
- */
-void flockfile(FILE* file)
-{
-  (void) file;
-}
-
-#endif
Index: cpukit/libcsupport/src/fpathconf.c
===================================================================
--- cpukit/libcsupport/src/fpathconf.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,111 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Configurable Pathname Varables
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-#include <unistd.h>
-#include <errno.h>
-
-/**
- *  POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables
- */
-long fpathconf(
-  int   fd,
-  int   name
-)
-{
-  long                                    return_value;
-  rtems_libio_t                          *iop;
-  const rtems_filesystem_limits_and_options_t *the_limits;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  /*
-   *  Now process the information request.
-   */
-
-  the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options;
-
-  switch ( name ) {
-    case _PC_LINK_MAX:
-      return_value = the_limits->link_max;
-      break;
-    case _PC_MAX_CANON:
-      return_value = the_limits->max_canon;
-      break;
-    case _PC_MAX_INPUT:
-      return_value = the_limits->max_input;
-      break;
-    case _PC_NAME_MAX:
-      return_value = the_limits->name_max;
-      break;
-    case _PC_PATH_MAX:
-      return_value = the_limits->path_max;
-      break;
-    case _PC_PIPE_BUF:
-      return_value = the_limits->pipe_buf;
-      break;
-    case _PC_CHOWN_RESTRICTED:
-      return_value = the_limits->posix_chown_restrictions;
-      break;
-    case _PC_NO_TRUNC:
-      return_value = the_limits->posix_no_trunc;
-      break;
-    case _PC_VDISABLE:
-      return_value = the_limits->posix_vdisable;
-      break;
-    case _PC_ASYNC_IO:
-      return_value = the_limits->posix_async_io;
-      break;
-    case _PC_PRIO_IO:
-      return_value = the_limits->posix_prio_io;
-      break;
-    case _PC_SYNC_IO:
-      return_value = the_limits->posix_sync_io;
-      break;
-    default:
-      errno = EINVAL;
-      return_value = -1;
-      break;
-  }
-
-  rtems_libio_iop_drop( iop );
-  return return_value;
-}
Index: cpukit/libcsupport/src/free.c
===================================================================
--- cpukit/libcsupport/src/free.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,107 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief calloc()
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include "malloc_p.h"
-#include <stdlib.h>
-
-#include <rtems/chain.h>
-
-static RTEMS_CHAIN_DEFINE_EMPTY( _Malloc_GC_list );
-
-RTEMS_INTERRUPT_LOCK_DEFINE( static, _Malloc_GC_lock, "Malloc GC" )
-
-static void *_Malloc_Get_deferred_free( void )
-{
-  rtems_interrupt_lock_context lock_context;
-  void *p;
-
-  rtems_interrupt_lock_acquire( &_Malloc_GC_lock, &lock_context );
-  p = rtems_chain_get_unprotected( &_Malloc_GC_list );
-  rtems_interrupt_lock_release( &_Malloc_GC_lock, &lock_context );
-
-  return p;
-}
-
-void _Malloc_Process_deferred_frees( void )
-{
-  rtems_chain_node *to_be_freed;
-
-  /*
-   *  If some free's have been deferred, then do them now.
-   */
-  while ( ( to_be_freed = _Malloc_Get_deferred_free() ) != NULL ) {
-    free( to_be_freed );
-  }
-}
-
-static void _Malloc_Deferred_free( void *p )
-{
-  rtems_interrupt_lock_context lock_context;
-  rtems_chain_node *node;
-
-  node = (rtems_chain_node *) p;
-
-  rtems_interrupt_lock_acquire( &_Malloc_GC_lock, &lock_context );
-  rtems_chain_initialize_node( node );
-  rtems_chain_append_unprotected( &_Malloc_GC_list, node );
-  rtems_interrupt_lock_release( &_Malloc_GC_lock, &lock_context );
-}
-
-void free(
-  void *ptr
-)
-{
-  if ( !ptr )
-    return;
-
-  /*
-   *  Do not attempt to free memory if in a critical section or ISR.
-   */
-  if ( _Malloc_System_state() != MALLOC_SYSTEM_STATE_NORMAL ) {
-      _Malloc_Deferred_free(ptr);
-      return;
-  }
-
-  if ( !_Protected_heap_Free( RTEMS_Malloc_Heap, ptr ) ) {
-    rtems_fatal( RTEMS_FATAL_SOURCE_INVALID_HEAP_FREE, (rtems_fatal_code) ptr );
-  }
-}
-#endif
Index: cpukit/libcsupport/src/freenode.c
===================================================================
--- cpukit/libcsupport/src/freenode.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Releases all Resources of a Location
- *  @ingroup LibIOInternal
- */
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Modifications to support reference counting in the file system are
- *  Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-void rtems_filesystem_location_free( rtems_filesystem_location_info_t *loc )
-{
-  rtems_filesystem_instance_lock( loc );
-  (*loc->mt_entry->ops->freenod_h)( loc );
-  rtems_filesystem_instance_unlock( loc );
-  rtems_filesystem_location_remove_from_mt_entry( loc );
-}
Index: cpukit/libcsupport/src/fstat.c
===================================================================
--- cpukit/libcsupport/src/fstat.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  fstat() - POSIX 1003.1b 5.6.2 - Get File Status
- *
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-int fstat(
-  int          fd,
-  struct stat *sbuf
-)
-{
-  rtems_libio_t *iop;
-  int            rv;
-
-  /*
-   *  Check to see if we were passed a valid pointer.
-   */
-  if ( !sbuf )
-    rtems_set_errno_and_return_minus_one( EFAULT );
-
-  /*
-   *  Now process the stat() request.
-   */
-  LIBIO_GET_IOP( fd, iop );
-
-  /*
-   *  Zero out the stat structure so the various support
-   *  versions of stat don't have to.
-   */
-  memset( sbuf, 0, sizeof(struct stat) );
-
-  rv = (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf );
-  rtems_libio_iop_drop( iop );
-  return rv;
-}
-
-/*
- *  _fstat_r
- *
- *  This is the Newlib dependent reentrant version of fstat().
- */
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_FSTAT_R)
-
-#include <reent.h>
-
-int _fstat_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  int            fd,
-  struct stat   *buf
-)
-{
-  return fstat( fd, buf );
-}
-#endif
Index: cpukit/libcsupport/src/fsync.c
===================================================================
--- cpukit/libcsupport/src/fsync.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Synchronize the State of a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-/**
- *  POSIX 1003.1b 6.6.1 - Synchronize the State of a File
- */
-int fsync(
-  int     fd
-)
-{
-  rtems_libio_t *iop;
-  int            rv;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  /*
-   *  Now process the fsync().
-   */
-
-  rv = (*iop->pathinfo.handlers->fsync_h)( iop );
-  rtems_libio_iop_drop( iop );
-  return rv;
-}
Index: cpukit/libcsupport/src/ftruncate.c
===================================================================
--- cpukit/libcsupport/src/ftruncate.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Truncate a File to the Specified Length
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-int ftruncate( int fd, off_t length )
-{
-  int rv = 0;
-
-  if ( length >= 0 ) {
-    rtems_libio_t *iop;
-
-    LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EINVAL );
-
-    rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length );
-    rtems_libio_iop_drop( iop );
-  } else {
-    errno = EINVAL;
-    rv = -1;
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/ftrylockfile.c
===================================================================
--- cpukit/libcsupport/src/ftrylockfile.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/*
- * Copyright (c) 2009 by
- * Ralf CorsÃ©pius, Ulm, Germany. All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * is freely granted, provided that this notice is preserved.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_FTRYLOCKFILE)
-
-#include <stdio.h>
-#include <rtems/seterr.h>
-#include <errno.h>
-
-/* This is a non-functional stub */
-int ftrylockfile(FILE* file)
-{
-  (void) file;
-  rtems_set_errno_and_return_minus_one( ENOTSUP );
-}
-
-#endif
Index: cpukit/libcsupport/src/funlockfile.c
===================================================================
--- cpukit/libcsupport/src/funlockfile.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/**
- *  @file
- *
- *  @brief Unlock File for Stdio
- *  @ingroup libcsupport
- */
-
-/*
- * Copyright (c) 2009 by
- * Ralf CorsÃ©pius, Ulm, Germany. All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * is freely granted, provided that this notice is preserved.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_FUNLOCKFILE)
-
-#include <stdio.h>
-
-/**
- * This is a non-functional stub 
- */
-void funlockfile(FILE* file)
-{
-  (void) file;
-}
-
-#endif
Index: cpukit/libcsupport/src/futimens.c
===================================================================
--- cpukit/libcsupport/src/futimens.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @ingroup libcsupport
- *
- *  @brief Set file access and modification times based on file descriptor in
- *  nanoseconds.
- */
-
-/*
- * COPYRIGHT (C) 2021 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-
-/**
- *  https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/functions/futimens.html
- *
- *  Set file access and modification times
- */
-int futimens(
-  int                    fd,
-  const struct timespec  times[2]
-)
-{
-  int rv;
-  rtems_libio_t *iop;
-  struct timespec new_times[2];
-  const rtems_filesystem_location_info_t *currentloc = NULL;
-
-  LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_READ, EBADF );
-
-  currentloc = &iop->pathinfo;
-
-  rv = rtems_filesystem_utime_update( times, new_times );
-  if ( rv != 0 ) {
-    rtems_libio_iop_drop( iop );
-    return rv;
-  }
-
-  rv = rtems_filesystem_utime_check_permissions( currentloc, times );
-  if ( rv != 0 ) {
-    rtems_libio_iop_drop( iop );
-    return rv;
-  }
-
-  rv = (*currentloc->mt_entry->ops->utimens_h)(
-    currentloc,
-    new_times
-  );
-
-  rtems_libio_iop_drop( iop );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/gcovfork.c
===================================================================
--- cpukit/libcsupport/src/gcovfork.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief This source file contains functions required by GCC if code and
- *   branch coverage instrumentation (gcov) is enabled.
- */
-
-/*
- * Copyright (C) 2021 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/types.h>
-
-#include <errno.h>
-
-#include <rtems/seterr.h>
-
-int __gcov_execl( const char *, char *, ... );
-
-int __gcov_execl( const char *path, char *arg, ... )
-{
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
-
-int __gcov_execlp( const char *, char *, ... );
-
-int __gcov_execlp( const char *path, char *arg, ... )
-{
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
-
-int __gcov_execle( const char *, char *, ... );
-
-int __gcov_execle( const char *path, char *arg, ... )
-{
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
-
-int __gcov_execv( const char *, char *const[] );
-
-int __gcov_execv( const char *path, char *const argv[] )
-{
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
-
-int __gcov_execvp( const char *, char *const[] );
-
-int __gcov_execvp( const char *path, char *const argv[] )
-{
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
-
-int __gcov_execve( const char *, char *const[], char *const[] );
-
-int __gcov_execve( const char *path, char *const argv[], char *const envp[] )
-{
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
-
-pid_t __gcov_fork( void );
-
-pid_t __gcov_fork( void )
-{
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
Index: cpukit/libcsupport/src/getchark.c
===================================================================
--- cpukit/libcsupport/src/getchark.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSAPIKernelCharIO
- *
- * @brief This source file contains the implementation of getchark().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/bspIo.h>
-
-int getchark( void )
-{
-  BSP_polling_getchar_function_type poll_char;
-
-  poll_char = BSP_poll_char;
-
-  if ( poll_char == NULL ) {
-    return -1;
-  }
-
-  return ( *poll_char )();
-}
Index: cpukit/libcsupport/src/getdents.c
===================================================================
--- cpukit/libcsupport/src/getdents.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get Directory Entries
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <errno.h>
-
-#include <rtems/score/objectimpl.h>
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-/*
- *  Prototypes to avoid warnings
- */
-int getdents(
-  int   dd_fd,
-  char *dd_buf,
-  int   dd_len
-);
-
-/**
- *  SVR4 and SVID extension required by Newlib readdir() family.
- *
- *  This routine will dd_len / (sizeof dirent) directory entries relative to
- *  the current directory position index. These entries will be placed in
- *  character array pointed to by -dd_buf-
- */
-int getdents(
-  int   dd_fd,
-  char *dd_buf,
-  int   dd_len
-)
-{
-  rtems_libio_t *iop;
-  mode_t type;
-
-  /*
-   *  Get the file control block structure associated with the file descriptor
-   */
-  iop = rtems_libio_iop( dd_fd );
-
-  /*
-   *  Make sure we are working on a directory
-   */
-  type = rtems_filesystem_location_type( &iop->pathinfo );
-  if ( !S_ISDIR( type ) )
-    rtems_set_errno_and_return_minus_one( ENOTDIR );
-
-  /*
-   *  Return the number of bytes that were actually transfered as a result
-   *  of the read attempt.
-   */
-  return (*iop->pathinfo.handlers->read_h)( iop, dd_buf, dd_len  );
-}
Index: cpukit/libcsupport/src/getegid.c
===================================================================
--- cpukit/libcsupport/src/getegid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get Real User, Effective User, Ral Group, and Effective Group IDs
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/seterr.h>
-#include <rtems/userenv.h>
-
-/**
- *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- *        P1003.1b-1993, p. 84
- */
-gid_t getegid( void )
-{
-  return _POSIX_types_Egid;
-}
Index: cpukit/libcsupport/src/geteuid.c
===================================================================
--- cpukit/libcsupport/src/geteuid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get Real User, Effective User, Ral Group, and Effective Group IDs
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/seterr.h>
-
-#include <rtems/userenv.h>
-
-/*
- * MACRO in userenv.h
-uid_t _POSIX_types_Euid = 0;
-*/
-
-/**
- *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- *        P1003.1b-1993, p. 84
- */
-uid_t geteuid( void )
-{
-  return _POSIX_types_Euid;
-}
Index: cpukit/libcsupport/src/getgid.c
===================================================================
--- cpukit/libcsupport/src/getgid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @ingroup
- *
- *  @brief
- */
-
-/*
- * COPYRIGHT (C) <YEAR> On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- *  @file
- *
- *  @brief Get Real User, Effective User, Ral Group, and Effective Group IDs
- *  @ingroup libcsupport
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <rtems/userenv.h>
-
-/**
- *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- *        P1003.1b-1993, p. 84
- */
-gid_t getgid( void )
-{
-  return _POSIX_types_Gid;
-}
Index: cpukit/libcsupport/src/getgrent.c
===================================================================
--- cpukit/libcsupport/src/getgrent.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,111 +1,0 @@
-/**
- *  @file
- *
- *  @brief User Database Access Routines
- *  @ingroup libcsupport
- */
-
-/*
- *  Copyright (c) 1999-2009 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
- *  Copyright (c) 1999-2013 Joel Sherrill <joel.sherrill@OARcorp.com>
- *  Copyright (c) 2000-2001 Fernando Ruiz Casas <fruizcasas@gmail.com>
- *  Copyright (c) 2002 Eric Norum <eric@norum.ca>
- *  Copyright (c) 2003 Till Straumann <strauman@slac.stanford.edu>
- *  Copyright (c) 2012 Alex Ivanov <alexivanov97@gmail.com>
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "pwdgrp.h"
-
-#include <stdlib.h>
-#include <pthread.h>
-#include <rtems/score/assert.h>
-
-typedef struct {
-  FILE *fp;
-  char buf[256];
-  struct group grp;
-} grp_context;
-
-static pthread_once_t grp_once = PTHREAD_ONCE_INIT;
-
-static pthread_key_t grp_key;
-
-static void grp_init(void)
-{
-  pthread_key_create(&grp_key, free);
-}
-
-static grp_context *grp_get_context(void)
-{
-  pthread_once(&grp_once, grp_init);
-
-  return pthread_getspecific(grp_key);
-}
-
-struct group *getgrent(void)
-{
-  grp_context *ctx = grp_get_context();
-
-  if (ctx == NULL)
-    return NULL;
-
-  if (ctx->fp == NULL)
-    return NULL;
-
-  if (!_libcsupport_scangr(ctx->fp, &ctx->grp, ctx->buf, sizeof(ctx->buf)))
-    return NULL;
-
-  return &ctx->grp;
-}
-
-void setgrent(void)
-{
-  grp_context *ctx = grp_get_context();
-
-  if (ctx == NULL) {
-    int eno;
-
-    ctx = calloc(1, sizeof(*ctx));
-    if (ctx == NULL)
-      return;
-
-    eno = pthread_setspecific(grp_key, ctx);
-    if (eno != 0) {
-      free(ctx);
-
-      return;
-    }
-  }
-
-  _libcsupport_pwdgrp_init();
-
-  if (ctx->fp != NULL)
-    fclose(ctx->fp);
-
-  ctx->fp = fopen("/etc/group", "r");
-}
-
-void endgrent(void)
-{
-  grp_context *ctx = grp_get_context();
-  int          sc;
-
-  if (ctx == NULL)
-    return;
-
-  if (ctx->fp != NULL) {
-    fclose(ctx->fp);
-  }
-
-  free(ctx);
-  sc = pthread_setspecific(grp_key, NULL);
-  _Assert_Unused_variable_equals(sc, 0);
-}
Index: cpukit/libcsupport/src/getgrnam.c
===================================================================
--- cpukit/libcsupport/src/getgrnam.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/**
- *  @file
- *
- *  @brief User Database Access Routines
- *  @ingroup libcsupport
- */
-
-/*
- *  Copyright (c) 1999-2009 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
- *  Copyright (c) 1999-2013 Joel Sherrill <joel.sherrill@OARcorp.com>
- *  Copyright (c) 2000-2001 Fernando Ruiz Casas <fruizcasas@gmail.com>
- *  Copyright (c) 2002 Eric Norum <eric@norum.ca>
- *  Copyright (c) 2003 Till Straumann <strauman@slac.stanford.edu>
- *  Copyright (c) 2012 Alex Ivanov <alexivanov97@gmail.com>
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "pwdgrp.h"
-
-/*
- * Static, thread-unsafe, buffers
- */
-static char grbuf[200];
-static struct group grent;
-
-struct group *getgrnam(
-  const char *name
-)
-{
-  struct group *p;
-
-  if(getgrnam_r(name, &grent, grbuf, sizeof grbuf, &p))
-    return NULL;
-  return p;
-}
-
-struct group *getgrgid(
-  gid_t gid
-)
-{
-  struct group *p;
-
-  if(getgrgid_r(gid, &grent, grbuf, sizeof grbuf, &p))
-    return NULL;
-  return p;
-}
Index: cpukit/libcsupport/src/getgroups.c
===================================================================
--- cpukit/libcsupport/src/getgroups.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,103 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get Supplementary IDs
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <grp.h>
-#include <pwd.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <rtems/seterr.h>
-
-/**
- *  4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
- */
-int getgroups(
-  int    gidsetsize,
-  gid_t  grouplist[]
-)
-{
-  int rv;
-  struct passwd pwd;
-  struct passwd *pwd_res;
-  char buf[256];
-  gid_t gid;
-  const char *user;
-  struct group *grp;
-
-  rv = getpwuid_r(getuid(), &pwd, &buf[0], sizeof(buf), &pwd_res);
-  if (rv != 0) {
-    return rv;
-  }
-
-  gid = pwd.pw_gid;
-  user = pwd.pw_name;
-
-  setgrent();
-
-  while ((grp = getgrent()) != NULL) {
-    char **mem = &grp->gr_mem[0];
-
-    if (grp->gr_gid == gid) {
-      continue;
-    }
-
-    while (*mem != NULL) {
-      if (strcmp(*mem, user) == 0) {
-        if (rv < gidsetsize) {
-          grouplist[rv] = grp->gr_gid;
-        }
-
-        ++rv;
-
-        break;
-      }
-
-      ++mem;
-    }
-  }
-
-  endgrent();
-
-  if (gidsetsize == 0 || rv <= gidsetsize) {
-    return rv;
-  } else {
-    rtems_set_errno_and_return_minus_one(EINVAL);
-  }
-}
Index: cpukit/libcsupport/src/getlogin.c
===================================================================
--- cpukit/libcsupport/src/getlogin.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get User Name
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <limits.h>
-#include <string.h>
-#include <sys/types.h>
-#include <errno.h>
-
-#include <rtems/seterr.h>
-#include <rtems/userenv.h>
-
-#include <unistd.h>
-#include <pwd.h>
-
-/**
- *  4.2.4 Get User Name, P1003.1b-1993, p. 87
- *
- *  @note P1003.1c/D10, p. 49 adds getlogin_r().
- */
-char *getlogin( void )
-{
-  (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
-  return _POSIX_types_Getlogin_buffer;
-}
-
-/**
- *  4.2.4 Get User Name, P1003.1b-1993, p. 87
- *
- *  @note P1003.1c/D10, p. 49 adds getlogin_r().
- */
-int getlogin_r(
-  char   *name,
-  size_t  namesize
-)
-{
-  struct passwd *pw;
-  char          *pname;
-
-  if ( !name ) 
-    return EFAULT;
-
-  if ( namesize < LOGIN_NAME_MAX )
-    return ERANGE;
-
-  /* Set the pointer to a default name */
-  pname = "";
-
-  pw = getpwuid(getuid());
-  if ( pw )
-   pname = pw->pw_name;
-
-  strncpy( name, pname, LOGIN_NAME_MAX );
-  return 0;
-}
Index: cpukit/libcsupport/src/getpagesize.c
===================================================================
--- cpukit/libcsupport/src/getpagesize.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get System Page Size
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 2001 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <sys/param.h>
-
-/**
- *  Get System Page Size (from SVR4 and 4.2+ BSD)
- *
- *  This is not a functional version but the SPARC backend for at least
- *  gcc 2.8.1 plus gnat 3.13p and gcc 3.0.1 require it to be there and
- *  return a reasonable value.
- */
-int getpagesize(void)
-{
-  return PAGE_SIZE;
-}
Index: cpukit/libcsupport/src/getpgrp.c
===================================================================
--- cpukit/libcsupport/src/getpgrp.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @ingroup libcsupport
- *
- *  @brief Get process group IDs
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <rtems.h>
-
-/*
- *  4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
- */
-
-pid_t getpgrp( void )
-{
-  /*
-   *  This always succeeds and returns the process group id.  For rtems,
-   *  this will always be the local node;
-   */
-
-  return rtems_object_get_local_node();
-}
Index: cpukit/libcsupport/src/getpid.c
===================================================================
--- cpukit/libcsupport/src/getpid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Process and Parent Process IDs
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems.h>
-
-/**
- *  4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
- */
-pid_t getpid( void )
-{
-  return rtems_object_get_local_node();
-}
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__GETPID_R)
-
-#include <reent.h>
-
-/**
- *  This is the Newlib dependent reentrant version of getpid().
- */
-pid_t _getpid_r(
-  struct _reent *ptr RTEMS_UNUSED
-)
-{
-  return getpid();
-}
-#endif
Index: cpukit/libcsupport/src/getppid.c
===================================================================
--- cpukit/libcsupport/src/getppid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @ingroup
- *
- *  @brief
- */
-
-/*
- * COPYRIGHT (C) <YEAR> On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- *  @file
- *
- *  @brief Get Process and Parent Process IDs
- *  @ingroup libcsupport
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-pid_t _POSIX_types_Ppid = 0;
-
-/**
- *  4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
- */
-pid_t getppid( void )
-{
-  return _POSIX_types_Ppid;
-}
Index: cpukit/libcsupport/src/getpwent.c
===================================================================
--- cpukit/libcsupport/src/getpwent.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,78 +1,0 @@
-/**
- *  @file
- *
- *  @brief User Database Access Routines
- *  @ingroup libcsupport
- */
-
-/*
- *  Copyright (c) 1999-2009 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
- *  Copyright (c) 1999-2013 Joel Sherrill <joel.sherrill@OARcorp.com>
- *  Copyright (c) 2000-2001 Fernando Ruiz Casas <fruizcasas@gmail.com>
- *  Copyright (c) 2002 Eric Norum <eric@norum.ca>
- *  Copyright (c) 2003 Till Straumann <strauman@slac.stanford.edu>
- *  Copyright (c) 2012 Alex Ivanov <alexivanov97@gmail.com>
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "pwdgrp.h"
-
-/*
- * Static, thread-unsafe, buffers
- */
-static FILE *passwd_fp;
-static char pwbuf[200];
-static struct passwd pwent;
-
-struct passwd *getpwnam(
-  const char *name
-)
-{
-  struct passwd *p;
-
-  if(getpwnam_r(name, &pwent, pwbuf, sizeof pwbuf, &p))
-    return NULL;
-  return p;
-}
-
-struct passwd *getpwuid(
-  uid_t uid
-)
-{
-  struct passwd *p;
-
-  if(getpwuid_r(uid, &pwent, pwbuf, sizeof pwbuf, &p))
-    return NULL;
-  return p;
-}
-
-struct passwd *getpwent(void)
-{
-  if (passwd_fp == NULL)
-    return NULL;
-  if (!_libcsupport_scanpw(passwd_fp, &pwent, pwbuf, sizeof pwbuf))
-    return NULL;
-  return &pwent;
-}
-
-void setpwent(void)
-{
-  _libcsupport_pwdgrp_init();
-
-  if (passwd_fp != NULL)
-    fclose(passwd_fp);
-  passwd_fp = fopen("/etc/passwd", "r");
-}
-
-void endpwent(void)
-{
-  if (passwd_fp != NULL)
-    fclose(passwd_fp);
-}
Index: cpukit/libcsupport/src/getreentglobal.c
===================================================================
--- cpukit/libcsupport/src/getreentglobal.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,24 +1,0 @@
-/*
- * Copyright (c) 2018 embedded brains GmbH & Co. KG
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB)
-#include <sys/reent.h>
-
-#ifndef _REENT_THREAD_LOCAL
-struct _reent *__getreent(void)
-{
-  return _GLOBAL_REENT;
-}
-#endif
-#endif
Index: cpukit/libcsupport/src/getrusage.c
===================================================================
--- cpukit/libcsupport/src/getrusage.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/resource.h>
-#include <errno.h>
-
-#include <rtems.h>
-#include <rtems/seterr.h>
-
-int getrusage(int who, struct rusage *usage)
-{
-  struct timespec uptime;
-  struct timeval  rtime;
-
-  if ( !usage )
-    rtems_set_errno_and_return_minus_one( EFAULT );
-
-  /*
-   *  RTEMS only has a single process so there are no children.
-   *  The single process has been running since the system
-   *  was booted and since there is no distinction between system
-   *  and user time, we will just report the uptime.
-   */
-  if (who == RUSAGE_SELF) {
-    rtems_clock_get_uptime( &uptime );
-
-    rtime.tv_sec  = uptime.tv_sec;
-    rtime.tv_usec = uptime.tv_nsec / 1000;
-
-    usage->ru_utime = rtime;
-    usage->ru_stime = rtime;
-
-    return 0;
-  }
-
-  if (who == RUSAGE_CHILDREN) {
-    rtems_set_errno_and_return_minus_one( ENOSYS );
-  }
-
-  rtems_set_errno_and_return_minus_one( EINVAL );
-}
-
Index: cpukit/libcsupport/src/getuid.c
===================================================================
--- cpukit/libcsupport/src/getuid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get Real User, Effective User, Ral Group, and Effective Group IDs
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/userenv.h>
-
-/**
- *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- *        P1003.1b-1993, p. 84
- */
-uid_t getuid( void )
-{
-  return _POSIX_types_Uid;
-}
-
Index: cpukit/libcsupport/src/ioctl.c
===================================================================
--- cpukit/libcsupport/src/ioctl.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief ioctl() system call
- */
-
-/*
- *  This routine is not defined in the POSIX 1003.1b standard but is
- *  commonly supported on most UNIX and POSIX systems.
- *
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdarg.h>
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-#include <unistd.h>
-
-int ioctl(
-  int  fd,
-  ioctl_command_t  command,
-  ...
-)
-{
-  va_list            ap;
-  int                rc;
-  rtems_libio_t     *iop;
-  void              *buffer;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  va_start(ap, command);
-
-  buffer = va_arg(ap, void *);
-
-  /*
-   *  Now process the ioctl().
-   */
-  rc = (*iop->pathinfo.handlers->ioctl_h)( iop, command, buffer );
-
-  va_end( ap );
-  rtems_libio_iop_drop( iop );
-  return rc;
-}
Index: cpukit/libcsupport/src/isatty_r.c
===================================================================
--- cpukit/libcsupport/src/isatty_r.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Test for a Terminal Device
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__ISATTY_R)
-
- /**
- *  This is the Newlib dependent reentrant version of isatty().
- */
-#include <unistd.h>
-#include <reent.h>
-
-int _isatty_r(
-  struct _reent *ptr,
-  int            fd
-)
-{
-  (void) ptr;
-  return isatty( fd );
-}
-#endif
Index: cpukit/libcsupport/src/issetugid.c
===================================================================
--- cpukit/libcsupport/src/issetugid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Dummy Version of BSD Routine
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_ISSETUGID)
-
-/*
- *  Prototype to avoid warnings
- */
-int issetugid (void);
-
-/**
- *  Dummy version of BSD routine
- */
-int issetugid (void)
-{
-  return 0;
-}
-#endif
Index: cpukit/libcsupport/src/kill_noposix.c
===================================================================
--- cpukit/libcsupport/src/kill_noposix.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief Kill No POSIX
- *
- *  Marginal implementations of some POSIX API routines
- *  to be used when POSIX is disabled.
- *
- *    + kill
- *    + _kill_r
- *    + sleep
- */
-
-/*
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-
-#include <signal.h>
-
-/*
- *  These are directly supported (and completely correct) in the posix api.
- */
-
-#if !defined(RTEMS_POSIX_API)
-int kill( pid_t pid, int sig )
-{
-  return 0;
-}
-
-#if defined(RTEMS_NEWLIB)
-#include <reent.h>
-
-int _kill_r( struct _reent *ptr, pid_t pid, int sig )
-{
-  return 0;
-}
-#endif
-#endif
Index: cpukit/libcsupport/src/lchown.c
===================================================================
--- cpukit/libcsupport/src/lchown.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*
- *  lchown() - POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
- *             But Do Not Follow a Symlink
- *
- *  Written by: Vinu Rajashekhar <vinutheraj@gmail.com>
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-int lchown( const char *path, uid_t owner, gid_t group )
-{
-  int rv;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_HARD_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  rv = rtems_filesystem_chown( currentloc, owner, group );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/libio.c
===================================================================
--- cpukit/libcsupport/src/libio.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,178 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief File Descriptor Routines
- *  @ingroup LibIOInternal
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <rtems.h>
-#include <rtems/libio_.h>
-#include <rtems/assoc.h>
-
-/* define this to alias O_NDELAY to  O_NONBLOCK, i.e.,
- * O_NDELAY is accepted on input but fcntl(F_GETFL) returns
- * O_NONBLOCK. This is because rtems has no distinction
- * between the two (but some systems have).
- * Note that accepting this alias creates a problem:
- * an application trying to clear the non-blocking flag
- * using a
- *
- *    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NDELAY);
- *
- * does (silently) ignore the operation.
- */
-#undef ACCEPT_O_NDELAY_ALIAS
-
-static const rtems_assoc_t access_modes_assoc[] = {
-  { "READ",       LIBIO_FLAGS_READ,  O_RDONLY },
-  { "WRITE",      LIBIO_FLAGS_WRITE, O_WRONLY },
-  { "READ/WRITE", LIBIO_FLAGS_READ_WRITE, O_RDWR },
-  { 0, 0, 0 },
-};
-
-static const rtems_assoc_t status_flags_assoc[] = {
-#ifdef ACCEPT_O_NDELAY_ALIAS
-  { "NO DELAY",  LIBIO_FLAGS_NO_DELAY,  O_NDELAY },
-#endif
-  { "NONBLOCK",  LIBIO_FLAGS_NO_DELAY,  O_NONBLOCK },
-  { "APPEND",    LIBIO_FLAGS_APPEND,    O_APPEND },
-  { 0, 0, 0 },
-};
-
-unsigned int rtems_libio_fcntl_flags( int fcntl_flags )
-{
-  unsigned int   flags = 0;
-  uint32_t   access_modes;
-
-  /*
-   * Access mode is a small integer
-   */
-
-  access_modes = (unsigned int) (fcntl_flags & O_ACCMODE);
-  fcntl_flags &= ~O_ACCMODE;
-  flags = rtems_assoc_local_by_remote( access_modes_assoc, access_modes );
-
-  /*
-   * Everything else is single bits
-   */
-
-  flags |= (unsigned int ) rtems_assoc_local_by_remote_bitfield(
-    status_flags_assoc,
-    (uint32_t) fcntl_flags
-  );
-
-  return flags;
-}
-
-int rtems_libio_to_fcntl_flags( unsigned int flags )
-{
-  int fcntl_flags = 0;
-
-  if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
-    fcntl_flags |= O_RDWR;
-  } else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
-    fcntl_flags |= O_RDONLY;
-  } else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
-    fcntl_flags |= O_WRONLY;
-  }
-
-  if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) {
-    fcntl_flags |= O_NONBLOCK;
-  }
-
-  if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
-    fcntl_flags |= O_APPEND;
-  }
-
-  return fcntl_flags;
-}
-
-rtems_libio_t *rtems_libio_allocate( void )
-{
-  rtems_libio_t *iop;
-
-  rtems_libio_lock();
-
-  iop = rtems_libio_iop_free_head;
-
-  if ( iop != NULL ) {
-    void *next;
-
-    next = iop->data1;
-    rtems_libio_iop_free_head = next;
-
-    if ( next == NULL ) {
-      rtems_libio_iop_free_tail = &rtems_libio_iop_free_head;
-    }
-  }
-
-  rtems_libio_unlock();
-
-  return iop;
-}
-
-void rtems_libio_free(
-  rtems_libio_t *iop
-)
-{
-  size_t zero;
-
-  rtems_filesystem_location_free( &iop->pathinfo );
-
-  rtems_libio_lock();
-
-  /*
-   * Clear everything except the reference count part.  At this point in time
-   * there may be still some holders of this file descriptor.
-   */
-  rtems_libio_iop_flags_clear( iop, LIBIO_FLAGS_REFERENCE_INC - 1U );
-  zero = offsetof( rtems_libio_t, offset );
-  memset( (char *) iop + zero, 0, sizeof( *iop ) - zero );
-
-  /*
-   * Append it to the free list.  This increases the likelihood that a use
-   * after close is detected.
-   */
-  *rtems_libio_iop_free_tail = iop;
-  rtems_libio_iop_free_tail = &iop->data1;
-
-  rtems_libio_unlock();
-}
Index: cpukit/libcsupport/src/libio_exit.c
===================================================================
--- cpukit/libcsupport/src/libio_exit.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup LibIO
- */
-
-/*
- * Copyright (c) 2013 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio.h>
-
-void rtems_libio_exit(void)
-{
-  (void)close(0);
-  (void)close(1);
-  (void)close(2);
-}
Index: cpukit/libcsupport/src/libio_init.c
===================================================================
--- cpukit/libcsupport/src/libio_init.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS LibIO Initialization
- *  @ingroup LibIO
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-#include <pthread.h>
-
-#include <rtems/sysinit.h>
-#include <rtems/score/apimutex.h>
-
-/*
- *  File descriptor Table Information
- */
-
-static API_Mutex_Control rtems_libio_mutex = API_MUTEX_INITIALIZER( "_Libio" );
-
-void rtems_libio_lock( void )
-{
-  _API_Mutex_Lock( &rtems_libio_mutex );
-}
-
-void rtems_libio_unlock( void )
-{
-  _API_Mutex_Unlock( &rtems_libio_mutex );
-}
-
-void *rtems_libio_iop_free_head;
-
-void **rtems_libio_iop_free_tail = &rtems_libio_iop_free_head;
-
-static void rtems_libio_init( void )
-{
-    uint32_t i;
-    rtems_libio_t *iop;
-
-    if (rtems_libio_number_iops > 0)
-    {
-        iop = rtems_libio_iop_free_head = &rtems_libio_iops[0];
-        for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
-          iop->data1 = iop + 1;
-        iop->data1 = NULL;
-        rtems_libio_iop_free_tail = &iop->data1;
-    }
-}
-
-RTEMS_SYSINIT_ITEM(
-  rtems_libio_init,
-  RTEMS_SYSINIT_LIBIO,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/libcsupport/src/libiozeroiops.c
===================================================================
--- cpukit/libcsupport/src/libiozeroiops.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup LibIOInternal
- *
- * @brief This source file provides rtems_libio_iops and
- *   rtems_libio_number_iops for a zero file descriptor application
- *   configuration.
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-rtems_libio_t rtems_libio_iops[ 0 ];
-
-const uint32_t rtems_libio_number_iops = 0;
Index: cpukit/libcsupport/src/link.c
===================================================================
--- cpukit/libcsupport/src/link.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,95 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Create a new link
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  link() - POSIX 1003.1b - 5.3.4 - Create a new link
- */
-int link( const char *path1, const char *path2 )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx_1;
-  rtems_filesystem_eval_path_context_t ctx_2;
-  int eval_flags_1 = RTEMS_FS_FOLLOW_LINK;
-  int eval_flags_2 = RTEMS_FS_FOLLOW_LINK
-    | RTEMS_FS_MAKE
-    | RTEMS_FS_EXCLUSIVE;
-  const rtems_filesystem_location_info_t *currentloc_1 =
-    rtems_filesystem_eval_path_start( &ctx_1, path1, eval_flags_1 );
-  const rtems_filesystem_location_info_t *currentloc_2 =
-    rtems_filesystem_eval_path_start( &ctx_2, path2, eval_flags_2 );
-
-  rv = rtems_filesystem_location_exists_in_same_instance_as(
-    currentloc_1,
-    currentloc_2
-  );
-  if ( rv == 0 ) {
-    rv = (*currentloc_2->mt_entry->ops->link_h)(
-      currentloc_2,
-      currentloc_1,
-      rtems_filesystem_eval_path_get_token( &ctx_2 ),
-      rtems_filesystem_eval_path_get_tokenlen( &ctx_2 )
-    );
-  }
-
-  rtems_filesystem_eval_path_cleanup( &ctx_1 );
-  rtems_filesystem_eval_path_cleanup( &ctx_2 );
-
-  return rv;
-}
-
-#if defined(RTEMS_NEWLIB)
-
-#include <reent.h>
-
-/**
- *  This is the Newlib dependent reentrant version of link().
- */
-int _link_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  const char    *path1,
-  const char    *path2
-)
-{
-  return link( path1, path2 );
-}
-#endif
Index: cpukit/libcsupport/src/lseek.c
===================================================================
--- cpukit/libcsupport/src/lseek.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- * @brief lseek() - POSIX 1003.1b 6.5.3 - Reposition Read/Write File Offset
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-off_t lseek( int fd, off_t offset, int whence )
-{
-  rtems_libio_t *iop;
-  off_t          rv;
-
-  LIBIO_GET_IOP( fd, iop );
-
-  rv = (*iop->pathinfo.handlers->lseek_h)( iop, offset, whence );
-  rtems_libio_iop_drop( iop );
-  return rv;
-}
-
-/*
- *  _lseek_r
- *
- *  This is the Newlib dependent reentrant version of lseek().
- */
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__LSEEK_R)
-
-#include <reent.h>
-
-off_t _lseek_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  int            fd,
-  off_t          offset,
-  int            whence
-)
-{
-  return lseek( fd, offset, whence );
-}
-#endif
Index: cpukit/libcsupport/src/lstat.c
===================================================================
--- cpukit/libcsupport/src/lstat.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get File Status
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define _STAT_NAME         lstat
-#define _STAT_R_NAME       _lstat_r
-#define _STAT_FOLLOW_LINKS RTEMS_FS_FOLLOW_HARD_LINK
-
-#include "stat.c"
-
-/**
- *  BSD 4.3 and SVR4 - Get File Status
- */
Index: cpukit/libcsupport/src/malloc.c
===================================================================
--- cpukit/libcsupport/src/malloc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ cpukit/libcsupport/src/malloc.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,46 +1,100 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Malloc Family Implementation
- *  @ingroup libcsupport
+/*
+ *  RTEMS Malloc Family Implementation
+ *
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
  */
 
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+#include <rtems.h>
+#ifdef RTEMS_LIBC
+#include <memory.h>
+#endif
+#include "libcsupport.h"
+#ifdef RTEMS_NEWLIB
+#include <sys/reent.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <assert.h>
+#include <errno.h>
+#include <string.h>
+
+/* 
+ *  XXX: Do we really need to duplicate these? It appears that they
+ *       only cause typing problems.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include <stdlib.h>
-#include <errno.h>
-
-#include "malloc_p.h"
+#if 0
+void *malloc(size_t);
+void *calloc(size_t, size_t);
+void *realloc(void *, size_t);
+void free(void *);
+void *sbrk(size_t);
+#endif
+
+rtems_id RTEMS_Malloc_Heap;
+size_t RTEMS_Malloc_Sbrk_amount;
+
+void RTEMS_Malloc_Initialize(
+  void   *start,
+  size_t  length,
+  size_t  sbrk_amount
+)
+{
+  rtems_status_code   status;
+  void               *starting_address;
+  rtems_unsigned32    u32_address;
+
+  /*
+   * If the starting address is 0 then we are to attempt to
+   * get length worth of memory using sbrk. Make sure we
+   * align the address that we get back.
+   */
+
+  starting_address = start;
+
+  if (!starting_address) {
+    u32_address = (unsigned int)sbrk(length);
+
+    if (u32_address == -1) {
+      rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
+      /* DOES NOT RETURN!!! */
+    }
+
+    if (u32_address & (CPU_ALIGNMENT-1)) {
+      u32_address = (u32_address + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
+      /* XXX: if we do any alignment .. then length should be shortened */
+    }
+
+    starting_address = (void *)u32_address;
+  }
+
+  /*
+   *  Unfortunately we cannot use assert if this fails because if this
+   *  has failed we do not have a heap and if we do not have a heap
+   *  STDIO cannot work because there will be no buffers.
+   */
+
+  status = rtems_region_create(
+    rtems_build_name( 'H', 'E', 'A', 'P' ),
+    starting_address,
+    length,
+    8,                     /* XXX : use CPU dependent RTEMS constant */
+    RTEMS_DEFAULT_ATTRIBUTES,
+    &RTEMS_Malloc_Heap
+  );
+  if ( status != RTEMS_SUCCESSFUL )
+    rtems_fatal_error_occurred( status );
+}
 
 void *malloc(
@@ -48,14 +102,71 @@
 )
 {
-  void        *return_this;
-
-  if ( size == 0 ) {
-    return NULL;
-  }
-
-  return_this = rtems_heap_allocate_aligned_with_boundary( size, 0, 0 );
-  if ( !return_this ) {
-    errno = ENOMEM;
-    return (void *) 0;
+  void              *return_this;
+  void              *starting_address;
+  rtems_unsigned32   the_size;
+  rtems_unsigned32   sbrk_amount;
+  rtems_status_code  status;
+
+  if ( !size )
+    return (void *) 0;
+
+  /*
+   * Try to give a segment in the current region if there is not
+   * enough space then try to grow the region using rtems_region_extend().
+   * If this fails then return a NULL pointer.
+   */
+
+  status = rtems_region_get_segment(
+    RTEMS_Malloc_Heap,
+    size,
+    RTEMS_NO_WAIT,
+    RTEMS_NO_TIMEOUT,
+    &return_this
+  );
+
+  if ( status != RTEMS_SUCCESSFUL ) {
+    /*
+     *  Round to the "requested sbrk amount" so hopefully we won't have
+     *  to grow again for a while.  This effectively does sbrk() calls
+     *  in "page" amounts.
+     */
+
+    sbrk_amount = RTEMS_Malloc_Sbrk_amount;
+
+    if ( sbrk_amount == 0 )
+      return (void *) 0;
+
+    the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
+
+    if (((rtems_unsigned32)starting_address = sbrk(the_size)) == -1)
+      return (void *) 0;
+
+    /*
+    fprintf(stderr, "Extended the C heap starting at 0x%x for %d bytes\n",
+        (unsigned32)starting_address, the_size);
+     */
+
+    status = rtems_region_extend(
+      RTEMS_Malloc_Heap,
+      starting_address,
+      the_size
+    );
+    if ( status != RTEMS_SUCCESSFUL ) {
+      sbrk(-the_size);
+      return(FALSE);
+      errno = ENOMEM;
+      return (void *) 0;
+    }
+    status = rtems_region_get_segment(
+      RTEMS_Malloc_Heap,
+       size,
+       RTEMS_NO_WAIT,
+       RTEMS_NO_TIMEOUT,
+       &return_this
+    );
+    if ( status != RTEMS_SUCCESSFUL ) {
+      errno = ENOMEM;
+      return (void *) 0;
+    }
   }
 
@@ -63,3 +174,107 @@
 }
 
-#endif
+void *calloc(
+  size_t nelem,
+  size_t elsize
+)
+{
+  register char *cptr;
+  int length;
+
+  length = nelem * elsize;
+  cptr = malloc( length );
+  if ( cptr )
+    memset( cptr, '\0', length );
+
+  return cptr;
+}
+
+void *realloc(
+  void *ptr,
+  size_t size
+)
+{
+  rtems_unsigned32  old_size;
+  rtems_status_code status;
+  char *new_area;
+
+  if ( !ptr )
+    return malloc( size );
+
+  if ( !size ) {
+    free( ptr );
+    return (void *) 0;
+  }
+
+  status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &old_size );
+  if ( status != RTEMS_SUCCESSFUL ) {
+    errno = EINVAL;
+    return (void *) 0;
+  }
+
+  new_area = malloc( size );
+  if ( !new_area ) {
+    free( ptr );
+    return (void *) 0;
+  }
+
+  memcpy( new_area, ptr, (size < old_size) ? size : old_size );
+  free( ptr );
+
+  return new_area;
+
+}
+
+void free(
+  void *ptr
+)
+{
+  rtems_status_code status;
+
+  if ( !ptr )
+    return;
+
+  status = rtems_region_return_segment( RTEMS_Malloc_Heap, ptr );
+  if ( status != RTEMS_SUCCESSFUL ) {
+    errno = EINVAL;
+    assert( 0 );
+  }
+}
+
+/*
+ *  "Reentrant" versions of the above routines implemented above.
+ */
+
+#ifdef RTEMS_NEWLIB
+void *malloc_r(
+  struct _reent *ignored,
+  size_t  size
+)
+{
+  return malloc( size );
+}
+
+void *calloc_r(
+  size_t nelem,
+  size_t elsize
+)
+{
+  return calloc( nelem, elsize );
+}
+
+void *realloc_r(
+  void *ptr,
+  size_t size
+)
+{
+  return realloc_r( ptr, size );
+}
+
+void free_r(
+  void *ptr
+)
+{
+  free( ptr );
+}
+#endif
+
Index: cpukit/libcsupport/src/malloc_deferred.c
===================================================================
--- cpukit/libcsupport/src/malloc_deferred.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,134 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Malloc Deferred Support
- *  @ingroup libcsupport
- */
-
-/*
- *  Process free requests deferred because they were from ISR
- *  or other critical section.
- *
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include <stdlib.h>
-#include <string.h>
-
-#include "malloc_p.h"
-
-#include <rtems/score/sysstate.h>
-#include <rtems/score/threaddispatch.h>
-
-Malloc_System_state _Malloc_System_state( void )
-{
-  System_state_Codes state = _System_state_Get();
-
-  if ( _System_state_Is_up( state ) ) {
-    if ( _Thread_Dispatch_is_enabled() ) {
-      return MALLOC_SYSTEM_STATE_NORMAL;
-    } else {
-      return MALLOC_SYSTEM_STATE_NO_ALLOCATION;
-    }
-  } else if ( _System_state_Is_before_multitasking( state ) ) {
-    return MALLOC_SYSTEM_STATE_NORMAL;
-  } else {
-    return MALLOC_SYSTEM_STATE_NO_PROTECTION;
-  }
-}
-
-RTEMS_WEAK void _Malloc_Process_deferred_frees( void )
-{
-  /*
-   * Do nothing by default.  If free() is used by the application, then a
-   * strong implementation of this function will be provided.
-   */
-}
-
-void *rtems_heap_allocate_aligned_with_boundary(
-  size_t    size,
-  uintptr_t alignment,
-  uintptr_t boundary
-)
-{
-  Heap_Control *heap = RTEMS_Malloc_Heap;
-  void *p;
-
-  switch ( _Malloc_System_state() ) {
-    case MALLOC_SYSTEM_STATE_NORMAL:
-      _RTEMS_Lock_allocator();
-      _Malloc_Process_deferred_frees();
-      p = _Heap_Allocate_aligned_with_boundary(
-        heap,
-        size,
-        alignment,
-        boundary
-      );
-      _RTEMS_Unlock_allocator();
-      break;
-    case MALLOC_SYSTEM_STATE_NO_PROTECTION:
-      p = _Heap_Allocate_aligned_with_boundary(
-        heap,
-        size,
-        alignment,
-        boundary
-      );
-      break;
-    default:
-      /*
-       *  Do not attempt to allocate memory if not in correct system state.
-       */
-      return NULL;
-  }
-
-  if ( p == NULL && alignment == 0 && boundary == 0 ) {
-    p = (*rtems_malloc_extend_handler)( heap, size );
-  }
-
-  /*
-   *  If the user wants us to dirty the allocated memory, then do it.
-   */
-  if ( p != NULL && rtems_malloc_dirty_helper != NULL )
-    (*rtems_malloc_dirty_helper)( p, size );
-
-  return p;
-}
-
-void *rtems_malloc( size_t size )
-{
-  if ( size == 0 ) {
-    return NULL;
-  }
-
-  return rtems_heap_allocate_aligned_with_boundary( size, 0, 0 );
-}
-#endif
Index: cpukit/libcsupport/src/malloc_dirtier.c
===================================================================
--- cpukit/libcsupport/src/malloc_dirtier.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Dirty Memory Function
- *  @ingroup MallocSupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/malloc.h>
-#include "malloc_p.h"
-
-#include <errno.h>
-#include <string.h>
-
-void rtems_malloc_dirty_memory(
-  void   *start,
-  size_t  size
-)
-{
-  (void) memset(start, 0xCF, size);
-}
Index: cpukit/libcsupport/src/malloc_p.h
===================================================================
--- cpukit/libcsupport/src/malloc_p.h	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief This header file provides interfaces used by the memory allocator
- *   implementation.
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <rtems.h>
-#include <rtems/score/protectedheap.h>
-#include <rtems/malloc.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef enum {
-  MALLOC_SYSTEM_STATE_NORMAL,
-  MALLOC_SYSTEM_STATE_NO_PROTECTION,
-  MALLOC_SYSTEM_STATE_NO_ALLOCATION
-} Malloc_System_state;
-
-Malloc_System_state _Malloc_System_state( void );
-
-void _Malloc_Process_deferred_frees( void );
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
Index: cpukit/libcsupport/src/malloc_walk.c
===================================================================
--- cpukit/libcsupport/src/malloc_walk.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Malloc Walk
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include "malloc_p.h"
-
-#include <stdlib.h>
-
-bool malloc_walk(int source, bool printf_enabled)
-{
-  return _Protected_heap_Walk( RTEMS_Malloc_Heap, source, printf_enabled );
-}
-
-#endif
Index: cpukit/libcsupport/src/mallocdirtydefault.c
===================================================================
--- cpukit/libcsupport/src/mallocdirtydefault.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/malloc.h>
-
-rtems_malloc_dirtier_t rtems_malloc_dirty_helper = NULL;
Index: cpukit/libcsupport/src/mallocextenddefault.c
===================================================================
--- cpukit/libcsupport/src/mallocextenddefault.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,35 +1,0 @@
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/malloc.h>
-
-const rtems_heap_extend_handler rtems_malloc_extend_handler =
-  rtems_heap_null_extend;
Index: cpukit/libcsupport/src/mallocfreespace.c
===================================================================
--- cpukit/libcsupport/src/mallocfreespace.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Malloc Get Free Information
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/libcsupport.h>
-#include <rtems/score/protectedheap.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
-
-#include "malloc_p.h"
-
-/*
- *  Find amount of free heap remaining
- */
-
-size_t malloc_free_space( void )
-{
-  Heap_Information info;
-
-  _Protected_heap_Get_free_information( RTEMS_Malloc_Heap, &info );
-  return (size_t) info.largest;
-}
Index: cpukit/libcsupport/src/mallocgetheapptr.c
===================================================================
--- cpukit/libcsupport/src/mallocgetheapptr.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Malloc Get Heap Pointer
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/libcsupport.h>
-#include "malloc_p.h"
-
-Heap_Control *malloc_get_heap_pointer( void )
-{
-  return RTEMS_Malloc_Heap;
-}
Index: cpukit/libcsupport/src/mallocheap.c
===================================================================
--- cpukit/libcsupport/src/mallocheap.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup MallocSupport
- *
- * @brief This source file provides the C Program Heap control along with the
- *   system initialization handler.
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/malloc.h>
-#include <rtems/sysinit.h>
-#include <rtems/score/wkspacedata.h>
-
-Heap_Control *RTEMS_Malloc_Heap;
-
-void _Malloc_Initialize( void )
-{
-  RTEMS_Malloc_Heap = ( *_Workspace_Malloc_initializer )();
-}
-
-RTEMS_SYSINIT_ITEM(
-  _Malloc_Initialize,
-  RTEMS_SYSINIT_MALLOC,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/libcsupport/src/mallocinfo.c
===================================================================
--- cpukit/libcsupport/src/mallocinfo.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Malloc Get Status Information
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/malloc.h>
-#include <rtems/score/protectedheap.h>
-
-int malloc_info(
-  Heap_Information_block *the_info
-)
-{
-  if ( !the_info )
-    return -1;
-
-  _Protected_heap_Get_information( RTEMS_Malloc_Heap, the_info );
-  return 0;
-}
Index: cpukit/libcsupport/src/mallocsetheapptr.c
===================================================================
--- cpukit/libcsupport/src/mallocsetheapptr.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Malloc Set Heap Pointer
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/libcsupport.h>
-#include "malloc_p.h"
-
-void malloc_set_heap_pointer(
-  Heap_Control *new_heap
-)
-{
-  RTEMS_Malloc_Heap = new_heap;
-}
Index: cpukit/libcsupport/src/mkdir.c
===================================================================
--- cpukit/libcsupport/src/mkdir.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Make a Directory
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/**
- *  POSIX 1003.1b 5.4.1 - Make a Directory
- */
-int mkdir(
-  const char *pathname,
-  mode_t      mode
-)
-{
-  return mknod( pathname, mode | S_IFDIR, 0LL);
-}
Index: cpukit/libcsupport/src/mkfifo.c
===================================================================
--- cpukit/libcsupport/src/mkfifo.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Make a FIFO Special File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-/**
- *  POSIX 1003.1b 5.4.1 - Make a FIFO Special File
- */
-int mkfifo(
-  const  char *path,
-  mode_t       mode
-)
-{
-  return mknod( path, mode | S_IFIFO, 0LL );
-}
Index: cpukit/libcsupport/src/mknod.c
===================================================================
--- cpukit/libcsupport/src/mknod.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,105 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Create a Special or Ordinary File 
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-
-#include <rtems/libio_.h>
-
-int rtems_filesystem_mknod(
-  const rtems_filesystem_location_info_t *parentloc,
-  const char *name,
-  size_t namelen,
-  mode_t mode,
-  dev_t dev
-)
-{
-  int rv = 0;
-
-  mode &= ~rtems_filesystem_umask;
-
-  switch (mode & S_IFMT) {
-    case S_IFBLK:
-    case S_IFCHR:
-    case S_IFDIR:
-    case S_IFIFO:
-    case S_IFREG:
-      break;
-    default:
-      errno = EINVAL;
-      rv = -1;
-      break;
-  }
-  
-  if ( rv == 0 ) {
-    const rtems_filesystem_operations_table *ops = parentloc->mt_entry->ops;
-
-    rv = (*ops->mknod_h)( parentloc, name, namelen, mode, dev );
-  }
-
-  return rv;
-}
-
-/**
- * This routine is not defined in the POSIX 1003.1b standard but is
- *  commonly supported on most UNIX and POSIX systems.  It is the
- *  foundation for creating file system objects.
- */
-int mknod( const char *path, mode_t mode, dev_t dev )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_LINK
-    | RTEMS_FS_MAKE
-    | RTEMS_FS_EXCLUSIVE
-    | (S_ISDIR(mode) ? RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS : 0);
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  rv = rtems_filesystem_mknod(
-    currentloc,
-    rtems_filesystem_eval_path_get_token( &ctx ),
-    rtems_filesystem_eval_path_get_tokenlen( &ctx ),
-    mode,
-    dev
-  );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/mount-mgr.c
===================================================================
--- cpukit/libcsupport/src/mount-mgr.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,190 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  mount()
- *
- *  Mange the mount table. You can iterate on mounts and file systems, as well
- *  as add and remove file systems not in the file system confiration table.
- *
- *  COPYRIGHT (c) Chris Johns <chrisj@rtems.org> 2010.
- *
- *  Copyright (c) 2010 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <rtems/chain.h>
-#include <rtems/seterr.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <rtems/libio_.h>
-
-typedef struct {
-  rtems_chain_node node;
-  rtems_filesystem_table_t entry;
-} filesystem_node;
-
-static RTEMS_CHAIN_DEFINE_EMPTY(filesystem_chain);
-
-bool rtems_filesystem_iterate(
-  rtems_per_filesystem_routine routine,
-  void *routine_arg
-)
-{
-  rtems_chain_control *chain = &filesystem_chain;
-  const rtems_filesystem_table_t *table_entry = &rtems_filesystem_table [0];
-  rtems_chain_node *node = NULL;
-  bool stop = false;
-
-  while ( table_entry->type && !stop ) {
-    stop = (*routine)( table_entry, routine_arg );
-    ++table_entry;
-  }
-
-  if ( !stop ) {
-    rtems_libio_lock();
-    for (
-      node = rtems_chain_first( chain );
-      !rtems_chain_is_tail( chain, node ) && !stop;
-      node = rtems_chain_next( node )
-    ) {
-      const filesystem_node *fsn = (filesystem_node *) node;
-
-      stop = (*routine)( &fsn->entry, routine_arg );
-    }
-    rtems_libio_unlock();
-  }
-
-  return stop;
-}
-
-typedef struct {
-  const char *type;
-  rtems_filesystem_fsmount_me_t mount_h;
-} find_arg;
-
-static bool find_handler(const rtems_filesystem_table_t *entry, void *arg)
-{
-  find_arg *fa = arg;
-
-  if ( strcmp( entry->type, fa->type ) != 0 ) {
-    return false;
-  } else {
-    fa->mount_h = entry->mount_h;
-
-    return true;
-  }
-}
-
-rtems_filesystem_fsmount_me_t
-rtems_filesystem_get_mount_handler(
-  const char *type
-)
-{
-  find_arg fa = {
-    .type = type,
-    .mount_h = NULL
-  };
-
-  if ( type != NULL ) {
-    rtems_filesystem_iterate( find_handler, &fa );
-  }
-
-  return fa.mount_h;
-}
-
-int
-rtems_filesystem_register(
-  const char                    *type,
-  rtems_filesystem_fsmount_me_t  mount_h
-)
-{
-  rtems_chain_control *chain = &filesystem_chain;
-  size_t type_size = strlen(type) + 1;
-  size_t fsn_size = sizeof( filesystem_node ) + type_size;
-  filesystem_node *fsn = malloc( fsn_size );
-  char *type_storage = (char *) fsn + sizeof( *fsn );
-
-  if ( fsn == NULL )
-    rtems_set_errno_and_return_minus_one( ENOMEM );
-
-  memcpy(type_storage, type, type_size);
-  fsn->entry.type = type_storage;
-  fsn->entry.mount_h = mount_h;
-
-  rtems_libio_lock();
-  if ( rtems_filesystem_get_mount_handler( type ) == NULL ) {
-    rtems_chain_initialize_node( &fsn->node );
-    rtems_chain_append_unprotected( chain, &fsn->node );
-  } else {
-    rtems_libio_unlock();
-    free( fsn );
-
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-  rtems_libio_unlock();
-
-  return 0;
-}
-
-int
-rtems_filesystem_unregister(
-  const char *type
-)
-{
-  rtems_chain_control *chain = &filesystem_chain;
-  rtems_chain_node *node = NULL;
-
-  if ( type == NULL ) {
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-
-  rtems_libio_lock();
-  for (
-    node = rtems_chain_first( chain );
-    !rtems_chain_is_tail( chain, node );
-    node = rtems_chain_next( node )
-  ) {
-    filesystem_node *fsn = (filesystem_node *) node;
-
-    if ( strcmp( fsn->entry.type, type ) == 0 ) {
-      rtems_chain_extract_unprotected( node );
-      free( fsn );
-      rtems_libio_unlock();
-
-      return 0;
-    }
-  }
-  rtems_libio_unlock();
-
-  rtems_set_errno_and_return_minus_one( ENOENT );
-}
Index: cpukit/libcsupport/src/mount-mktgt.c
===================================================================
--- cpukit/libcsupport/src/mount-mktgt.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,70 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup LibIO
- *
- * @brief mount_and_make_target_path() implementation.
- */
-
-/*
- * Copyright (c) 2010 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <errno.h>
-
-#include <rtems/libio.h>
-
-int mount_and_make_target_path(
-  const char *source,
-  const char *target,
-  const char *filesystemtype,
-  rtems_filesystem_options_t options,
-  const void *data
-)
-{
-  int rv = -1;
-
-  if (target != NULL) {
-    rv = rtems_mkdir(target, S_IRWXU | S_IRWXG | S_IRWXO);
-    if (rv == 0) {
-      rv = mount(
-        source,
-        target,
-        filesystemtype,
-        options,
-        data
-      );
-    }
-  } else {
-    errno = EINVAL;
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/mount.c
===================================================================
--- cpukit/libcsupport/src/mount.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,256 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Mounts a File System
- *  @ingroup FileSystemTypesAndMount
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Copyright (C) 2010, 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <rtems/libio_.h>
-
-RTEMS_CHAIN_DEFINE_EMPTY(rtems_filesystem_mount_table);
-
-const rtems_filesystem_limits_and_options_t rtems_filesystem_default_pathconf = {
-   5,    /* link_max: count */
-   128,  /* max_canon: max formatted input line size */
-   7,    /* max_input: max input line size */
-   255,  /* name_max: max name */
-   255,  /* path_max: max path */
-   1024, /* pipe_buf: pipe buffer size */
-   0,    /* posix_async_io: async IO supported on fs, 0=no, 1=yes */
-   0 ,   /* posix_chown_restrictions: can chown: 0=no, 1=yes */
-   1,    /* posix_no_trunc: error on filenames > max name, 0=no, 1=yes */
-   0,    /* posix_prio_io: priority IO, 0=no, 1=yes */
-   0,    /* posix_sync_io: file can be sync'ed, 0=no, 1=yes */
-   0     /* posix_vdisable: special char processing, 0=no, 1=yes */
-};
-
-static rtems_filesystem_mount_table_entry_t *alloc_mount_table_entry(
-  const char *source_or_null,
-  const char *target_or_null,
-  const char *filesystemtype,
-  size_t *target_length_ptr
-)
-{
-  const char *target = target_or_null != NULL ? target_or_null : "/";
-  size_t filesystemtype_size = strlen( filesystemtype ) + 1;
-  size_t source_size = source_or_null != NULL ?
-    strlen( source_or_null ) + 1 : 0;
-  size_t target_size = strlen( target ) + 1;
-  size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
-    + filesystemtype_size + source_size + target_size
-    + sizeof( rtems_filesystem_global_location_t );
-  rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
-
-  if ( mt_entry != NULL ) {
-    rtems_filesystem_global_location_t *mt_fs_root =
-      (rtems_filesystem_global_location_t *)
-        ((char *) mt_entry + sizeof( *mt_entry ));
-    char *str = (char *) mt_fs_root + sizeof( *mt_fs_root );
-
-    memcpy( str, filesystemtype, filesystemtype_size );
-    mt_entry->type = str;
-    str += filesystemtype_size;
-
-    if ( source_or_null != NULL ) {
-      memcpy( str, source_or_null, source_size );
-      mt_entry->dev = str;
-      str += source_size;
-    }
-
-    memcpy( str, target, target_size );
-    mt_entry->target = str;
-
-    mt_entry->mounted = true;
-    mt_entry->mt_fs_root = mt_fs_root;
-    mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
-
-    mt_fs_root->location.mt_entry = mt_entry;
-    mt_fs_root->reference_count = 1;
-
-    rtems_chain_initialize(
-      &mt_entry->location_chain,
-      mt_fs_root,
-      1,
-      sizeof(*mt_fs_root)
-    );
-  }
-
-  *target_length_ptr = target_size - 1;
-
-  return mt_entry;
-}
-
-static int register_subordinate_file_system(
-  rtems_filesystem_mount_table_entry_t *mt_entry,
-  const char *target
-)
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_PERMS_RWX
-    | RTEMS_FS_FOLLOW_LINK;
-  rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, target, eval_flags );
-
-  if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) {
-    rtems_filesystem_location_info_t targetloc;
-    rtems_filesystem_global_location_t *mt_point_node;
-
-    rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc );
-    mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc );
-    mt_entry->mt_point_node = mt_point_node;
-    rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry );
-    if ( rv == 0 ) {
-      rtems_filesystem_mt_lock();
-      rtems_chain_append_unprotected(
-        &rtems_filesystem_mount_table,
-        &mt_entry->mt_node
-      );
-      rtems_filesystem_mt_unlock();
-    } else {
-      rtems_filesystem_global_location_release( mt_point_node, true );
-    }
-  } else {
-    rtems_filesystem_eval_path_error( &ctx, EBUSY );
-    rv = -1;
-  }
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
-
-static int register_root_file_system(
-  rtems_filesystem_mount_table_entry_t *mt_entry
-)
-{
-  int rv = 0;
-
-  rtems_filesystem_mt_lock();
-  if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) {
-    rtems_chain_append_unprotected(
-      &rtems_filesystem_mount_table,
-      &mt_entry->mt_node
-    );
-  } else {
-    errno = EINVAL;
-    rv = -1;
-  }
-  rtems_filesystem_mt_unlock();
-
-  if ( rv == 0 ) {
-    rtems_filesystem_global_location_t *new_fs_root =
-      rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
-    rtems_filesystem_global_location_t *new_fs_current =
-      rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
-
-    rtems_filesystem_global_location_assign(
-      &rtems_filesystem_root,
-      new_fs_root
-    );
-    rtems_filesystem_global_location_assign(
-      &rtems_filesystem_current,
-      new_fs_current
-    );
-  }
-
-  return rv;
-}
-
-int mount(
-  const char                 *source,
-  const char                 *target,
-  const char                 *filesystemtype,
-  rtems_filesystem_options_t options,
-  const void                 *data
-)
-{
-  int rv = 0;
-
-  if (
-    options == RTEMS_FILESYSTEM_READ_ONLY
-      || options == RTEMS_FILESYSTEM_READ_WRITE
-  ) {
-    rtems_filesystem_fsmount_me_t fsmount_me_h =
-      rtems_filesystem_get_mount_handler( filesystemtype );
-
-    if ( fsmount_me_h != NULL ) {
-      size_t target_length = 0;
-      rtems_filesystem_mount_table_entry_t *mt_entry = alloc_mount_table_entry(
-        source,
-        target,
-        filesystemtype,
-        &target_length
-      );
-
-      if ( mt_entry != NULL ) {
-        mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE;
-
-        rv = (*fsmount_me_h)( mt_entry, data );
-        if ( rv == 0 ) {
-          if ( target != NULL ) {
-            rv = register_subordinate_file_system( mt_entry, target );
-          } else {
-            rv = register_root_file_system( mt_entry );
-          }
-
-          if ( rv != 0 ) {
-            (*mt_entry->ops->fsunmount_me_h)( mt_entry );
-          }
-        }
-
-        if ( rv != 0 ) {
-          free( mt_entry );
-        }
-      } else {
-        errno = ENOMEM;
-        rv = -1;
-      }
-    } else {
-      errno = EINVAL;
-      rv = -1;
-    }
-  } else {
-    errno = EINVAL;
-    rv = -1;
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/newlibc.c
===================================================================
--- cpukit/libcsupport/src/newlibc.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/libcsupport/src/newlibc.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,292 @@
+/*
+ *	@(#)newlibc.c	1.8 - 95/04/25
+ *	
+ */
+
+#if defined(RTEMS_NEWLIB)
+
+/*
+ *  File:	$RCSfile$
+ *  Project:	PixelFlow
+ *  Created:	94/12/7
+ *  Revision:	$Revision$
+ *  Last Mod:	$Date$
+ *
+ *  COPYRIGHT (c) 1994 by Division Incorporated
+ *
+ *  To anyone who acknowledges that this file is provided "AS IS"
+ *  without any express or implied warranty:
+ *      permission to use, copy, modify, and distribute this file
+ *      for any purpose is hereby granted without fee, provided that
+ *      the above copyright notice and this notice appears in all
+ *      copies, and that the name of Division Incorporated not be
+ *      used in advertising or publicity pertaining to distribution
+ *      of the software without specific, written prior permission.
+ *      Division Incorporated makes no representations about the
+ *      suitability of this software for any purpose.
+ *
+ *  Description:
+ *      Implementation of hooks for the CYGNUS newlib libc
+ *      These hooks set things up so that:
+ *              '_REENT' is switched at task switch time.
+ *
+ *
+ *  TODO:
+ *
+ *  NOTE:
+ *
+ *  $Id$
+ *
+ */
+
+#include <rtems.h>
+#include <libcsupport.h>
+#include <stdlib.h>             /* for free() */
+#include <string.h>             /* for memset() */
+
+#include <sys/reent.h>          /* for extern of _REENT (aka _impure_ptr) */
+
+#include "internal.h"
+
+#define LIBC_NOTEPAD RTEMS_NOTEPAD_LAST
+
+
+int              libc_reentrant;        /* do we think we are reentrant? */
+struct _reent    libc_global_reent = _REENT_INIT(libc_global_reent);;
+
+/*
+ * CYGNUS newlib routine that does atexit() processing and flushes
+ *      stdio streams
+ *      undocumented
+ */
+
+extern void _wrapup_reent(struct _reent *);
+extern void _reclaim_reent(struct _reent *);
+
+void
+libc_wrapup(void)
+{
+    _wrapup_reent(0);
+    if (_REENT != &libc_global_reent)
+    {
+        _wrapup_reent(&libc_global_reent);
+#if 0
+        /* don't reclaim this one, just in case we do printfs */
+        /* on our way out to ROM */
+        _reclaim_reent(&libc_global_reent);
+#endif
+        _REENT = &libc_global_reent;
+    }
+}
+
+
+rtems_extension
+libc_create_hook(rtems_tcb *current_task,
+                 rtems_tcb *creating_task)
+{
+    MY_task_set_note(creating_task, LIBC_NOTEPAD, 0);
+}
+
+/*
+ * Called for all user TASKS (system tasks are SYSI and IDLE)
+ */
+
+rtems_extension
+libc_start_hook(rtems_tcb *current_task,
+                rtems_tcb *starting_task)
+{
+    struct _reent *ptr;
+
+    /* NOTE: our malloc is reentrant without a reent ptr since
+     *  it is based on region manager
+     */
+
+    ptr = (struct _reent *) malloc(sizeof(struct _reent));
+
+    /* GCC extension: structure constants */
+    *ptr = (struct _reent) _REENT_INIT((*ptr));
+
+    MY_task_set_note(starting_task, LIBC_NOTEPAD, (rtems_unsigned32) ptr);
+}
+
+rtems_extension
+libc_switch_hook(rtems_tcb *current_task,
+                 rtems_tcb *heir_task)
+{
+    rtems_unsigned32 impure_value;
+
+    /* XXX We can't use rtems_task_set_note() here since SYSI task has a
+     * tid of 0, which is treated specially (optimized, actually)
+     * by rtems_task_set_note
+     */
+
+    impure_value = (rtems_unsigned32) _REENT;
+    MY_task_set_note(current_task, LIBC_NOTEPAD, impure_value);
+
+    _REENT = (struct _reent *) MY_task_get_note(heir_task, LIBC_NOTEPAD);
+
+}
+
+/*
+ *  Function:   libc_delete_hook
+ *  Created:    94/12/10
+ *
+ *  Description:
+ *      Called when a task is deleted.
+ *      Must restore the new lib reentrancy state for the new current
+ *      task.
+ *
+ *  Parameters:
+ *
+ *
+ *  Returns:
+ *
+ *
+ *  Side Effects:
+ *
+ *  Notes:
+ *
+ *
+ *  Deficiencies/ToDo:
+ *
+ *
+ */
+rtems_extension
+libc_delete_hook(rtems_tcb *current_task,
+                 rtems_tcb *deleted_task)
+{
+    struct _reent *ptr;
+
+    /*
+     * The reentrancy structure was allocated by newlib using malloc()
+     */
+
+    if (current_task == deleted_task)
+    {
+        ptr = _REENT;
+    }
+    else
+    {
+        ptr = (struct _reent *) MY_task_get_note(deleted_task, LIBC_NOTEPAD);
+    }
+
+    if (ptr)
+    {
+        _wrapup_reent(ptr);
+        _reclaim_reent(ptr);
+    }
+
+    MY_task_set_note(deleted_task, LIBC_NOTEPAD, 0);
+
+    /*
+     * Require the switch back to another task to install its own
+     */
+
+    if (current_task == deleted_task)
+    {
+        _REENT = 0;
+    }
+}
+
+/*
+ *  Function:   libc_init
+ *  Created:    94/12/10
+ *
+ *  Description:
+ *      Init libc for CYGNUS newlib
+ *      Set up _REENT to use our global libc_global_reent.
+ *      (newlib provides a global of its own, but we prefer our
+ *      own name for it)
+ *
+ *      If reentrancy is desired (which it should be), then
+ *      we install the task extension hooks to maintain the
+ *      newlib reentrancy global variable _REENT on task
+ *      create, delete, switch, exit, etc.
+ *
+ *  Parameters:
+ *      reentrant               non-zero if reentrant library desired.
+ *
+ *  Returns:
+ *
+ *  Side Effects:
+ *      installs libc extensions if reentrant.
+ *
+ *  Notes:
+ *
+ *
+ *  Deficiencies/ToDo:
+ *
+ */
+
+void
+libc_init(int reentrant)
+{
+    rtems_extensions_table  libc_extension;
+    rtems_id                extension_id;
+    rtems_status_code       rc;
+
+    _REENT = &libc_global_reent;
+
+    if (reentrant)
+    {
+        memset(&libc_extension, 0, sizeof(libc_extension));
+
+        libc_extension.rtems_task_create  = libc_create_hook;
+        libc_extension.rtems_task_start   = libc_start_hook;
+        libc_extension.task_switch  = libc_switch_hook;
+        libc_extension.rtems_task_delete  = libc_delete_hook;
+
+        rc = rtems_extension_create(rtems_build_name('L', 'I', 'B', 'C'),
+                              &libc_extension, &extension_id);
+        if (rc != RTEMS_SUCCESSFUL)
+            rtems_fatal_error_occurred(rc);
+
+        libc_reentrant = reentrant;
+    }
+}
+
+
+void
+exit(int status)
+{
+    libc_wrapup();
+    rtems_shutdown_executive(status);
+}
+
+
+/*
+ *  Function:   _exit
+ *  Created:    94/12/10
+ *
+ *  Description:
+ *      Called from exit() after it does atexit() processing and stdio fflush's
+ *
+ *      called from bottom of exit() to really delete the task.
+ *      If we are using reentrant libc, then let the delete extension
+ *      do all the work, otherwise if a shutdown is in progress,
+ *      then just do it.
+ *
+ *  Parameters:
+ *      exit status
+ *
+ *  Returns:
+ *      does not return
+ *
+ *  Side Effects:
+ *
+ *  Notes:
+ *
+ *
+ *  Deficiencies/ToDo:
+ *
+ *
+ */
+
+#ifndef RTEMS_UNIX
+void _exit(int status)
+{
+    rtems_shutdown_executive(status);
+}
+#endif
+
+#endif
Index: cpukit/libcsupport/src/newlibc_exit.c
===================================================================
--- cpukit/libcsupport/src/newlibc_exit.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- *  COPYRIGHT (c) 1994 by Division Incorporated
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB)
-#include <stdio.h>
-#include <unistd.h>
-
-  #if defined(__USE_INIT_FINI__)
-    #if CPU_USE_LIBC_INIT_FINI_ARRAY == TRUE
-      #define FINI_SYMBOL __libc_fini_array
-    #else
-      #define FINI_SYMBOL _fini
-    #endif
-
-    extern void FINI_SYMBOL( void );
-  #endif
-
-void _exit(int status)
-{
-  /*
-   *  If the toolset uses init/fini sections, then we need to
-   *  run the global destructors now.
-   */
-  #if defined(FINI_SYMBOL)
-    FINI_SYMBOL();
-  #endif
-
-  rtems_shutdown_executive(status);
-  /* does not return */
-}
-
-#endif
Index: cpukit/libcsupport/src/newlibc_reent.c
===================================================================
--- cpukit/libcsupport/src/newlibc_reent.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/**
- *  @file
- *
- *  @brief Newlib Support
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1994 by Division Incorporated
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/reent.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <rtems/libcsupport.h>
-#include <rtems/score/threadimpl.h>
-
-#ifndef _REENT_THREAD_LOCAL
-bool newlib_create_hook(
-  rtems_tcb *current_task RTEMS_UNUSED,
-  rtems_tcb *creating_task
-)
-{
-  _REENT_INIT_PTR((creating_task->libc_reent)); /* GCC extension: structure constants */
-
-  return true;
-}
-#endif
-
-void newlib_terminate_hook(
-  rtems_tcb *current_task
-)
-{
-#ifdef _REENT_THREAD_LOCAL
-  _reclaim_reent(NULL);
-#else
-  _reclaim_reent(current_task->libc_reent);
-#endif
-}
-
-#endif
Index: cpukit/libcsupport/src/no_libc.c
===================================================================
--- cpukit/libcsupport/src/no_libc.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/libcsupport/src/no_libc.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,45 @@
+#if  !defined(RTEMS_LIBC) && !defined(RTEMS_NEWLIB) && !defined(RTEMS_UNIX)
+
+/*  no_libc.h
+ *
+ *  This file contains stubs for the reentrancy hooks when
+ *  an unknown C library is used.
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
+ *
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
+ *
+ *  $Id$
+ */
+
+
+#include <rtems.h>
+
+#include "libcsupport.h"
+#include "internal.h"
+
+#include <stdlib.h>             /* for free() */
+
+void
+libc_init(int reentrant)
+{
+}
+
+void libc_suspend_main(void)
+{
+}
+
+
+void libc_global_exit(rtems_unsigned32 code)
+{
+}
+
+void _exit(int status)
+{
+}
+
+#endif
Index: cpukit/libcsupport/src/open.c
===================================================================
--- cpukit/libcsupport/src/open.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,213 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Open a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  Modifications to support reference counting in the file system are
- *  Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-static void create_regular_file(
-  rtems_filesystem_eval_path_context_t *ctx,
-  mode_t mode
-)
-{
-  int rv = 0;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_get_currentloc( ctx );
-  const char *token = rtems_filesystem_eval_path_get_token( ctx );
-  size_t tokenlen = rtems_filesystem_eval_path_get_tokenlen( ctx );
-
-  rv = rtems_filesystem_mknod(
-    currentloc,
-    token,
-    tokenlen,
-    S_IFREG | mode,
-    0
-  );
-
-  if ( rv == 0 ) {
-    /* The mode only applies to future accesses of the newly created file */
-    rtems_filesystem_eval_path_set_flags( ctx, 0 );
-
-    rtems_filesystem_eval_path_set_path( ctx, token, tokenlen );
-    rtems_filesystem_eval_path_continue( ctx );
-  } else {
-    rtems_filesystem_eval_path_error( ctx, 0 );
-  }
-}
-
-static int do_open(
-  rtems_libio_t *iop,
-  const char *path,
-  int oflag,
-  mode_t mode
-)
-{
-  int rv = 0;
-  int fd = rtems_libio_iop_to_descriptor( iop );
-  int rwflag = oflag + 1;
-  bool read_access = (rwflag & _FREAD) == _FREAD;
-  bool write_access = (rwflag & _FWRITE) == _FWRITE;
-  bool make = (oflag & O_CREAT) == O_CREAT;
-  bool exclusive = (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL);
-  bool truncate = (oflag & O_TRUNC) == O_TRUNC;
-  bool open_dir;
-#ifdef O_NOFOLLOW
-  int follow = (oflag & O_NOFOLLOW) == O_NOFOLLOW ? 0 : RTEMS_FS_FOLLOW_LINK;
-#else
-  int follow = RTEMS_FS_FOLLOW_LINK;
-#endif
-  int eval_flags = follow
-    | (read_access ? RTEMS_FS_PERMS_READ : 0)
-    | (write_access ? RTEMS_FS_PERMS_WRITE : 0)
-    | (make ? RTEMS_FS_MAKE : 0)
-    | (exclusive ?  RTEMS_FS_EXCLUSIVE : 0);
-  rtems_filesystem_eval_path_context_t ctx;
-  const rtems_filesystem_location_info_t *currentloc;
-  bool create_reg_file;
-
-  rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  currentloc = rtems_filesystem_eval_path_get_currentloc( &ctx );
-  create_reg_file = !currentloc->mt_entry->no_regular_file_mknod;
-
-  if ( create_reg_file && rtems_filesystem_eval_path_has_token( &ctx ) ) {
-    create_regular_file( &ctx, mode );
-  }
-
-#ifdef O_DIRECTORY
-  open_dir = ( oflag & O_DIRECTORY ) == O_DIRECTORY;
-#else
-  open_dir = false;
-#endif
-
-  if ( write_access || open_dir ) {
-    mode_t type = rtems_filesystem_location_type( currentloc );
-
-    if ( create_reg_file && write_access && S_ISDIR( type ) ) {
-      rtems_filesystem_eval_path_error( &ctx, EISDIR );
-    }
-
-    if ( open_dir && !S_ISDIR( type ) ) {
-      rtems_filesystem_eval_path_error( &ctx, ENOTDIR );
-    }
-  }
-
-  rtems_filesystem_eval_path_extract_currentloc( &ctx, &iop->pathinfo );
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  rtems_libio_iop_flags_set( iop, rtems_libio_fcntl_flags( oflag ) );
-
-  rv = (*iop->pathinfo.handlers->open_h)( iop, path, oflag, mode );
-
-  if ( rv == 0 ) {
-    rtems_libio_iop_flags_set( iop, LIBIO_FLAGS_OPEN );
-
-    if ( truncate ) {
-      rv = ftruncate( fd, 0 );
-      if ( rv != 0 ) {
-        (*iop->pathinfo.handlers->close_h)( iop );
-      }
-    }
-
-    if ( rv == 0 ) {
-      rv = fd;
-    } else {
-      rv = -1;
-    }
-  }
-
-  if ( rv < 0 ) {
-    rtems_libio_free( iop );
-  }
-
-  return rv;
-}
-
-/**
-*  POSIX 1003.1 5.3.1 - Open a File
-*/
-int open( const char *path, int oflag, ... )
-{
-  int rv = 0;
-  va_list ap;
-  mode_t mode = 0;
-  rtems_libio_t *iop = NULL;
-
-  va_start( ap, oflag );
-
-  mode = va_arg( ap, mode_t );
-
-  iop = rtems_libio_allocate();
-  if ( iop != NULL ) {
-    rv = do_open( iop, path, oflag, mode );
-  } else {
-    errno = ENFILE;
-    rv = -1;
-  }
-
-  va_end( ap );
-
-  return rv;
-}
-
-
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__OPEN_R)
-
-#include <reent.h>
-
-/**
- *  This is the Newlib dependent reentrant version of open().
- */
-int _open_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  const char    *buf,
-  int            oflag,
-  int            mode
-)
-{
-  return open( buf, oflag, mode );
-}
-#endif
Index: cpukit/libcsupport/src/open_dev_console.c
===================================================================
--- cpukit/libcsupport/src/open_dev_console.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- * @brief open_dev_console - open /dev/console
- */
-
-/*
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/console.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-/*
- *  This is a replaceable stub which opens the console, if present.
- */
-void rtems_libio_post_driver(void)
-{
-  /*
-   * Attempt to open /dev/console.
-   */
-  if ( open( CONSOLE_DEVICE_NAME, O_RDONLY, 0 ) != STDIN_FILENO ) {
-    /*
-     * There may not be a console driver so this is OK.
-     */
-    return;
-  }
-
-  /*
-   *  But if we find /dev/console once, we better find it twice more
-   *  or something is REALLY wrong.
-   */
-  if ( open( CONSOLE_DEVICE_NAME, O_WRONLY, 0 ) != STDOUT_FILENO ) {
-    _Internal_error( INTERNAL_ERROR_LIBIO_STDOUT_FD_OPEN_FAILED );
-  }
-
-  if ( open( CONSOLE_DEVICE_NAME, O_WRONLY, 0 ) != STDERR_FILENO ) {
-    _Internal_error( INTERNAL_ERROR_LIBIO_STDERR_FD_OPEN_FAILED );
-  }
-
-  atexit(rtems_libio_exit);
-}
-
Index: cpukit/libcsupport/src/pathconf.c
===================================================================
--- cpukit/libcsupport/src/pathconf.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Configurable Pathname Varables
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-/**
- *  POSIX 1003.1b - 5.7.1 - Configurable Pathname Varables
- */
-long pathconf(
-  const char *path,
-  int         name
-)
-{
-  int status;
-  int fd;
-
-  fd = open( path, O_RDONLY );
-  if ( fd == -1 )
-    return -1;
-
-  status = fpathconf( fd, name );
-
-  (void) close( fd );
-
-  return status;
-}
Index: cpukit/libcsupport/src/posix_devctl.c
===================================================================
--- cpukit/libcsupport/src/posix_devctl.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,150 +1,0 @@
-/*
- * Copyright (c) 2016, 2020 Joel Sherrill <joel@rtems.org>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define _POSIX_26_C_SOURCE
-
-#include <devctl.h>
-#include <sys/ioctl.h>
-#include <rtems/seterr.h>
-
-#include  <unistd.h>
-#include  <fcntl.h>
-
-int posix_devctl(
-  int              fd,
-  int              dcmd,
-  void *__restrict dev_data_ptr,
-  size_t           nbyte,
-  int *__restrict  dev_info_ptr
-)
-{
-  int rv = 0;
-
-  /*
-   * posix_devctl() is supposed to return an errno. errno needs to be
-   * preserved in spite of calling methods (e.g., close, fcntl, and ioctl)
-   * that set it.
-   */
-  int errno_copy = errno;
-
-  /*
-   * The POSIX 1003.26 standard allows for library implementations
-   * that implement posix_devctl() using ioctl(). In this case,
-   * the extra parameters are largely ignored.
-   *
-   * The FACE Technical Standard requires only that FIONBIO
-   * be supported for sockets.
-   *
-   * This method appears to be rarely implemented and there are
-   * no known required use cases for this method beyond those
-   * from the FACE Technical Standard.
-   */
-
-  /*
-   * POSIX 1003.26 mentions that nbyte must be non-negative but this
-   * doesn't make sense because size_t is guaranteed to be unsigned.
-   */
-
-  /*
-   * Since this is implemented on top of ioctl(), the device information
-   * is not going to be passed down. Fill it in with zero so the behavior
-   * is defined.
-   */
-  if (dev_info_ptr != NULL) {
-    *dev_info_ptr = 0;
-  }
-
-  /*
-   *
-   */
-  switch (dcmd) {
-
-    /*
-     * The FACE Technical Standard Edition 3.0 and newer requires the SOCKCLOSE
-     * ioctl command. This is because the Security Profile does not include
-     * close() and applications need a way to close sockets. Closing sockets is
-     * a minimum requirement so using close() in the implementation meets that
-     * requirement but also lets the application close other file types.
-     */
-    case SOCKCLOSE:
-      if (close(fd) != 0) {
-        rv    = errno;
-        errno = errno_copy;
-
-        return rv;
-      }
-      break;
-
-    /*
-     * The FACE Technical Standard Edition 3.0 and newer requires the
-     * posix_devctl command to support the FIONBIO subcommand.
-     */
-    case FIONBIO: {
-      int tmp_flag;
-      int flag;
-
-      if (nbyte != sizeof(int)) {
-        return EINVAL;
-      }
-
-      tmp_flag = fcntl(fd, F_GETFL, 0);
-      if (tmp_flag == -1) {
-        rv = errno;
-        errno = errno_copy;
-
-        return rv;
-      }
-
-      flag = *(int *)dev_data_ptr;
-
-      if (flag != 0) {
-        tmp_flag |= O_NONBLOCK;
-      } else {
-        tmp_flag &= ~O_NONBLOCK;
-      }
-
-      (void) fcntl(fd, F_SETFL, tmp_flag);
-      break;
-    }
-
-    default:
-      if (ioctl(fd, dcmd, dev_data_ptr) != 0) {
-        rv = errno;
-        errno = errno_copy;
-
-        return rv;
-      }
-      break;
-  }
-
-  errno = errno_copy;
-
-  return rv;
-}
Index: cpukit/libcsupport/src/posix_memalign.c
===================================================================
--- cpukit/libcsupport/src/posix_memalign.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include "malloc_p.h"
-
-#include <stdlib.h>
-#include <errno.h>
-
-int posix_memalign(
-  void   **memptr,
-  size_t   alignment,
-  size_t   size
-)
-{
-  RTEMS_OBFUSCATE_VARIABLE( memptr );
-
-  if ( memptr == NULL ) {
-    return EINVAL;
-  }
-
-  *memptr = NULL;
-
-  if ( alignment < sizeof( void * ) ) {
-    return EINVAL;
-  }
-
-  if ( ( ( alignment - 1 ) & alignment ) != 0 ) {
-    return EINVAL;
-  }
-
-  if ( size == 0 ) {
-    return 0;
-  }
-
-  *memptr = rtems_heap_allocate_aligned_with_boundary( size, alignment, 0 );
-
-  if ( *memptr == NULL ) {
-    return ENOMEM;
-  }
-
-  return 0;
-}
-#endif
Index: cpukit/libcsupport/src/print_fprintf.c
===================================================================
--- cpukit/libcsupport/src/print_fprintf.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Print Support
- *  @ingroup libcsupport
- */
-
-/*
- * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/printer.h>
-
-static int rtems_fprintf_plugin(void *context, const char *fmt, va_list ap)
-{
-  return vfprintf(context, fmt, ap);
-}
-
-void rtems_print_printer_fprintf(rtems_printer *printer, FILE *file)
-{
-  printer->context = file;
-  printer->printer = rtems_fprintf_plugin;
-}
Index: cpukit/libcsupport/src/print_printf.c
===================================================================
--- cpukit/libcsupport/src/print_printf.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Print Support
- *  @ingroup libcsupport
- */
-
-/*
- * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/printer.h>
-
-int rtems_vprintf(
-  const rtems_printer *printer,
-  const char          *format,
-  va_list              ap
-)
-{
-  int len = 0;
-  if ( rtems_print_printer_valid( printer ) ) {
-    len = printer->printer( printer->context, format, ap );
-  }
-  return len;
-}
-
-int rtems_printf(
-  const rtems_printer *printer,
-  const char          *format,
-  ...
-)
-{
-  int len = 0;
-  if ( rtems_print_printer_valid( printer ) ) {
-    va_list ap;
-    va_start( ap, format );
-    len = printer->printer( printer->context, format, ap );
-    va_end( ap );
-  }
-  return len;
-}
Index: cpukit/libcsupport/src/printerfprintfputc.c
===================================================================
--- cpukit/libcsupport/src/printerfprintfputc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2017 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/printer.h>
-#include <rtems/bspIo.h>
-
-#include <pthread.h>
-
-static pthread_once_t fprintf_putc_once = PTHREAD_ONCE_INIT;
-
-static FILE fprintf_putc_file;
-
-static _READ_WRITE_RETURN_TYPE fprintf_putc_write(
-  struct _reent            *ptr,
-  void                     *cookie,
-  char const               *buf,
-  _READ_WRITE_BUFSIZE_TYPE  n
-)
-{
-  _READ_WRITE_RETURN_TYPE i;
-  _READ_WRITE_RETURN_TYPE m;
-
-  m = (_READ_WRITE_RETURN_TYPE) n;
-  for (i = 0; i < m; ++i) {
-    rtems_putc(buf[i]);
-  }
-
-  return m;
-}
-
-static void fprintf_putc_init(void)
-{
-  FILE *f;
-
-  f = &fprintf_putc_file;
-  f->_flags = __SWR | __SNBF;
-  f->_cookie = f;
-  f->_write = fprintf_putc_write;
-  __lock_init_recursive(f->_lock);
-}
-
-static int fprintf_putc_printer(void *context, const char *fmt, va_list ap)
-{
-  return vfprintf(context, fmt, ap);
-}
-
-void rtems_print_printer_fprintf_putc(rtems_printer *printer)
-{
-  pthread_once(&fprintf_putc_once, fprintf_putc_init);
-  printer->context = &fprintf_putc_file;
-  printer->printer = fprintf_putc_printer;
-}
Index: cpukit/libcsupport/src/printertask.c
===================================================================
--- cpukit/libcsupport/src/printertask.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,222 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/printer.h>
-
-#include <rtems.h>
-#include <rtems/seterr.h>
-
-#include <unistd.h>
-
-#define PRINT_TASK_WAKE_UP RTEMS_EVENT_0
-
-typedef struct {
-  rtems_chain_node node;
-
-  enum {
-    ACTION_WRITE,
-    ACTION_DRAIN
-  } action_kind;
-
-  union {
-    size_t   size;
-    rtems_id task;
-  } action_data;
-
-  char data[ RTEMS_ZERO_LENGTH_ARRAY ];
-} printer_task_buffer;
-
-static void printer_task_acquire(
-  rtems_printer_task_context   *ctx,
-  rtems_interrupt_lock_context *lock_context
-)
-{
-  rtems_interrupt_lock_acquire( &ctx->lock, lock_context );
-}
-
-static void printer_task_release(
-  rtems_printer_task_context   *ctx,
-  rtems_interrupt_lock_context *lock_context
-)
-{
-  rtems_interrupt_lock_release( &ctx->lock, lock_context );
-}
-
-static printer_task_buffer *printer_task_get_buffer(
-  rtems_printer_task_context *ctx,
-  rtems_chain_control        *chain
-)
-{
-  rtems_interrupt_lock_context  lock_context;
-  printer_task_buffer          *buffer;
-
-  printer_task_acquire( ctx, &lock_context );
-  buffer = (printer_task_buffer *) rtems_chain_get_unprotected( chain );
-  printer_task_release( ctx, &lock_context );
-
-  return buffer;
-}
-
-static void printer_task_append_buffer(
-  rtems_printer_task_context *ctx,
-  rtems_chain_control        *chain,
-  printer_task_buffer        *buffer
-)
-{
-  rtems_interrupt_lock_context lock_context;
-
-  printer_task_acquire( ctx, &lock_context );
-  rtems_chain_append_unprotected( chain, &buffer->node );
-  printer_task_release( ctx, &lock_context );
-}
-
-static int printer_task_printer( void *context, const char *fmt, va_list ap )
-{
-  rtems_printer_task_context *ctx;
-  printer_task_buffer        *buffer;
-  int                         n;
-
-  ctx = context;
-  buffer = printer_task_get_buffer( ctx, &ctx->free_buffers );
-
-  if ( buffer == NULL ) {
-    rtems_set_errno_and_return_minus_one( ENOMEM );
-  }
-
-  n = vsnprintf( &buffer->data[ 0 ], ctx->buffer_size, fmt, ap );
-
-  if ( n >= (int) ctx->buffer_size ) {
-    printer_task_append_buffer( ctx, &ctx->free_buffers, buffer );
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-
-  buffer->action_kind = ACTION_WRITE;
-  buffer->action_data.size = (size_t) n;
-  printer_task_append_buffer( ctx, &ctx->todo_buffers, buffer );
-  rtems_event_send( ctx->task, PRINT_TASK_WAKE_UP );
-
-  return n;
-}
-
-static void printer_task( rtems_task_argument arg )
-{
-  rtems_printer_task_context *ctx;
-  int                         fd;
-  int                         err;
-  rtems_status_code           sc;
-
-  ctx = (rtems_printer_task_context *) arg;
-  fd = ctx->fd;
-
-  while ( true ) {
-    rtems_event_set      unused;
-    printer_task_buffer *buffer;
-
-    rtems_event_receive(
-      PRINT_TASK_WAKE_UP,
-      RTEMS_EVENT_ALL | RTEMS_WAIT,
-      RTEMS_NO_TIMEOUT,
-      &unused
-    );
-
-    while (
-      ( buffer = printer_task_get_buffer( ctx, &ctx->todo_buffers ) ) != NULL
-    ) {
-      switch ( buffer->action_kind ) {
-        case ACTION_WRITE:
-          write( fd, &buffer->data[ 0 ], buffer->action_data.size );
-          printer_task_append_buffer( ctx, &ctx->free_buffers, buffer );
-          break;
-        case ACTION_DRAIN:
-          err = fsync(fd);
-          _Assert_Unused_variable_equals(err, 0);
-          sc = rtems_event_transient_send( buffer->action_data.task );
-          _Assert_Unused_variable_equals(sc, RTEMS_SUCCESSFUL);
-          break;
-      }
-    }
-  }
-}
-
-int rtems_print_printer_task(
-  rtems_printer              *printer,
-  rtems_printer_task_context *ctx
-)
-{
-  rtems_status_code sc;
-
-  if ( ctx->buffer_size < sizeof( printer_task_buffer ) ) {
-    return EINVAL;
-  }
-
-  sc = rtems_task_create(
-    rtems_build_name( 'P', 'R', 'N', 'T'),
-    ctx->task_priority,
-    ctx->task_stack_size,
-    RTEMS_DEFAULT_MODES,
-    RTEMS_DEFAULT_ATTRIBUTES,
-    &ctx->task
-  );
-
-  if ( sc != RTEMS_SUCCESSFUL ) {
-    return ENOMEM;
-  }
-
-  rtems_chain_initialize_empty( &ctx->todo_buffers );
-  rtems_chain_initialize(
-    &ctx->free_buffers,
-    ctx->buffer_table,
-    ctx->buffer_count,
-    ctx->buffer_size
-  );
-  ctx->buffer_size -= sizeof( printer_task_buffer );
-
-  printer->context = ctx;
-  printer->printer = printer_task_printer;
-
-  sc = rtems_task_start( ctx->task, printer_task, (rtems_task_argument) ctx );
-  _Assert_Unused_variable_equals(sc, RTEMS_SUCCESSFUL);
-
-  return 0;
-}
-
-void rtems_printer_task_drain( rtems_printer_task_context *ctx )
-{
-  printer_task_buffer buffer;
-
-  rtems_chain_initialize_node( &buffer.node );
-  buffer.action_kind = ACTION_DRAIN;
-  buffer.action_data.task = rtems_task_self();
-
-  printer_task_append_buffer( ctx, &ctx->todo_buffers, &buffer );
-  rtems_event_send( ctx->task, PRINT_TASK_WAKE_UP );
-  rtems_event_transient_receive( RTEMS_WAIT, RTEMS_NO_TIMEOUT );
-}
Index: cpukit/libcsupport/src/printf_plugin.c
===================================================================
--- cpukit/libcsupport/src/printf_plugin.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Plugin Printf
- *  @ingroup libcsupport
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/printer.h>
-
-static int rtems_printf_plugin(void *context, const char *format, va_list ap)
-{
-  (void) context;
-  return vprintf(format, ap);
-}
-
-void rtems_print_printer_printf(rtems_printer *printer)
-{
-  printer->context = NULL;
-  printer->printer = rtems_printf_plugin;
-}
Index: cpukit/libcsupport/src/printk.c
===================================================================
--- cpukit/libcsupport/src/printk.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/**
- * @file
- *
- * @ingroup RTEMSAPIKernelCharIO
- *
- * @brief This source file contains the implementation of printk().
- */
-
-/*
- * (C) Copyright 1997 -
- * - NavIST Group - Real-Time Distributed Systems and Industrial Automation
- *
- * http://pandora.ist.utl.pt
- *
- * Instituto Superior Tecnico * Lisboa * PORTUGAL
- *
- * Disclaimer:
- *
- * This file is provided "AS IS" without warranty of any kind, either
- * expressed or implied.
- *
- * This code is based on code by: Jose Rufino - IST
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <rtems/bspIo.h>
-
-/**
- *  Kernel printf function requiring minimal infrastructure.
- */
-int printk(const char *fmt, ...)
-{
-  va_list ap;       /* points to each unnamed argument in turn */
-  int     len;
-  va_start(ap, fmt); /* make ap point to 1st unnamed arg */
-  len = vprintk(fmt, ap);
-  va_end(ap);        /* clean up when done */
-  return len;
-}
Index: cpukit/libcsupport/src/printk_plugin.c
===================================================================
--- cpukit/libcsupport/src/printk_plugin.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSAPIKernelCharIO
- * @ingroup RTEMSPrintSupport
- *
- * @brief This source file contains the implementation of
- *   rtems_printk_printer() and rtems_print_printer_printk().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/printer.h>
-#include <rtems/bspIo.h>
-
-int rtems_printk_printer(
-  void *ignored,
-  const char *format,
-  va_list ap
-)
-{
-  (void) ignored;
-  return vprintk( format, ap );
-}
-
-void rtems_print_printer_printk(
-  rtems_printer *printer
-)
-{
-  printer->context = NULL;
-  printer->printer = rtems_printk_printer;
-}
Index: cpukit/libcsupport/src/privateenv.c
===================================================================
--- cpukit/libcsupport/src/privateenv.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,158 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Instantiate a Private User Environment
- *  @ingroup LibIOEnv
- */
-
-/*
- * Copyright (c) 2001 Fernando Ruiz Casas <fruizcasas@gmail.com>
- *
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-
-#include <rtems/libio_.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/userextimpl.h>
-#include <rtems/sysinit.h>
-
-/**
- *  Instantiate a private user environment for the calling thread.
- */
-
-static void rtems_libio_free_user_env(rtems_user_env_t *env)
-{
-  bool uses_global_env = env == &rtems_global_user_env;
-
-  if (!uses_global_env) {
-    rtems_filesystem_global_location_release(env->current_directory, false);
-    rtems_filesystem_global_location_release(env->root_directory, false);
-    free(env);
-  }
-}
-
-rtems_status_code rtems_libio_set_private_env(void)
-{
-  rtems_status_code sc = RTEMS_SUCCESSFUL;
-  rtems_user_env_t *old_env = rtems_current_user_env;
-  bool uses_global_env = old_env == &rtems_global_user_env;
-
-  if (uses_global_env) {
-    Thread_Life_state life_state =
-      _Thread_Set_life_protection(THREAD_LIFE_PROTECTED);
-    rtems_user_env_t *new_env = calloc(1, sizeof(*new_env));
-
-    if (new_env != NULL) {
-      *new_env = *old_env;
-      new_env->root_directory =
-        rtems_filesystem_global_location_obtain(&old_env->root_directory);
-      new_env->current_directory =
-        rtems_filesystem_global_location_obtain(&old_env->current_directory);
-
-      if (
-        !rtems_filesystem_global_location_is_null(new_env->root_directory)
-          && !rtems_filesystem_global_location_is_null(new_env->current_directory)
-      ) {
-        Thread_Control *executing = _Thread_Get_executing();
-
-        executing->user_environment = new_env;
-      } else {
-        sc = RTEMS_UNSATISFIED;
-      }
-
-      if (sc != RTEMS_SUCCESSFUL) {
-        rtems_libio_free_user_env(new_env);
-      }
-    } else {
-      sc = RTEMS_NO_MEMORY;
-    }
-
-    _Thread_Set_life_protection(life_state);
-  }
-
-  return sc;
-}
-
-void rtems_libio_use_global_env(void)
-{
-  rtems_user_env_t *env = rtems_current_user_env;
-  bool uses_private_env = env != &rtems_global_user_env;
-
-  if (uses_private_env) {
-    Thread_Life_state life_state =
-      _Thread_Set_life_protection(THREAD_LIFE_PROTECTED);
-    Thread_Control *executing;
-
-    rtems_libio_free_user_env(env);
-    executing = _Thread_Get_executing();
-    executing->user_environment = NULL;
-
-    _Thread_Set_life_protection(life_state);
-  }
-}
-
-static void rtems_libio_env_thread_terminate(Thread_Control *the_thread)
-{
-  rtems_user_env_t *env = the_thread->user_environment;
-
-  if (env != NULL) {
-    rtems_libio_free_user_env(env);
-  }
-}
-
-static void rtems_libio_env_thread_restart(
-  Thread_Control *executing,
-  Thread_Control *the_thread
-)
-{
-  (void) executing;
-  rtems_libio_env_thread_terminate( the_thread );
-}
-
-static User_extensions_Control rtems_libio_env_extensions = {
-  .Callouts = {
-    .thread_restart = rtems_libio_env_thread_restart,
-    .thread_terminate = rtems_libio_env_thread_terminate
-  }
-};
-
-static void rtems_libio_env_init(void)
-{
-  _User_extensions_Add_API_set(&rtems_libio_env_extensions);
-}
-
-RTEMS_SYSINIT_ITEM(
-  rtems_libio_env_init,
-  RTEMS_SYSINIT_USER_ENVIRONMENT,
-  RTEMS_SYSINIT_ORDER_MIDDLE
-);
Index: cpukit/libcsupport/src/putk.c
===================================================================
--- cpukit/libcsupport/src/putk.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSAPIKernelCharIO
- *
- * @brief This source file contains the implementation of putk().
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/bspIo.h>
-
-/**
- * Kernel putk (e.g. puts) function requiring minimal infrastrure.
- */
-int putk(const char *s)
-{
-  const char *p;
-  int len_out = 0;
-
-  for (p=s ; *p ; p++, len_out++ )
-    rtems_putc(*p);
-  rtems_putc('\n');
-  return len_out + 1;
-}
Index: cpukit/libcsupport/src/pwdgrp.c
===================================================================
--- cpukit/libcsupport/src/pwdgrp.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,366 +1,0 @@
-/**
- *  @file
- *
- *  @brief User Database Access Routines
- *  @ingroup libcsupport
- */
-
-/*
- *  Copyright (c) 1999-2009 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
- *  Copyright (c) 1999-2013 Joel Sherrill <joel.sherrill@OARcorp.com>
- *  Copyright (c) 2000-2001 Fernando Ruiz Casas <fruizcasas@gmail.com>
- *  Copyright (c) 2002 Eric Norum <eric@norum.ca>
- *  Copyright (c) 2003 Till Straumann <strauman@slac.stanford.edu>
- *  Copyright (c) 2012 Alex Ivanov <alexivanov97@gmail.com>
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-#include <pwd.h>
-#include <grp.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <ctype.h>
-#include <pthread.h>
-#include <stdint.h>
-
-#include <rtems/seterr.h>
-#include <rtems/score/assert.h>
-
-#include "pwdgrp.h"
-
-static pthread_once_t pwdgrp_once = PTHREAD_ONCE_INIT;
-
-static void init_file(const char *name, const char *content)
-{
-  /*
-   * Unlike to standard UNIX systems, these files are only readable and
-   * writeable for the root user.  This way we avoid the need for an
-   * /etc/shadow.  In case more UNIX compatibility is desired, this can be
-   * added on demand.
-   */
-  int fd = open(name, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
-
-  if (fd >= 0) {
-    write(fd, content, strlen(content));
-    close(fd);
-  }
-}
-
-/**
- *  Initialize useable but dummy databases
- */
-static void pwdgrp_init(void)
-{
-  /*
-   * Do the best to create this directory.
-   *
-   * /etc could be created by the network stack initialization or an initial
-   * filesystem image. Deliberately ignore the return value.
-   */
-  (void) mkdir("/etc", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
-
-  /*
-   *  Initialize /etc/passwd
-   */
-  init_file("/etc/passwd", "root::0:0::::\n");
-
-  /*
-   *  Initialize /etc/group
-   */
-  init_file("/etc/group", "root::0:\n");
-}
-
-void _libcsupport_pwdgrp_init(void)
-{
-  pthread_once(&pwdgrp_once, pwdgrp_init);
-}
-
-/**
- *  Extract a string value from the database
- */
-static int
-scanString(FILE *fp, char **name, char **bufp, size_t *nleft, int nlFlag)
-{
-  int c;
-
-  *name = *bufp;
-  for (;;) {
-    c = getc(fp);
-    if (c == ':') {
-        if (nlFlag)
-            return 0;
-        break;
-    }
-    if (c == '\n') {
-        if (!nlFlag)
-            return 0;
-        break;
-    }
-    if (c == EOF)
-      return 0;
-    if (*nleft < 2)
-      return 0;
-    **bufp = c;
-    ++(*bufp);
-    --(*nleft);
-  }
-  **bufp = '\0';
-  ++(*bufp);
-  --(*nleft);
-  return 1;
-}
-
-/**
- *  Extract an integer value from the database
- */
-static int
-scanInt(FILE *fp, int *val)
-{
-  int c;
-  unsigned int i = 0;
-  unsigned int limit = INT_MAX;
-  int sign = 0;
-  int d;
-
-  for (;;) {
-    c = getc(fp);
-    if (c == ':')
-      break;
-    if (sign == 0) {
-      if (c == '-') {
-        sign = -1;
-        limit++;
-        continue;
-      }
-      sign = 1;
-    }
-    if (!isdigit(c))
-      return 0;
-    d = c - '0';
-    if ((i > (limit / 10))
-     || ((i == (limit / 10)) && (d > (limit % 10))))
-      return 0;
-    i = i * 10 + d;
-  }
-  if (sign == 0)
-    return 0;
-  *val = i * sign;
-  return 1;
-}
-
-/*
- * Extract a single password record from the database
- */
-int _libcsupport_scanpw(
-  FILE *fp,
-  struct passwd *pwd,
-  char *buffer,
-  size_t bufsize
-)
-{
-  int pwuid, pwgid;
-
-  if (!scanString(fp, &pwd->pw_name, &buffer, &bufsize, 0)
-   || !scanString(fp, &pwd->pw_passwd, &buffer, &bufsize, 0)
-   || !scanInt(fp, &pwuid)
-   || !scanInt(fp, &pwgid)
-   || !scanString(fp, &pwd->pw_comment, &buffer, &bufsize, 0)
-   || !scanString(fp, &pwd->pw_gecos, &buffer, &bufsize, 0)
-   || !scanString(fp, &pwd->pw_dir, &buffer, &bufsize, 0)
-   || !scanString(fp, &pwd->pw_shell, &buffer, &bufsize, 1))
-    return 0;
-  pwd->pw_uid = pwuid;
-  pwd->pw_gid = pwgid;
-  return 1;
-}
-
-static int getpw_r(
-  const char     *name,
-  int             uid,
-  struct passwd  *pwd,
-  char           *buffer,
-  size_t          bufsize,
-  struct passwd **result
-)
-{
-  FILE *fp;
-  int match;
-
-  _libcsupport_pwdgrp_init();
-
-  if ((fp = fopen("/etc/passwd", "r")) == NULL)
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
-  for(;;) {
-    if (!_libcsupport_scanpw(fp, pwd, buffer, bufsize))
-      goto error_einval;
-
-    if (name) {
-      match = (strcmp(pwd->pw_name, name) == 0);
-    } else {
-      match = (pwd->pw_uid == uid);
-    }
-
-    if (match) {
-      fclose(fp);
-      *result = pwd;
-      return 0;
-    }
-  }
-error_einval:
-  fclose(fp);
-  rtems_set_errno_and_return_minus_one( EINVAL );
-}
-
-int getpwnam_r(
-  const char     *name,
-  struct passwd  *pwd,
-  char           *buffer,
-  size_t          bufsize,
-  struct passwd **result
-)
-{
-  return getpw_r(name, 0, pwd, buffer, bufsize, result);
-}
-
-int getpwuid_r(
-  uid_t           uid,
-  struct passwd  *pwd,
-  char           *buffer,
-  size_t          bufsize,
-  struct passwd **result
-)
-{
-  return getpw_r(NULL, uid, pwd, buffer, bufsize, result);
-}
-
-/**
- *  Extract a single group record from the database
- */
-int _libcsupport_scangr(
-  FILE *fp,
-  struct group *grp,
-  char *buffer,
-  size_t bufsize
-)
-{
-  int grgid;
-  char *grmem, *cp;
-  int memcount;
-
-  if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
-   || !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
-   || !scanInt(fp, &grgid)
-   || !scanString(fp, &grmem, &buffer, &bufsize, 1))
-    return 0;
-  grp->gr_gid = grgid;
-
-  /*
-   * Determine number of members
-   */
-  if (grmem[0] == '\0') {
-    memcount = 0;
-  } else {
-    for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
-      if(*cp == ',')
-        memcount++;
-    }
-  }
-
-  /*
-   * Hack to produce (hopefully) a suitably-aligned array of pointers
-   */
-  if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
-    return 0;
-  grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15);
-
-  /*
-   * Fill in pointer array
-   */
-  if (grmem[0] == '\0') {
-    memcount = 0;
-  } else {
-    grp->gr_mem[0] = grmem;
-    for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
-      if(*cp == ',') {
-        *cp = '\0';
-        grp->gr_mem[memcount++] = cp + 1;
-      }
-    }
-  }
-
-  grp->gr_mem[memcount] = NULL;
-  return 1;
-}
-
-static int getgr_r(
-  const char     *name,
-  int             gid,
-  struct group   *grp,
-  char           *buffer,
-  size_t          bufsize,
-  struct group  **result
-)
-{
-  FILE *fp;
-  int match;
-
-  _libcsupport_pwdgrp_init();
-
-  if ((fp = fopen("/etc/group", "r")) == NULL)
-    rtems_set_errno_and_return_minus_one( EINVAL );
-
-  for(;;) {
-    if (!_libcsupport_scangr(fp, grp, buffer, bufsize))
-      goto error_einval;
-
-    if (name) {
-      match = (strcmp(grp->gr_name, name) == 0);
-    } else {
-      match = (grp->gr_gid == gid);
-    }
-
-    if (match) {
-      fclose(fp);
-      *result = grp;
-      return 0;
-    }
-  }
-error_einval:
-  fclose(fp);
-  rtems_set_errno_and_return_minus_one( EINVAL );
-}
-
-int getgrnam_r(
-  const char     *name,
-  struct group   *grp,
-  char           *buffer,
-  size_t          bufsize,
-  struct group  **result
-)
-{
-  return getgr_r(name, 0, grp, buffer, bufsize, result);
-}
-
-int getgrgid_r(
-  gid_t           gid,
-  struct group   *grp,
-  char           *buffer,
-  size_t          bufsize,
-  struct group  **result
-)
-{
-  return getgr_r(NULL, gid, grp, buffer, bufsize, result);
-}
Index: cpukit/libcsupport/src/pwdgrp.h
===================================================================
--- cpukit/libcsupport/src/pwdgrp.h	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _RTEMS_LIBCSUPPORT_PWDGRP_H
-#define _RTEMS_LIBCSUPPORT_PWDGRP_H
-
-#include <grp.h>
-#include <pwd.h>
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-void _libcsupport_pwdgrp_init(void);
-
-int _libcsupport_scanpw(
-  FILE *fp,
-  struct passwd *pwd,
-  char *buffer,
-  size_t bufsize
-);
-
-int _libcsupport_scangr(
-  FILE *fp,
-  struct group *grp,
-  char *buffer,
-  size_t bufsize
-);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _RTEMS_LIBCSUPPORT_PWDGRP_H */
Index: cpukit/libcsupport/src/read.c
===================================================================
--- cpukit/libcsupport/src/read.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Read From a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-/**
- *  POSIX 1003.1b 6.4.1 - Read From a File
- */
-ssize_t read(
-  int         fd,
-  void       *buffer,
-  size_t      count
-)
-{
-  rtems_libio_t *iop;
-  ssize_t        n;
-
-  rtems_libio_check_buffer( buffer );
-  rtems_libio_check_count( count );
-
-  LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_READ, EBADF );
-
-  /*
-   *  Now process the read().
-   */
-  n = (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
-  rtems_libio_iop_drop( iop );
-  return n;
-}
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE__READ_R)
-
-#include <reent.h>
-
-/**
- *  This is the Newlib dependent reentrant version of read().
- */
-ssize_t _read_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  int            fd,
-  void          *buf,
-  size_t         nbytes
-)
-{
-  return read( fd, buf, nbytes );
-}
-#endif
Index: cpukit/libcsupport/src/readlink.c
===================================================================
--- cpukit/libcsupport/src/readlink.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Read Value of a Symbolic Link 
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  POSIX 1003.1b - X.X.X - XXX
- */
-ssize_t readlink( const char *__restrict path, char *__restrict buf,
-                  size_t bufsize )
-{
-  ssize_t rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_HARD_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-  const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
-  mode_t type = rtems_filesystem_location_type( currentloc );
-
-  if ( S_ISLNK( type ) ) {
-    rv = (*ops->readlink_h)( currentloc, buf, bufsize );
-  } else {
-    rtems_filesystem_eval_path_error( &ctx, EINVAL );
-    rv = -1;
-  }
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/readv.c
===================================================================
--- cpukit/libcsupport/src/readv.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Read a Vector
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/uio.h>
-
-#include <rtems/libio_.h>
-
-static ssize_t readv_adapter(
-  rtems_libio_t      *iop,
-  const struct iovec *iov,
-  int                 iovcnt,
-  ssize_t             total
-)
-{
-  return ( *iop->pathinfo.handlers->readv_h )( iop, iov, iovcnt, total );
-}
-
-/**
- *  readv() - POSIX 1003.1 - Read a Vector
- *
- *  OpenGroup URL:
- *
- *  http://www.opengroup.org/onlinepubs/009695399/functions/readv.html
- */
-ssize_t readv(
-  int                 fd,
-  const struct iovec *iov,
-  int                 iovcnt
-)
-{
-  return rtems_libio_iovec_eval(
-    fd,
-    iov,
-    iovcnt,
-    LIBIO_FLAGS_READ,
-    readv_adapter
-  );
-}
Index: cpukit/libcsupport/src/realloc.c
===================================================================
--- cpukit/libcsupport/src/realloc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,110 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Reallocate Memory Block
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "malloc_p.h"
-
-static void *new_alloc( void *old_ptr, size_t new_size, size_t old_size )
-{
-  void *new_ptr;
-
-  /*
-   *  There used to be a free on this error case but it is wrong to
-   *  free the memory per OpenGroup Single UNIX Specification V2
-   *  and the C Standard.
-   */
-
-  new_ptr = malloc( new_size );
-  if ( new_ptr == NULL ) {
-    return NULL;
-  }
-
-  memcpy( new_ptr, old_ptr, ( new_size < old_size ) ? new_size : old_size );
-  free( old_ptr );
-
-  return new_ptr;
-}
-
-void *realloc( void *ptr, size_t size )
-{
-  Heap_Control       *heap;
-  Heap_Resize_status  status;
-  uintptr_t           old_size;
-  uintptr_t           avail_size;
-
-  if ( ptr == NULL ) {
-    return malloc( size );
-  }
-
-  if ( size == 0 ) {
-    free( ptr );
-    return NULL;
-  }
-
-  heap = RTEMS_Malloc_Heap;
-
-  switch ( _Malloc_System_state() ) {
-    case MALLOC_SYSTEM_STATE_NORMAL:
-      _RTEMS_Lock_allocator();
-      _Malloc_Process_deferred_frees();
-      status = _Heap_Resize_block( heap, ptr, size, &old_size, &avail_size );
-      _RTEMS_Unlock_allocator();
-      break;
-    case MALLOC_SYSTEM_STATE_NO_PROTECTION:
-      status = _Heap_Resize_block( heap, ptr, size, &old_size, &avail_size );
-      break;
-    default:
-      return NULL;
-  }
-
-  switch ( status ) {
-    case HEAP_RESIZE_SUCCESSFUL:
-      return ptr;
-    case HEAP_RESIZE_UNSATISFIED:
-      return new_alloc( ptr, size, old_size );
-    default:
-      errno = EINVAL;
-      return NULL;
-  }
-}
-#endif
Index: cpukit/libcsupport/src/realpath.c
===================================================================
--- cpukit/libcsupport/src/realpath.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,253 +1,0 @@
-/*
- * Copyright (c) 2003 Constantin S. Svintsoff <kostik@iclub.nsu.ru>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The names of the authors may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)realpath.c	8.1 (Berkeley) 2/16/94";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: release/9.1.0/lib/libc/stdlib/realpath.c 240647 2012-09-18 13:03:00Z emaste $");
-
-#if !defined(__rtems__)
-#include "namespace.h"
-#endif
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#if !defined(__rtems__)
-#include "un-namespace.h"
-#endif
-
-/*
- * Find the real name of path, by removing all ".", ".." and symlink
- * components.  Returns (resolved) on success, or (NULL) on failure,
- * in which case the path which caused trouble is left in (resolved).
- */
-char *
-realpath(const char * __restrict path, char * __restrict resolved)
-{
-	struct stat sb;
-	char *p, *q, *s;
-	size_t left_len, resolved_len;
-	unsigned symlinks;
-	int m, slen;
-	char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX];
-
-	if (path == NULL) {
-		errno = EINVAL;
-		return (NULL);
-	}
-	if (path[0] == '\0') {
-		errno = ENOENT;
-		return (NULL);
-	}
-	if (resolved == NULL) {
-		resolved = malloc(PATH_MAX);
-		if (resolved == NULL)
-			return (NULL);
-		m = 1;
-	} else
-		m = 0;
-	symlinks = 0;
-	if (path[0] == '/') {
-		resolved[0] = '/';
-		resolved[1] = '\0';
-		if (path[1] == '\0')
-			return (resolved);
-		resolved_len = 1;
-		left_len = strlcpy(left, path + 1, sizeof(left));
-	} else {
-		if (getcwd(resolved, PATH_MAX) == NULL) {
-			if (m)
-				free(resolved);
-			else {
-				resolved[0] = '.';
-				resolved[1] = '\0';
-			}
-			return (NULL);
-		}
-		resolved_len = strlen(resolved);
-		left_len = strlcpy(left, path, sizeof(left));
-	}
-	if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) {
-		if (m)
-			free(resolved);
-		errno = ENAMETOOLONG;
-		return (NULL);
-	}
-
-	/*
-	 * Iterate over path components in `left'.
-	 */
-	while (left_len != 0) {
-		/*
-		 * Extract the next path component and adjust `left'
-		 * and its length.
-		 */
-		p = strchr(left, '/');
-		s = p ? p : left + left_len;
-		if (s - left >= sizeof(next_token)) {
-			if (m)
-				free(resolved);
-			errno = ENAMETOOLONG;
-			return (NULL);
-		}
-		memcpy(next_token, left, s - left);
-		next_token[s - left] = '\0';
-		left_len -= s - left;
-		if (p != NULL)
-			memmove(left, s + 1, left_len + 1);
-		if (resolved[resolved_len - 1] != '/') {
-			if (resolved_len + 1 >= PATH_MAX) {
-				if (m)
-					free(resolved);
-				errno = ENAMETOOLONG;
-				return (NULL);
-			}
-			resolved[resolved_len++] = '/';
-			resolved[resolved_len] = '\0';
-		}
-		if (next_token[0] == '\0') {
-			/*
-			 * Handle consequential slashes.  The path
-			 * before slash shall point to a directory.
-			 *
-			 * Only the trailing slashes are not covered
-			 * by other checks in the loop, but we verify
-			 * the prefix for any (rare) "//" or "/\0"
-			 * occurence to not implement lookahead.
-			 */
-			if (lstat(resolved, &sb) != 0) {
-				if (m)
-					free(resolved);
-				return (NULL);
-			}
-			if (!S_ISDIR(sb.st_mode)) {
-				if (m)
-					free(resolved);
-				errno = ENOTDIR;
-				return (NULL);
-			}
-			continue;
-		}
-		else if (strcmp(next_token, ".") == 0)
-			continue;
-		else if (strcmp(next_token, "..") == 0) {
-			/*
-			 * Strip the last path component except when we have
-			 * single "/"
-			 */
-			if (resolved_len > 1) {
-				resolved[resolved_len - 1] = '\0';
-				q = strrchr(resolved, '/') + 1;
-				*q = '\0';
-				resolved_len = q - resolved;
-			}
-			continue;
-		}
-
-		/*
-		 * Append the next path component and lstat() it.
-		 */
-		resolved_len = strlcat(resolved, next_token, PATH_MAX);
-		if (resolved_len >= PATH_MAX) {
-			if (m)
-				free(resolved);
-			errno = ENAMETOOLONG;
-			return (NULL);
-		}
-		if (lstat(resolved, &sb) != 0) {
-			if (m)
-				free(resolved);
-			return (NULL);
-		}
-		if (S_ISLNK(sb.st_mode)) {
-			if (symlinks++ > MAXSYMLINKS) {
-				if (m)
-					free(resolved);
-				errno = ELOOP;
-				return (NULL);
-			}
-			slen = readlink(resolved, symlink, sizeof(symlink) - 1);
-			if (slen < 0) {
-				if (m)
-					free(resolved);
-				return (NULL);
-			}
-			symlink[slen] = '\0';
-			if (symlink[0] == '/') {
-				resolved[1] = 0;
-				resolved_len = 1;
-			} else if (resolved_len > 1) {
-				/* Strip the last path component. */
-				resolved[resolved_len - 1] = '\0';
-				q = strrchr(resolved, '/') + 1;
-				*q = '\0';
-				resolved_len = q - resolved;
-			}
-
-			/*
-			 * If there are any path components left, then
-			 * append them to symlink. The result is placed
-			 * in `left'.
-			 */
-			if (p != NULL) {
-				if (symlink[slen - 1] != '/') {
-					if (slen + 1 >= sizeof(symlink)) {
-						if (m)
-							free(resolved);
-						errno = ENAMETOOLONG;
-						return (NULL);
-					}
-					symlink[slen] = '/';
-					symlink[slen + 1] = 0;
-				}
-				left_len = strlcat(symlink, left,
-				    sizeof(symlink));
-				if (left_len >= sizeof(left)) {
-					if (m)
-						free(resolved);
-					errno = ENAMETOOLONG;
-					return (NULL);
-				}
-			}
-			left_len = strlcpy(left, symlink, sizeof(left));
-		}
-	}
-
-	/*
-	 * Remove trailing slash except when the resolved pathname
-	 * is a single "/".
-	 */
-	if (resolved_len > 1 && resolved[resolved_len - 1] == '/')
-		resolved[resolved_len - 1] = '\0';
-	return (resolved);
-}
Index: cpukit/libcsupport/src/resource_snapshot.c
===================================================================
--- cpukit/libcsupport/src/resource_snapshot.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,163 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (C) 2012, 2014 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libcsupport.h>
-
-#include <string.h>
-
-#include <rtems/libio_.h>
-#include <rtems/malloc.h>
-#include <rtems/score/rbtreeimpl.h>
-#include <rtems/score/protectedheap.h>
-#include <rtems/score/threadimpl.h>
-#include <rtems/score/wkspace.h>
-#include <rtems/posix/keyimpl.h>
-
-static const struct {
-  Objects_APIs api;
-  uint16_t cls;
-} objects_info_table[] = {
-  { OBJECTS_POSIX_API, OBJECTS_POSIX_KEYS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_BARRIERS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_EXTENSIONS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_MESSAGE_QUEUES },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_PARTITIONS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_PERIODS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_PORTS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_REGIONS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_SEMAPHORES },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TASKS },
-  { OBJECTS_CLASSIC_API, OBJECTS_RTEMS_TIMERS },
-  { OBJECTS_POSIX_API, OBJECTS_POSIX_MESSAGE_QUEUES },
-  { OBJECTS_POSIX_API, OBJECTS_POSIX_SEMAPHORES },
-  { OBJECTS_POSIX_API, OBJECTS_POSIX_THREADS }
-  #ifdef RTEMS_POSIX_API
-    ,
-    { OBJECTS_POSIX_API, OBJECTS_POSIX_TIMERS }
-  #endif
-};
-
-static int open_files(void)
-{
-  int free_count = 0;
-  rtems_libio_t *iop;
-
-  rtems_libio_lock();
-
-  iop = rtems_libio_iop_free_head;
-  while (iop != NULL) {
-    ++free_count;
-
-    iop = iop->data1;
-  }
-
-  rtems_libio_unlock();
-
-  return (int) rtems_libio_number_iops - free_count;
-}
-
-static void get_heap_info(Heap_Control *heap, Heap_Information_block *info)
-{
-  _Heap_Get_information(heap, info);
-  memset(&info->Stats, 0, sizeof(info->Stats));
-}
-
-static POSIX_Keys_Control *get_next_key(Objects_Id *id)
-{
-  return (POSIX_Keys_Control *)
-    _Objects_Get_next(*id, &_POSIX_Keys_Information, id);
-}
-
-static uint32_t get_active_posix_key_value_pairs(void)
-{
-  uint32_t count = 0;
-  Objects_Id id = OBJECTS_ID_INITIAL_INDEX;
-  POSIX_Keys_Control *the_key;
-
-  while ((the_key = get_next_key(&id)) != NULL ) {
-    count += _Chain_Node_count_unprotected(&the_key->Key_value_pairs);
-    _Objects_Allocator_unlock();
-  }
-
-  return count;
-}
-
-void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
-{
-  uint32_t *active;
-  size_t i;
-
-  memset(snapshot, 0, sizeof(*snapshot));
-
-  _RTEMS_Lock_allocator();
-
-  _Thread_Kill_zombies();
-
-  get_heap_info(RTEMS_Malloc_Heap, &snapshot->heap_info);
-  get_heap_info(&_Workspace_Area, &snapshot->workspace_info);
-
-  active = &snapshot->active_posix_keys;
-
-  for (i = 0; i < RTEMS_ARRAY_SIZE(objects_info_table); ++i) {
-    const Objects_Information *information;
-
-    information = _Objects_Get_information(
-      objects_info_table[i].api,
-      objects_info_table[i].cls
-    );
-
-    if (information != NULL) {
-      active[i] = _Objects_Active_count(information);
-    }
-  }
-
-  _RTEMS_Unlock_allocator();
-
-  snapshot->active_posix_key_value_pairs = get_active_posix_key_value_pairs();
-  snapshot->open_files = open_files();
-}
-
-bool rtems_resource_snapshot_equal(
-  const rtems_resource_snapshot *a,
-  const rtems_resource_snapshot *b
-)
-{
-  return memcmp(a, b, sizeof(*a)) == 0;
-}
-
-bool rtems_resource_snapshot_check(const rtems_resource_snapshot *snapshot)
-{
-  rtems_resource_snapshot now;
-
-  rtems_resource_snapshot_take(&now);
-
-  return rtems_resource_snapshot_equal(&now, snapshot);
-}
Index: cpukit/libcsupport/src/rmdir.c
===================================================================
--- cpukit/libcsupport/src/rmdir.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,82 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Remove a Directory
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-/**
- *   POSIX 1003.1b - 5.2.2 - Remove a Directory
- */
-int rmdir( const char *path )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_REJECT_TERMINAL_DOT;
-  rtems_filesystem_location_info_t parentloc;
-  int parent_eval_flags = RTEMS_FS_PERMS_WRITE
-    | RTEMS_FS_PERMS_EXEC
-    | RTEMS_FS_FOLLOW_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start_with_parent(
-      &ctx,
-      path,
-      eval_flags,
-      &parentloc,
-      parent_eval_flags
-    );
-  const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
-  mode_t type = rtems_filesystem_location_type( currentloc );
-
-  if ( S_ISDIR( type ) ) {
-    if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) {
-      rv = (*ops->rmnod_h)( &parentloc, currentloc );
-    } else {
-      rtems_filesystem_eval_path_error( &ctx, EBUSY );
-      rv = -1;
-    }
-  } else {
-    rtems_filesystem_eval_path_error( &ctx, ENOTDIR );
-    rv = -1;
-  }
-
-  rtems_filesystem_eval_path_cleanup_with_parent( &ctx, &parentloc );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/rtems_heap_extend.c
===================================================================
--- cpukit/libcsupport/src/rtems_heap_extend.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief rtems_heap_extend() implementation.
- */
-
-/*
- * Copyright (c) 2011 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include "malloc_p.h"
-
-rtems_status_code rtems_heap_extend(
-  void *area_begin,
-  uintptr_t area_size
-)
-{
-  bool ok = _Protected_heap_Extend(RTEMS_Malloc_Heap, area_begin, area_size);
-
-  if (ok) {
-    return RTEMS_SUCCESSFUL;
-  } else {
-    return RTEMS_INVALID_ADDRESS;
-  }
-}
-#endif /* RTEMS_NEWLIB */
Index: cpukit/libcsupport/src/rtems_heap_extend_via_sbrk.c
===================================================================
--- cpukit/libcsupport/src/rtems_heap_extend_via_sbrk.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Extend Heap via Sbrk
- *  @ingroup MallocSupport
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/malloc.h>
-
-#include "malloc_p.h"
-
-static ptrdiff_t RTEMS_Malloc_Sbrk_amount;
-
-void rtems_heap_set_sbrk_amount( ptrdiff_t sbrk_amount )
-{
-  RTEMS_Malloc_Sbrk_amount = sbrk_amount;
-}
-
-void *rtems_heap_extend_via_sbrk(
-  Heap_Control *heap,
-  size_t alloc_size
-)
-{
-  ptrdiff_t sbrk_amount = RTEMS_Malloc_Sbrk_amount;
-  ptrdiff_t sbrk_size = (ptrdiff_t) alloc_size;
-  ptrdiff_t misaligned = sbrk_amount != 0 ? sbrk_size % sbrk_amount : 0;
-  void *return_this = NULL;
-
-  if ( misaligned != 0 ) {
-    sbrk_size += sbrk_amount - misaligned;
-  }
-
-  if ( sbrk_size > 0 && sbrk_amount > 0 ) {
-    void *area_begin = sbrk( sbrk_size );
-
-    if ( area_begin != (void *) -1 ) {
-      bool ok = _Protected_heap_Extend( heap, area_begin, sbrk_size );
-
-      if ( ok ) {
-        return_this = _Protected_heap_Allocate( heap, alloc_size );
-      } else {
-        sbrk( -sbrk_size );
-      }
-    }
-  }
-
-  return return_this;
-}
Index: cpukit/libcsupport/src/rtems_heap_greedy.c
===================================================================
--- cpukit/libcsupport/src/rtems_heap_greedy.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,84 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Greedy Allocate that Empties the Heap
- *  @ingroup MallocSupport
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "malloc_p.h"
-
-#define SBRK_ALLOC_SIZE (128 * 1024UL * 1024UL)
-
-void *rtems_heap_greedy_allocate(
-  const uintptr_t *block_sizes,
-  size_t block_count
-)
-{
-  Heap_Control *heap = RTEMS_Malloc_Heap;
-  void *opaque;
-
-  rtems_heap_sbrk_greedy_allocate( heap, SBRK_ALLOC_SIZE );
-
-  _RTEMS_Lock_allocator();
-  opaque = _Heap_Greedy_allocate( RTEMS_Malloc_Heap, block_sizes, block_count );
-  _RTEMS_Unlock_allocator();
-
-  return opaque;
-}
-
-void *rtems_heap_greedy_allocate_all_except_largest(
-  uintptr_t *allocatable_size
-)
-{
-  Heap_Control *heap = RTEMS_Malloc_Heap;
-  void *opaque;
-
-  rtems_heap_sbrk_greedy_allocate( heap, SBRK_ALLOC_SIZE );
-
-  _RTEMS_Lock_allocator();
-  opaque = _Heap_Greedy_allocate_all_except_largest(
-    heap,
-    allocatable_size
-  );
-  _RTEMS_Unlock_allocator();
-
-  return opaque;
-}
-
-void rtems_heap_greedy_free( void *opaque )
-{
-  _RTEMS_Lock_allocator();
-  _Heap_Greedy_free( RTEMS_Malloc_Heap, opaque );
-  _RTEMS_Unlock_allocator();
-}
Index: cpukit/libcsupport/src/rtems_heap_null_extend.c
===================================================================
--- cpukit/libcsupport/src/rtems_heap_null_extend.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,40 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/malloc.h>
-
-void *rtems_heap_null_extend(
-  Heap_Control *heap RTEMS_UNUSED,
-  size_t alloc_size RTEMS_UNUSED
-)
-{
-  return NULL;
-}
Index: cpukit/libcsupport/src/rtems_heap_sbrk_greedy.c
===================================================================
--- cpukit/libcsupport/src/rtems_heap_sbrk_greedy.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @brief Greedy Allocate that Empties the sbrk system call
- *
- * @ingroup MallocSupport
- *
- * @brief Greedy allocation os sbrk system call memory
- *
- * The call consumes all the avialable sbrk memory extending
- * the supplied heap with it. There is no free as sbrk memory
- * is only ever allocated.
- */
-
-/*
- * Copyright (c) 2021 Chris Johns.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "malloc_p.h"
-
-void rtems_heap_sbrk_greedy_allocate(
-  Heap_Control *heap,
-  size_t alloc_size
-)
-{
-  while ( alloc_size > 0 ) {
-    void *p = (*rtems_malloc_extend_handler)( heap, alloc_size );
-    if ( p == NULL ) {
-      alloc_size >>= 1;
-    } else {
-      if ( rtems_malloc_dirty_helper != NULL ) {
-	(*rtems_malloc_dirty_helper)( p, alloc_size );
-      }
-    }
-  }
-}
Index: cpukit/libcsupport/src/rtems_memalign.c
===================================================================
--- cpukit/libcsupport/src/rtems_memalign.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,76 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS Variation on Aligned Memory Allocation
- *  @ingroup MallocSupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef RTEMS_NEWLIB
-#include "malloc_p.h"
-
-#include <stdlib.h>
-#include <errno.h>
-
-int rtems_memalign(
-  void   **pointer,
-  size_t   alignment,
-  size_t   size
-)
-{
-  void *return_this;
-
-  /*
-   *  Parameter error checks
-   */
-  if ( !pointer )
-    return EINVAL;
-
-  *pointer = NULL;
-
-  if ( size == 0 ) {
-    return 0;
-  }
-
-  /*
-   *  Perform the aligned allocation requested
-   */
-  return_this = rtems_heap_allocate_aligned_with_boundary( size, alignment, 0 );
-  if ( !return_this )
-    return ENOMEM;
-
-  *pointer = return_this;
-  return 0;
-}
-#endif
Index: cpukit/libcsupport/src/rtems_mkdir.c
===================================================================
--- cpukit/libcsupport/src/rtems_mkdir.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,141 +1,0 @@
-/**
- * @file
- *
- * @ingroup LibIO
- *
- * @brief rtems_mkdir() implementation.
- *
- * The implementation is based on FreeBSD 'bin/mkdir/mkdir.c' revision 163213.
- */
-
-/*-
- * Copyright (c) 2010 embedded brains GmbH & Co. KG
- *
- * Copyright (c) 1983, 1992, 1993
- *  The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <rtems/libio.h>
-
-/*
- * Returns 1 if a directory has been created,
- * 2 if it already existed, and 0 on failure.
- */
-static int
-build(char *path, mode_t omode)
-{
-  struct stat sb;
-  mode_t numask, oumask;
-  int first, last, retval;
-  char *p;
-
-  p = path;
-  oumask = 0;
-  retval = 1;
-  if (p[0] == '/')    /* Skip leading '/'. */
-    ++p;
-  for (first = 1, last = 0; !last ; ++p) {
-    if (p[0] == '\0')
-      last = 1;
-    else if (p[0] != '/')
-      continue;
-    *p = '\0';
-    if (!last && p[1] == '\0')
-      last = 1;
-    if (first) {
-      /*
-       * POSIX 1003.2:
-       * For each dir operand that does not name an existing
-       * directory, effects equivalent to those caused by the
-       * following command shall occcur:
-       *
-       * mkdir -p -m $(umask -S),u+wx $(dirname dir) &&
-       *    mkdir [-m mode] dir
-       *
-       * We change the user's umask and then restore it,
-       * instead of doing chmod's.
-       */
-      oumask = umask(0);
-      numask = oumask & ~(S_IWUSR | S_IXUSR);
-      (void)umask(numask);
-      first = 0;
-    }
-    if (last)
-      (void)umask(oumask);
-    if (mkdir(path, last ? omode : S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
-      if (errno == EEXIST || errno == EISDIR) {
-        if (stat(path, &sb) < 0) {
-          retval = 0;
-          break;
-        } else if (!S_ISDIR(sb.st_mode)) {
-          if (last)
-            errno = EEXIST;
-          else
-            errno = ENOTDIR;
-          retval = 0;
-          break;
-        }
-        if (last)
-          retval = 2;
-      } else {
-        retval = 0;
-        break;
-      }
-    }
-    if (!last)
-        *p = '/';
-  }
-  if (!first && !last)
-    (void)umask(oumask);
-  return (retval);
-}
-
-int
-rtems_mkdir(const char *path, mode_t mode)
-{
-  int success = 0;
-  char *dup_path = strdup(path);
-
-  if (dup_path != NULL) {
-    success = build(dup_path, mode);
-    free(dup_path);
-  }
-
-  return success != 0 ? 0 : -1;
-}
Index: cpukit/libcsupport/src/rtems_put_char.c
===================================================================
--- cpukit/libcsupport/src/rtems_put_char.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSAPIKernelCharIO
- *
- * @brief This source file contains the implementation of rtems_put_char().
- */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/bspIo.h>
-
-void rtems_put_char( int c, void *arg )
-{
-  (void) arg;
-  rtems_putc( (char) c );
-}
Index: cpukit/libcsupport/src/rtems_putc.c
===================================================================
--- cpukit/libcsupport/src/rtems_putc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSAPIKernelCharIO
- *
- * @brief This source file contains the implementation of rtems_putc().
- */
-
-/*
- * Copyright (C) 2012, 2021 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/bspIo.h>
-
-void rtems_putc( char c )
-{
-  BSP_output_char_function_type output_char;
-
-  output_char = BSP_output_char;
-
-  if ( c == '\n' ) {
-    ( *output_char )( '\r' );
-  }
-
-  ( *output_char )( c );
-}
Index: cpukit/libcsupport/src/rtemscalloc.c
===================================================================
--- cpukit/libcsupport/src/rtemscalloc.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief This source file contains the implementation of rtems_calloc().
- */
-
-/*
- * Copyright (C) 2018 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/malloc.h>
-
-#include <string.h>
-
-void *rtems_calloc( size_t nelem, size_t elsize )
-{
-  size_t  length;
-  void   *p;
-
-  if ( nelem == 0 ) {
-    return NULL;
-  }
-
-  if ( elsize > SIZE_MAX / nelem ) {
-    return NULL;
-  }
-
-  length = nelem * elsize;
-  p = rtems_malloc( length );
-  RTEMS_OBFUSCATE_VARIABLE( p );
-  if ( RTEMS_PREDICT_FALSE( p == NULL ) ) {
-    return p;
-  }
-
-  return memset( p, 0, length );
-}
Index: cpukit/libcsupport/src/setegid.c
===================================================================
--- cpukit/libcsupport/src/setegid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief Get Real User, Effective User, Ral Group, and Effective Group IDs
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/seterr.h>
-#include <rtems/userenv.h>
-
-/**
- *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
- *        P1003.1b-1993, p. 84
- */
-int setegid(
-  gid_t  gid
-)
-{
-  _POSIX_types_Egid = gid;
-  return 0;
-}
Index: cpukit/libcsupport/src/seteuid.c
===================================================================
--- cpukit/libcsupport/src/seteuid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Set Effective User Id
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/userenv.h>
-
-int seteuid( uid_t euid )
-{
-  _POSIX_types_Euid = euid;
-  return 0;
-}
Index: cpukit/libcsupport/src/setgid.c
===================================================================
--- cpukit/libcsupport/src/setgid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief POSIX sets user and group ids
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <rtems/userenv.h>
-
-int setgid(
-  gid_t  gid
-)
-{
-  _POSIX_types_Gid = gid;
-  return 0;
-}
Index: cpukit/libcsupport/src/setgroups.c
===================================================================
--- cpukit/libcsupport/src/setgroups.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2016 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <unistd.h>
-
-int setgroups(int size, const gid_t *list)
-{
-	/* FIXME: Implement this function properly. Currently it only returns a
-	 * success. */
-
-	(void) size;
-	(void) list;
-
-	return 0;
-}
Index: cpukit/libcsupport/src/setpgid.c
===================================================================
--- cpukit/libcsupport/src/setpgid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Set Process Group ID for Job Control
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <errno.h>
-#include <rtems/seterr.h>
-
-/**
- *  4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
- */
-int setpgid(
-  pid_t  pid,
-  pid_t  pgid
-)
-{
-  (void) pid;
-  (void) pgid;
-  rtems_set_errno_and_return_minus_one( ENOSYS );
-}
Index: cpukit/libcsupport/src/setsid.c
===================================================================
--- cpukit/libcsupport/src/setsid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Create Session and Set Process Group ID
- *
- *  @ingroup libcsupport
- */
-
-/*
- * COPYRIGHT (C) 1989-1999 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/seterr.h>
-
-/**
- *  4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
- */
-pid_t setsid( void )
-{
-  rtems_set_errno_and_return_minus_one( EPERM );
-}
Index: cpukit/libcsupport/src/setuid.c
===================================================================
--- cpukit/libcsupport/src/setuid.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/userenv.h>
-
-/*
- *
- *  4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
- */
-int setuid(
-  uid_t  uid
-)
-{
-  _POSIX_types_Uid = uid;
-  return 0;
-}
Index: cpukit/libcsupport/src/stat.c
===================================================================
--- cpukit/libcsupport/src/stat.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,107 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get File Status
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-/*
- *  lstat() and stat() share the same implementation with a minor
- *  difference on how links are evaluated.
- */
-
-#ifndef _STAT_NAME
-#define _STAT_NAME         stat
-#define _STAT_R_NAME       _stat_r
-#define _STAT_FOLLOW_LINKS RTEMS_FS_FOLLOW_LINK
-#endif
-
-#include <sys/stat.h>
-#include <string.h>
-
-#include <rtems/libio_.h>
-
-/*
- *  Prototype to avoid warnings
- */
-int _STAT_NAME( const char *path, struct stat *buf );
-
-/**
- *  POSIX 1003.1b 5.6.2 - Get File Status
- * 
- *  Reused from lstat().
- */
-int _STAT_NAME( const char *path, struct stat *buf )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = _STAT_FOLLOW_LINKS;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  memset( buf, 0, sizeof( *buf ) );
-
-  rv = (*currentloc->handlers->fstat_h)( currentloc, buf );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
-
-#if defined(RTEMS_NEWLIB)
-
-#include <reent.h>
-
-/*
- *  Prototype to avoid warnings
- */
-int _STAT_R_NAME(
-  struct _reent *ptr RTEMS_UNUSED,
-  const char    *path,
-  struct stat   *buf
-);
-
-/**
- *  This is the Newlib dependent reentrant version of stat() and lstat().
- */
-int _STAT_R_NAME(
-  struct _reent *ptr RTEMS_UNUSED,
-  const char    *path,
-  struct stat   *buf
-)
-{
-  return _STAT_NAME( path, buf );
-}
-#endif
Index: cpukit/libcsupport/src/statvfs.c
===================================================================
--- cpukit/libcsupport/src/statvfs.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  COPYRIGHT (c) 2009 Chris Johns <chrisj@rtems.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * The statvfs as defined by the SUS:
- *    http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/statvfs.h.html
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/statvfs.h>
-#include <string.h>
-
-#include <rtems/libio_.h>
-
-int statvfs( const char *__restrict path, struct statvfs *__restrict buf )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  memset( buf, 0, sizeof( *buf ) );
-
-  rv = (*currentloc->mt_entry->ops->statvfs_h)( currentloc, buf );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/sup_fs_check_permissions.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_check_permissions.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,152 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS File System Permissions Check Support
- *  @ingroup LibIOInternal
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-
-#include <rtems/libio_.h>
-
-#define RTEMS_FS_USR_SHIFT 6
-#define RTEMS_FS_GRP_SHIFT 3
-#define RTEMS_FS_OTH_SHIFT 0
-
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_READ << RTEMS_FS_USR_SHIFT) == S_IRUSR,
-  S_IRUSR
-);
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_READ << RTEMS_FS_GRP_SHIFT) == S_IRGRP,
-  S_IRGRP
-);
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_READ << RTEMS_FS_OTH_SHIFT) == S_IROTH,
-  S_IROTH
-);
-
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_WRITE << RTEMS_FS_USR_SHIFT) == S_IWUSR,
-  S_IWUSR
-);
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_WRITE << RTEMS_FS_GRP_SHIFT) == S_IWGRP,
-  S_IWGRP
-);
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_WRITE << RTEMS_FS_OTH_SHIFT) == S_IWOTH,
-  S_IWOTH
-);
-
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_EXEC << RTEMS_FS_USR_SHIFT) == S_IXUSR,
-  S_IXUSR
-);
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_EXEC << RTEMS_FS_GRP_SHIFT) == S_IXGRP,
-  S_IXGRP
-);
-RTEMS_STATIC_ASSERT(
-  (RTEMS_FS_PERMS_EXEC << RTEMS_FS_OTH_SHIFT) == S_IXOTH,
-  S_IXOTH
-);
-
-static bool equals_supplementary_group(
-  const rtems_user_env_t *uenv,
-  gid_t object_gid
-)
-{
-  size_t i;
-
-  for (i = 0; i < uenv->ngroups; ++i) {
-    if (uenv->groups[i] == object_gid) {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-bool rtems_filesystem_check_access(
-  int flags,
-  mode_t object_mode,
-  uid_t object_uid,
-  gid_t object_gid
-)
-{
-  const rtems_user_env_t *uenv = rtems_current_user_env_get();
-  mode_t access_flags = flags & RTEMS_FS_PERMS_RWX;
-  uid_t task_uid = uenv->euid;
-
-  if (task_uid == 0 || task_uid == object_uid) {
-    access_flags <<= RTEMS_FS_USR_SHIFT;
-  } else {
-    gid_t task_gid = uenv->egid;
-
-    if (
-      task_gid == 0
-        || task_gid == object_gid
-        || equals_supplementary_group(uenv, object_gid)
-    ) {
-      access_flags <<= RTEMS_FS_GRP_SHIFT;
-    } else {
-      access_flags <<= RTEMS_FS_OTH_SHIFT;
-    }
-  }
-
-  return (access_flags & object_mode) == access_flags;
-}
-
-bool rtems_filesystem_eval_path_check_access(
-  rtems_filesystem_eval_path_context_t *ctx,
-  int eval_flags,
-  mode_t node_mode,
-  uid_t node_uid,
-  gid_t node_gid
-)
-{
-  bool access_ok = rtems_filesystem_check_access(
-    eval_flags,
-    node_mode,
-    node_uid,
-    node_gid
-  );
-
-  if (!access_ok) {
-    rtems_filesystem_eval_path_error(ctx, EACCES);
-  }
-
-  return access_ok;
-}
Index: cpukit/libcsupport/src/sup_fs_deviceio.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_deviceio.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,159 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS DeviceIO Support
- *  @ingroup Device
- */
-
-/*
- *  COPYRIGHT (c) 1989-2013.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/deviceio.h>
-#include <rtems/rtems/status.h>
-
-int rtems_deviceio_open(
-  rtems_libio_t *iop,
-  const char *path,
-  int oflag,
-  mode_t mode,
-  rtems_device_major_number major,
-  rtems_device_minor_number minor
-)
-{
-  rtems_status_code status;
-  rtems_libio_open_close_args_t args;
-
-  args.iop = iop;
-  args.flags = rtems_libio_iop_flags( iop );
-  args.mode = mode;
-
-  status = rtems_io_open( major, minor, &args );
-
-  return rtems_status_code_to_errno( status );
-}
-
-int rtems_deviceio_close(
-  rtems_libio_t *iop,
-  rtems_device_major_number major,
-  rtems_device_minor_number minor
-)
-{
-  rtems_status_code status;
-  rtems_libio_open_close_args_t args;
-
-  args.iop = iop;
-  args.flags = 0;
-  args.mode = 0;
-
-  status = rtems_io_close( major, minor, &args );
-
-  return rtems_status_code_to_errno( status );
-}
-
-ssize_t rtems_deviceio_read(
-  rtems_libio_t *iop,
-  void *buf,
-  size_t nbyte,
-  rtems_device_major_number major,
-  rtems_device_minor_number minor
-)
-{
-  rtems_status_code status;
-  rtems_libio_rw_args_t args;
-
-  args.iop = iop;
-  args.offset = iop->offset;
-  args.buffer = buf;
-  args.count = nbyte;
-  args.flags = rtems_libio_iop_flags( iop );
-  args.bytes_moved = 0;
-
-  status = rtems_io_read( major, minor, &args );
-  if ( status == RTEMS_SUCCESSFUL ) {
-    iop->offset += args.bytes_moved;
-
-    return (ssize_t) args.bytes_moved;
-  } else {
-    return rtems_status_code_to_errno( status );
-  }
-}
-
-ssize_t rtems_deviceio_write(
-  rtems_libio_t *iop,
-  const void *buf,
-  size_t nbyte,
-  rtems_device_major_number major,
-  rtems_device_minor_number minor
-)
-{
-  rtems_status_code status;
-  rtems_libio_rw_args_t args;
-
-  args.iop = iop;
-  args.offset = iop->offset;
-  args.buffer = RTEMS_DECONST( void *, buf );
-  args.count = nbyte;
-  args.flags = rtems_libio_iop_flags( iop );
-  args.bytes_moved = 0;
-
-  status = rtems_io_write( major, minor, &args );
-  if ( status == RTEMS_SUCCESSFUL ) {
-    iop->offset += args.bytes_moved;
-
-    return (ssize_t) args.bytes_moved;
-  } else {
-    return rtems_status_code_to_errno( status );
-  }
-}
-
-int rtems_deviceio_control(
-  rtems_libio_t *iop,
-  ioctl_command_t command,
-  void *buffer,
-  rtems_device_major_number major,
-  rtems_device_minor_number minor
-)
-{
-  rtems_status_code status;
-  rtems_libio_ioctl_args_t args;
-
-  args.iop = iop;
-  args.command = command;
-  args.buffer = buffer;
-
-  status = rtems_io_control( major, minor, &args );
-  if ( status == RTEMS_SUCCESSFUL ) {
-    return args.ioctl_return;
-  } else {
-    return rtems_status_code_to_errno(status);
-  }
-}
Index: cpukit/libcsupport/src/sup_fs_eval_path.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_eval_path.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,343 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS File Sysyem Path Eval Support
- *  @ingroup LibIOInternal
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-#include <string.h>
-
-static size_t get_parentpathlen(const char *path, size_t pathlen)
-{
-  while (pathlen > 0) {
-    size_t i = pathlen - 1;
-
-    if (rtems_filesystem_is_delimiter(path [i])) {
-      return pathlen;
-    }
-
-    pathlen = i;
-  }
-
-  return 0;
-}
-
-static void set_startloc(
-  rtems_filesystem_eval_path_context_t *ctx,
-  rtems_filesystem_global_location_t *const *global_root_ptr,
-  rtems_filesystem_global_location_t *const *global_current_ptr
-)
-{
-  if (ctx->pathlen > 0) {
-    char c = ctx->path [0];
-
-    ctx->rootloc = rtems_filesystem_global_location_obtain(global_root_ptr);
-
-    if (rtems_filesystem_is_delimiter(c)) {
-      ++ctx->path;
-      --ctx->pathlen;
-      ctx->startloc = rtems_filesystem_global_location_obtain(
-        &ctx->rootloc
-      );
-    } else {
-      ctx->startloc = rtems_filesystem_global_location_obtain(
-        global_current_ptr
-      );
-    }
-  } else {
-    ctx->rootloc = rtems_filesystem_global_location_obtain_null();
-    ctx->startloc = rtems_filesystem_global_location_obtain_null();
-    errno = ENOENT;
-  }
-}
-
-static void check_access(
-  rtems_filesystem_eval_path_context_t *ctx,
-  int eval_flags
-)
-{
-  const rtems_filesystem_location_info_t *currentloc = &ctx->currentloc;
-  const rtems_filesystem_mount_table_entry_t *mt_entry = currentloc->mt_entry;
-
-  if ((eval_flags & RTEMS_FS_PERMS_WRITE) == 0 || mt_entry->writeable) {
-    struct stat st;
-    int rv;
-
-    st.st_mode = 0;
-    st.st_uid = 0;
-    st.st_gid = 0;
-    rv = (*currentloc->handlers->fstat_h)(currentloc, &st);
-    if (rv == 0) {
-      bool access_ok = rtems_filesystem_check_access(
-        eval_flags,
-        st.st_mode,
-        st.st_uid,
-        st.st_gid
-      );
-
-      if (!access_ok) {
-        rtems_filesystem_eval_path_error(ctx, EACCES);
-      }
-    } else {
-      rtems_filesystem_eval_path_error(ctx, 0);
-    }
-  } else {
-    rtems_filesystem_eval_path_error(ctx, EROFS);
-  }
-}
-
-void rtems_filesystem_eval_path_continue(
-  rtems_filesystem_eval_path_context_t *ctx
-)
-{
-  int eval_flags;
-
-  while (ctx->pathlen > 0) {
-    (*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
-  }
-
-  eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
-  if (rtems_filesystem_eval_path_has_token(ctx)) {
-    bool make = (eval_flags & RTEMS_FS_MAKE) != 0;
-
-    if (make) {
-      check_access(ctx, RTEMS_FS_PERMS_WRITE);
-    } else {
-      rtems_filesystem_eval_path_error(ctx, ENOENT);
-    }
-  } else {
-    bool exclusive = (eval_flags & RTEMS_FS_EXCLUSIVE) != 0;
-
-    if (!exclusive) {
-      check_access(ctx, ctx->flags);
-    } else {
-      rtems_filesystem_eval_path_error(ctx, EEXIST);
-    }
-  }
-}
-
-rtems_filesystem_location_info_t *
-rtems_filesystem_eval_path_start_with_root_and_current(
-  rtems_filesystem_eval_path_context_t *ctx,
-  const char *path,
-  size_t pathlen,
-  int eval_flags,
-  rtems_filesystem_global_location_t *const *global_root_ptr,
-  rtems_filesystem_global_location_t *const *global_current_ptr
-)
-{
-  memset(ctx, 0, sizeof(*ctx));
-
-  ctx->path = path;
-  ctx->pathlen = pathlen;
-  ctx->flags = eval_flags;
-
-  set_startloc(ctx, global_root_ptr, global_current_ptr);
-
-  rtems_filesystem_instance_lock(&ctx->startloc->location);
-
-  rtems_filesystem_location_clone(
-    &ctx->currentloc,
-    &ctx->startloc->location
-  );
-
-  rtems_filesystem_eval_path_continue(ctx);
-
-  return &ctx->currentloc;
-}
-
-rtems_filesystem_location_info_t *
-rtems_filesystem_eval_path_start(
-  rtems_filesystem_eval_path_context_t *ctx,
-  const char *path,
-  int eval_flags
-)
-{
-  return rtems_filesystem_eval_path_start_with_root_and_current(
-    ctx,
-    path,
-    strlen(path),
-    eval_flags,
-    &rtems_filesystem_root,
-    &rtems_filesystem_current
-  );
-}
-
-rtems_filesystem_location_info_t *
-rtems_filesystem_eval_path_start_with_parent(
-  rtems_filesystem_eval_path_context_t *ctx,
-  const char *path,
-  int eval_flags,
-  rtems_filesystem_location_info_t *parentloc,
-  int parent_eval_flags
-)
-{
-  size_t pathlen = strlen(path);
-  const char *parentpath = path;
-  size_t parentpathlen = get_parentpathlen(path, pathlen);
-  const char *name = NULL;
-  size_t namelen = 0;
-  const rtems_filesystem_location_info_t *currentloc = NULL;
-
-  if (pathlen > 0) {
-    if (parentpathlen == 0) {
-      parentpath = ".";
-      parentpathlen = 1;
-      name = path;
-      namelen = pathlen;
-    } else {
-      name = path + parentpathlen;
-      namelen = pathlen - parentpathlen;
-    }
-  }
-
-  currentloc = rtems_filesystem_eval_path_start_with_root_and_current(
-    ctx,
-    parentpath,
-    parentpathlen,
-    parent_eval_flags,
-    &rtems_filesystem_root,
-    &rtems_filesystem_current
-  );
-
-  rtems_filesystem_location_clone(parentloc, currentloc);
-
-  ctx->path = name;
-  ctx->pathlen = namelen;
-  ctx->flags = eval_flags;
-
-  rtems_filesystem_eval_path_continue(ctx);
-
-  return &ctx->currentloc;
-}
-
-void rtems_filesystem_eval_path_recursive(
-  rtems_filesystem_eval_path_context_t *ctx,
-  const char *path,
-  size_t pathlen
-)
-{
-  if (pathlen > 0) {
-    if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
-      const char *saved_path = ctx->path;
-      size_t saved_pathlen = ctx->pathlen;
-
-      if (rtems_filesystem_is_delimiter(path [0])) {
-        rtems_filesystem_eval_path_restart(ctx, &ctx->rootloc);
-      }
-
-      ctx->path = path;
-      ctx->pathlen = pathlen;
-
-      ++ctx->recursionlevel;
-      while (ctx->pathlen > 0) {
-        (*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
-      }
-      --ctx->recursionlevel;
-
-      ctx->path = saved_path;
-      ctx->pathlen = saved_pathlen;
-    } else {
-      rtems_filesystem_eval_path_error(ctx, ELOOP);
-    }
-  } else {
-    rtems_filesystem_eval_path_error(ctx, ENOENT);
-  }
-}
-
-void rtems_filesystem_eval_path_error(
-  rtems_filesystem_eval_path_context_t *ctx,
-  int eno
-)
-{
-  ctx->path = NULL;
-  ctx->pathlen = 0;
-  ctx->token = NULL;
-  ctx->tokenlen = 0;
-
-  if (!rtems_filesystem_location_is_null(&ctx->currentloc)) {
-    if (eno != 0) {
-      errno = eno;
-    }
-
-    rtems_filesystem_location_detach(&ctx->currentloc);
-  }
-}
-
-static void free_location(rtems_filesystem_location_info_t *loc)
-{
-  rtems_filesystem_mt_entry_declare_lock_context(lock_context);
-
-  (*loc->mt_entry->ops->freenod_h)(loc);
-
-  rtems_filesystem_mt_entry_lock(lock_context);
-  rtems_chain_extract_unprotected(&loc->mt_entry_node);
-  rtems_filesystem_mt_entry_unlock(lock_context);
-}
-
-void rtems_filesystem_eval_path_cleanup(
-  rtems_filesystem_eval_path_context_t *ctx
-)
-{
-  free_location(&ctx->currentloc);
-  rtems_filesystem_instance_unlock(&ctx->startloc->location);
-  rtems_filesystem_global_location_release(ctx->startloc, false);
-  rtems_filesystem_global_location_release(ctx->rootloc, false);
-}
-
-void rtems_filesystem_eval_path_cleanup_with_parent(
-  rtems_filesystem_eval_path_context_t *ctx,
-  rtems_filesystem_location_info_t *parentloc
-)
-{
-  free_location(parentloc);
-  rtems_filesystem_eval_path_cleanup(ctx);
-}
-
-void rtems_filesystem_eval_path_restart(
-  rtems_filesystem_eval_path_context_t *ctx,
-  rtems_filesystem_global_location_t **newstartloc_ptr
-)
-{
-  free_location(&ctx->currentloc);
-  rtems_filesystem_instance_unlock(&ctx->startloc->location);
-  rtems_filesystem_global_location_assign(
-    &ctx->startloc,
-    rtems_filesystem_global_location_obtain(newstartloc_ptr)
-  );
-  rtems_filesystem_instance_lock(&ctx->startloc->location);
-  rtems_filesystem_location_clone(&ctx->currentloc, &ctx->startloc->location);
-}
Index: cpukit/libcsupport/src/sup_fs_eval_path_generic.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_eval_path_generic.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,140 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS File System Eval Generic Path
- *  @ingroup LibIOInternal
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-static bool is_fs_root( const rtems_filesystem_location_info_t *loc )
-{
-  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
-  const rtems_filesystem_location_info_t *mt_fs_root =
-    &mt_entry->mt_fs_root->location;
-
-  return (*mt_entry->ops->are_nodes_equal_h)( loc, mt_fs_root );
-}
-
-static bool is_eval_path_root(
-  const rtems_filesystem_eval_path_context_t *ctx,
-  const rtems_filesystem_location_info_t *loc
-)
-{
-  const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
-  const rtems_filesystem_location_info_t *rootloc = &ctx->rootloc->location;
-
-  return mt_entry == rootloc->mt_entry
-    && (*mt_entry->ops->are_nodes_equal_h)( loc, rootloc );
-}
-
-void rtems_filesystem_eval_path_generic(
-  rtems_filesystem_eval_path_context_t *ctx,
-  void *arg,
-  const rtems_filesystem_eval_path_generic_config *config
-)
-{
-  rtems_filesystem_eval_path_generic_status status =
-    RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
-
-  while (status == RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE) {
-    const char *token;
-    size_t tokenlen;
-
-    rtems_filesystem_eval_path_get_next_token(ctx, &token, &tokenlen);
-
-    if (tokenlen > 0) {
-      if ((*config->is_directory)(ctx, arg)) {
-        if (rtems_filesystem_is_current_directory(token, tokenlen)) {
-          if (rtems_filesystem_eval_path_has_path(ctx)) {
-            status = (*config->eval_token)(ctx, arg, ".", 1);
-          } else {
-            int eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
-
-            if ((eval_flags & RTEMS_FS_REJECT_TERMINAL_DOT) == 0) {
-              status = (*config->eval_token)(ctx, arg, ".", 1);
-            } else {
-              rtems_filesystem_eval_path_error(ctx, EINVAL);
-              status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
-            }
-          }
-        } else if (rtems_filesystem_is_parent_directory(token, tokenlen)) {
-          rtems_filesystem_location_info_t *currentloc =
-            rtems_filesystem_eval_path_get_currentloc( ctx );
-
-          if (is_eval_path_root(ctx, currentloc)) {
-            /* This prevents the escape from a chroot() environment */
-            status = (*config->eval_token)(ctx, arg, ".", 1);
-          } else if (is_fs_root(currentloc)) {
-            if (currentloc->mt_entry->mt_point_node != NULL) {
-              rtems_filesystem_eval_path_put_back_token(ctx);
-              rtems_filesystem_eval_path_restart(
-                ctx,
-                &currentloc->mt_entry->mt_point_node
-              );
-              status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
-            } else {
-              /* This is the root file system */
-              status = (*config->eval_token)(ctx, arg, ".", 1);
-            }
-          } else {
-            status = (*config->eval_token)(ctx, arg, "..", 2);
-          }
-        } else {
-          status = (*config->eval_token)(ctx, arg, token, tokenlen);
-        }
-
-        if (status == RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY) {
-          if (rtems_filesystem_eval_path_has_path(ctx)) {
-            int eval_flags;
-
-            rtems_filesystem_eval_path_eat_delimiter(ctx);
-            eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
-            if (
-              (eval_flags & RTEMS_FS_ACCEPT_RESIDUAL_DELIMITERS) == 0
-                || rtems_filesystem_eval_path_has_path(ctx)
-            ) {
-              rtems_filesystem_eval_path_error(ctx, ENOENT);
-            }
-          }
-        }
-      } else {
-        rtems_filesystem_eval_path_error(ctx, ENOTDIR);
-        status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
-      }
-    } else {
-      status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
-    }
-  }
-}
Index: cpukit/libcsupport/src/sup_fs_exist_in_same_instance.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_exist_in_same_instance.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Checks that the Locations Exist in the Same File System Instance
- *  @ingroup LibIOInternal
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-int rtems_filesystem_location_exists_in_same_instance_as(
-  const rtems_filesystem_location_info_t *a,
-  const rtems_filesystem_location_info_t *b
-)
-{
-  int rv = -1;
-
-  if (
-    !rtems_filesystem_location_is_null( a )
-      && !rtems_filesystem_location_is_null( b )
-  ) {
-    if ( a->mt_entry == b->mt_entry ) {
-      rv = 0;
-    } else {
-      errno = EXDEV;
-    }
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/sup_fs_location.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_location.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,261 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS File System Location Support
- *  @ingroup LibIOInternal
- */
-
-/*
- * Copyright (C) 2012, 2015 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-
-#include <rtems/libio_.h>
-
-rtems_interrupt_lock rtems_filesystem_mt_entry_lock_control =
-  RTEMS_INTERRUPT_LOCK_INITIALIZER("mount table entry");
-
-RTEMS_INTERRUPT_LOCK_DEFINE(
-  static,
-  deferred_release_lock,
-  "Filesystem Deferred Release"
-)
-
-static rtems_filesystem_global_location_t *deferred_released_global_locations;
-
-rtems_filesystem_location_info_t *rtems_filesystem_location_copy(
-  rtems_filesystem_location_info_t *dst,
-  const rtems_filesystem_location_info_t *src
-)
-{
-  dst->node_access = src->node_access;
-  dst->node_access_2 = src->node_access_2;
-  dst->handlers = src->handlers;
-  dst->mt_entry = src->mt_entry;
-  rtems_chain_initialize_node(&dst->mt_entry_node);
-  rtems_filesystem_location_add_to_mt_entry(dst);
-
-  return dst;
-}
-
-void rtems_filesystem_location_detach(
-  rtems_filesystem_location_info_t *detach
-)
-{
-  rtems_filesystem_location_free(detach);
-  rtems_filesystem_location_initialize_to_null(detach);
-}
-
-void rtems_filesystem_location_copy_and_detach(
-  rtems_filesystem_location_info_t *copy,
-  rtems_filesystem_location_info_t *detach
-)
-{
-  rtems_filesystem_location_copy(copy, detach);
-  rtems_filesystem_location_remove_from_mt_entry(detach);
-  rtems_filesystem_location_initialize_to_null(detach);
-}
-
-rtems_filesystem_global_location_t *rtems_filesystem_location_transform_to_global(
-  rtems_filesystem_location_info_t *loc
-)
-{
-  rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
-
-  if (global_loc != NULL) {
-    global_loc->reference_count = 1;
-    global_loc->deferred_released_next = NULL;
-    global_loc->deferred_released_count = 0;
-    rtems_filesystem_location_copy(&global_loc->location, loc);
-    rtems_filesystem_location_remove_from_mt_entry(loc);
-  } else {
-    rtems_filesystem_location_free(loc);
-    global_loc = rtems_filesystem_global_location_obtain_null();
-    errno = ENOMEM;
-  }
-
-  return global_loc;
-}
-
-void rtems_filesystem_global_location_assign(
-  rtems_filesystem_global_location_t **lhs_global_loc_ptr,
-  rtems_filesystem_global_location_t *rhs_global_loc
-)
-{
-  rtems_filesystem_mt_entry_declare_lock_context(lock_context);
-  rtems_filesystem_global_location_t *lhs_global_loc;
-
-  rtems_filesystem_mt_entry_lock(lock_context);
-  lhs_global_loc = *lhs_global_loc_ptr;
-  *lhs_global_loc_ptr = rhs_global_loc;
-  rtems_filesystem_mt_entry_unlock(lock_context);
-
-  rtems_filesystem_global_location_release(lhs_global_loc, true);
-}
-
-static void release_with_count(
-  rtems_filesystem_global_location_t *global_loc,
-  int count
-)
-{
-  rtems_filesystem_mount_table_entry_t *mt_entry =
-    global_loc->location.mt_entry;
-  rtems_filesystem_mt_entry_declare_lock_context(lock_context);
-  bool do_free;
-  bool do_unmount;
-
-  rtems_filesystem_mt_entry_lock(lock_context);
-  global_loc->reference_count -= count;
-  do_free = global_loc->reference_count == 0;
-  do_unmount = rtems_filesystem_is_ready_for_unmount(mt_entry);
-  rtems_filesystem_mt_entry_unlock(lock_context);
-
-  if (do_free) {
-    rtems_filesystem_location_free(&global_loc->location);
-    free(global_loc);
-  }
-
-  if (do_unmount) {
-    rtems_filesystem_do_unmount(mt_entry);
-  }
-}
-
-static void deferred_release(void)
-{
-  rtems_filesystem_global_location_t *current = NULL;
-
-  do {
-    rtems_interrupt_lock_context lock_context;
-    int count = 0;
-
-    rtems_interrupt_lock_acquire(&deferred_release_lock, &lock_context);
-    current = deferred_released_global_locations;
-    if (current != NULL) {
-      deferred_released_global_locations = current->deferred_released_next;
-      count = current->deferred_released_count;
-      current->deferred_released_next = NULL;
-      current->deferred_released_count = 0;
-    }
-    rtems_interrupt_lock_release(&deferred_release_lock, &lock_context);
-
-    if (current != NULL) {
-      release_with_count(current, count);
-    }
-  } while (current != NULL);
-}
-
-rtems_filesystem_global_location_t *rtems_filesystem_global_location_obtain(
-  rtems_filesystem_global_location_t *const *global_loc_ptr
-)
-{
-  rtems_filesystem_mt_entry_declare_lock_context(lock_context);
-  rtems_filesystem_global_location_t *global_loc;
-
-  if (deferred_released_global_locations != NULL) {
-    deferred_release();
-  }
-
-  rtems_filesystem_mt_entry_lock(lock_context);
-  global_loc = *global_loc_ptr;
-  if (global_loc == NULL || !global_loc->location.mt_entry->mounted) {
-    global_loc = &rtems_filesystem_global_location_null;
-    errno = ENXIO;
-  }
-  ++global_loc->reference_count;
-  rtems_filesystem_mt_entry_unlock(lock_context);
-
-  return global_loc;
-}
-
-void rtems_filesystem_global_location_release(
-  rtems_filesystem_global_location_t *global_loc,
-  bool deferred
-)
-{
-  if (!deferred) {
-    release_with_count(global_loc, 1);
-  } else {
-    rtems_interrupt_lock_context lock_context;
-
-    rtems_interrupt_lock_acquire(&deferred_release_lock, &lock_context);
-
-    if (global_loc->deferred_released_count == 0) {
-      rtems_filesystem_global_location_t *head =
-        deferred_released_global_locations;
-
-      global_loc->deferred_released_count = 1;
-      global_loc->deferred_released_next = head;
-      deferred_released_global_locations = global_loc;
-    } else {
-      ++global_loc->deferred_released_count;
-    }
-
-    rtems_interrupt_lock_release(&deferred_release_lock, &lock_context);
-  }
-}
-
-void rtems_filesystem_location_remove_from_mt_entry(
-  rtems_filesystem_location_info_t *loc
-)
-{
-  rtems_filesystem_mt_entry_declare_lock_context(lock_context);
-  bool do_unmount;
-
-  rtems_filesystem_mt_entry_lock(lock_context);
-  rtems_chain_extract_unprotected(&loc->mt_entry_node);
-  do_unmount = rtems_filesystem_is_ready_for_unmount(loc->mt_entry);
-  rtems_filesystem_mt_entry_unlock(lock_context);
-
-  if (do_unmount) {
-    rtems_filesystem_do_unmount(loc->mt_entry);
-  }
-}
-
-void rtems_filesystem_do_unmount(
-  rtems_filesystem_mount_table_entry_t *mt_entry
-)
-{
-  rtems_filesystem_mt_lock();
-  rtems_chain_extract_unprotected(&mt_entry->mt_node);
-  rtems_filesystem_mt_unlock();
-  rtems_filesystem_global_location_release(mt_entry->mt_point_node, false);
-  (*mt_entry->ops->fsunmount_me_h)(mt_entry);
-
-  if (mt_entry->unmount_task != 0) {
-    rtems_status_code sc =
-      rtems_event_transient_send(mt_entry->unmount_task);
-    if (sc != RTEMS_SUCCESSFUL) {
-      rtems_fatal_error_occurred(0xdeadbeef);
-    }
-  }
-
-  free(mt_entry);
-}
Index: cpukit/libcsupport/src/sup_fs_mount_iterate.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_mount_iterate.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup Termios Termios
- *
- * @brief Mount table entry visitor.
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-bool rtems_filesystem_mount_iterate(
-  rtems_filesystem_mt_entry_visitor visitor,
-  void *visitor_arg
-)
-{
-  rtems_chain_control *chain = &rtems_filesystem_mount_table;
-  rtems_chain_node *node = NULL;
-  bool stop = false;
-
-  rtems_filesystem_mt_lock();
-  for (
-    node = rtems_chain_first( chain );
-    !rtems_chain_is_tail( chain, node ) && !stop;
-    node = rtems_chain_next( node )
-  ) {
-    const rtems_filesystem_mount_table_entry_t *mt_entry =
-      (rtems_filesystem_mount_table_entry_t *) node;
-
-    stop = (*visitor)( mt_entry, visitor_arg );
-  }
-  rtems_filesystem_mt_unlock();
-
-  return stop;
-}
Index: cpukit/libcsupport/src/sup_fs_next_token.c
===================================================================
--- cpukit/libcsupport/src/sup_fs_next_token.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,78 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief RTEMS File System Eval Eat Delimiter Path
- *  @ingroup LibIOInternal
- */
-
-/*
- * Copyright (c) 2012 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-void rtems_filesystem_eval_path_eat_delimiter(
-  rtems_filesystem_eval_path_context_t *ctx
-)
-{
-  const char *current = ctx->path;
-  const char *end = current + ctx->pathlen;
-
-  while (current != end && rtems_filesystem_is_delimiter(*current)) {
-    ++current;
-  }
-
-  ctx->path = current;
-  ctx->pathlen = (size_t) (end - current);
-}
-
-static void next_token(rtems_filesystem_eval_path_context_t *ctx)
-{
-  const char *begin = ctx->path;
-  const char *end = begin + ctx->pathlen;
-  const char *current = begin;
-
-  while (current != end && !rtems_filesystem_is_delimiter(*current)) {
-    ++current;
-  }
-
-  ctx->path = current;
-  ctx->pathlen = (size_t) (end - current);
-  ctx->token = begin;
-  ctx->tokenlen = (size_t) (current - begin);
-}
-
-void rtems_filesystem_eval_path_next_token(
-  rtems_filesystem_eval_path_context_t *ctx
-)
-{
-  rtems_filesystem_eval_path_eat_delimiter(ctx);
-  next_token(ctx);
-}
Index: cpukit/libcsupport/src/symlink.c
===================================================================
--- cpukit/libcsupport/src/symlink.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Make a Symbolic Link to a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-int symlink( const char *path1, const char *path2 )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_HARD_LINK
-    | RTEMS_FS_MAKE
-    | RTEMS_FS_EXCLUSIVE;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path2, eval_flags );
-
-  rv = (*currentloc->mt_entry->ops->symlink_h)(
-    currentloc,
-    rtems_filesystem_eval_path_get_token( &ctx ),
-    rtems_filesystem_eval_path_get_tokenlen( &ctx ),
-    path1
-  );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/sync.c
===================================================================
--- cpukit/libcsupport/src/sync.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief This source file contains the implementation of sync().
- */
-
-/*
- * Copyright (C) 2022 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-void sync( void )
-{
-  int fd;
-
-  for ( fd = 0; fd < (int) rtems_libio_number_iops; ++fd ) {
-    (void) fsync( fd );
-    (void) fdatasync( fd );
-  }
-}
Index: cpukit/libcsupport/src/tcdrain.c
===================================================================
--- cpukit/libcsupport/src/tcdrain.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Line Control Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-/* #include <sys/ioctl.h> */
-
-#include <rtems/libio.h>
-
-/**
- *  POSIX 1003.1b 7.2.2 - Line Control Functions
- */
-int tcdrain(
-  int fd
-)
-{
-  return ioctl( fd, TIOCDRAIN, 0 );
-}
-
-#endif
Index: cpukit/libcsupport/src/tcflow.c
===================================================================
--- cpukit/libcsupport/src/tcflow.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Line Control Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB)
-#include <termios.h>
-#include <unistd.h>
-#include <errno.h>
-#include <rtems/seterr.h>
-
-int tcflow (
-  int fd,
-  int action
-)
-{
-  (void) fd;
-
-  switch (action) {
-    case TCOOFF:
-    case TCOON:
-    case TCIOFF:
-    case TCION:
-      break;
-    default:
-      rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-
-  /* fd is not validated */
-
-  /* When this is supported, implement it here */
-  rtems_set_errno_and_return_minus_one( ENOTSUP );
-}
-
-#endif
Index: cpukit/libcsupport/src/tcflush.c
===================================================================
--- cpukit/libcsupport/src/tcflush.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- * @brief tcflush() - POSIX 1003.1b 7.2.2 - Line Control Functions
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/fcntl.h>
-#include <termios.h>
-#include <stdint.h>
-#include <sys/ioccom.h>
-#include <rtems/libio.h>
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-int tcflush( int fd, int which )
-{
-  int com;
-
-  switch (which) {
-  case TCIFLUSH:
-    com = FREAD;
-    break;
-  case TCOFLUSH:
-    com = FWRITE;
-    break;
-  case TCIOFLUSH:
-    com = FREAD | FWRITE;
-    break;
-  default:
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-  return ioctl( fd, TIOCFLUSH, &com );
-}
Index: cpukit/libcsupport/src/tcgetattr.c
===================================================================
--- cpukit/libcsupport/src/tcgetattr.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get State
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-/* #include <sys/ioctl.h> */
-
-#include <rtems/libio.h>
-
-int tcgetattr(
-  int fd,
-  struct termios *tp
-)
-{
-  return ioctl( fd, TIOCGETA, tp );
-}
-#endif
Index: cpukit/libcsupport/src/tcgetpgrp.c
===================================================================
--- cpukit/libcsupport/src/tcgetpgrp.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get Foreground Process Group ID
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if defined(RTEMS_NEWLIB) && !defined(HAVE_TCGETPGRP)
-
-#include <sys/types.h>
-#include <unistd.h>
-
-/**
- *  POSIX 1003.1b 7.2.3 - Get Foreground Process Group ID
- */
-pid_t tcgetpgrp(int fd)
-{
-  (void) fd;
-  return getpid();
-}
-
-#endif
Index: cpukit/libcsupport/src/tcsendbreak.c
===================================================================
--- cpukit/libcsupport/src/tcsendbreak.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Line Control Functions
- *  @ingroup Termios
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-/* #include <sys/ioctl.h> */
-
-#include <rtems/libio.h>
-
-int tcsendbreak (
-  int fd RTEMS_UNUSED,
-  int duration RTEMS_UNUSED )
-{
-  return 0;
-}
-
-#endif
Index: cpukit/libcsupport/src/tcsetattr.c
===================================================================
--- cpukit/libcsupport/src/tcsetattr.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Get and Set State
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-/* #include <sys/ioctl.h> */
-
-#include <rtems/libio.h>
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-/**
- *  POSIX 1003.1b 7.2.1 - Get and Set State
- */
-int tcsetattr(
-  int                   fd,
-  int                   opt,
-  const struct termios *tp
-)
-{
-  struct termios localterm;
-
-  if (opt & TCSASOFT) {
-    localterm = *tp;
-    localterm.c_cflag |= CIGNORE;
-    tp = &localterm;
-  }
-
-  switch (opt & ~TCSASOFT) {
-
-  case TCSANOW:
-    return ioctl( fd, TIOCSETA, tp );
-
-  case TCSADRAIN:
-    return ioctl( fd, TIOCSETAW, tp );
-
-  case TCSAFLUSH:
-    return ioctl( fd, TIOCSETAF, tp );
-
-  default:
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-}
-#endif
Index: cpukit/libcsupport/src/tcsetpgrp.c
===================================================================
--- cpukit/libcsupport/src/tcsetpgrp.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Set Foreground Process Group ID
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#if defined(RTEMS_NEWLIB)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <termios.h>
-/* #include <sys/ioctl.h> */
-
-#include <rtems/libio.h>
-
-/**
- *  POSIX 1003.1b 7.2.4 - Set Foreground Process Group ID
- */
-int tcsetpgrp(
-  int fd RTEMS_UNUSED,
-  pid_t pid RTEMS_UNUSED )
-{
-  return 0;
-}
-
-#endif
Index: cpukit/libcsupport/src/termios.c
===================================================================
--- cpukit/libcsupport/src/termios.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,2262 +1,0 @@
-/**
- * @file
- * TERMIOS serial line support
- */
-
-/*
- * Copyright (c) 1997 Eric Norum <eric@norum.ca>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/imfs.h>
-#include <rtems/score/assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <termios.h>
-#include <unistd.h>
-#include <sys/fcntl.h>
-#include <sys/filio.h>
-#include <sys/ttycom.h>
-
-#include <rtems/termiostypes.h>
-
-/*
- * The size of the cooked buffer
- */
-#define CBUFSIZE  (rtems_termios_cbufsize)
-
-/*
- * The sizes of the raw message buffers.
- * On most architectures it is quite a bit more
- * efficient if these are powers of two.
- */
-#define RAW_INPUT_BUFFER_SIZE  (rtems_termios_raw_input_size)
-#define RAW_OUTPUT_BUFFER_SIZE  (rtems_termios_raw_output_size)
-
-/* fields for "flow_ctrl" status */
-#define FL_IREQXOF 1U        /* input queue requests stop of incoming data */
-#define FL_ISNTXOF 2U        /* XOFF has been sent to other side of line   */
-#define FL_IRTSOFF 4U        /* RTS has been turned off for other side..   */
-
-#define FL_ORCVXOF 0x10U     /* XOFF has been received                     */
-#define FL_OSTOP   0x20U     /* output has been stopped due to XOFF        */
-
-#define FL_MDRTS   0x100U    /* input controlled with RTS/CTS handshake    */
-#define FL_MDXON   0x200U    /* input controlled with XON/XOFF protocol    */
-#define FL_MDXOF   0x400U    /* output controlled with XON/XOFF protocol   */
-
-#define NODISC(n) \
-  { NULL,  NULL,  NULL,  NULL, \
-    NULL,  NULL,  NULL,  NULL }
-/*
- * FIXME: change rtems_termios_linesw entries consistent
- *        with rtems_termios_linesw entry usage...
- */
-struct  rtems_termios_linesw rtems_termios_linesw[MAXLDISC] =
-{
-  NODISC(0),    /* 0- termios-built-in */
-  NODISC(1),    /* 1- defunct */
-  NODISC(2),    /* 2- NTTYDISC */
-  NODISC(3),    /* TABLDISC */
-  NODISC(4),    /* SLIPDISC */
-  NODISC(5),    /* PPPDISC */
-  NODISC(6),    /* loadable */
-  NODISC(7),    /* loadable */
-};
-
-int  rtems_termios_nlinesw =
-       sizeof (rtems_termios_linesw) / sizeof (rtems_termios_linesw[0]);
-
-static size_t rtems_termios_cbufsize = 256;
-static size_t rtems_termios_raw_input_size = 256;
-static size_t rtems_termios_raw_output_size = 64;
-
-static const IMFS_node_control rtems_termios_imfs_node_control;
-
-static struct rtems_termios_tty *rtems_termios_ttyHead;
-static struct rtems_termios_tty *rtems_termios_ttyTail;
-
-static RTEMS_CHAIN_DEFINE_EMPTY(rtems_termios_devices);
-
-static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument);
-static rtems_task rtems_termios_txdaemon(rtems_task_argument argument);
-/*
- * some constants for I/O daemon task creation
- */
-#define TERMIOS_TXTASK_PRIO 10
-#define TERMIOS_RXTASK_PRIO 9
-#define TERMIOS_TXTASK_STACKSIZE 1024
-#define TERMIOS_RXTASK_STACKSIZE 1024
-/*
- * some events to be sent to the I/O tasks
- */
-#define TERMIOS_TX_START_EVENT     RTEMS_EVENT_1
-#define TERMIOS_TX_TERMINATE_EVENT RTEMS_EVENT_0
-
-#define TERMIOS_RX_PROC_EVENT      RTEMS_EVENT_1
-#define TERMIOS_RX_TERMINATE_EVENT RTEMS_EVENT_0
-
-static rtems_mutex rtems_termios_ttyMutex =
-  RTEMS_MUTEX_INITIALIZER( "termios" );
-
-static void
-rtems_termios_obtain (void)
-{
-  rtems_mutex_lock (&rtems_termios_ttyMutex);
-}
-
-static void
-rtems_termios_release (void)
-{
-  rtems_mutex_unlock (&rtems_termios_ttyMutex);
-}
-
-rtems_status_code rtems_termios_device_install(
-  const char                         *device_file,
-  const rtems_termios_device_handler *handler,
-  const rtems_termios_device_flow    *flow,
-  rtems_termios_device_context       *context
-)
-{
-  rtems_termios_device_node *new_device_node;
-  int rv;
-
-  new_device_node = calloc (1, sizeof(*new_device_node));
-  if (new_device_node == NULL) {
-    return RTEMS_NO_MEMORY;
-  }
-
-  rtems_chain_initialize_node (&new_device_node->node);
-  new_device_node->handler = handler;
-  new_device_node->flow = flow;
-  new_device_node->context = context;
-  new_device_node->tty = NULL;
-
-  rv = IMFS_make_generic_node(
-    device_file,
-    S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
-    &rtems_termios_imfs_node_control,
-    new_device_node
-  );
-  if (rv != 0) {
-    free (new_device_node);
-    return RTEMS_UNSATISFIED;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
-
-static rtems_termios_tty *
-legacyContextToTTY (rtems_termios_device_context *ctx)
-{
-  return RTEMS_CONTAINER_OF (ctx, rtems_termios_tty, legacy_device_context);
-}
-
-static bool
-rtems_termios_callback_firstOpen(
-  rtems_termios_tty             *tty,
-  rtems_termios_device_context  *ctx,
-  struct termios                *term,
-  rtems_libio_open_close_args_t *args
-)
-{
-  (void) ctx;
-  (void) term;
-
-  (*tty->device.firstOpen) (tty->major, tty->minor, args);
-
-  return true;
-}
-
-static void
-rtems_termios_callback_lastClose(
-  rtems_termios_tty             *tty,
-  rtems_termios_device_context  *ctx,
-  rtems_libio_open_close_args_t *args
-)
-{
-  (void) ctx;
-
-  (*tty->device.lastClose) (tty->major, tty->minor, args);
-}
-
-static int
-rtems_termios_callback_pollRead (rtems_termios_device_context *ctx)
-{
-  rtems_termios_tty *tty = legacyContextToTTY (ctx);
-
-  return (*tty->device.pollRead) (tty->minor);
-}
-
-static void
-rtems_termios_callback_write(
-  rtems_termios_device_context *ctx,
-  const char                   *buf,
-  size_t                        len
-)
-{
-  rtems_termios_tty *tty = legacyContextToTTY (ctx);
-
-  (*tty->device.write) (tty->minor, buf, len);
-}
-
-static bool
-rtems_termios_callback_setAttributes(
-  rtems_termios_device_context *ctx,
-  const struct termios         *term
-)
-{
-  rtems_termios_tty *tty = legacyContextToTTY (ctx);
-
-  (*tty->device.setAttributes) (tty->minor, term);
-
-  return true;
-}
-
-static void
-rtems_termios_callback_stopRemoteTx (rtems_termios_device_context *ctx)
-{
-  rtems_termios_tty *tty = legacyContextToTTY (ctx);
-
-  (*tty->device.stopRemoteTx) (tty->minor);
-}
-
-static void
-rtems_termios_callback_startRemoteTx (rtems_termios_device_context *ctx)
-{
-  rtems_termios_tty *tty = legacyContextToTTY (ctx);
-
-  (*tty->device.startRemoteTx) (tty->minor);
-}
-
-/*
- * Drain output queue
- */
-static void
-drainOutput (struct rtems_termios_tty *tty)
-{
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interrupt_lock_context lock_context;
-
-  if (tty->handler.mode != TERMIOS_POLLED) {
-    rtems_termios_device_lock_acquire (ctx, &lock_context);
-    while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
-      tty->rawOutBufState = rob_wait;
-      rtems_termios_device_lock_release (ctx, &lock_context);
-      rtems_binary_semaphore_wait (&tty->rawOutBuf.Semaphore);
-      rtems_termios_device_lock_acquire (ctx, &lock_context);
-    }
-    rtems_termios_device_lock_release (ctx, &lock_context);
-  }
-}
-
-static bool
-needDeviceMutex (rtems_termios_tty *tty)
-{
-  return tty->handler.mode == TERMIOS_IRQ_SERVER_DRIVEN
-    || tty->handler.mode == TERMIOS_TASK_DRIVEN;
-}
-
-static void
-rtems_termios_destroy_tty (rtems_termios_tty *tty, void *arg, bool last_close)
-{
-  if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
-    /*
-     * call discipline-specific close
-     */
-    (void) rtems_termios_linesw[tty->t_line].l_close(tty);
-  } else if (last_close) {
-    /*
-     * default: just flush output buffer
-     */
-    rtems_mutex_lock (&tty->osem);
-    drainOutput (tty);
-    rtems_mutex_unlock (&tty->osem);
-  }
-
-  if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
-    rtems_status_code sc;
-
-    /*
-     * send "terminate" to I/O tasks
-     */
-    sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
-    if (sc != RTEMS_SUCCESSFUL)
-      rtems_fatal_error_occurred (sc);
-    sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
-    if (sc != RTEMS_SUCCESSFUL)
-      rtems_fatal_error_occurred (sc);
-  }
-  if (last_close && tty->handler.last_close)
-     (*tty->handler.last_close)(tty, tty->device_context, arg);
-
-  if (tty->device_node != NULL)
-    tty->device_node->tty = NULL;
-
-  rtems_mutex_destroy (&tty->isem);
-  rtems_mutex_destroy (&tty->osem);
-  rtems_binary_semaphore_destroy (&tty->rawOutBuf.Semaphore);
-  if ((tty->handler.poll_read == NULL) ||
-      (tty->handler.mode == TERMIOS_TASK_DRIVEN))
-    rtems_binary_semaphore_destroy (&tty->rawInBuf.Semaphore);
-
-  if (needDeviceMutex (tty)) {
-    rtems_mutex_destroy (&tty->device_context->lock.mutex);
-  } else if (tty->device_context == &tty->legacy_device_context) {
-    rtems_interrupt_lock_destroy (&tty->legacy_device_context.lock.interrupt);
-  }
-
-  free (tty->rawInBuf.theBuf);
-  free (tty->rawOutBuf.theBuf);
-  free (tty->cbuf);
-  free (tty);
-}
-
-static void
-deviceAcquireMutex(
-  rtems_termios_device_context *ctx,
-  rtems_interrupt_lock_context *lock_context
-)
-{
-  rtems_mutex_lock (&ctx->lock.mutex);
-}
-
-static void
-deviceReleaseMutex(
-  rtems_termios_device_context *ctx,
-  rtems_interrupt_lock_context *lock_context
-)
-{
-  rtems_mutex_unlock (&ctx->lock.mutex);
-}
-
-static rtems_termios_tty *
-rtems_termios_open_tty(
-  rtems_device_major_number      major,
-  rtems_device_minor_number      minor,
-  rtems_libio_open_close_args_t *args,
-  rtems_termios_tty             *tty,
-  rtems_termios_device_node     *device_node,
-  const rtems_termios_callbacks *callbacks
-)
-{
-  if (tty == NULL) {
-    static char c = 'a';
-    rtems_termios_device_context *ctx;
-
-    /*
-     * Create a new device
-     */
-    tty = calloc (1, sizeof (struct rtems_termios_tty));
-    if (tty == NULL) {
-      return NULL;
-    }
-    /*
-     * allocate raw input buffer
-     */
-    tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
-    tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
-    if (tty->rawInBuf.theBuf == NULL) {
-            free(tty);
-      return NULL;
-    }
-    /*
-     * allocate raw output buffer
-     */
-    tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
-    tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
-    if (tty->rawOutBuf.theBuf == NULL) {
-            free((void *)(tty->rawInBuf.theBuf));
-            free(tty);
-      return NULL;
-    }
-    /*
-     * allocate cooked buffer
-     */
-    tty->cbuf  = malloc (CBUFSIZE);
-    if (tty->cbuf == NULL) {
-            free((void *)(tty->rawOutBuf.theBuf));
-            free((void *)(tty->rawInBuf.theBuf));
-            free(tty);
-      return NULL;
-    }
-    /*
-     * Initialize wakeup callbacks
-     */
-    tty->tty_snd.sw_pfn = NULL;
-    tty->tty_snd.sw_arg = NULL;
-    tty->tty_rcv.sw_pfn = NULL;
-    tty->tty_rcv.sw_arg = NULL;
-    tty->tty_rcvwakeup  = false;
-
-    tty->minor = minor;
-    tty->major = major;
-
-    /*
-     * Set up mutex semaphores
-     */
-    rtems_mutex_init (&tty->isem, "termios input");
-    rtems_mutex_init (&tty->osem, "termios output");
-    rtems_binary_semaphore_init (&tty->rawOutBuf.Semaphore,
-                                 "termios raw output");
-    tty->rawOutBufState = rob_idle;
-
-    /*
-     * Set callbacks
-     */
-    if (device_node != NULL) {
-      device_node->tty = tty;
-      tty->handler = *device_node->handler;
-
-      if (device_node->flow != NULL) {
-        tty->flow = *device_node->flow;
-      }
-
-      tty->device_node = device_node;
-      tty->device_context = device_node->context;
-      memset(&tty->device, 0, sizeof(tty->device));
-    } else {
-      tty->handler.first_open = callbacks->firstOpen != NULL ?
-        rtems_termios_callback_firstOpen : NULL;
-      tty->handler.last_close = callbacks->lastClose != NULL ?
-        rtems_termios_callback_lastClose : NULL;
-      tty->handler.poll_read = callbacks->pollRead != NULL ?
-        rtems_termios_callback_pollRead : NULL;
-      tty->handler.write = callbacks->write != NULL ?
-        rtems_termios_callback_write : NULL;
-      tty->handler.set_attributes = callbacks->setAttributes != NULL ?
-        rtems_termios_callback_setAttributes : NULL;
-      tty->flow.stop_remote_tx = callbacks->stopRemoteTx != NULL ?
-        rtems_termios_callback_stopRemoteTx : NULL;
-      tty->flow.start_remote_tx = callbacks->startRemoteTx != NULL ?
-        rtems_termios_callback_startRemoteTx : NULL;
-      tty->handler.mode = callbacks->outputUsesInterrupts;
-      tty->device_context = NULL;
-      tty->device_node = NULL;
-      tty->device = *callbacks;
-    }
-
-    if (tty->device_context == NULL) {
-      tty->device_context = &tty->legacy_device_context;
-      rtems_termios_device_context_initialize (tty->device_context, "Termios");
-    }
-
-    ctx = tty->device_context;
-
-    if (needDeviceMutex (tty)) {
-      rtems_mutex_init (&ctx->lock.mutex, "termios device");
-      ctx->lock_acquire = deviceAcquireMutex;
-      ctx->lock_release = deviceReleaseMutex;
-    } else {
-      ctx->lock_acquire = rtems_termios_device_lock_acquire_default;
-      ctx->lock_release = rtems_termios_device_lock_release_default;
-    }
-
-    /*
-     * Create I/O tasks
-     */
-    if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
-      rtems_status_code sc;
-
-      sc = rtems_task_create (
-                                   rtems_build_name ('T', 'x', 'T', c),
-           TERMIOS_TXTASK_PRIO,
-           TERMIOS_TXTASK_STACKSIZE,
-           RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
-           RTEMS_NO_ASR,
-           RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
-           &tty->txTaskId);
-      if (sc != RTEMS_SUCCESSFUL)
-        rtems_fatal_error_occurred (sc);
-      sc = rtems_task_create (
-                                   rtems_build_name ('R', 'x', 'T', c),
-           TERMIOS_RXTASK_PRIO,
-           TERMIOS_RXTASK_STACKSIZE,
-           RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
-           RTEMS_NO_ASR,
-           RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
-           &tty->rxTaskId);
-      if (sc != RTEMS_SUCCESSFUL)
-        rtems_fatal_error_occurred (sc);
-
-    }
-    if ((tty->handler.poll_read == NULL) ||
-        (tty->handler.mode == TERMIOS_TASK_DRIVEN)){
-      rtems_binary_semaphore_init (&tty->rawInBuf.Semaphore,
-                                   "termios raw input");
-    }
-
-    /*
-     * Set default parameters
-     */
-    tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
-    tty->termios.c_oflag = OPOST | ONLCR | OXTABS;
-    tty->termios.c_cflag = CS8 | CREAD | CLOCAL;
-    tty->termios.c_lflag =
-       ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
-
-    tty->termios.c_ispeed = B9600;
-    tty->termios.c_ospeed = B9600;
-
-    tty->termios.c_cc[VINTR] = '\003';
-    tty->termios.c_cc[VQUIT] = '\034';
-    tty->termios.c_cc[VERASE] = '\177';
-    tty->termios.c_cc[VKILL] = '\025';
-    tty->termios.c_cc[VEOF] = '\004';
-    tty->termios.c_cc[VEOL] = '\000';
-    tty->termios.c_cc[VEOL2] = '\000';
-    tty->termios.c_cc[VSTART] = '\021';
-    tty->termios.c_cc[VSTOP] = '\023';
-    tty->termios.c_cc[VSUSP] = '\032';
-    tty->termios.c_cc[VREPRINT] = '\022';
-    tty->termios.c_cc[VDISCARD] = '\017';
-    tty->termios.c_cc[VWERASE] = '\027';
-    tty->termios.c_cc[VLNEXT] = '\026';
-
-    /* start with no flow control, clear flow control flags */
-    tty->flow_ctrl = 0;
-    /*
-     * set low/highwater mark for XON/XOFF support
-     */
-    tty->lowwater  = tty->rawInBuf.Size * 1/2;
-    tty->highwater = tty->rawInBuf.Size * 3/4;
-    /*
-     * Bump name characer
-     */
-    if (c++ == 'z')
-      c = 'a';
-
-  }
-  args->iop->data1 = tty;
-  if (!tty->refcount++) {
-    if (tty->handler.first_open && !(*tty->handler.first_open)(
-        tty, tty->device_context, &tty->termios, args)) {
-      rtems_termios_destroy_tty(tty, args, false);
-      return NULL;
-    }
-
-    /*
-     * start I/O tasks, if needed
-     */
-    if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
-      rtems_status_code sc;
-
-      sc = rtems_task_start(
-        tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
-      if (sc != RTEMS_SUCCESSFUL)
-        rtems_fatal_error_occurred (sc);
-
-      sc = rtems_task_start(
-        tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
-      if (sc != RTEMS_SUCCESSFUL)
-        rtems_fatal_error_occurred (sc);
-    }
-  }
-
-  return tty;
-}
-
-/*
- * Open a termios device
- */
-rtems_status_code
-rtems_termios_open (
-  rtems_device_major_number      major,
-  rtems_device_minor_number      minor,
-  void                          *arg,
-  const rtems_termios_callbacks *callbacks
-)
-{
-  struct rtems_termios_tty *tty;
-
-  /*
-   * See if the device has already been opened
-   */
-  rtems_termios_obtain ();
-
-  for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
-    if ((tty->major == major) && (tty->minor == minor))
-      break;
-  }
-
-  tty = rtems_termios_open_tty(
-    major, minor, arg, tty, NULL, callbacks);
-  if (tty == NULL) {
-    rtems_termios_release ();
-    return RTEMS_NO_MEMORY;
-  }
-
-  if (tty->refcount == 1) {
-    /*
-     * link tty
-     */
-    tty->forw = rtems_termios_ttyHead;
-    tty->back = NULL;
-    if (rtems_termios_ttyHead != NULL)
-      rtems_termios_ttyHead->back = tty;
-    rtems_termios_ttyHead = tty;
-    if (rtems_termios_ttyTail == NULL)
-      rtems_termios_ttyTail = tty;
-  }
-
-  rtems_termios_release ();
-
-  return RTEMS_SUCCESSFUL;
-}
-
-static void
-flushOutput (struct rtems_termios_tty *tty)
-{
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interrupt_lock_context lock_context;
-
-  rtems_termios_device_lock_acquire (ctx, &lock_context);
-  tty->rawOutBuf.Tail = 0;
-  tty->rawOutBuf.Head = 0;
-  tty->rawOutBufState = rob_idle;
-  rtems_termios_device_lock_release (ctx, &lock_context);
-}
-
-static void
-flushInput (struct rtems_termios_tty *tty)
-{
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interrupt_lock_context lock_context;
-
-  rtems_termios_device_lock_acquire (ctx, &lock_context);
-  tty->rawInBuf.Tail = 0;
-  tty->rawInBuf.Head = 0;
-  rtems_termios_device_lock_release (ctx, &lock_context);
-}
-
-static void
-rtems_termios_close_tty (rtems_termios_tty *tty, void *arg)
-{
-  if (--tty->refcount == 0) {
-    rtems_termios_destroy_tty (tty, arg, true);
-  }
-}
-
-rtems_status_code
-rtems_termios_close (void *arg)
-{
-  rtems_libio_open_close_args_t *args = arg;
-  struct rtems_termios_tty *tty = args->iop->data1;
-
-  rtems_termios_obtain ();
-
-  if (tty->refcount == 1) {
-    if (tty->forw == NULL) {
-      rtems_termios_ttyTail = tty->back;
-      if ( rtems_termios_ttyTail != NULL ) {
-        rtems_termios_ttyTail->forw = NULL;
-      }
-    } else {
-      tty->forw->back = tty->back;
-    }
-
-    if (tty->back == NULL) {
-      rtems_termios_ttyHead = tty->forw;
-      if ( rtems_termios_ttyHead != NULL ) {
-        rtems_termios_ttyHead->back = NULL;
-      }
-    } else {
-      tty->back->forw = tty->forw;
-    }
-  }
-
-  rtems_termios_close_tty (tty, arg);
-
-  rtems_termios_release ();
-
-  return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code rtems_termios_bufsize (
-  size_t cbufsize,
-  size_t raw_input,
-  size_t raw_output
-)
-{
-  rtems_termios_cbufsize        = cbufsize;
-  rtems_termios_raw_input_size  = raw_input;
-  rtems_termios_raw_output_size = raw_output;
-  return RTEMS_SUCCESSFUL;
-}
-
-static void
-termios_set_flowctrl(struct rtems_termios_tty *tty)
-{
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interrupt_lock_context lock_context;
-  /*
-   * check for flow control options to be switched off
-   */
-
-  /* check for outgoing XON/XOFF flow control switched off */
-  if (( tty->flow_ctrl & FL_MDXON) &&
-      !(tty->termios.c_iflag & IXON)) {
-    /* clear related flags in flow_ctrl */
-    tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF);
-
-    /* has output been stopped due to received XOFF? */
-    if (tty->flow_ctrl & FL_OSTOP) {
-      /* disable interrupts    */
-      rtems_termios_device_lock_acquire (ctx, &lock_context);
-      tty->flow_ctrl &= ~FL_OSTOP;
-      /* check for chars in output buffer (or rob_state?) */
-      if (tty->rawOutBufState != rob_idle) {
-        /* if chars available, call write function... */
-        (*tty->handler.write)(
-          ctx, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
-      }
-      /* reenable interrupts */
-      rtems_termios_device_lock_release (ctx, &lock_context);
-    }
-  }
-  /* check for incoming XON/XOFF flow control switched off */
-  if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) {
-    /* clear related flags in flow_ctrl */
-    tty->flow_ctrl &= ~(FL_MDXOF);
-    /* FIXME: what happens, if we had sent XOFF but not yet XON? */
-    tty->flow_ctrl &= ~(FL_ISNTXOF);
-  }
-
-  /* check for incoming RTS/CTS flow control switched off */
-  if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) {
-    /* clear related flags in flow_ctrl */
-    tty->flow_ctrl &= ~(FL_MDRTS);
-
-    /* restart remote Tx, if it was stopped */
-    if ((tty->flow_ctrl & FL_IRTSOFF) &&
-        (tty->flow.start_remote_tx != NULL)) {
-      tty->flow.start_remote_tx(ctx);
-    }
-    tty->flow_ctrl &= ~(FL_IRTSOFF);
-  }
-
-  /*
-   * check for flow control options to be switched on
-   */
-  /* check for incoming RTS/CTS flow control switched on */
-  if (tty->termios.c_cflag & CRTSCTS) {
-    tty->flow_ctrl |= FL_MDRTS;
-  }
-  /* check for incoming XON/XOF flow control switched on */
-  if (tty->termios.c_iflag & IXOFF) {
-    tty->flow_ctrl |= FL_MDXOF;
-  }
-  /* check for outgoing XON/XOF flow control switched on */
-  if (tty->termios.c_iflag & IXON) {
-    tty->flow_ctrl |= FL_MDXON;
-  }
-}
-
-rtems_status_code
-rtems_termios_ioctl (void *arg)
-{
-  rtems_libio_ioctl_args_t *args = arg;
-  struct rtems_termios_tty *tty = args->iop->data1;
-  struct ttywakeup         *wakeup = (struct ttywakeup *)args->buffer;
-  rtems_status_code sc;
-  int flags;
-
-  sc = RTEMS_SUCCESSFUL;
-  args->ioctl_return = 0;
-  rtems_mutex_lock (&tty->osem);
-  switch (args->command) {
-  default:
-    if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
-      sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
-    } else if (tty->handler.ioctl) {
-      args->ioctl_return = (*tty->handler.ioctl) (tty->device_context,
-        args->command, args->buffer);
-      sc = RTEMS_SUCCESSFUL;
-    } else {
-      sc = RTEMS_INVALID_NUMBER;
-    }
-    break;
-
-  case TIOCGETA:
-    *(struct termios *)args->buffer = tty->termios;
-    break;
-
-  case TIOCSETA:
-  case TIOCSETAW:
-  case TIOCSETAF:
-    tty->termios = *(struct termios *)args->buffer;
-
-    if (args->command == TIOCSETAW || args->command == TIOCSETAF) {
-      drainOutput (tty);
-      if (args->command == TIOCSETAF) {
-        flushInput (tty);
-      }
-    }
-    /* check for and process change in flow control options */
-    termios_set_flowctrl(tty);
-
-    if (tty->termios.c_lflag & ICANON) {
-      tty->rawInBufSemaphoreWait = true;
-      tty->rawInBufSemaphoreTimeout = 0;
-      tty->rawInBufSemaphoreFirstTimeout = 0;
-    } else {
-      tty->vtimeTicks = tty->termios.c_cc[VTIME] *
-                    rtems_clock_get_ticks_per_second() / 10;
-      if (tty->termios.c_cc[VTIME]) {
-        tty->rawInBufSemaphoreWait = true;
-        tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
-        if (tty->termios.c_cc[VMIN])
-          tty->rawInBufSemaphoreFirstTimeout = 0;
-        else
-          tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
-      } else {
-        if (tty->termios.c_cc[VMIN]) {
-          tty->rawInBufSemaphoreWait = true;
-          tty->rawInBufSemaphoreTimeout = 0;
-          tty->rawInBufSemaphoreFirstTimeout = 0;
-        } else {
-          tty->rawInBufSemaphoreWait = false;
-        }
-      }
-    }
-    if (tty->handler.set_attributes) {
-      sc = (*tty->handler.set_attributes)(tty->device_context, &tty->termios) ?
-        RTEMS_SUCCESSFUL : RTEMS_IO_ERROR;
-    }
-    break;
-
-  case TIOCDRAIN:
-    drainOutput (tty);
-    break;
-
-  case TIOCFLUSH:
-    flags = *((int *)args->buffer);
-
-    if (flags == 0) {
-      flags = FREAD | FWRITE;
-    } else {
-      flags &= FREAD | FWRITE;
-    }
-    if (flags & FWRITE) {
-      flushOutput (tty);
-    }
-    if (flags & FREAD) {
-      flushInput (tty);
-    }
-    break;
-
-  case RTEMS_IO_SNDWAKEUP:
-    tty->tty_snd = *wakeup;
-    break;
-
-  case RTEMS_IO_RCVWAKEUP:
-    tty->tty_rcv = *wakeup;
-    break;
-
-    /*
-     * FIXME: add various ioctl code handlers
-     */
-
-#if 1 /* FIXME */
-  case TIOCSETD:
-    /*
-     * close old line discipline
-     */
-    if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
-      sc = rtems_termios_linesw[tty->t_line].l_close(tty);
-    }
-    tty->t_line=*(int*)(args->buffer);
-    tty->t_sc = NULL; /* ensure that no more valid data */
-    /*
-     * open new line discipline
-     */
-    if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
-      sc = rtems_termios_linesw[tty->t_line].l_open(tty);
-    }
-    break;
-  case TIOCGETD:
-    *(int*)(args->buffer)=tty->t_line;
-    break;
-#endif
-   case FIONREAD: {
-      int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
-      if ( rawnc < 0 )
-        rawnc += tty->rawInBuf.Size;
-      /* Half guess that this is the right operation */
-      *(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
-    }
-    break;
-  }
-
-  rtems_mutex_unlock (&tty->osem);
-  return sc;
-}
-
-/*
- * Send as many chars at once as possible to device-specific code.
- * If transmitting==true then assume transmission is already running and
- * an explicit write(0) is needed if output has to stop for flow control.
- */
-static unsigned int
-startXmit (
-  struct rtems_termios_tty *tty,
-  unsigned int newTail,
-  bool transmitting
-)
-{
-  unsigned int nToSend;
-
-  tty->rawOutBufState = rob_busy;
-
-  /* if XOFF was received, do not (re)start output */
-  if (tty->flow_ctrl & FL_ORCVXOF) {
-    /* set flag, that output has been stopped */
-    tty->flow_ctrl |= FL_OSTOP;
-    nToSend = 0;
-    /* stop transmitter */
-    if (transmitting) {
-      (*tty->handler.write) (tty->device_context, NULL, 0);
-    }
-  } else {
-    /* when flow control XON or XOF, don't send blocks of data     */
-    /* to allow fast reaction on incoming flow ctrl and low latency*/
-    /* for outgoing flow control                                   */
-    if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF))
-      nToSend = 1;
-    else if (newTail > tty->rawOutBuf.Head)
-      nToSend = tty->rawOutBuf.Size - newTail;
-    else
-      nToSend = tty->rawOutBuf.Head - newTail;
-
-    (*tty->handler.write)(
-        tty->device_context, &tty->rawOutBuf.theBuf[newTail], nToSend);
-  }
-
-  return nToSend;
-}
-
-/*
- * Send characters to device-specific code
- */
-static size_t
-doTransmit (const char *buf, size_t len, rtems_termios_tty *tty,
-            bool wait, bool nextWait)
-{
-  unsigned int newHead;
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interrupt_lock_context lock_context;
-  size_t todo;
-
-  if (tty->handler.mode == TERMIOS_POLLED) {
-    (*tty->handler.write)(ctx, buf, len);
-    return len;
-  }
-
-  todo = len;
-
-  while (todo > 0) {
-    size_t nToCopy;
-    size_t nAvail;
-
-    /* Check space for at least one char */
-    newHead = tty->rawOutBuf.Head + 1;
-    if (newHead >= tty->rawOutBuf.Size)
-      newHead -= tty->rawOutBuf.Size;
-
-    rtems_termios_device_lock_acquire (ctx, &lock_context);
-    if (newHead == tty->rawOutBuf.Tail) {
-      if (wait) {
-        do {
-          tty->rawOutBufState = rob_wait;
-          rtems_termios_device_lock_release (ctx, &lock_context);
-          rtems_binary_semaphore_wait (&tty->rawOutBuf.Semaphore);
-          rtems_termios_device_lock_acquire (ctx, &lock_context);
-        } while (newHead == tty->rawOutBuf.Tail);
-      } else {
-        rtems_termios_device_lock_release (ctx, &lock_context);
-        return len - todo;
-      }
-    }
-
-    /* Determine free space up to current tail or end of ring buffer */
-    nToCopy = todo;
-    if (tty->rawOutBuf.Tail > tty->rawOutBuf.Head) {
-      /* Available space is contiguous from Head to Tail */
-      nAvail = tty->rawOutBuf.Tail - tty->rawOutBuf.Head - 1;
-    } else {
-      /* Available space wraps at buffer end. To keep it simple, utilize
-         only the free space from Head to end during this iteration */
-      nAvail = tty->rawOutBuf.Size - tty->rawOutBuf.Head;
-      /* Head may not touch Tail after wraparound */
-      if (tty->rawOutBuf.Tail == 0)
-        nAvail--;
-    }
-    if (nToCopy > nAvail)
-      nToCopy = nAvail;
-
-    /* To minimize latency, the memcpy could be done
-     * with interrupts enabled or with limit on nToCopy (TBD)
-     */
-    memcpy(&tty->rawOutBuf.theBuf[tty->rawOutBuf.Head], buf, nToCopy);
-
-    newHead = tty->rawOutBuf.Head + nToCopy;
-    if (newHead >= tty->rawOutBuf.Size)
-      newHead -= tty->rawOutBuf.Size;
-    tty->rawOutBuf.Head = newHead;
-
-    if (tty->rawOutBufState == rob_idle) {
-      startXmit (tty, tty->rawOutBuf.Tail, false);
-    }
-
-    rtems_termios_device_lock_release (ctx, &lock_context);
-
-    buf += nToCopy;
-    todo -= nToCopy;
-    wait = nextWait;
-  }
-
-  return len;
-}
-
-void
-rtems_termios_puts (
-  const void *_buf, size_t len, struct rtems_termios_tty *tty)
-{
-  doTransmit (_buf, len, tty, true, true);
-}
-
-static bool
-canTransmit (rtems_termios_tty *tty, bool wait, size_t len)
-{
-  rtems_termios_device_context *ctx;
-  rtems_interrupt_lock_context lock_context;
-  unsigned int capacity;
-
-  if (wait || tty->handler.mode == TERMIOS_POLLED) {
-    return true;
-  }
-
-  ctx = tty->device_context;
-  rtems_termios_device_lock_acquire (ctx, &lock_context);
-  capacity = (tty->rawOutBuf.Tail - tty->rawOutBuf.Head - 1) %
-    tty->rawOutBuf.Size;
-  rtems_termios_device_lock_release (ctx, &lock_context);
-  return capacity >= len;
-}
-
-/*
- * Handle output processing
- */
-static bool
-oproc (unsigned char c, rtems_termios_tty *tty, bool wait)
-{
-  char buf[8];
-  size_t len;
-
-  buf[0] = c;
-  len = 1;
-
-  if (tty->termios.c_oflag & OPOST) {
-    int oldColumn = tty->column;
-    int columnAdj = 0;
-
-    switch (c) {
-    case '\n':
-      if (tty->termios.c_oflag & ONLRET)
-        columnAdj = -oldColumn;
-      if (tty->termios.c_oflag & ONLCR) {
-        len = 2;
-
-        if (!canTransmit (tty, wait, len)) {
-          return false;
-        }
-
-        columnAdj = -oldColumn;
-        buf[0] = '\r';
-        buf[1] = c;
-      }
-      break;
-
-    case '\r':
-      if ((tty->termios.c_oflag & ONOCR) && (oldColumn == 0))
-        return true;
-      if (tty->termios.c_oflag & OCRNL) {
-        buf[0] = '\n';
-        if (tty->termios.c_oflag & ONLRET)
-          columnAdj = -oldColumn;
-      } else {
-        columnAdj = -oldColumn;
-      }
-      break;
-
-    case '\t':
-      columnAdj = 8 - (oldColumn & 7);
-      if ((tty->termios.c_oflag & TABDLY) == OXTABS) {
-        int i;
-
-        len = (size_t) columnAdj;
-
-        if (!canTransmit (tty, wait, len)) {
-          return false;
-        }
-
-        for (i = 0; i < columnAdj; ++i) {
-          buf[i] = ' ';
-        }
-      }
-      break;
-
-    case '\b':
-      if (oldColumn > 0)
-        columnAdj = -1;
-      break;
-
-    default:
-      if (tty->termios.c_oflag & OLCUC) {
-        c = toupper(c);
-        buf[0] = c;
-      }
-      if (!iscntrl(c))
-        columnAdj = 1;
-      break;
-    }
-
-    tty->column = oldColumn + columnAdj;
-  }
-
-  return doTransmit (buf, len, tty, wait, true) > 0;
-}
-
-static uint32_t
-rtems_termios_write_tty (rtems_libio_t *iop, rtems_termios_tty *tty,
-                         const char *buf, uint32_t len)
-{
-  bool wait = !rtems_libio_iop_is_no_delay (iop);
-
-  if (tty->termios.c_oflag & OPOST) {
-    uint32_t todo = len;
-
-    while (todo > 0) {
-      if (!oproc (*buf, tty, wait)) {
-        break;
-      }
-
-      ++buf;
-      --todo;
-      wait = false;
-    }
-
-    return len - todo;
-  } else {
-    return doTransmit (buf, len, tty, wait, false);
-  }
-}
-
-rtems_status_code
-rtems_termios_write (void *arg)
-{
-  rtems_libio_rw_args_t *args = arg;
-  struct rtems_termios_tty *tty = args->iop->data1;
-
-  rtems_mutex_lock (&tty->osem);
-  if (rtems_termios_linesw[tty->t_line].l_write != NULL) {
-    rtems_status_code sc;
-
-    sc = rtems_termios_linesw[tty->t_line].l_write(tty,args);
-    rtems_mutex_unlock (&tty->osem);
-    return sc;
-  }
-  args->bytes_moved = rtems_termios_write_tty (args->iop, tty,
-                                               args->buffer, args->count);
-  rtems_mutex_unlock (&tty->osem);
-  return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Echo a typed character
- */
-static void
-echo (unsigned char c, struct rtems_termios_tty *tty)
-{
-  if ((tty->termios.c_lflag & ECHOCTL) &&
-       iscntrl(c) && (c != '\t') && (c != '\n')) {
-    char echobuf[2];
-
-    echobuf[0] = '^';
-    echobuf[1] = c ^ 0x40;
-    doTransmit (echobuf, 2, tty, true, true);
-    tty->column += 2;
-  } else {
-    oproc (c, tty, true);
-  }
-}
-
-/*
- * Erase a character or line
- * FIXME: Needs support for WERASE and ECHOPRT.
- * FIXME: Some of the tests should check for IEXTEN, too.
- */
-static void
-erase (struct rtems_termios_tty *tty, int lineFlag)
-{
-  if (tty->ccount == 0)
-    return;
-  if (lineFlag) {
-    if (!(tty->termios.c_lflag & ECHO)) {
-      tty->ccount = 0;
-      return;
-    }
-    if (!(tty->termios.c_lflag & ECHOE)) {
-      tty->ccount = 0;
-      echo (tty->termios.c_cc[VKILL], tty);
-      if (tty->termios.c_lflag & ECHOK)
-        echo ('\n', tty);
-      return;
-    }
-  }
-
-  while (tty->ccount) {
-    unsigned char c = tty->cbuf[--tty->ccount];
-
-    if (tty->termios.c_lflag & ECHO) {
-      if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
-        echo (tty->termios.c_cc[VERASE], tty);
-      } else if (c == '\t') {
-        int col = tty->read_start_column;
-        int i = 0;
-
-        /*
-         * Find the character before the tab
-         */
-        while (i != tty->ccount) {
-          c = tty->cbuf[i++];
-          if (c == '\t') {
-            col = (col | 7) + 1;
-          } else if (iscntrl (c)) {
-            if (tty->termios.c_lflag & ECHOCTL)
-              col += 2;
-          } else {
-            col++;
-          }
-        }
-
-        /*
-         * Back up over the tab
-         */
-        while (tty->column > col) {
-          doTransmit ("\b", 1, tty, true, true);
-          tty->column--;
-        }
-      }
-      else {
-        if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
-          doTransmit ("\b \b", 3, tty, true, true);
-          if (tty->column)
-            tty->column--;
-        }
-        if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
-          doTransmit ("\b \b", 3, tty, true, true);
-          if (tty->column)
-            tty->column--;
-        }
-      }
-    }
-    if (!lineFlag)
-      break;
-  }
-}
-
-static unsigned char
-iprocEarly (unsigned char c, rtems_termios_tty *tty)
-{
-  if (tty->termios.c_iflag & ISTRIP)
-    c &= 0x7f;
-
-  if (tty->termios.c_iflag & IUCLC)
-    c = tolower (c);
-
-  if (c == '\r') {
-    if (tty->termios.c_iflag & ICRNL)
-      c = '\n';
-  } else if (c == '\n') {
-    if (tty->termios.c_iflag & INLCR)
-      c = '\r';
-  }
-
-  return c;
-}
-
-/*
- * This points to the currently registered method to perform
- * ISIG processing of VKILL and VQUIT characters.
- */
-static rtems_termios_isig_handler termios_isig_handler =
-   rtems_termios_default_isig_handler;
-
-/*
- * This is the default method to process VKILL or VQUIT characters if
- * ISIG processing is enabled. Note that it does nothing.
- */
-rtems_termios_iproc_status_code rtems_termios_default_isig_handler(
-  unsigned char c,
-  struct rtems_termios_tty *tty
-)
-{
-  return RTEMS_TERMIOS_IPROC_CONTINUE;
-}
-
-/*
- * Register a method to process VKILL or VQUIT characters if
- * ISIG processing is enabled.
- */
-rtems_status_code rtems_termios_register_isig_handler(
-  rtems_termios_isig_handler handler
-)
-{
-  if (handler == NULL) {
-    return RTEMS_INVALID_ADDRESS;
-  }
-
-  termios_isig_handler = handler;
-  return RTEMS_SUCCESSFUL;
-}
-
-/*
- * Process a single input character
- */
-static rtems_termios_iproc_status_code
-iproc (unsigned char c, struct rtems_termios_tty *tty)
-{
-  /*
-   * If signals are enabled, then allow possibility of VINTR causing
-   * SIGINTR and VQUIT causing SIGQUIT. Invoke user provided isig handler.
-   */
-  if ((tty->termios.c_lflag & ISIG)) {
-    if ((c == tty->termios.c_cc[VINTR]) || (c == tty->termios.c_cc[VQUIT])) {
-      return (*termios_isig_handler)(c, tty);
-    }
-  }
-
-  /*
-   * Perform canonical character processing.
-   */
-  if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
-    if (c == tty->termios.c_cc[VERASE]) {
-      erase (tty, 0);
-      return RTEMS_TERMIOS_IPROC_CONTINUE;
-    }
-    else if (c == tty->termios.c_cc[VKILL]) {
-      erase (tty, 1);
-      return RTEMS_TERMIOS_IPROC_CONTINUE;
-    }
-    else if (c == tty->termios.c_cc[VEOF]) {
-      return RTEMS_TERMIOS_IPROC_DONE;
-    } else if (c == '\n') {
-      if (tty->termios.c_lflag & (ECHO | ECHONL))
-        echo (c, tty);
-      tty->cbuf[tty->ccount++] = c;
-      return RTEMS_TERMIOS_IPROC_DONE;
-    } else if ((c == tty->termios.c_cc[VEOL]) ||
-               (c == tty->termios.c_cc[VEOL2])) {
-      if (tty->termios.c_lflag & ECHO)
-        echo (c, tty);
-      tty->cbuf[tty->ccount++] = c;
-      return RTEMS_TERMIOS_IPROC_DONE;
-    }
-  }
-
-  /*
-   * Perform non-canonical character processing.
-   *
-   * FIXME: Should do IMAXBEL handling somehow
-   */
-  if (tty->ccount < (CBUFSIZE-1)) {
-    if (tty->termios.c_lflag & ECHO)
-      echo (c, tty);
-    tty->cbuf[tty->ccount++] = c;
-  }
-  return RTEMS_TERMIOS_IPROC_CONTINUE;
-}
-
-/*
- * Process input character, with semaphore.
- */
-static rtems_termios_iproc_status_code
-siproc (unsigned char c, struct rtems_termios_tty *tty)
-{
-  rtems_termios_iproc_status_code rc;
-
-  /*
-   * Obtain output semaphore if character will be echoed
-   */
-  if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
-    rtems_mutex_lock (&tty->osem);
-    rc = iproc (c, tty);
-    rtems_mutex_unlock (&tty->osem);
-  }
-  else {
-    rc = iproc (c, tty);
-  }
-  return rc;
-}
-
-static rtems_termios_iproc_status_code
-siprocPoll (unsigned char c, rtems_termios_tty *tty)
-{
-  if (c == '\r' && (tty->termios.c_iflag & IGNCR) != 0) {
-    return RTEMS_TERMIOS_IPROC_CONTINUE;
-  }
-
-  /*
-   * iprocEarly is done at the interrupt level for interrupt driven
-   * devices so we need to perform those actions before processing
-   * the character.
-   */
-  c = iprocEarly (c, tty);
-  return siproc (c, tty);
-}
-
-/*
- * Fill the input buffer by polling the device
- */
-static rtems_termios_iproc_status_code
-fillBufferPoll (struct rtems_termios_tty *tty)
-{
-  int                             n;
-  rtems_termios_iproc_status_code rc;
-
-  if (tty->termios.c_lflag & ICANON) {
-    for (;;) {
-      n = (*tty->handler.poll_read)(tty->device_context);
-      if (n < 0) {
-        rtems_task_wake_after (1);
-      } else {
-        rc = siprocPoll (n, tty);
-        if (rc != RTEMS_TERMIOS_IPROC_CONTINUE) {
-          return rc;
-        }
-      }
-    }
-  } else {
-    rtems_interval then, now;
-
-    then = rtems_clock_get_ticks_since_boot();
-    for (;;) {
-      n = (*tty->handler.poll_read)(tty->device_context);
-      if (n < 0) {
-        if (tty->termios.c_cc[VMIN]) {
-          if (tty->termios.c_cc[VTIME] && tty->ccount) {
-            now = rtems_clock_get_ticks_since_boot();
-            if ((now - then) > tty->vtimeTicks) {
-              break;
-            }
-          }
-        } else {
-          if (!tty->termios.c_cc[VTIME])
-            break;
-          now = rtems_clock_get_ticks_since_boot();
-          if ((now - then) > tty->vtimeTicks) {
-            break;
-          }
-        }
-        rtems_task_wake_after (1);
-      } else {
-        rc = siprocPoll (n, tty);
-        if (rc != RTEMS_TERMIOS_IPROC_CONTINUE) {
-          return rc;
-        }
-        if (tty->ccount >= tty->termios.c_cc[VMIN])
-          break;
-        if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
-          then = rtems_clock_get_ticks_since_boot();
-      }
-    }
-  }
-  return RTEMS_TERMIOS_IPROC_CONTINUE;
-}
-
-/*
- * Fill the input buffer from the raw input queue
- */
-static rtems_termios_iproc_status_code
-fillBufferQueue (struct rtems_termios_tty *tty)
-{
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
-  bool wait = true;
-
-  while ( wait ) {
-    rtems_interrupt_lock_context lock_context;
-
-    /*
-     * Process characters read from raw queue
-     */
-
-    rtems_termios_device_lock_acquire (ctx, &lock_context);
-
-    while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
-                       (tty->ccount < (CBUFSIZE-1))) {
-      unsigned char                    c;
-      unsigned int                     newHead;
-      rtems_termios_iproc_status_code  rc;
-
-      newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size;
-      c = tty->rawInBuf.theBuf[newHead];
-      tty->rawInBuf.Head = newHead;
-
-      if(((tty->rawInBuf.Tail - newHead) % tty->rawInBuf.Size)
-         < tty->lowwater) {
-        tty->flow_ctrl &= ~FL_IREQXOF;
-        /* if tx stopped and XON should be sent... */
-        if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
-             ==                (FL_MDXON | FL_ISNTXOF))
-            && ((tty->rawOutBufState == rob_idle)
-          || (tty->flow_ctrl & FL_OSTOP))) {
-          /* XON should be sent now... */
-          (*tty->handler.write)(
-            tty->device_context, (void *)&(tty->termios.c_cc[VSTART]), 1);
-        } else if (tty->flow_ctrl & FL_MDRTS) {
-          tty->flow_ctrl &= ~FL_IRTSOFF;
-          /* activate RTS line */
-          if (tty->flow.start_remote_tx != NULL) {
-            tty->flow.start_remote_tx(tty->device_context);
-          }
-        }
-      }
-
-      rtems_termios_device_lock_release (ctx, &lock_context);
-
-      /* continue processing new character */
-      if (tty->termios.c_lflag & ICANON) {
-        rc = siproc (c, tty);
-        if (rc != RTEMS_TERMIOS_IPROC_CONTINUE) {
-          return rc;
-        }
-      } else {
-        rc = siproc (c, tty);
-
-        /* in non-canonical mode only stop on interrupt */
-        if (rc == RTEMS_TERMIOS_IPROC_INTERRUPT) {
-          return rc;
-        }
-
-        if (tty->ccount >= tty->termios.c_cc[VMIN])
-          wait = false;
-      }
-      timeout = tty->rawInBufSemaphoreTimeout;
-
-      rtems_termios_device_lock_acquire (ctx, &lock_context);
-    }
-
-    rtems_termios_device_lock_release (ctx, &lock_context);
-
-    /*
-     * Wait for characters
-     */
-    if (wait) {
-      if (tty->ccount < CBUFSIZE - 1) {
-        rtems_binary_semaphore *sem;
-        int eno;
-
-        sem = &tty->rawInBuf.Semaphore;
-
-        if (tty->rawInBufSemaphoreWait) {
-          eno = rtems_binary_semaphore_wait_timed_ticks (sem, timeout);
-        } else {
-          eno = rtems_binary_semaphore_try_wait (sem);
-        }
-
-        if (eno != 0) {
-          break;
-        }
-      } else {
-        break;
-      }
-    }
-  }
-  return RTEMS_TERMIOS_IPROC_CONTINUE;
-}
-
-static rtems_status_code
-rtems_termios_read_tty (
-  struct rtems_termios_tty *tty,
-  char                     *buffer,
-  uint32_t                  initial_count,
-  uint32_t                 *count_read
-)
-{
-  uint32_t                         count;
-  rtems_termios_iproc_status_code  rc;
-
-  count = initial_count;
-
-  if (tty->cindex == tty->ccount) {
-    tty->cindex = tty->ccount = 0;
-    tty->read_start_column = tty->column;
-    if (tty->handler.poll_read != NULL && tty->handler.mode == TERMIOS_POLLED)
-      rc = fillBufferPoll (tty);
-    else
-      rc = fillBufferQueue (tty);
-  } else {
-    rc = RTEMS_TERMIOS_IPROC_CONTINUE;
-  }
-
-  /*
-   * If there are characters in the buffer, then copy them to the caller.
-   */
-  while (count && (tty->cindex < tty->ccount)) {
-    *buffer++ = tty->cbuf[tty->cindex++];
-    count--;
-   }
-  tty->tty_rcvwakeup = false;
-  *count_read = initial_count - count;
-
-  /*
-   * fillBufferPoll and fillBufferQueue can indicate that the operation
-   * was interrupted. The isig handler can do nothing, have POSIX behavior
-   * and cause a signal, or a user defined action.
-   */
-  if (rc == RTEMS_TERMIOS_IPROC_INTERRUPT) {
-    return RTEMS_INTERRUPTED;
-  }
-
-  return RTEMS_SUCCESSFUL;
-}
-
-rtems_status_code
-rtems_termios_read (void *arg)
-{
-  rtems_libio_rw_args_t    *args = arg;
-  struct rtems_termios_tty *tty = args->iop->data1;
-  rtems_status_code         sc;
-
-  rtems_mutex_lock (&tty->isem);
-
-  if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
-
-    sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
-    tty->tty_rcvwakeup = false;
-    rtems_mutex_unlock (&tty->isem);
-    return sc;
-  }
-
-  sc = rtems_termios_read_tty(
-    tty,
-    args->buffer,
-    args->count,
-    &args->bytes_moved
-  );
-  rtems_mutex_unlock (&tty->isem);
-  return sc;
-}
-
-/*
- * signal receive interrupt to rx daemon
- * NOTE: This routine runs in the context of the
- *       device receive interrupt handler.
- */
-void rtems_termios_rxirq_occured(struct rtems_termios_tty *tty)
-{
-  /*
-   * send event to rx daemon task
-   */
-  rtems_event_send(tty->rxTaskId,TERMIOS_RX_PROC_EVENT);
-}
-
-static bool
-mustCallReceiveCallback (const rtems_termios_tty *tty, unsigned char c,
-                         unsigned int newTail, unsigned int head)
-{
-  if ((tty->termios.c_lflag & ICANON) != 0) {
-    return c == '\n' || c == tty->termios.c_cc[VEOF] ||
-      c == tty->termios.c_cc[VEOL] || c == tty->termios.c_cc[VEOL2];
-  } else {
-    unsigned int rawContentSize = (newTail - head) % tty->rawInBuf.Size;
-
-    return rawContentSize >= tty->termios.c_cc[VMIN];
-  }
-}
-
-/*
- * Place characters on raw queue.
- * NOTE: This routine runs in the context of the
- *       device receive interrupt handler.
- * Returns the number of characters dropped because of overflow.
- */
-int
-rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len)
-{
-  struct rtems_termios_tty *tty = ttyp;
-  char c;
-  int dropped = 0;
-  bool flow_rcv = false; /* true, if flow control char received */
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interrupt_lock_context lock_context;
-
-  if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
-    while (len--) {
-      c = *buf++;
-      rtems_termios_linesw[tty->t_line].l_rint(c,tty);
-    }
-
-    /*
-     * check to see if rcv wakeup callback was set
-     */
-    if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
-      tty->tty_rcvwakeup = true;
-      (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
-    }
-    return 0;
-  }
-
-  while (len--) {
-    c = *buf++;
-    /* FIXME: implement IXANY: any character restarts output */
-    /* if incoming XON/XOFF controls outgoing stream: */
-    if (tty->flow_ctrl & FL_MDXON) {
-      /* if received char is V_STOP and V_START (both are equal value) */
-      if (c == tty->termios.c_cc[VSTOP]) {
-        if (c == tty->termios.c_cc[VSTART]) {
-          /* received VSTOP and VSTART==VSTOP? */
-          /* then toggle "stop output" status  */
-          tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF;
-        }
-        else {
-          /* VSTOP received (other code than VSTART) */
-          /* stop output                             */
-          tty->flow_ctrl |= FL_ORCVXOF;
-        }
-        flow_rcv = true;
-      }
-      else if (c == tty->termios.c_cc[VSTART]) {
-        /* VSTART received */
-        /* restart output  */
-        tty->flow_ctrl &= ~FL_ORCVXOF;
-        flow_rcv = true;
-      }
-    }
-    if (flow_rcv) {
-      /* restart output according to FL_ORCVXOF flag */
-      if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
-        /* disable interrupts    */
-        rtems_termios_device_lock_acquire (ctx, &lock_context);
-        tty->flow_ctrl &= ~FL_OSTOP;
-        /* check for chars in output buffer (or rob_state?) */
-        if (tty->rawOutBufState != rob_idle) {
-          /* if chars available, call write function... */
-          (*tty->handler.write)(
-            ctx, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
-        }
-        /* reenable interrupts */
-        rtems_termios_device_lock_release (ctx, &lock_context);
-      }
-    } else {
-      unsigned int head;
-      unsigned int oldTail;
-      unsigned int newTail;
-      bool callReciveCallback;
-
-      if (c == '\r' && (tty->termios.c_iflag & IGNCR) != 0) {
-        continue;
-      }
-
-      c = iprocEarly (c, tty);
-
-      rtems_termios_device_lock_acquire (ctx, &lock_context);
-
-      head = tty->rawInBuf.Head;
-      oldTail = tty->rawInBuf.Tail;
-      newTail = (oldTail + 1) % tty->rawInBuf.Size;
-
-      /* if chars_in_buffer > highwater                */
-      if ((tty->flow_ctrl & FL_IREQXOF) != 0 && (((newTail - head) %
-          tty->rawInBuf.Size) > tty->highwater)) {
-        /* incoming data stream should be stopped */
-        tty->flow_ctrl |= FL_IREQXOF;
-        if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
-            ==                (FL_MDXOF             ) ) {
-          if ((tty->flow_ctrl & FL_OSTOP) ||
-              (tty->rawOutBufState == rob_idle)) {
-            /* if tx is stopped due to XOFF or out of data */
-            /*    call write function here                 */
-            tty->flow_ctrl |= FL_ISNTXOF;
-            (*tty->handler.write)(ctx,
-                (void *)&(tty->termios.c_cc[VSTOP]), 1);
-          }
-        } else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
-          tty->flow_ctrl |= FL_IRTSOFF;
-          /* deactivate RTS line */
-          if (tty->flow.stop_remote_tx != NULL) {
-            tty->flow.stop_remote_tx(ctx);
-          }
-        }
-      }
-
-      callReciveCallback = false;
-
-      if (newTail != head) {
-        tty->rawInBuf.theBuf[newTail] = c;
-        tty->rawInBuf.Tail = newTail;
-
-        /*
-         * check to see if rcv wakeup callback was set
-         */
-        if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
-          if (mustCallReceiveCallback (tty, c, newTail, head)) {
-            tty->tty_rcvwakeup = true;
-            callReciveCallback = true;
-          }
-        }
-      } else {
-        ++dropped;
-
-        if (tty->tty_rcv.sw_pfn != NULL && !tty->tty_rcvwakeup) {
-          tty->tty_rcvwakeup = true;
-          callReciveCallback = true;
-        }
-      }
-
-      rtems_termios_device_lock_release (ctx, &lock_context);
-
-      if (callReciveCallback) {
-        (*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
-      }
-    }
-  }
-
-  tty->rawInBufDropped += dropped;
-  rtems_binary_semaphore_post (&tty->rawInBuf.Semaphore);
-  return dropped;
-}
-
-/*
- * in task-driven mode, this function is called in Tx task context
- * in interrupt-driven mode, this function is called in TxIRQ context
- */
-static int
-rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
-{
-  bool wakeUpWriterTask = false;
-  unsigned int newTail;
-  int nToSend;
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_interrupt_lock_context lock_context;
-  int len;
-
-  rtems_termios_device_lock_acquire (ctx, &lock_context);
-
-  /* check for XOF/XON to send */
-  if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
-      == (FL_MDXOF | FL_IREQXOF)) {
-    /* XOFF should be sent now... */
-    (*tty->handler.write)(ctx, (void *)&(tty->termios.c_cc[VSTOP]), 1);
-
-    tty->t_dqlen--;
-    tty->flow_ctrl |= FL_ISNTXOF;
-
-    nToSend = 1;
-
-  } else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
-    /* NOTE: send XON even, if no longer in XON/XOFF mode... */
-    /* XON should be sent now... */
-    /*
-     * FIXME: this .write call will generate another
-     * dequeue callback. This will advance the "Tail" in the data
-     * buffer, although the corresponding data is not yet out!
-     * Therefore the dequeue "length" should be reduced by 1
-     */
-    (*tty->handler.write)(ctx, (void *)&(tty->termios.c_cc[VSTART]), 1);
-
-    tty->t_dqlen--;
-    tty->flow_ctrl &= ~FL_ISNTXOF;
-
-    nToSend = 1;
-  } else if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
-    /*
-     * buffer was empty
-     */
-    if (tty->rawOutBufState == rob_wait) {
-      /*
-       * this should never happen...
-       */
-      wakeUpWriterTask = true;
-    }
-
-    (*tty->handler.write) (ctx, NULL, 0);
-    nToSend = 0;
-  } else {
-    len = tty->t_dqlen;
-    tty->t_dqlen = 0;
-
-    newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
-    tty->rawOutBuf.Tail = newTail;
-    if (tty->rawOutBufState == rob_wait) {
-      /*
-       * wake up any pending writer task
-       */
-      wakeUpWriterTask = true;
-    }
-
-    if (newTail == tty->rawOutBuf.Head) {
-      /*
-       * Buffer has become empty
-       */
-      tty->rawOutBufState = rob_idle;
-      (*tty->handler.write) (ctx, NULL, 0);
-      nToSend = 0;
-
-      /*
-       * check to see if snd wakeup callback was set
-       */
-      if ( tty->tty_snd.sw_pfn != NULL) {
-        (*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg);
-      }
-    } else {
-      /*
-       * Buffer not empty, check flow control, start transmitter
-       */
-      nToSend = startXmit (tty, newTail, true);
-    }
-  }
-
-  rtems_termios_device_lock_release (ctx, &lock_context);
-
-  if (wakeUpWriterTask) {
-    rtems_binary_semaphore_post (&tty->rawOutBuf.Semaphore);
-  }
-
-  return nToSend;
-}
-
-/*
- * Characters have been transmitted
- * NOTE: This routine runs in the context of the
- *       device transmit interrupt handler.
- * The second argument is the number of characters transmitted so far.
- * This value will always be 1 for devices which generate an interrupt
- * for each transmitted character.
- * It returns number of characters left to transmit
- */
-int
-rtems_termios_dequeue_characters (void *ttyp, int len)
-{
-  struct rtems_termios_tty *tty = ttyp;
-  rtems_status_code sc;
-
-  /*
-   * sum up character count already sent
-   */
-  tty->t_dqlen += len;
-
-  if (tty->handler.mode == TERMIOS_TASK_DRIVEN) {
-    /*
-     * send wake up to transmitter task
-     */
-    tty->txTaskCharsDequeued = len;
-    sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
-    if (sc != RTEMS_SUCCESSFUL)
-      rtems_fatal_error_occurred (sc);
-    return 0; /* nothing to output in IRQ... */
-  }
-
-  if (tty->t_line == PPPDISC ) {
-    /*
-     * call PPP line discipline start function
-     */
-    if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
-      rtems_termios_linesw[tty->t_line].l_start(tty, len);
-    }
-    return 0; /* nothing to output in IRQ... */
-  }
-
-  return rtems_termios_refill_transmitter(tty);
-}
-
-/*
- * this task actually processes any transmit events
- */
-static rtems_task rtems_termios_txdaemon(rtems_task_argument argument)
-{
-  struct rtems_termios_tty *tty = (struct rtems_termios_tty *)argument;
-  rtems_event_set the_event;
-
-  while (1) {
-    /*
-     * wait for rtems event
-     */
-    rtems_event_receive(
-       (TERMIOS_TX_START_EVENT | TERMIOS_TX_TERMINATE_EVENT),
-       RTEMS_EVENT_ANY | RTEMS_WAIT,
-       RTEMS_NO_TIMEOUT,
-       &the_event
-    );
-    if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) {
-      tty->txTaskId = 0;
-      rtems_task_exit();
-    }
-
-    /*
-     * call any line discipline start function
-     */
-    if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
-      rtems_termios_linesw[tty->t_line].l_start(tty, tty->txTaskCharsDequeued);
-
-      if (tty->t_line == PPPDISC) {
-        /*
-         * Do not call rtems_termios_refill_transmitter() in this case similar
-         * to rtems_termios_dequeue_characters().
-         */
-        continue;
-      }
-    }
-
-    /*
-     * try to push further characters to device
-     */
-    rtems_termios_refill_transmitter(tty);
-  }
-}
-
-/*
- * this task actually processes any receive events
- */
-static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument)
-{
-  struct rtems_termios_tty *tty = (struct rtems_termios_tty *)argument;
-  rtems_termios_device_context *ctx = tty->device_context;
-  rtems_event_set the_event;
-  int c;
-  char c_buf;
-
-  while (1) {
-    /*
-     * wait for rtems event
-     */
-    rtems_event_receive(
-      (TERMIOS_RX_PROC_EVENT | TERMIOS_RX_TERMINATE_EVENT),
-      RTEMS_EVENT_ANY | RTEMS_WAIT,
-      RTEMS_NO_TIMEOUT,
-      &the_event
-    );
-    if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) {
-      tty->rxTaskId = 0;
-      rtems_task_exit();
-    }
-
-    /*
-     * do something
-     */
-    c = tty->handler.poll_read(ctx);
-    if (c != EOF) {
-      /*
-       * poll_read did call enqueue on its own
-       */
-      c_buf = c;
-      rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
-    }
-  }
-}
-
-static int
-rtems_termios_imfs_open (rtems_libio_t *iop,
-  const char *path, int oflag, mode_t mode)
-{
-  rtems_termios_device_node *device_node;
-  rtems_libio_open_close_args_t args;
-  struct rtems_termios_tty *tty;
-
-  device_node = IMFS_generic_get_context_by_iop (iop);
-
-  memset (&args, 0, sizeof (args));
-  args.iop = iop;
-  args.flags = rtems_libio_iop_flags (iop);
-  args.mode = mode;
-
-  rtems_termios_obtain ();
-
-  tty = rtems_termios_open_tty (device_node->major, device_node->minor, &args,
-      device_node->tty, device_node, NULL);
-  if (tty == NULL) {
-    rtems_termios_release ();
-    rtems_set_errno_and_return_minus_one (ENOMEM);
-  }
-
-  rtems_termios_release ();
-  return 0;
-}
-
-static int
-rtems_termios_imfs_close (rtems_libio_t *iop)
-{
-  rtems_libio_open_close_args_t args;
-  struct rtems_termios_tty *tty;
-
-  memset (&args, 0, sizeof (args));
-  args.iop = iop;
-
-  tty = iop->data1;
-
-  rtems_termios_obtain ();
-  rtems_termios_close_tty (tty, &args);
-  rtems_termios_release ();
-  return 0;
-}
-
-static ssize_t
-rtems_termios_imfs_read (rtems_libio_t *iop, void *buffer, size_t count)
-{
-  struct rtems_termios_tty *tty;
-  uint32_t                  bytes_moved;
-  rtems_status_code         sc;
-
-  tty = iop->data1;
-
-  rtems_mutex_lock (&tty->isem);
-
-  if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
-    rtems_libio_rw_args_t args;
-    rtems_status_code sc;
-
-    memset (&args, 0, sizeof (args));
-    args.iop = iop;
-    args.buffer = buffer;
-    args.count = count;
-    args.flags = rtems_libio_iop_flags (iop);
-
-    sc = rtems_termios_linesw[tty->t_line].l_read (tty, &args);
-    tty->tty_rcvwakeup = false;
-    rtems_mutex_unlock (&tty->isem);
-
-    if (sc != RTEMS_SUCCESSFUL) {
-      return rtems_status_code_to_errno (sc);
-    }
-
-    return (ssize_t) args.bytes_moved;
-  }
-
-  sc = rtems_termios_read_tty(tty, buffer, count, &bytes_moved);
-  rtems_mutex_unlock (&tty->isem);
-  if (sc != RTEMS_SUCCESSFUL) {
-     return rtems_status_code_to_errno (sc);
-  }
-  return (ssize_t) bytes_moved;
-  
-}
-
-static ssize_t
-rtems_termios_imfs_write (rtems_libio_t *iop, const void *buffer, size_t count)
-{
-  struct rtems_termios_tty *tty;
-  uint32_t bytes_moved;
-
-  tty = iop->data1;
-
-  rtems_mutex_lock (&tty->osem);
-
-  if (rtems_termios_linesw[tty->t_line].l_write != NULL) {
-    rtems_libio_rw_args_t args;
-    rtems_status_code sc;
-
-    memset (&args, 0, sizeof (args));
-    args.iop = iop;
-    args.buffer = RTEMS_DECONST (void *, buffer);
-    args.count = count;
-    args.flags = rtems_libio_iop_flags (iop);
-
-    sc = rtems_termios_linesw[tty->t_line].l_write (tty, &args);
-    rtems_mutex_unlock (&tty->osem);
-
-    if (sc != RTEMS_SUCCESSFUL) {
-      return rtems_status_code_to_errno (sc);
-    }
-
-    return (ssize_t) args.bytes_moved;
-  }
-
-  bytes_moved = rtems_termios_write_tty (iop, tty, buffer, count);
-  rtems_mutex_unlock (&tty->osem);
-  return (ssize_t) bytes_moved;
-}
-
-static int
-rtems_termios_imfs_ioctl (rtems_libio_t *iop, ioctl_command_t request,
-  void *buffer)
-{
-  rtems_status_code sc;
-  rtems_libio_ioctl_args_t args;
-
-  memset (&args, 0, sizeof (args));
-  args.iop = iop;
-  args.command = request;
-  args.buffer = buffer;
-
-  sc = rtems_termios_ioctl (&args);
-  if ( sc == RTEMS_SUCCESSFUL ) {
-    return args.ioctl_return;
-  } else {
-    return rtems_status_code_to_errno (sc);
-  }
-}
-
-static const rtems_filesystem_file_handlers_r rtems_termios_imfs_handler = {
-  .open_h = rtems_termios_imfs_open,
-  .close_h = rtems_termios_imfs_close,
-  .read_h = rtems_termios_imfs_read,
-  .write_h = rtems_termios_imfs_write,
-  .ioctl_h = rtems_termios_imfs_ioctl,
-  .lseek_h = rtems_filesystem_default_lseek,
-  .fstat_h = IMFS_stat,
-  .ftruncate_h = rtems_filesystem_default_ftruncate,
-  .fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
-  .fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
-  .fcntl_h = rtems_filesystem_default_fcntl,
-  .kqfilter_h = rtems_termios_kqfilter,
-  .mmap_h = rtems_termios_mmap,
-  .poll_h = rtems_termios_poll,
-  .readv_h = rtems_filesystem_default_readv,
-  .writev_h = rtems_filesystem_default_writev
-};
-
-static IMFS_jnode_t *
-rtems_termios_imfs_node_initialize (IMFS_jnode_t *node, void *arg)
-{
-  rtems_termios_device_node *device_node;
-  dev_t dev;
-
-  node = IMFS_node_initialize_generic (node, arg);
-  device_node = IMFS_generic_get_context_by_node (node);
-  dev = IMFS_generic_get_device_identifier_by_node (node);
-  device_node->major = rtems_filesystem_dev_major_t (dev);
-  device_node->minor = rtems_filesystem_dev_minor_t (dev);
-
-  return node;
-}
-
-static void
-rtems_termios_imfs_node_destroy (IMFS_jnode_t *node)
-{
-  rtems_termios_device_node *device_node;
-
-  device_node = IMFS_generic_get_context_by_node (node);
-  free (device_node);
-  IMFS_node_destroy_default (node);
-}
-
-static const IMFS_node_control rtems_termios_imfs_node_control =
-  IMFS_GENERIC_INITIALIZER(
-    &rtems_termios_imfs_handler,
-    rtems_termios_imfs_node_initialize,
-    rtems_termios_imfs_node_destroy
-  );
Index: cpukit/libcsupport/src/termios_baud2index.c
===================================================================
--- cpukit/libcsupport/src/termios_baud2index.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Convert Bxxx Constant to Index
- *  @ingroup TermiostypesSupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <termios.h>
-#include <rtems/termiostypes.h>
-
-int rtems_termios_baud_to_index(
-  rtems_termios_baud_t termios_baud
-)
-{
-  int baud_index;
-
-  switch (termios_baud) {
-    case B0:        baud_index =  0;  break;
-    case B50:       baud_index =  1;  break;
-    case B75:       baud_index =  2;  break;
-    case B110:      baud_index =  3;  break;
-    case B134:      baud_index =  4;  break;
-    case B150:      baud_index =  5;  break;
-    case B200:      baud_index =  6;  break;
-    case B300:      baud_index =  7;  break;
-    case B600:      baud_index =  8;  break;
-    case B1200:     baud_index =  9;  break;
-    case B1800:     baud_index = 10;  break;
-    case B2400:     baud_index = 11;  break;
-    case B4800:     baud_index = 12;  break;
-    case B9600:     baud_index = 13;  break;
-    case B19200:    baud_index = 14;  break;
-    case B38400:    baud_index = 15;  break;
-    case B7200:     baud_index = 16;  break;
-    case B14400:    baud_index = 17;  break;
-    case B28800:    baud_index = 18;  break;
-    case B57600:    baud_index = 19;  break;
-    case B76800:    baud_index = 20;  break;
-    case B115200:   baud_index = 21;  break;
-    case B230400:   baud_index = 22;  break;
-    case B460800:   baud_index = 23;  break;
-    case B921600:   baud_index = 24;  break;
-    default:        baud_index = -1;  break;
-  }
-
-  return baud_index;
-}
Index: cpukit/libcsupport/src/termios_baud2num.c
===================================================================
--- cpukit/libcsupport/src/termios_baud2num.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Convert Baud Part of Termios control flags to an integral Baud Value
- *  @ingroup TermiostypesSupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/termiostypes.h>
-
-rtems_termios_baud_t rtems_termios_baud_to_number(speed_t spd)
-{
-  return rtems_assoc_local_by_remote(rtems_termios_baud_table, spd);
-}
Index: cpukit/libcsupport/src/termios_baudtable.c
===================================================================
--- cpukit/libcsupport/src/termios_baudtable.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief  RTEMS Termios Baud Table
- *  @ingroup TermiostypesSupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/termiostypes.h>
-
-const rtems_assoc_t rtems_termios_baud_table [] = {
-  { "B0",      0,      B0 },
-  { "B50",     50,     B50 },
-  { "B75",     75,     B75 },
-  { "B110",    110,    B110 },
-  { "B134",    134,    B134 },
-  { "B150",    150,    B150 },
-  { "B200",    200,    B200 },
-  { "B300",    300,    B300 },
-  { "B600",    600,    B600 },
-  { "B1200",   1200,   B1200 },
-  { "B1800",   1800,   B1800 },
-  { "B2400",   2400,   B2400 },
-  { "B4800",   4800,   B4800 },
-  { "B9600",   9600,   B9600 },
-  { "B19200",  19200,  B19200 },
-  { "B38400",  38400,  B38400 },
-  { "B7200",   7200,   B7200 },
-  { "B14400",  14400,  B14400 },
-  { "B28800",  28800,  B28800 },
-  { "B57600",  57600,  B57600 },
-  { "B76800",  76800,  B76800 },
-  { "B115200", 115200, B115200 },
-  { "B230400", 230400, B230400 },
-  { "B460800", 460800, B460800 },
-  { "B921600", 921600, B921600 },
-  { NULL,      0,      0 }
-};
Index: cpukit/libcsupport/src/termios_num2baud.c
===================================================================
--- cpukit/libcsupport/src/termios_num2baud.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Converts the Integral Baud to Termios Control Flag Representation
- *  @ingroup TermiostypesSupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/termiostypes.h>
-
-tcflag_t rtems_termios_number_to_baud(rtems_termios_baud_t baud)
-{
-  uint32_t remote_value = rtems_assoc_remote_by_local(
-    rtems_termios_baud_table,
-    baud
-  );
-
-  if (remote_value == 0) {
-    remote_value = B0;
-  }
-
-  return (tcflag_t) remote_value;
-}
Index: cpukit/libcsupport/src/termios_posix_isig_handler.c
===================================================================
--- cpukit/libcsupport/src/termios_posix_isig_handler.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/**
- * @file
- * TERMIOS POSIX behavior on INTR and QUIT characters
- */
-
-/*
- *  COPYRIGHT (c) 1989-2012,2019.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  SPDX-License-Identifier: BSD-2-Clause
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems.h>
-#include <rtems/libio.h>
-#include <rtems/termiostypes.h>
-
-#include <signal.h>
-
-rtems_termios_iproc_status_code rtems_termios_posix_isig_handler(
-  unsigned char             c,
-  struct rtems_termios_tty *tty
-)
-{
-  int sig;
-
-  if ( c == tty->termios.c_cc[ VQUIT ] ) {
-    sig = SIGQUIT;
-  } else {
-    sig = SIGINT;
-  }
-
-  (void) raise( sig );
-
-  return RTEMS_TERMIOS_IPROC_INTERRUPT;
-}
Index: cpukit/libcsupport/src/termios_setbestbaud.c
===================================================================
--- cpukit/libcsupport/src/termios_setbestbaud.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/termiostypes.h>
-
-void rtems_termios_set_best_baud(
-  struct termios *term,
-  uint32_t        baud
-)
-{
-  const rtems_assoc_t *current = &rtems_termios_baud_table[ 0 ];
-  const rtems_assoc_t *last = current;
-  speed_t spd;
-
-  while ( current->name != NULL && current->local_value < baud ) {
-    last = current;
-    ++current;
-  }
-
-  if ( current->name != NULL ) {
-    uint32_t mid = (last->local_value + current->local_value) / UINT32_C( 2 );
-
-    spd = baud <= mid ? last->remote_value : current->remote_value;
-  } else {
-    spd = B460800;
-  }
-
-  term->c_ispeed = spd;
-  term->c_ospeed = spd;
-}
Index: cpukit/libcsupport/src/termios_setinitialbaud.c
===================================================================
--- cpukit/libcsupport/src/termios_setinitialbaud.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Sets the Initial Baud in the Termios Context
- *  @ingroup TermiostypesSupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/termiostypes.h>
-
-int rtems_termios_set_initial_baud(
-  struct rtems_termios_tty *tty,
-  rtems_termios_baud_t baud
-)
-{
-  int rv = 0;
-  speed_t spd = rtems_termios_number_to_baud(baud);
-
-  if ( spd != 0 ) {
-    tty->termios.c_ispeed = spd;
-    tty->termios.c_ospeed = spd;
-  } else {
-    rv = -1;
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/termiosinitialize.c
===================================================================
--- cpukit/libcsupport/src/termiosinitialize.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/**
- * @file
- *
- * @ingroup TermiostypesSupport
- *
- * @brief This source file contains the implementation of
- *   rtems_termios_device_lock_acquire_default() and
- *   rtems_termios_device_lock_release_default().
- */
-
-/*
- * Copyright (c) 1997 Eric Norum <eric@norum.ca>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/termiosdevice.h>
-
-void
-rtems_termios_device_lock_acquire_default(
-  rtems_termios_device_context *ctx,
-  rtems_interrupt_lock_context *lock_context
-)
-{
-  rtems_interrupt_lock_acquire (&ctx->lock.interrupt, lock_context);
-}
-
-void
-rtems_termios_device_lock_release_default(
-  rtems_termios_device_context *ctx,
-  rtems_interrupt_lock_context *lock_context
-)
-{
-  rtems_interrupt_lock_release (&ctx->lock.interrupt, lock_context);
-}
Index: cpukit/libcsupport/src/truncate.c
===================================================================
--- cpukit/libcsupport/src/truncate.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Truncate a File to the Specified Length
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-
-/**
- *  This routine is not defined in the POSIX 1003.1b standard but is
- *  commonly supported on most UNIX and POSIX systems.  It is provided
- *  for compatibility.
- */
-int truncate(
-  const char  *path,
-  off_t        length
-)
-{
-  int status;
-  int fd;
-
-  fd = open( path, O_WRONLY );
-  if ( fd == -1 )
-    return -1;
-
-  status = ftruncate( fd, length );
-
-  (void) close( fd );
-
-  return status;
-}
Index: cpukit/libcsupport/src/uenvgetgroups.c
===================================================================
--- cpukit/libcsupport/src/uenvgetgroups.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,50 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (c) 2014 embedded brains GmbH & Co. KG
- *
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/userenv.h>
-#include <rtems.h>
-
-#include <sys/types.h>
-#include <unistd.h>
-
-void rtems_current_user_env_getgroups(void)
-{
-  rtems_user_env_t *uenv = rtems_current_user_env_get();
-  int ngroups = (int) RTEMS_ARRAY_SIZE( uenv->groups );
-
-  ngroups = getgroups( ngroups, &uenv->groups[ 0 ] );
-  if ( ngroups > 0 ) {
-    uenv->ngroups = (size_t) ngroups;
-  } else {
-    uenv->ngroups = 0;
-  }
-}
Index: cpukit/libcsupport/src/umask.c
===================================================================
--- cpukit/libcsupport/src/umask.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Set File Creation Mask
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/stat.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  POSIX 1003.1b 5.3.3 - Set File Creation Mask
- */
-mode_t umask( mode_t cmask )
-{
-  mode_t old_mask;
-
-  rtems_libio_lock();
-  old_mask = rtems_filesystem_umask;
-  rtems_filesystem_umask = cmask & (S_IRWXU | S_IRWXG | S_IRWXO);
-  rtems_libio_unlock();
-
-  return old_mask;
-}
Index: cpukit/libcsupport/src/unixlibc.c
===================================================================
--- cpukit/libcsupport/src/unixlibc.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
+++ cpukit/libcsupport/src/unixlibc.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -0,0 +1,7 @@
+#if defined(RTEMS_UNIXLIB)
+
+void libc_init(int reentrant)
+{
+}
+
+#endif
Index: cpukit/libcsupport/src/unlink.c
===================================================================
--- cpukit/libcsupport/src/unlink.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Remove an Existing Link
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <unistd.h>
-
-#include <rtems/libio_.h>
-
-/**
- *  POSIX 1003.1b - 5.5.1 - Remove an existing link
- */
-int unlink( const char *path )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_REJECT_TERMINAL_DOT;
-  rtems_filesystem_location_info_t parentloc;
-  int parent_eval_flags = RTEMS_FS_PERMS_WRITE
-    | RTEMS_FS_PERMS_EXEC
-    | RTEMS_FS_FOLLOW_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start_with_parent(
-      &ctx,
-      path,
-      eval_flags,
-      &parentloc,
-      parent_eval_flags
-    );
-
-  if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) {
-    const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
-
-    rv = (*ops->rmnod_h)( &parentloc, currentloc );
-  } else {
-    rtems_filesystem_eval_path_error( &ctx, EBUSY );
-    rv = -1;
-  }
-
-  rtems_filesystem_eval_path_cleanup_with_parent( &ctx, &parentloc );
-
-  return rv;
-}
-
-#if defined(RTEMS_NEWLIB)
-
-#include <reent.h>
-
-/**
- *  This is the Newlib dependent reentrant version of unlink().
- */
-int _unlink_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  const char    *path
-)
-{
-  return unlink( path );
-}
-#endif
Index: cpukit/libcsupport/src/unmount.c
===================================================================
--- cpukit/libcsupport/src/unmount.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,109 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Unmount a File System
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2010.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <errno.h>
-
-#include <rtems/libio_.h>
-
-static bool contains_root_or_current_directory(
-  const rtems_filesystem_mount_table_entry_t *mt_entry
-)
-{
-  const rtems_filesystem_location_info_t *root =
-    &rtems_filesystem_root->location;
-  const rtems_filesystem_location_info_t *current =
-    &rtems_filesystem_current->location;
-
-  return mt_entry == root->mt_entry || mt_entry == current->mt_entry;
-}
-
-/**
- *  This routine is not defined in the POSIX 1003.1b standard but
- *  in some form is supported on most UNIX and POSIX systems.  This
- *  routine is necessary to mount instantiations of a file system
- *  into the file system name space.
- */
-int unmount( const char *path )
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_LINK;
-  const rtems_filesystem_location_info_t *currentloc =
-    rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-  rtems_filesystem_mount_table_entry_t *mt_entry = currentloc->mt_entry;
-
-  if ( rtems_filesystem_location_is_instance_root( currentloc ) ) {
-    if ( !contains_root_or_current_directory( mt_entry ) ) {
-      const rtems_filesystem_operations_table *mt_point_ops =
-        mt_entry->mt_point_node->location.mt_entry->ops;
-
-      rv = (*mt_point_ops->unmount_h)( mt_entry );
-      if ( rv == 0 ) {
-        rtems_id self_task_id = rtems_task_self();
-        rtems_filesystem_mt_entry_declare_lock_context( lock_context );
-
-        rtems_filesystem_mt_entry_lock( lock_context );
-        mt_entry->unmount_task = self_task_id;
-        mt_entry->mounted = false;
-        rtems_filesystem_mt_entry_unlock( lock_context );
-      }
-    } else {
-      errno = EBUSY;
-      rv = -1;
-    }
-  } else {
-    errno = EACCES;
-    rv = -1;
-  }
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  if ( rv == 0 ) {
-    rtems_status_code sc = rtems_event_transient_receive(
-      RTEMS_WAIT,
-      RTEMS_NO_TIMEOUT
-    );
-
-    if ( sc != RTEMS_SUCCESSFUL ) {
-      rtems_fatal_error_occurred( 0xdeadbeef );
-    }
-  }
-
-  return rv;
-}
Index: cpukit/libcsupport/src/utime.c
===================================================================
--- cpukit/libcsupport/src/utime.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @ingroup libcsupport
- *
- *  @brief Set file access and modification times in seconds.
- */
-
-/*
- * COPYRIGHT (C) 1989, 2021 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-
-#include <fcntl.h>
-#include <utime.h>
-
-/**
- *  https://pubs.opengroup.org/onlinepubs/009604599/functions/utime.html
- *
- *  Set file access and modification times
- */
-int utime(
-  const char *path,
-  const struct utimbuf *times
-)
-{
-  struct timespec new_times[2];
-
-  if ( times == NULL ) {
-    return utimensat(AT_FDCWD, path, NULL, 0);
-  }
-
-  _Timespec_Set(&new_times[0], times->actime, 0);
-  _Timespec_Set(&new_times[1], times->modtime, 0);
-
-  return utimensat(AT_FDCWD, path, new_times, 0);
-}
Index: cpukit/libcsupport/src/utimensat.c
===================================================================
--- cpukit/libcsupport/src/utimensat.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,225 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @ingroup libcsupport
- *
- *  @brief Set file access and modification times in nanoseconds.
- */
-
-/*
- * COPYRIGHT (C) 2021 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-#include <rtems/score/todimpl.h>
-
-#include <fcntl.h>
-#include <string.h>
-
-/*
- * Make sure that tv_nsec is either UTIME_NOW, UTIME_OMIT, a value
- * greater than zero, or a value less-than a billion.
- *
- * These guidelines come from the description of the EINVAL errors on
- * https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html
- */
-bool rtems_filesystem_utime_tv_nsec_valid(struct timespec time)
-{
-  if ( time.tv_nsec == UTIME_NOW ) {
-    return true;
-  }
-
-  if ( time.tv_nsec == UTIME_OMIT ) {
-    return true;
-  }
-
-  if ( time.tv_nsec < 0 ) {
-    return false;
-  }
-
-  if ( time.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
-    return false;
-  }
-
-  return true;
-}
-
-/* Determine whether the access and modified timestamps can be updated */
-int rtems_filesystem_utime_check_permissions(
-  const rtems_filesystem_location_info_t * currentloc,
-  const struct timespec times[2]
-)
-{
-  struct stat st = {};
-  int rv;
-  bool write_access;
-
-  rv = (*currentloc->handlers->fstat_h)( currentloc, &st );
-  if ( rv != 0 ) {
-    rtems_set_errno_and_return_minus_one( ENOENT );
-  }
-
-  write_access = rtems_filesystem_check_access(
-    RTEMS_FS_PERMS_WRITE,
-    st.st_mode,
-    st.st_uid,
-    st.st_gid
-  );
-
-  /*
-   * The logic for the EACCES error is an inverted subset of the EPERM
-   * conditional according to the POSIX standard.
-   */
-  if ( (times == NULL) ||
-     ( (times[0].tv_nsec == UTIME_NOW) && (times[1].tv_nsec == UTIME_NOW) )) {
-      if ( !write_access ) {
-        rtems_set_errno_and_return_minus_one( EACCES );
-      }
-  } else {
-    if ( times[0].tv_nsec != UTIME_OMIT || times[1].tv_nsec != UTIME_OMIT ) {
-      if ( !write_access ) {
-        rtems_set_errno_and_return_minus_one( EPERM );
-      }
-    }
-  }
-
-  return 0;
-}
-
-/*
- * Determine if the current time needs to be gotten, and then check
- * whether the values in times are valid.
- */
-int rtems_filesystem_utime_update(
-  const struct timespec times[2],
-  struct timespec new_times[2]
-)
-{
-  bool got_time = false;
-  struct timespec now;
-
-  /*
-   * If times is NULL, it's equivalent to adding UTIME_NOW in both time
-   * elements
-   */
-  if ( times == NULL ) {
-    _Timespec_Set( &new_times[0], 0, UTIME_NOW );
-    _Timespec_Set( &new_times[1], 0, UTIME_NOW );
-  } else {
-    new_times[0] = times[0];
-    new_times[1] = times[1];
-  }
-
-  if ( new_times[0].tv_nsec == UTIME_NOW ) {
-    clock_gettime( CLOCK_REALTIME, &now );
-    new_times[0] = now;
-    got_time = true;
-  }
-
-  if ( new_times[1].tv_nsec == UTIME_NOW ) {
-    if ( !got_time ) {
-      clock_gettime( CLOCK_REALTIME, &now );
-    }
-    new_times[1] = now;
-  }
-
-  if ( !_Timespec_Is_non_negative( &new_times[0] ) ) {
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-
-  if ( !_Timespec_Is_non_negative( &new_times[1] ) ) {
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-
-  if ( !rtems_filesystem_utime_tv_nsec_valid( new_times[0] ) ) {
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-
-  if ( !rtems_filesystem_utime_tv_nsec_valid( new_times[1] ) ) {
-    rtems_set_errno_and_return_minus_one( EINVAL );
-  }
-
-  return 0;
-}
-
-/**
- *  https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/functions/futimens.html
- *
- *  Set file access and modification times
- */
-int utimensat(
-  int                    fd,
-  const char            *path,
-  const struct timespec  times[2],
-  int                    flag
-)
-{
-  int rv = 0;
-  rtems_filesystem_eval_path_context_t ctx;
-  int eval_flags = RTEMS_FS_FOLLOW_LINK;
-  const rtems_filesystem_location_info_t *currentloc = NULL;
-  struct timespec new_times[2];
-
-  /*
-   * RTEMS does not currently support operating on a real file descriptor
-   */
-  if ( fd != AT_FDCWD ) {
-    rtems_set_errno_and_return_minus_one( ENOSYS );
-  }
-
-  /*
-   * RTEMS does not currently support AT_SYMLINK_NOFOLLOW
-   */
-  if ( flag != 0 ) {
-    rtems_set_errno_and_return_minus_one( ENOSYS );
-  }
-
-  rv = rtems_filesystem_utime_update( times, new_times );
-  if ( rv != 0 ) {
-    return rv;
-  }
-
-  currentloc = rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
-
-  rv = rtems_filesystem_utime_check_permissions( currentloc, times );
-  if ( rv != 0 ) {
-    rtems_filesystem_eval_path_cleanup( &ctx );
-    return rv;
-  }
-
-  rv = (*currentloc->mt_entry->ops->utimens_h)(
-    currentloc,
-    new_times
-  );
-
-  rtems_filesystem_eval_path_cleanup( &ctx );
-
-  return rv;
-}
Index: cpukit/libcsupport/src/utimes.c
===================================================================
--- cpukit/libcsupport/src/utimes.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @ingroup libcsupport
- *
- *  @brief Set file access and modification times in milliseconds.
- */
-
-/*
- * COPYRIGHT (C) 1989, 2021 On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/time.h>
-#include <rtems/score/todimpl.h>
-
-#include <fcntl.h>
-
-/**
- *  https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/functions/futimens.html
- *
- *  Set file access and modification times
- */
-int utimes(
-  const char           *path,
-  const struct timeval  times[2]
-)
-{
-  struct timespec new_times[2];
-
-  if ( times == NULL ) {
-    return utimensat( AT_FDCWD, path, NULL , 0 );
-  }
-
-  _Timespec_Set(
-    &new_times[0],
-    times[0].tv_sec,
-    times[0].tv_usec * TOD_NANOSECONDS_PER_MICROSECOND
-  );
-  _Timespec_Set(
-    &new_times[1],
-    times[1].tv_sec,
-    times[1].tv_usec * TOD_NANOSECONDS_PER_MICROSECOND
-  );
-
-  return utimensat( AT_FDCWD, path, new_times, 0 );
-}
Index: cpukit/libcsupport/src/utsname.c
===================================================================
--- cpukit/libcsupport/src/utsname.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,83 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup utsname Service
- *
- * @brief Get System Name
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/utsname.h>
-#include <inttypes.h>
-
-#include <rtems.h>
-#include <rtems/seterr.h>
-
-/*
- *  4.4.1 Get System Name, P1003.1b-1993, p. 90
- */
-
-int uname(
-  struct utsname *name
-)
-{
-  /*  XXX: Here is what Solaris returns...
-          sysname = SunOS
-          nodename = node_name
-          release = 5.3
-          version = Generic_101318-12
-          machine = sun4m
-  */
-
-  if ( !name )
-    rtems_set_errno_and_return_minus_one( EFAULT );
-
-  strncpy( name->sysname, "RTEMS", sizeof(name->sysname) );
-
-  snprintf(
-    name->nodename,
-    sizeof(name->nodename),
-    "Node %" PRId16, rtems_object_get_local_node()
-  );
-
-  strncpy( name->release, RTEMS_VERSION, sizeof(name->release) );
-
-  strncpy( name->version, "", sizeof(name->version) );
-
-  snprintf( name->machine, sizeof(name->machine), "%s/%s", CPU_NAME, CPU_MODEL_NAME );
-
-  return 0;
-}
Index: cpukit/libcsupport/src/vprintk.c
===================================================================
--- cpukit/libcsupport/src/vprintk.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup RTEMSAPIKernelCharIO
- *
- * @brief This source file contains the implementation of vprintk().
- */
-
-/*
- * Copyright (c) 2017 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/bspIo.h>
-#include <rtems/dev/io.h>
-
-int vprintk( const char *fmt, va_list ap )
-{
-  return _IO_Vprintf( rtems_put_char, NULL, fmt, ap );
-}
Index: cpukit/libcsupport/src/write.c
===================================================================
--- cpukit/libcsupport/src/write.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- *  @file
- *
- *  @brief Write to a File
- *  @ingroup libcsupport
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-/**
- *  POSIX 1003.1b 6.4.2 - Write to a File
- * 
- *  This routine writes count bytes from from buffer pointed to by buffer
- *  to the file associated with the open file descriptor, fildes.
- */
-ssize_t write(
-  int         fd,
-  const void *buffer,
-  size_t      count
-)
-{
-  rtems_libio_t *iop;
-  ssize_t        n;
-
-  rtems_libio_check_buffer( buffer );
-  rtems_libio_check_count( count );
-
-  LIBIO_GET_IOP_WITH_ACCESS( fd, iop, LIBIO_FLAGS_WRITE, EBADF );
-
-  /*
-   *  Now process the write() request.
-   */
-  n = (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
-  rtems_libio_iop_drop( iop );
-  return n;
-}
Index: cpukit/libcsupport/src/write_r.c
===================================================================
--- cpukit/libcsupport/src/write_r.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- *
- * @ingroup libcsupport
- *
- * @brief POSIX 1003.1b 6.4.2 - Write to a File
- */
-
-/*
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/libio_.h>
-#include <rtems/seterr.h>
-
-/*
- *  _write_r
- *
- *  This is the Newlib dependent reentrant version of write().
- */
-
-#if defined(RTEMS_NEWLIB)
-
-#include <reent.h>
-
-_ssize_t _write_r(
-  struct _reent *ptr RTEMS_UNUSED,
-  int            fd,
-  const void    *buf,
-  size_t         nbytes
-)
-{
-  return write( fd, buf, nbytes );
-}
-#endif
Index: cpukit/libcsupport/src/writev.c
===================================================================
--- cpukit/libcsupport/src/writev.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/**
- * @file
- * @brief writev() - POSIX 1003.1 - Write a Vector
- *
- * OpenGroup URL:
- *
- * http://www.opengroup.org/onlinepubs/009695399/functions/writev.html
- */
-
-/*
- *  COPYRIGHT (c) 1989-2011.
- *  On-Line Applications Research Corporation (OAR).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <sys/uio.h>
-
-#include <rtems/libio_.h>
-
-static ssize_t writev_adapter(
-  rtems_libio_t      *iop,
-  const struct iovec *iov,
-  int                 iovcnt,
-  ssize_t             total
-)
-{
-  return ( *iop->pathinfo.handlers->writev_h )( iop, iov, iovcnt, total );
-}
-
-ssize_t writev(
-  int                 fd,
-  const struct iovec *iov,
-  int                 iovcnt
-)
-{
-  return rtems_libio_iovec_eval(
-    fd,
-    iov,
-    iovcnt,
-    LIBIO_FLAGS_WRITE,
-    writev_adapter
-  );
-}
