Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
_set_errno
div
eof
Collapse the table of content
Expand the table of content

_set_errno 

Set the value of the errno global variable.


errno_t _set_errno( 
   int value 
);

Parameters

[in] value

The new value of errno.

Returns zero if successful.

Possible values are defined in Errno.h. Also, see errno Constants.

// crt_set_errno.c
#include <stdio.h>
#include <errno.h>

int main()
{
   _set_errno( EILSEQ );
   perror( "Oops" );
}

Output

Oops: Illegal byte sequence

Routine Required header Optional header Compatibility

_set_errno

<stdlib.h>

<errno.h>

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

For more compatibility information, see Compatibility in the Introduction.

Community Additions

ADD
Show:
© 2015 Microsoft