Package: gnat-4.9 Followup-For: Bug #673772 Control: retitle: ATC with syscalls not working Control: reassign -1 gnat-5 5.2.1-19
As I understand the reference manual, the following program with Ada.Calendar; use Ada.Calendar; with Ada.Text_IO; use Ada.Text_IO; with Interfaces.C; use Interfaces.C; procedure Main is function usleep (Secs : int) return int; pragma Import (C, usleep, "usleep"); Res : int; Start_Time : Time := Clock; begin select delay 1.0; Put_Line ("OK:" & Integer'Image (Integer (Clock - Start_Time))); then abort Res := usleep (10_000_000); Put_Line ("KO:" & Integer'Image (Integer (Clock - Start_Time))); end select; end Main; should produce OK: 1 Instead, on amd64 with gnat-5.2.1-17: KO: 1 OK: 1 and on mips with gnat-5.2.1-19: KO: 10 OK: 10