Opened 9 years ago

Last modified 9 years ago

#8926 new Bugs

Windows error messages used for errno codes

Reported by: Lars T. Kyllingstad <lars.kyllingstad@…> Owned by: Beman Dawes
Milestone: To Be Determined Component: system
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

Consider the following:

using namespace boost::system;
system_error e(errc::resource_unavailable_try_again, system_category());
std::cout << e.what() << std::endl;

This should print something along the lines of "Resource unavailable", but instead it prints "An attempt was made to load a program with an incorrect format".

The value of errc::resource_unavailable_try_again is 11, or EAGAIN. What is printed, however, is the message for the Windows system error code ERROR_BAD_FORMAT, which is also 11.

I encountered this while using boost::thread. I got the above message when I ran out of memory during thread creation.

Change History (2)

comment:1 by Lars T. Kyllingstad <lars.kyllingstad@…>, 9 years ago

I forgot to say, I am compiling with Visual Studio 2010 on Windows 7.

comment:2 by s.cheban@…, 9 years ago

Try system_error e(errc::resource_unavailable_try_again, generic_category());

Note: See TracTickets for help on using tickets.