| title |
_set_errno | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
article |
| apiname |
|
| apilocation |
msvcrt.dll |
msvcr80.dll |
msvcr90.dll |
msvcr100.dll |
msvcr100_clr0400.dll |
msvcr110.dll |
msvcr110_clr0400.dll |
msvcr120.dll |
msvcr120_clr0400.dll |
ucrtbase.dll |
api-ms-win-crt-runtime-l1-1-0.dll |
|
| apitype |
DLLExport |
| f1_keywords |
|
| dev_langs |
|
| helpviewer_keywords |
errno global variable |
set_errno function |
_set_errno function |
|
| ms.assetid |
d338914a-1894-4cf3-ae45-f2c4eb26590b |
| caps.latest.revision |
15 |
| author |
corob-msft |
| ms.author |
corob |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
Set the value of the errno global variable.
errno_t _set_errno(
int value
);
[in] value
The new value of errno.
Returns zero if successful.
Remarks
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" );
}
Oops: Illegal byte sequence
| Routine |
Required header |
Optional header |
_set_errno |
<stdlib.h> |
<errno.h> |
For more compatibility information, see Compatibility in the Introduction.
_get_errno
errno, _doserrno, _sys_errlist, and _sys_nerr