2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>

* 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.
This commit is contained in:
Joel Sherrill
2007-12-13 16:52:21 +00:00
parent 8d8daef461
commit fbfb59262d
42 changed files with 710 additions and 328 deletions

View File

@@ -1,3 +1,25 @@
2007-12-13 Joel Sherrill <joel.sherrill@OARcorp.com>
* 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 <joel.sherrill@OARcorp.com>
* libcsupport/preinstall.am, posix/preinstall.am, posix/src/aio.c,

View File

@@ -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

View File

@@ -1,117 +0,0 @@
/*
* $Id$
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
/*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 );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_cancel(
int filedes,
struct aiocb *aiocbp
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_error(
const struct aiocb *aiocbp
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_read(
struct aiocb *aiocbp
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_return(
const struct aiocb *aiocbp
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_suspend(
struct aiocb * const list[],
int nent,
const struct timespec *timeout
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int aio_write(
struct aiocb *aiocbp
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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$
*/

View File

@@ -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$
*/

View File

@@ -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$
*/

View File

@@ -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$
*/

View File

@@ -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$
*/

View File

@@ -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$
*/

View File

@@ -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 <errno.h>
#include <rtems/seterr.h>
int execl(
const char *path,
@@ -16,6 +24,5 @@ int execl(
...
)
{
errno = ENOSYS;
return -1;
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <errno.h>
#include <rtems/seterr.h>
int execle(
const char *path,
@@ -16,6 +24,5 @@ int execle(
...
)
{
errno = ENOSYS;
return -1;
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <errno.h>
#include <rtems/seterr.h>
int execlp(
const char *file,
@@ -16,6 +24,5 @@ int execlp(
...
)
{
errno = ENOSYS;
return -1;
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <errno.h>
#include <rtems/seterr.h>
int execv(
const char *file,
char *const argv[]
)
{
errno = ENOSYS;
return -1;
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <errno.h>
#include <rtems/seterr.h>
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 );
}

View File

@@ -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 <errno.h>
#include <rtems/seterr.h>
int execvp(
const char *path,
char *const argv[]
)
{
errno = ENOSYS;
return -1;
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <sys/types.h>
#include <errno.h>
#include <rtems/seterr.h>
int fork( void )
{
errno = ENOSYS;
return -1;
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <aio.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int lio_listio(
int mode,
struct aiocb * const list[],
int nent,
struct sigevent *sig
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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$
*/

View File

@@ -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 <sys/types.h>
#include <errno.h>
#include <rtems/seterr.h>
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 );
}

View File

@@ -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

View File

@@ -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 ) {

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/tod.h>
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
/*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;
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
int sched_getparam(
pid_t pid,
const struct sched_param *param
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
#include <rtems/posix/priority.h>
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;
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
#include <rtems/posix/priority.h>
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;
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/tod.h>
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
int sched_getscheduler(
pid_t pid
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/tod.h>
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
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;
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/tod.h>
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
int sched_setparam(
pid_t pid,
const struct sched_param *param
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/tod.h>
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
int sched_setscheduler(
pid_t pid,
int policy,
const struct sched_param *param
)
{
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/tod.h>
#include <rtems/score/thread.h>
#include <rtems/seterr.h>
#include <rtems/posix/priority.h>
#include <rtems/posix/time.h>
int sched_yield( void )
{
_Thread_Disable_dispatch();
_Thread_Yield_processor();
_Thread_Enable_dispatch();
return 0;
}

View File

@@ -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$
*/

View File

@@ -11,6 +11,7 @@
#include <errno.h>
#include <rtems/system.h>
#include <rtems/seterr.h>
#include <rtems/score/tod.h>
#include <sys/param.h>
@@ -49,6 +50,5 @@ long sysconf(
break;
}
errno = EINVAL;
return -1;
rtems_set_errno_and_return_minus_one( EINVAL );
}

View File

@@ -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 <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/seterr.h>

View File

@@ -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 <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <rtems/seterr.h>
int wait(
int *stat_loc
)
{
errno = ENOSYS;
return -1;
rtems_set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -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 <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <rtems/seterr.h>
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 );
}