with Text_Io;

package body Ip_Tcp_Defs is
    package body Unix_Error is
        function Decode (Status : Vms.Cond_Value_Type) return Number is
            use System;
        begin
            if (Unsigned_Longword (Status) and 16#8000#) = 0 then
                return Epipe;
            else
                return Number (16#0FFF# and Unsigned_Word
                                               (Vms.Message_Number (Status)));
            end if;
        end Decode;

        function Decode (Status : Vms.Iosb_Type) return Number is
        begin
            return Decode (Vms.Cond_Value_Type (Status.Status));
        end Decode;
    end Unix_Error;
end Ip_Tcp_Defs;