Windows API 可能会返回 MSDN 文档上没有提到的错误码

例如 _sopen_s 在磁盘空间不够的时候, 宏 errno 就会返回 ENOSPC(28)

 

MSDN 文档时只提到以下错误码

errno valueCondition
EACCES The given path is a directory, or the file is read-only, but an open-for-writing operation was attempted.
EEXIST _O_CREAT and _O_EXCL flags were specified, but filename already exists.
EINVAL Invalid oflag, shflag, or pmode argument, or pfh or filename was a null pointer.
EMFILE No more file descriptors available.
ENOENT File or path not found.

posted on 2021-02-25 15:50  liujx2019  阅读(100)  评论(0编辑  收藏  举报

导航