diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-11-20 21:52:19 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-11-20 21:52:19 +0000 |
commit | d05ab3519a2b742b0eed656995ac9ea0e6d5699e (patch) | |
tree | e305211aec78c752f4f7545afde6136e0c603b42 /cpukit | |
parent | 2008-11-20 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-d05ab3519a2b742b0eed656995ac9ea0e6d5699e.tar.bz2 |
2008-11-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/Makefile.am, posix/include/rtems/posix/psignal.h: Add stubs for
gettimer() and setitimer().
* posix/src/getitimer.c, posix/src/setitimer.c: New files.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/posix/Makefile.am | 5 | ||||
-rw-r--r-- | cpukit/posix/include/rtems/posix/psignal.h | 11 | ||||
-rw-r--r-- | cpukit/posix/src/getitimer.c | 34 | ||||
-rw-r--r-- | cpukit/posix/src/setitimer.c | 35 |
5 files changed, 86 insertions, 5 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 72b961bddc..53b09ea7fb 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,11 @@ 2008-11-20 Joel Sherrill <joel.sherrill@oarcorp.com> + * posix/Makefile.am, posix/include/rtems/posix/psignal.h: Add stubs for + gettimer() and setitimer(). + * posix/src/getitimer.c, posix/src/setitimer.c: New files. + +2008-11-20 Joel Sherrill <joel.sherrill@oarcorp.com> + * libcsupport/Makefile.am, posix/Makefile.am: Comment out including files which contain routines which are now provided by the newlib posix subdirectory. Document a few which come from the unix directory. diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am index 71c604a4b3..8bb94aca85 100644 --- a/cpukit/posix/Makefile.am +++ b/cpukit/posix/Makefile.am @@ -159,13 +159,14 @@ libposix_a_SOURCES += src/adjtime.c src/posixtimespecabsolutetimeout.c \ src/clockgetcpuclockid.c src/clockgetenableattr.c src/clockgetres.c \ src/clocksetenableattr.c -# the timer manager needs to be split further but only after its -# dependence on the Classic API Timer Manager is removed. ## TIMER_C_FILES libposix_a_SOURCES += src/ptimer.c src/timercreate.c src/timerdelete.c \ src/timergetoverrun.c src/timergettime.c src/timersettime.c \ src/timertsr.c src/timerinserthelper.c +## ITIMER_C_FILES +libposix_a_SOURCES += src/getitimer.c src/setitimer.c + EXTRA_DIST += src/README.mqueue libposix_a_SOURCES += src/sched_getparam.c src/sched_getprioritymax.c \ diff --git a/cpukit/posix/include/rtems/posix/psignal.h b/cpukit/posix/include/rtems/posix/psignal.h index 66c6bd1bc3..2d5a450e91 100644 --- a/cpukit/posix/include/rtems/posix/psignal.h +++ b/cpukit/posix/include/rtems/posix/psignal.h @@ -23,9 +23,14 @@ */ #define SIGNAL_EMPTY_MASK 0x00000000 -#define SIGNAL_ALL_MASK 0xffffffff - -#define signo_to_mask( _sig ) (1 << ((_sig) - 1)) +#define SIGNAL_ALL_MASK 0xffffffffL + +static inline sigset_t signo_to_mask( + uint32_t sig +) +{ + return (1 << sig) - 1; +} #define is_valid_signo( _sig ) \ ((_sig) >= 1 && (_sig) <= 32 ) diff --git a/cpukit/posix/src/getitimer.c b/cpukit/posix/src/getitimer.c new file mode 100644 index 0000000000..1892a6016f --- /dev/null +++ b/cpukit/posix/src/getitimer.c @@ -0,0 +1,34 @@ +/* + * COPYRIGHT (c) 1989-2008. + * 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 <time.h> +#include <sys/time.h> +#include <errno.h> +#include <rtems/seterr.h> + +int getitimer( + int which, + struct itimerval *value +) +{ + switch ( which ) { + case ITIMER_REAL: break; + case ITIMER_VIRTUAL: break; + case ITIMER_PROF: break; + } + rtems_set_errno_and_return_minus_one( ENOSYS ); + /* return -1; */ +} + diff --git a/cpukit/posix/src/setitimer.c b/cpukit/posix/src/setitimer.c new file mode 100644 index 0000000000..1895838155 --- /dev/null +++ b/cpukit/posix/src/setitimer.c @@ -0,0 +1,35 @@ +/* + * COPYRIGHT (c) 1989-2008. + * 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 <time.h> +#include <sys/time.h> +#include <errno.h> +#include <rtems/seterr.h> + +int setitimer( + int which, + const struct itimerval *value, + struct itimerval *ovalue +) +{ + switch ( which ) { + case ITIMER_REAL: break; + case ITIMER_VIRTUAL: break; + case ITIMER_PROF: break; + } + rtems_set_errno_and_return_minus_one( ENOSYS ); + /* return -1; */ +} + |