Mercury Bugs - mercury
View Issue Details
0000546mercuryFeature Requestpublic2022-02-07 14:342022-02-07 16:56
Reporterwangp 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000546: make io.system_error public
DescriptionAs discussed on mercury-users (05 Feb 2022) we should give access to the system error code from an io.error value. Something like this:

    % implementation
    :- type io.error
        ---> io_error(system_error, string).

    :- func make_io_error(system_error, string) = io.error.

    :- pred get_system_error(io.error::in, system_error::out)
        is semidet.


(Assign yourself if you want to work on it.)
TagsNo tags attached.
Attached Files

Notes
(0001170)
juliensf   
2022-02-07 16:56   
A complication here is that on Windows, there are two different sets of error codes: one for the system calls and another for the library functions that report their errors via errno. Currently we don't distinguish between the two, which means any potential user of a public system_error type won't know which is which.

Issue History
2022-02-07 14:34wangpNew Issue
2022-02-07 16:56juliensfNote Added: 0001170