diff options
author | Robert Dewar <dewar@adacore.com> | 2007-08-14 10:36:48 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-14 10:36:48 +0200 |
commit | 835d23b2e08bb08e88163700eac0dc08442b2b0b (patch) | |
tree | 05b5ae79d8bf769dcfc728d032c9a64d115ddfeb /gcc/ada/s-osinte-freebsd.adb | |
parent | 4a9b6b95df593226fd81c8d2a828e130b9d9a660 (diff) | |
download | gcc-835d23b2e08bb08e88163700eac0dc08442b2b0b.tar.gz |
uintp.adb, [...]: Minor reformatting.
2007-08-14 Robert Dewar <dewar@adacore.com>
* uintp.adb, a-ztedit.adb, s-wchcon.adb, xnmake.adb, s-wchcon.adb,
par-ch5.adb, par-ch10.adb, get_targ.adb, a-wtedit.adb, a-teioed.adb,
s-osinte-solaris.adb, s-osinte-solaris.ads,
s-osinte-freebsd.ads, s-osinte-freebsd.adb: Minor reformatting.
* styleg.adb, styleg.ads, stylesw.adb, stylesw.ads: implement style
switch -gnatyS. Enable -gnatyS in GNAT style check mode
From-SVN: r127409
Diffstat (limited to 'gcc/ada/s-osinte-freebsd.adb')
-rw-r--r-- | gcc/ada/s-osinte-freebsd.adb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/ada/s-osinte-freebsd.adb b/gcc/ada/s-osinte-freebsd.adb index 33daa45482a..fbc12c18036 100644 --- a/gcc/ada/s-osinte-freebsd.adb +++ b/gcc/ada/s-osinte-freebsd.adb @@ -38,21 +38,34 @@ with Interfaces.C; use Interfaces.C; package body System.OS_Interface is + ----------- + -- Errno -- + ----------- + function Errno return int is type int_ptr is access all int; function internal_errno return int_ptr; pragma Import (C, internal_errno, "__error"); + begin return (internal_errno.all); end Errno; + -------------------- + -- Get_Stack_Base -- + -------------------- + function Get_Stack_Base (thread : pthread_t) return Address is pragma Unreferenced (thread); begin return (0); end Get_Stack_Base; + ------------------ + -- pthread_init -- + ------------------ + procedure pthread_init is begin null; @@ -85,15 +98,20 @@ package body System.OS_Interface is function To_Timespec (D : Duration) return timespec 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; + + if F < 0.0 then + S := S - 1; + F := F + 1.0; + end if; + return timespec'(ts_sec => S, - ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); + ts_nsec => long (Long_Long_Integer (F * 10#1#E9))); end To_Timespec; end System.OS_Interface; |