[thread.req.exception] (original) (raw)

Some functions described in this Clause are specified to throw exceptions of typesystem_error ([syserr.syserr]).

Such exceptions are thrown if any of the function's error conditions is detected or a call to an operating system or other underlying API results in an error that prevents the library function from meeting its specifications.

[Example 1:

Consider a function in this Clause that is specified to throw exceptions of typesystem_error and specifies error conditions that includeoperation_not_permitted for a thread that does not have the privilege to perform the operation.

Assume that, during the execution of this function, an errnoof EPERM is reported by a POSIX API call used by the implementation.

Since POSIX specifies an errno of EPERM when “the caller does not have the privilege to perform the operation”, the implementation maps EPERM to anerror_condition of operation_not_permitted ([syserr]) and an exception of type system_error is thrown.

— _end example_]