summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-13 14:24:00 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-13 14:24:00 +0000
commitf48c906895baa269d0b16837cf66caed6eebc3c9 (patch)
tree03e6f1ffc024b458f59c375c68c271bec8d17e83 /c
parentadded page break before sysconf() (diff)
downloadrtems-f48c906895baa269d0b16837cf66caed6eebc3c9.tar.bz2
removed errors for TOD not set yet.
made nanosleep return -1/EINTR for being interrupted for a signal.
Diffstat (limited to 'c')
-rw-r--r--c/src/exec/posix/src/time.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/c/src/exec/posix/src/time.c b/c/src/exec/posix/src/time.c
index a915d7617a..3a36bb33f5 100644
--- a/c/src/exec/posix/src/time.c
+++ b/c/src/exec/posix/src/time.c
@@ -171,10 +171,6 @@ int clock_gettime(
switch ( clock_id ) {
case CLOCK_REALTIME:
-#if 0
- if ( !_TOD_Is_set() ) /* XXX does posix allow it to not be set? */
- set_errno_and_return_minus_one( EINVAL );
-#endif
_ISR_Disable( level );
seconds = _TOD_Seconds_since_epoch;
@@ -266,8 +262,6 @@ int nanosleep(
if ( rqtp->tv_nsec >= TOD_NANOSECONDS_PER_SECOND )
set_errno_and_return_minus_one( EINVAL );
-/* XXX this is interruptible by a posix signal */
-
ticks = _POSIX_Timespec_to_interval( rqtp );
/*
@@ -292,7 +286,7 @@ int nanosleep(
);
_Watchdog_Initialize(
&_Thread_Executing->Timer,
- _Thread_Delay_ended, /* XXX may need to be POSIX specific */
+ _Thread_Delay_ended,
_Thread_Executing->Object.id,
NULL
);
@@ -306,10 +300,16 @@ int nanosleep(
_Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time;
_POSIX_Interval_to_timespec( ticks, rmtp );
- }
- return 0; /* XXX should account for signal */
+ /*
+ * If there is time remaining, then we were interrupted by a signal.
+ */
+
+ if ( ticks )
+ set_errno_and_return_minus_one( EINTR );
+ }
+ return 0;
}
/*PAGE