code-examples/2015/2015_03/ada/nauka/calling_libc/call.adb

17 lines
419 B
Ada
Raw Normal View History

2025-03-09 10:58:55 +00:00
with Ada.Text_IO; use Ada.Text_IO;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
procedure call is
function kill (pid: Integer; signal: Integer) return Integer;
pragma Import (C, kill, "kill");
res: Integer;
begin
res := kill(2,3);
if res /= 0 then
Put_Line("Blad");
else
Put_Line("Sukces");
end if;
end call;