RTEMS: Set Errno

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Macros
Set Errno
Internal » SuperCore

## 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] | _error | is 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] | _error | is the error code
  [in] | _value | is the value to return