From f7845a920d6e267e5efca40b3edf5474b1f60a24 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 13 Dec 2013 07:57:13 -0600 Subject: Move sleep() and usleep() from sched/ to libc/unistd/. These functions now are simple wrappers for nanosleep(). Remove sleep() and usleep() from system calls; add nanosleep() to system calls --- nuttx/syscall/syscall.csv | 5 ++--- nuttx/syscall/syscall_lookup.h | 5 ++--- nuttx/syscall/syscall_stublookup.c | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'nuttx/syscall') diff --git a/nuttx/syscall/syscall.csv b/nuttx/syscall/syscall.csv index e470b91a7..3ae366a39 100644 --- a/nuttx/syscall/syscall.csv +++ b/nuttx/syscall/syscall.csv @@ -40,11 +40,12 @@ "mq_timedsend","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","const char*","size_t","int","const struct timespec*" "mq_unlink","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","const char*" "on_exit","stdlib.h","defined(CONFIG_SCHED_ONEXIT)","int","CODE void (*)(int, FAR void *)","FAR void *" +"nanosleep","time.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const struct timespec *", "FAR struct timespec*" "open","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","int","..." "opendir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR DIR*","FAR const char*" "pipe","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int [2]|int*" "poll","poll.h","!defined(CONFIG_DISABLE_POLL) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","FAR struct pollfd*","nfds_t","int" -"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..." +"prctl","sys/prctl.h", "CONFIG_TASK_NAME_SIZE > 0","int","int","..." "posix_spawnp","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []","FAR char *const []" "posix_spawn","spawn.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS) && !defined(CONFIG_BINFMT_EXEPATH)","int","FAR pid_t *","FAR const char *","FAR const posix_spawn_file_actions_t *","FAR const posix_spawnattr_t *","FAR char *const []","FAR char *const []" "pthread_barrier_destroy","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_barrier_t*" @@ -118,7 +119,6 @@ "sigsuspend","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*" "sigtimedwait","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*","FAR struct siginfo*","FAR const struct timespec*" "sigwaitinfo","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*","FAR struct siginfo*" -"sleep","unistd.h","!defined(CONFIG_DISABLE_SIGNALS)","unsigned int","unsigned int" "socket","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int" "stat","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0","int","const char*","FAR struct stat*" #"statfs","stdio.h","","int","FAR const char*","FAR struct statfs*" @@ -138,7 +138,6 @@ "unsetenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","const char*" "up_assert","assert.h","","void","FAR const uint8_t*","int" #"up_assert","assert.h","","void" -"usleep","unistd.h","!defined(CONFIG_DISABLE_SIGNALS)","int","useconds_t" "vfork","unistd.h","defined(CONFIG_ARCH_HAVE_VFORK)","pid_t" "wait","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","pid_t","int*" "waitid","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","int","idtype_t","id_t"," FAR siginfo_t *","int" diff --git a/nuttx/syscall/syscall_lookup.h b/nuttx/syscall/syscall_lookup.h index b370bdd5b..7f6da78ab 100644 --- a/nuttx/syscall/syscall_lookup.h +++ b/nuttx/syscall/syscall_lookup.h @@ -118,8 +118,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) SYSCALL_LOOKUP(sigsuspend, 1, STUB_sigsuspend) SYSCALL_LOOKUP(sigtimedwait, 3, STUB_sigtimedwait) SYSCALL_LOOKUP(sigwaitinfo, 2, STUB_sigwaitinfo) - SYSCALL_LOOKUP(sleep, 1, STUB_sleep) - SYSCALL_LOOKUP(usleep, 1, STUB_usleep) + SYSCALL_LOOKUP(nanosleep, 2, STUB_nanosleep) #endif /* The following are only defined if the system clock is enabled in the @@ -148,7 +147,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert) * enabled. */ -#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 +#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 SYSCALL_LOOKUP(close, 1, STUB_close) SYSCALL_LOOKUP(ioctl, 3, STUB_ioctl) SYSCALL_LOOKUP(read, 3, STUB_read) diff --git a/nuttx/syscall/syscall_stublookup.c b/nuttx/syscall/syscall_stublookup.c index 65d7a3503..50e302e59 100644 --- a/nuttx/syscall/syscall_stublookup.c +++ b/nuttx/syscall/syscall_stublookup.c @@ -132,8 +132,7 @@ uintptr_t STUB_sigsuspend(int nbr, uintptr_t parm1); uintptr_t STUB_sigtimedwait(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t parm3); uintptr_t STUB_sigwaitinfo(int nbr, uintptr_t parm1, uintptr_t parm2); -uintptr_t STUB_sleep(int nbr, uintptr_t parm1); -uintptr_t STUB_usleep(int nbr, uintptr_t parm1); +uintptr_t STUB_nanosleep(int nbr, uintptr_t parm1, uintptr_t parm2); /* The following are only defined if the system clock is enabled in the * NuttX configuration. -- cgit v1.2.3