Mouse.The.Lucky.Dog
Mouse.The.Lucky.Dog

Reputation: 755

Throwing C++ exceptions from linux system errors

I am looking for non-vulgar code that throws an exception when a UNIxs, and more specifically linux, system function returns an error.

Said code should skip throwing exceptions when there is no error. ( For example when errno is EAGAIN for a nonblocking read ). And preferably contain FILE and LINE of the line that the exception is thrown from.

I am very much uncertain whiat is going on with the new exception system and in particular the differences between system_catecories and generic_categories and where errno and strerror fit into it all.

Upvotes: 0

Views: 274

Answers (1)

Nicola Musatti
Nicola Musatti

Reputation: 18226

You can find out how it works by exploring the Boost.System library, which is where the relevant part of the C++ standard originated from.

To see how it may be used you can check out the Boost.Filesystem library, which depends on Boost.System and is likely to become part of the standard in the future.

Upvotes: 1

Related Questions