以前做IO操作时,常常会得到一个errno_t,其实就是整数 typedef int errno_t;
以下是VC的errno头文件,可以看出Error Code定义为一些整数值
/***
*errno.h - system wide error numbers (set by system calls)
*
* Copyright (c) Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file defines the system-wide error numbers (set by
* system calls). Conforms to the XENIX standard. Extended
* for compatibility with Uniforum standard.
* [System V]
*
* [Public]
*
****/
#pragma once
#ifndef _INC_ERRNO
#define _INC_ERRNO
#include <crtdefs.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* Declare reference to errno */
#ifndef _CRT_ERRNO_DEFINED
#define _CRT_ERRNO_DEFINED
_CRTIMP extern int * __cdecl _errno(void);
#define errno (*_errno())
errno_t __cdecl _set_errno(_In_ int _Value);
errno_t __cdecl _get_errno(_Out_ int * _Value);
#endif /* _CRT_ERRNO_DEFINED */
/* Error Codes */
#define EPERM