Skip to content

Latest commit

 

History

History
104 lines (91 loc) · 2.04 KB

File metadata and controls

104 lines (91 loc) · 2.04 KB
title _set_errno | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-standard-libraries
ms.tgt_pltfrm
ms.topic article
apiname
_set_errno
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
set_errno
_set_errno
dev_langs
C++
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_errno

Set the value of the errno global variable.

Syntax

errno_t _set_errno(   
   int value   
);  

Parameters

[in] value
The new value of errno.

Return Value

Returns zero if successful.

Remarks

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

Example

// crt_set_errno.c  
#include <stdio.h>  
#include <errno.h>  
  
int main()  
{  
   _set_errno( EILSEQ );  
   perror( "Oops" );  
}  
Oops: Illegal byte sequence  

Requirements

Routine Required header Optional header
_set_errno <stdlib.h> <errno.h>

For more compatibility information, see Compatibility in the Introduction.

See Also

_get_errno
errno, _doserrno, _sys_errlist, and _sys_nerr