12 #ifndef ECL_THREADS_PRIORITY_POS_HPP_ 13 #define ECL_THREADS_PRIORITY_POS_HPP_ 20 #if defined(ECL_IS_POSIX) 30 #include <sys/resource.h> 32 #include <ecl/exceptions/macros.hpp> 33 #include <ecl/exceptions/standard_exception.hpp> 34 #include "priority_common.hpp" 152 #if defined(ECL_HAS_EXCEPTIONS) 171 inline StandardException
ECL_LOCAL throwPriorityException(
const char* loc ) {
172 int error_result = errno;
173 switch (error_result) {
174 case ( EINVAL ) :
return StandardException(loc,
ecl::InvalidInputError,
"The specified param structure or priority group was invalid.");
175 case ( ESRCH ) :
return StandardException(loc,
ecl::InvalidInputError,
"The process specified could not be found.");
176 case ( EPERM ) :
return StandardException(loc,
ecl::PermissionsError,
"The caller does not have the appropriate privileges for realtime scheduling (http://snorriheim.dnsdojo.com/doku/doku.php/en:linux:admin:priorities).");
177 case ( EACCES ) :
return StandardException(loc,
ecl::PermissionsError,
"The caller does not have the appropriate privileges for elevating the process priority by reducing the niceness value (http://snorriheim.dnsdojo.com/doku/doku.php/en:linux:admin:priorities).");
180 std::ostringstream ostream;
181 ostream <<
"Unknown posix error " << error_result <<
": " << strerror(error_result) <<
".";
182 return StandardException(loc,
UnknownError, ostream.str());
Pre-processed macro definitions that define the target platform.
#define ecl_debug_throw_decl(exception)
Debug mode throw exception declaration.