ErrorException thrown when errno is modified ?

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 19 06:20:17 PDT 2016


On 05/19/2016 03:05 PM, chmike wrote:
> I'm planning to call some posix functions core.sys.posix that may set
> the errno value in case of error. e.g. read() or write().
>
> Checking the std.exception documentation I see that ErrnoException may
> be thrown when errors setting errno may occur. Does this affect the
> posix calls ?
>
>  From what I saw in the code, it doesn't seam the case. Just making sure
> I'm correct.

I think the description for ErrnoException is a bit misleading. I'm 
fairly certain that there is no code running that watches errno and 
throws an ErrnoException whenever it gets set. Rather, code that calls C 
functions which set errno can/should use ErrnoException and the 
errnoEnforce helper function to make a nice Exception from an errno value.


More information about the Digitalmars-d-learn mailing list