RTEMS  5.0.0
Macros
Set Errno

Macros

#define rtems_set_errno_and_return_value(_error, _value)   do { errno = ( _error ); return ( _value ); } while ( 0 )
 
#define rtems_set_errno_and_return_minus_one(_error)   rtems_set_errno_and_return_value( _error, -1 )
 

Detailed Description

Macro Definition Documentation

◆ rtems_set_errno_and_return_minus_one

#define rtems_set_errno_and_return_minus_one (   _error)    rtems_set_errno_and_return_value( _error, -1 )

This is a helper macro which will set the variable errno and return -1 to the caller. This pattern is common to many POSIX methods.

Parameters
[in]_erroris the error code

◆ rtems_set_errno_and_return_value

#define rtems_set_errno_and_return_value (   _error,
  _value 
)    do { errno = ( _error ); return ( _value ); } while ( 0 )

This is a helper macro which will set the variable errno and return the specified value to the caller.

Parameters
[in]_erroris the error code
[in]_valueis the value to return