diff options
-rw-r--r-- | cpukit/ChangeLog | 8 | ||||
-rw-r--r-- | cpukit/configure.ac | 9 | ||||
-rw-r--r-- | cpukit/libcsupport/Makefile.am | 2 | ||||
-rw-r--r-- | cpukit/libcsupport/src/sleep_noposix.c | 55 | ||||
-rw-r--r-- | cpukit/posix/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/posix/src/sleep.c | 40 | ||||
-rw-r--r-- | cpukit/posix/src/usleep.c | 45 |
7 files changed, 14 insertions, 146 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 0e009c7b39..d7d3b1d52b 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,13 @@ 2011-02-25 Ralf Corsépius <ralf.corsepius@rtems.org> + * libcsupport/src/sleep_noposix.c: Remove. + * libcsupport/Makefile.am: Reflect changes above. + * posix/src/sleep.c, posix/src/usleep.c: Remove. + * posix/Makefile.am: Reflect changes above. + * configure.ac: Error out if libc doesn't provide sleep, usleep. + +2011-02-25 Ralf Corsépius <ralf.corsepius@rtems.org> + * aclocal/canonical-target-name.m4: Stop pretending no_cpu* was buildable. Derive RTEMS_CPU from "$host_cpu". diff --git a/cpukit/configure.ac b/cpukit/configure.ac index 1e8c410a64..5a5ae8f67d 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -48,11 +48,12 @@ AC_CHECK_FUNCS([isascii fileno]) # <FIXME> # Check for functions supplied by newlib >= 1.17.0 # Newlib's posix/ directory -AC_CHECK_FUNCS([sleep usleep \ - readdir_r \ - isatty]) +AC_CHECK_FUNCS([readdir_r isatty]) AC_CHECK_FUNCS([creat \ - opendir closedir readdir rewinddir scandir seekdir telldir],, + opendir closedir readdir rewinddir scandir seekdir \ + sleep \ + telldir \ + usleep],, [rtems_missing_func="$ac_func";break]) AS_IF([test -n "$rtems_missing_func"], AC_MSG_ERROR([Missing function $rtems_missing_func in libc])]) diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am index 090ca0b0f1..95eee5bd77 100644 --- a/cpukit/libcsupport/Makefile.am +++ b/cpukit/libcsupport/Makefile.am @@ -109,7 +109,7 @@ TERMINAL_IDENTIFICATION_C_FILES += src/ttyname.c LIBC_GLUE_C_FILES = src/__getpid.c src/__gettod.c src/__times.c \ src/truncate.c src/access.c src/stat.c src/lstat.c src/pathconf.c \ src/newlibc_reent.c src/newlibc_init.c src/newlibc_exit.c \ - src/kill_noposix.c src/sleep_noposix.c src/utsname.c + src/kill_noposix.c src/utsname.c BSD_LIBC_C_FILES = src/strlcpy.c src/strlcat.c src/issetugid.c diff --git a/cpukit/libcsupport/src/sleep_noposix.c b/cpukit/libcsupport/src/sleep_noposix.c deleted file mode 100644 index 2498dd9b0d..0000000000 --- a/cpukit/libcsupport/src/sleep_noposix.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Marginal implementations of some POSIX API routines - * to be used when POSIX is disabled. - * - * + kill - * + _kill_r - * + __kill - * + sleep - * - * 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. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <rtems.h> - -#include <unistd.h> - -/* - * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 - * - * $Id$ - */ - -#include <time.h> -#include <unistd.h> - -#include <rtems.h> - -#if !defined(RTEMS_POSIX_API) -unsigned int sleep( - unsigned int seconds -) -{ - rtems_status_code status; - rtems_interval ticks_per_second; - - ticks_per_second = rtems_clock_get_ticks_per_second() * seconds; - - status = rtems_task_wake_after( ticks_per_second ); - - /* - * Returns the "unslept" amount of time. In RTEMS signals are not - * interruptable, so tasks really sleep all of the requested time. - */ - - return 0; -} -#endif diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am index d75dc98eb4..34e1cfa0ab 100644 --- a/cpukit/posix/Makefile.am +++ b/cpukit/posix/Makefile.am @@ -14,7 +14,6 @@ libposix_a_CPPFLAGS = $(AM_CPPFLAGS) libposix_a_SOURCES = # Some POSIX functions that are nice to always have -libposix_a_SOURCES += src/sleep.c src/usleep.c libposix_a_SOURCES += src/nanosleep.c src/clockgettime.c src/clocksettime.c \ src/clockgetres.c src/sysconf.c diff --git a/cpukit/posix/src/sleep.c b/cpukit/posix/src/sleep.c deleted file mode 100644 index 98239dc292..0000000000 --- a/cpukit/posix/src/sleep.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 - * - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * 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. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef HAVE_SLEEP -#include <time.h> -#include <unistd.h> - -#include <rtems/system.h> - - -unsigned int sleep( - unsigned int seconds -) -{ - struct timespec tp; - struct timespec tm; - - tp.tv_sec = seconds; - tp.tv_nsec = 0; - - nanosleep( &tp, &tm ); - - return tm.tv_sec; /* seconds remaining */ -} - -#endif diff --git a/cpukit/posix/src/usleep.c b/cpukit/posix/src/usleep.c deleted file mode 100644 index e864f3566a..0000000000 --- a/cpukit/posix/src/usleep.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 3.4.3 Delay Process Execution, P1003.1b-1993, p. 81 - * - * COPYRIGHT (c) 1989-2007. - * On-Line Applications Research Corporation (OAR). - * - * 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. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef HAVE_USLEEP - -#include <time.h> -#include <unistd.h> - -#include <rtems/system.h> -#include <rtems/score/tod.h> - - -int usleep( - useconds_t useconds -) -{ - struct timespec tp; - struct timespec tm; - unsigned remaining; - - tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; - tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; - - nanosleep( &tp, &tm ); - - remaining = tm.tv_sec * TOD_MICROSECONDS_PER_SECOND; - remaining += tm.tv_nsec / 1000; - return remaining; /* seconds remaining */ -} - -#endif |