-- B o d y --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2009, AdaCore --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
tv_nsec => long (Long_Long_Integer (F * 10#1#E9)));
end To_Timespec;
- function To_Duration (TV : struct_timeval) return Duration is
- begin
- return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6;
- end To_Duration;
-
- function To_Timeval (D : Duration) return struct_timeval is
- S : time_t;
- F : Duration;
- begin
- S := time_t (Long_Long_Integer (D));
- F := D - Duration (S);
-
- -- If F has negative value due to a round-up, adjust for positive F
- -- value.
-
- if F < 0.0 then
- S := S - 1;
- F := F + 1.0;
- end if;
-
- return
- struct_timeval'
- (tv_sec => S,
- tv_usec => time_t (Long_Long_Integer (F * 10#1#E6)));
- end To_Timeval;
-
-------------------------
-- POSIX.1c Section 3 --
-------------------------
return 0;
end sigwait;
- -- DCE_THREADS does not have pthread_kill. Instead, we just ignore it.
+ -- DCE_THREADS does not have pthread_kill. Instead, we just ignore it
function pthread_kill (thread : pthread_t; sig : Signal) return int is
pragma Unreferenced (thread, sig);
begin
if pthread_cond_timedwait_base (cond, mutex, abstime) /= 0 then
- if errno = EAGAIN then
- return ETIMEDOUT;
- else
- return errno;
- end if;
+ return (if errno = EAGAIN then ETIMEDOUT else errno);
else
return 0;
end if;