From fbfb59262d68f7064ee37c018567d2f7f2ff19f4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 13 Dec 2007 16:52:21 +0000 Subject: 2007-12-13 Joel Sherrill * posix/Makefile.am, posix/src/clockgetcpuclockid.c, posix/src/clockgetenableattr.c, posix/src/clockgettime.c, posix/src/clocksetenableattr.c, posix/src/clocksettime.c, posix/src/devctl.c, posix/src/execl.c, posix/src/execle.c, posix/src/execlp.c, posix/src/execv.c, posix/src/execve.c, posix/src/execvp.c, posix/src/fork.c, posix/src/mutexinit.c, posix/src/pthreadatfork.c, posix/src/pthreadgetcpuclockid.c, posix/src/pthreadkill.c, posix/src/semaphorecreatesupp.c, posix/src/sysconf.c, posix/src/wait.c, posix/src/waitpid.c: Split files into one function per file. * posix/src/aio_cancel.c, posix/src/aio_error.c, posix/src/aio_fsync.c, posix/src/aio_read.c, posix/src/aio_return.c, posix/src/aio_suspend.c, posix/src/aio_write.c, posix/src/lio_listio.c, posix/src/sched_getparam.c, posix/src/sched_getprioritymax.c, posix/src/sched_getprioritymin.c, posix/src/sched_getscheduler.c, posix/src/sched_rr_get_interval.c, posix/src/sched_setparam.c, posix/src/sched_setscheduler.c, posix/src/sched_yield.c: New files. * posix/src/aio.c, posix/src/sched.c, posix/src/types.c: Removed. --- cpukit/ChangeLog | 22 +++++ cpukit/posix/Makefile.am | 9 +- cpukit/posix/src/aio.c | 117 ---------------------- cpukit/posix/src/aio_cancel.c | 30 ++++++ cpukit/posix/src/aio_error.c | 29 ++++++ cpukit/posix/src/aio_fsync.c | 30 ++++++ cpukit/posix/src/aio_read.c | 29 ++++++ cpukit/posix/src/aio_return.c | 30 ++++++ cpukit/posix/src/aio_suspend.c | 31 ++++++ cpukit/posix/src/aio_write.c | 29 ++++++ cpukit/posix/src/clockgetcpuclockid.c | 7 ++ cpukit/posix/src/clockgetenableattr.c | 7 ++ cpukit/posix/src/clockgettime.c | 7 ++ cpukit/posix/src/clocksetenableattr.c | 7 ++ cpukit/posix/src/clocksettime.c | 7 ++ cpukit/posix/src/devctl.c | 7 ++ cpukit/posix/src/execl.c | 11 ++- cpukit/posix/src/execle.c | 11 ++- cpukit/posix/src/execlp.c | 11 ++- cpukit/posix/src/execv.c | 11 ++- cpukit/posix/src/execve.c | 11 ++- cpukit/posix/src/execvp.c | 11 ++- cpukit/posix/src/fork.c | 11 ++- cpukit/posix/src/lio_listio.c | 32 ++++++ cpukit/posix/src/mutexinit.c | 7 ++ cpukit/posix/src/pthreadatfork.c | 12 ++- cpukit/posix/src/pthreadgetcpuclockid.c | 2 +- cpukit/posix/src/pthreadkill.c | 5 - cpukit/posix/src/sched.c | 161 ------------------------------- cpukit/posix/src/sched_getparam.c | 30 ++++++ cpukit/posix/src/sched_getprioritymax.c | 41 ++++++++ cpukit/posix/src/sched_getprioritymin.c | 41 ++++++++ cpukit/posix/src/sched_getscheduler.c | 33 +++++++ cpukit/posix/src/sched_rr_get_interval.c | 43 +++++++++ cpukit/posix/src/sched_setparam.c | 34 +++++++ cpukit/posix/src/sched_setscheduler.c | 36 +++++++ cpukit/posix/src/sched_yield.c | 34 +++++++ cpukit/posix/src/semaphorecreatesupp.c | 7 ++ cpukit/posix/src/sysconf.c | 4 +- cpukit/posix/src/types.c | 19 ---- cpukit/posix/src/wait.c | 11 ++- cpukit/posix/src/waitpid.c | 11 ++- 42 files changed, 710 insertions(+), 328 deletions(-) delete mode 100644 cpukit/posix/src/aio.c create mode 100644 cpukit/posix/src/aio_cancel.c create mode 100644 cpukit/posix/src/aio_error.c create mode 100644 cpukit/posix/src/aio_fsync.c create mode 100644 cpukit/posix/src/aio_read.c create mode 100644 cpukit/posix/src/aio_return.c create mode 100644 cpukit/posix/src/aio_suspend.c create mode 100644 cpukit/posix/src/aio_write.c create mode 100644 cpukit/posix/src/lio_listio.c delete mode 100644 cpukit/posix/src/sched.c create mode 100644 cpukit/posix/src/sched_getparam.c create mode 100644 cpukit/posix/src/sched_getprioritymax.c create mode 100644 cpukit/posix/src/sched_getprioritymin.c create mode 100644 cpukit/posix/src/sched_getscheduler.c create mode 100644 cpukit/posix/src/sched_rr_get_interval.c create mode 100644 cpukit/posix/src/sched_setparam.c create mode 100644 cpukit/posix/src/sched_setscheduler.c create mode 100644 cpukit/posix/src/sched_yield.c delete mode 100644 cpukit/posix/src/types.c diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 2279e09ee6..46d3d4daae 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,25 @@ +2007-12-13 Joel Sherrill + + * posix/Makefile.am, posix/src/clockgetcpuclockid.c, + posix/src/clockgetenableattr.c, posix/src/clockgettime.c, + posix/src/clocksetenableattr.c, posix/src/clocksettime.c, + posix/src/devctl.c, posix/src/execl.c, posix/src/execle.c, + posix/src/execlp.c, posix/src/execv.c, posix/src/execve.c, + posix/src/execvp.c, posix/src/fork.c, posix/src/mutexinit.c, + posix/src/pthreadatfork.c, posix/src/pthreadgetcpuclockid.c, + posix/src/pthreadkill.c, posix/src/semaphorecreatesupp.c, + posix/src/sysconf.c, posix/src/wait.c, posix/src/waitpid.c: Split + files into one function per file. + * posix/src/aio_cancel.c, posix/src/aio_error.c, posix/src/aio_fsync.c, + posix/src/aio_read.c, posix/src/aio_return.c, + posix/src/aio_suspend.c, posix/src/aio_write.c, + posix/src/lio_listio.c, posix/src/sched_getparam.c, + posix/src/sched_getprioritymax.c, posix/src/sched_getprioritymin.c, + posix/src/sched_getscheduler.c, posix/src/sched_rr_get_interval.c, + posix/src/sched_setparam.c, posix/src/sched_setscheduler.c, + posix/src/sched_yield.c: New files. + * posix/src/aio.c, posix/src/sched.c, posix/src/types.c: Removed. + 2007-12-13 Joel Sherrill * libcsupport/preinstall.am, posix/preinstall.am, posix/src/aio.c, diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am index 60785028d0..4708af7989 100644 --- a/cpukit/posix/Makefile.am +++ b/cpukit/posix/Makefile.am @@ -51,7 +51,9 @@ include_rtems_posix_HEADERS += inline/rtems/posix/cond.inl \ # These are really in the stand but not really functional ## BUILD_FOR_NOW_C_FILES -libposix_a_SOURCES += src/aio.c src/devctl.c +libposix_a_SOURCES += src/aio_cancel.c src/aio_error.c src/aio_fsync.c \ + src/aio_read.c src/aio_return.c src/aio_suspend.c src/aio_write.c \ + src/lio_listio.c src/devctl.c ## ENOSYS_C_FILES libposix_a_SOURCES += src/execl.c src/execle.c src/execlp.c src/execv.c \ @@ -163,7 +165,10 @@ libposix_a_SOURCES += src/ptimer.c src/ptimer1.c EXTRA_DIST += src/README.mqueue -libposix_a_SOURCES += src/sched.c src/sysconf.c src/types.c +libposix_a_SOURCES += src/sched_getparam.c src/sched_getprioritymax.c \ + src/sched_getprioritymin.c src/sched_getscheduler.c \ + src/sched_rr_get_interval.c src/sched_setparam.c \ + src/sched_setscheduler.c src/sched_yield.c src/sysconf.c endif endif diff --git a/cpukit/posix/src/aio.c b/cpukit/posix/src/aio.c deleted file mode 100644 index 692a3cdf60..0000000000 --- a/cpukit/posix/src/aio.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include - -#include -#include - -/*PAGE - * - * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154 - */ - -int aio_read( - struct aiocb *aiocbp -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155 - */ - -int aio_write( - struct aiocb *aiocbp -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158 - */ - -int lio_listio( - int mode, - struct aiocb * const list[], - int nent, - struct sigevent *sig -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161 - */ - -int aio_error( - const struct aiocb *aiocbp -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, - * P1003.1b-1993, p. 162 - */ - -int aio_return( - const struct aiocb *aiocbp -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163 - */ - -int aio_cancel( - int filedes, - struct aiocb *aiocbp -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164 - */ - -int aio_suspend( - struct aiocb * const list[], - int nent, - const struct timespec *timeout -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166 - */ - -int aio_fsync( - int op, - struct aiocb *aiocbp -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} diff --git a/cpukit/posix/src/aio_cancel.c b/cpukit/posix/src/aio_cancel.c new file mode 100644 index 0000000000..0f4440580b --- /dev/null +++ b/cpukit/posix/src/aio_cancel.c @@ -0,0 +1,30 @@ +/* + * 6.7.7 Cancel Asynchronous I/O Operation, P1003.1b-1993, p. 163 + * + * 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 + +#include +#include + +#include +#include + +int aio_cancel( + int filedes, + struct aiocb *aiocbp +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/aio_error.c b/cpukit/posix/src/aio_error.c new file mode 100644 index 0000000000..21bb030606 --- /dev/null +++ b/cpukit/posix/src/aio_error.c @@ -0,0 +1,29 @@ +/* + * 6.7.5 Retrieve Error of Asynchronous I/O Operation, P1003.1b-1993, p. 161 + * + * 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 + +#include +#include + +#include +#include + +int aio_error( + const struct aiocb *aiocbp +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/aio_fsync.c b/cpukit/posix/src/aio_fsync.c new file mode 100644 index 0000000000..e90ea5b4d9 --- /dev/null +++ b/cpukit/posix/src/aio_fsync.c @@ -0,0 +1,30 @@ +/* + * 6.7.9 Asynchronous File Synchronization, P1003.1b-1993, p. 166 + * + * 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 + +#include +#include + +#include +#include + +int aio_fsync( + int op, + struct aiocb *aiocbp +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/aio_read.c b/cpukit/posix/src/aio_read.c new file mode 100644 index 0000000000..63a774b252 --- /dev/null +++ b/cpukit/posix/src/aio_read.c @@ -0,0 +1,29 @@ +/* + * 6.7.2 Asynchronous Read, P1003.1b-1993, p. 154 + * + * 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 + +#include +#include + +#include +#include + +int aio_read( + struct aiocb *aiocbp +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/aio_return.c b/cpukit/posix/src/aio_return.c new file mode 100644 index 0000000000..8a9d00054b --- /dev/null +++ b/cpukit/posix/src/aio_return.c @@ -0,0 +1,30 @@ +/* + * 6.7.6 Retrieve Return Status of Asynchronous I/O Operation, + * P1003.1b-1993, p. 162 + * + * 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 + +#include +#include + +#include +#include + +int aio_return( + const struct aiocb *aiocbp +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/aio_suspend.c b/cpukit/posix/src/aio_suspend.c new file mode 100644 index 0000000000..79ffa609da --- /dev/null +++ b/cpukit/posix/src/aio_suspend.c @@ -0,0 +1,31 @@ +/* + * 6.7.7 Wait for Asynchronous I/O Request, P1003.1b-1993, p. 164 + * + * 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 + +#include +#include + +#include +#include + +int aio_suspend( + struct aiocb * const list[], + int nent, + const struct timespec *timeout +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/aio_write.c b/cpukit/posix/src/aio_write.c new file mode 100644 index 0000000000..99040525c6 --- /dev/null +++ b/cpukit/posix/src/aio_write.c @@ -0,0 +1,29 @@ +/* + * 6.7.3 Asynchronous Write, P1003.1b-1993, p. 155 + * + * 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 + +#include +#include + +#include +#include + +int aio_write( + struct aiocb *aiocbp +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/clockgetcpuclockid.c b/cpukit/posix/src/clockgetcpuclockid.c index 9623eba741..b4472f8a10 100644 --- a/cpukit/posix/src/clockgetcpuclockid.c +++ b/cpukit/posix/src/clockgetcpuclockid.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/clockgetenableattr.c b/cpukit/posix/src/clockgetenableattr.c index 53e121deb9..95efe0de3b 100644 --- a/cpukit/posix/src/clockgetenableattr.c +++ b/cpukit/posix/src/clockgetenableattr.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/clockgettime.c b/cpukit/posix/src/clockgettime.c index 91e3c96d73..d87503e2cf 100644 --- a/cpukit/posix/src/clockgettime.c +++ b/cpukit/posix/src/clockgettime.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/clocksetenableattr.c b/cpukit/posix/src/clocksetenableattr.c index 386e9d0c27..f11f8d14e8 100644 --- a/cpukit/posix/src/clocksetenableattr.c +++ b/cpukit/posix/src/clocksetenableattr.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/clocksettime.c b/cpukit/posix/src/clocksettime.c index f625d99c28..64cd5c4110 100644 --- a/cpukit/posix/src/clocksettime.c +++ b/cpukit/posix/src/clocksettime.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/devctl.c b/cpukit/posix/src/devctl.c index ab6dc6bc4b..84674c52ea 100644 --- a/cpukit/posix/src/devctl.c +++ b/cpukit/posix/src/devctl.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/execl.c b/cpukit/posix/src/execl.c index fa820a268f..0ea72edbf3 100644 --- a/cpukit/posix/src/execl.c +++ b/cpukit/posix/src/execl.c @@ -1,6 +1,13 @@ /* * execl() - POSIX 1003.1b 3.1.2 * + * 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$ */ @@ -9,6 +16,7 @@ #endif #include +#include int execl( const char *path, @@ -16,6 +24,5 @@ int execl( ... ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/execle.c b/cpukit/posix/src/execle.c index 83bd05882c..520fc589b1 100644 --- a/cpukit/posix/src/execle.c +++ b/cpukit/posix/src/execle.c @@ -1,6 +1,13 @@ /* * execle() - POSIX 1003.1b 3.1.2 * + * 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$ */ @@ -9,6 +16,7 @@ #endif #include +#include int execle( const char *path, @@ -16,6 +24,5 @@ int execle( ... ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/execlp.c b/cpukit/posix/src/execlp.c index 2bc1303527..af584fc5ab 100644 --- a/cpukit/posix/src/execlp.c +++ b/cpukit/posix/src/execlp.c @@ -1,6 +1,13 @@ /* * execlp() - POSIX 1003.1b 3.1.2 * + * 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$ */ @@ -9,6 +16,7 @@ #endif #include +#include int execlp( const char *file, @@ -16,6 +24,5 @@ int execlp( ... ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/execv.c b/cpukit/posix/src/execv.c index c30d4939b6..e7c9a9ce85 100644 --- a/cpukit/posix/src/execv.c +++ b/cpukit/posix/src/execv.c @@ -1,6 +1,13 @@ /* * execv() - POSIX 1003.1b 3.1.2 * + * 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$ */ @@ -9,12 +16,12 @@ #endif #include +#include int execv( const char *file, char *const argv[] ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/execve.c b/cpukit/posix/src/execve.c index 43ec3004e6..5a00a26790 100644 --- a/cpukit/posix/src/execve.c +++ b/cpukit/posix/src/execve.c @@ -1,6 +1,13 @@ /* * execve() - POSIX 1003.1b 3.1.2 * + * 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$ */ @@ -9,6 +16,7 @@ #endif #include +#include int execve( const char *path, @@ -16,6 +24,5 @@ int execve( char *const envp[] ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/execvp.c b/cpukit/posix/src/execvp.c index a82db0ed32..e68f44c1a9 100644 --- a/cpukit/posix/src/execvp.c +++ b/cpukit/posix/src/execvp.c @@ -1,6 +1,13 @@ /* * execvp() - POSIX 1003.1b 3.1.2 * + * 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$ */ @@ -9,12 +16,12 @@ #endif #include +#include int execvp( const char *path, char *const argv[] ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/fork.c b/cpukit/posix/src/fork.c index b06b1c9dbf..f0023e2978 100644 --- a/cpukit/posix/src/fork.c +++ b/cpukit/posix/src/fork.c @@ -1,6 +1,13 @@ /* * fork() - POSIX 1003.1b 3.1.1 * + * 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$ */ @@ -10,9 +17,9 @@ #include #include +#include int fork( void ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/lio_listio.c b/cpukit/posix/src/lio_listio.c new file mode 100644 index 0000000000..8a153f4c38 --- /dev/null +++ b/cpukit/posix/src/lio_listio.c @@ -0,0 +1,32 @@ +/* + * 6.7.4 List Directed I/O, P1003.1b-1993, p. 158 + * + * 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 + +#include +#include + +#include +#include + +int lio_listio( + int mode, + struct aiocb * const list[], + int nent, + struct sigevent *sig +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/mutexinit.c b/cpukit/posix/src/mutexinit.c index 9751c00179..1a30740633 100644 --- a/cpukit/posix/src/mutexinit.c +++ b/cpukit/posix/src/mutexinit.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/pthreadatfork.c b/cpukit/posix/src/pthreadatfork.c index 7bc398ed85..84aed3a196 100644 --- a/cpukit/posix/src/pthreadatfork.c +++ b/cpukit/posix/src/pthreadatfork.c @@ -10,6 +10,13 @@ * as described above or the pthread_atfork() funciton shall not be * provided." * + * 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$ */ @@ -17,8 +24,8 @@ #include "config.h" #endif -#include #include +#include int pthread_atfork( void (*prepare)(void), @@ -26,6 +33,5 @@ int pthread_atfork( void (*child)(void) ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/pthreadgetcpuclockid.c b/cpukit/posix/src/pthreadgetcpuclockid.c index 65a4c9bc99..2ba0dcc3e0 100644 --- a/cpukit/posix/src/pthreadgetcpuclockid.c +++ b/cpukit/posix/src/pthreadgetcpuclockid.c @@ -1,7 +1,7 @@ /* * 20.1.6 Accessing a Thread CPU-time Clock, P1003.4b/Draft 8, p. 58 * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/cpukit/posix/src/pthreadkill.c b/cpukit/posix/src/pthreadkill.c index 0c9c3caa00..e8de99f4dd 100644 --- a/cpukit/posix/src/pthreadkill.c +++ b/cpukit/posix/src/pthreadkill.c @@ -40,11 +40,6 @@ int pthread_kill( if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); -/* commented out when posix timers added - if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) - rtems_set_errno_and_return_minus_one( ENOSYS ); -*/ - the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { diff --git a/cpukit/posix/src/sched.c b/cpukit/posix/src/sched.c deleted file mode 100644 index c298655dc7..0000000000 --- a/cpukit/posix/src/sched.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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 - -#include -#include - -#include -#include -#include -#include -#include -#include - -/*PAGE - * - * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 - * - */ - -int sched_setparam( - pid_t pid, - const struct sched_param *param -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 - */ - -int sched_getparam( - pid_t pid, - const struct sched_param *param -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.3 Set Scheduling Policy and Scheduling Parameters, - * P1003.1b-1993, p. 254 - */ - -int sched_setscheduler( - pid_t pid, - int policy, - const struct sched_param *param -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256 - */ - -int sched_getscheduler( - pid_t pid -) -{ - rtems_set_errno_and_return_minus_one( ENOSYS ); -} - -/*PAGE - * - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 - */ - -int sched_get_priority_max( - int policy -) -{ - switch ( policy ) { - case SCHED_OTHER: - case SCHED_FIFO: - case SCHED_RR: - case SCHED_SPORADIC: - break; - - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - return POSIX_SCHEDULER_MAXIMUM_PRIORITY; -} - -/*PAGE - * - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 - */ - -int sched_get_priority_min( - int policy -) -{ - switch ( policy ) { - case SCHED_OTHER: - case SCHED_FIFO: - case SCHED_RR: - case SCHED_SPORADIC: - break; - - default: - rtems_set_errno_and_return_minus_one( EINVAL ); - } - - return POSIX_SCHEDULER_MINIMUM_PRIORITY; -} - -/*PAGE - * - * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 - */ - -int sched_rr_get_interval( - pid_t pid, - struct timespec *interval -) -{ - /* - * Only supported for the "calling process" (i.e. this node). - */ - - if ( pid && pid != getpid() ) - rtems_set_errno_and_return_minus_one( ESRCH ); - - if ( !interval ) - rtems_set_errno_and_return_minus_one( EINVAL ); - - _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); - return 0; -} - -/*PAGE - * - * 13.3.5 Yield Processor, P1003.1b-1993, p. 257 - */ - -int sched_yield( void ) -{ - _Thread_Disable_dispatch(); - _Thread_Yield_processor(); - _Thread_Enable_dispatch(); - return 0; -} diff --git a/cpukit/posix/src/sched_getparam.c b/cpukit/posix/src/sched_getparam.c new file mode 100644 index 0000000000..1ae748c126 --- /dev/null +++ b/cpukit/posix/src/sched_getparam.c @@ -0,0 +1,30 @@ +/* + * 13.3.2 Set Scheduling Parameters, P1003.1b-1993, p. 253 + * + * 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 + +#include +#include + +#include +#include + +int sched_getparam( + pid_t pid, + const struct sched_param *param +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/sched_getprioritymax.c b/cpukit/posix/src/sched_getprioritymax.c new file mode 100644 index 0000000000..9f8965e4d5 --- /dev/null +++ b/cpukit/posix/src/sched_getprioritymax.c @@ -0,0 +1,41 @@ +/* + * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 + * + * 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 + +#include +#include + +#include +#include +#include + +int sched_get_priority_max( + int policy +) +{ + switch ( policy ) { + case SCHED_OTHER: + case SCHED_FIFO: + case SCHED_RR: + case SCHED_SPORADIC: + break; + + default: + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + return POSIX_SCHEDULER_MAXIMUM_PRIORITY; +} diff --git a/cpukit/posix/src/sched_getprioritymin.c b/cpukit/posix/src/sched_getprioritymin.c new file mode 100644 index 0000000000..88e1170f12 --- /dev/null +++ b/cpukit/posix/src/sched_getprioritymin.c @@ -0,0 +1,41 @@ +/* + * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 + * + * 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 + +#include +#include + +#include +#include +#include + +int sched_get_priority_min( + int policy +) +{ + switch ( policy ) { + case SCHED_OTHER: + case SCHED_FIFO: + case SCHED_RR: + case SCHED_SPORADIC: + break; + + default: + rtems_set_errno_and_return_minus_one( EINVAL ); + } + + return POSIX_SCHEDULER_MINIMUM_PRIORITY; +} diff --git a/cpukit/posix/src/sched_getscheduler.c b/cpukit/posix/src/sched_getscheduler.c new file mode 100644 index 0000000000..5a53372dd1 --- /dev/null +++ b/cpukit/posix/src/sched_getscheduler.c @@ -0,0 +1,33 @@ +/* + * 13.3.4 Get Scheduling Policy, P1003.1b-1993, p. 256 + * + * 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 + +#include +#include + +#include +#include +#include +#include +#include +#include + +int sched_getscheduler( + pid_t pid +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/sched_rr_get_interval.c b/cpukit/posix/src/sched_rr_get_interval.c new file mode 100644 index 0000000000..2cd1625743 --- /dev/null +++ b/cpukit/posix/src/sched_rr_get_interval.c @@ -0,0 +1,43 @@ +/* + * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 + * + * 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 + +#include +#include + +#include +#include +#include +#include + +int sched_rr_get_interval( + pid_t pid, + struct timespec *interval +) +{ + /* + * Only supported for the "calling process" (i.e. this node). + */ + + if ( pid && pid != getpid() ) + rtems_set_errno_and_return_minus_one( ESRCH ); + + if ( !interval ) + rtems_set_errno_and_return_minus_one( EINVAL ); + + _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); + return 0; +} diff --git a/cpukit/posix/src/sched_setparam.c b/cpukit/posix/src/sched_setparam.c new file mode 100644 index 0000000000..bc79b85878 --- /dev/null +++ b/cpukit/posix/src/sched_setparam.c @@ -0,0 +1,34 @@ +/* + * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 + * + * 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 + +#include +#include + +#include +#include +#include +#include +#include +#include + +int sched_setparam( + pid_t pid, + const struct sched_param *param +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/sched_setscheduler.c b/cpukit/posix/src/sched_setscheduler.c new file mode 100644 index 0000000000..4ca1516eac --- /dev/null +++ b/cpukit/posix/src/sched_setscheduler.c @@ -0,0 +1,36 @@ +/* + * 13.3.3 Set Scheduling Policy and Scheduling Parameters, + * P1003.1b-1993, p. 254 + * + * 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 + +#include +#include + +#include +#include +#include +#include +#include +#include + +int sched_setscheduler( + pid_t pid, + int policy, + const struct sched_param *param +) +{ + rtems_set_errno_and_return_minus_one( ENOSYS ); +} diff --git a/cpukit/posix/src/sched_yield.c b/cpukit/posix/src/sched_yield.c new file mode 100644 index 0000000000..0925e3cbd0 --- /dev/null +++ b/cpukit/posix/src/sched_yield.c @@ -0,0 +1,34 @@ +/* + * 13.3.5 Yield Processor, P1003.1b-1993, p. 257 + * + * 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 + +#include +#include + +#include +#include +#include +#include +#include +#include + +int sched_yield( void ) +{ + _Thread_Disable_dispatch(); + _Thread_Yield_processor(); + _Thread_Enable_dispatch(); + return 0; +} diff --git a/cpukit/posix/src/semaphorecreatesupp.c b/cpukit/posix/src/semaphorecreatesupp.c index 2914ec3539..fb87f0f8a6 100644 --- a/cpukit/posix/src/semaphorecreatesupp.c +++ b/cpukit/posix/src/semaphorecreatesupp.c @@ -1,4 +1,11 @@ /* + * 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$ */ diff --git a/cpukit/posix/src/sysconf.c b/cpukit/posix/src/sysconf.c index 788688ef22..bdb0f1044d 100644 --- a/cpukit/posix/src/sysconf.c +++ b/cpukit/posix/src/sysconf.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -49,6 +50,5 @@ long sysconf( break; } - errno = EINVAL; - return -1; + rtems_set_errno_and_return_minus_one( EINVAL ); } diff --git a/cpukit/posix/src/types.c b/cpukit/posix/src/types.c deleted file mode 100644 index 52e5841e3b..0000000000 --- a/cpukit/posix/src/types.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * This file is the shell of what it initially was and is now misnamed. - * - * $Id$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include -#include - diff --git a/cpukit/posix/src/wait.c b/cpukit/posix/src/wait.c index 5bfa8ce943..b277930b47 100644 --- a/cpukit/posix/src/wait.c +++ b/cpukit/posix/src/wait.c @@ -1,6 +1,13 @@ /* * waitpid() - POSIX 1003.1b 3.2.1 * + * 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$ */ @@ -11,11 +18,11 @@ #include #include #include +#include int wait( int *stat_loc ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } diff --git a/cpukit/posix/src/waitpid.c b/cpukit/posix/src/waitpid.c index 5201f56a05..b3c3918f4e 100644 --- a/cpukit/posix/src/waitpid.c +++ b/cpukit/posix/src/waitpid.c @@ -1,6 +1,13 @@ /* * waitpid() - POSIX 1003.1 3.2.1 * + * 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$ */ @@ -11,6 +18,7 @@ #include #include #include +#include int waitpid( pid_t pid, @@ -18,6 +26,5 @@ int waitpid( int options ) { - errno = ENOSYS; - return -1; + rtems_set_errno_and_return_minus_one( ENOSYS ); } -- cgit v1.2.3