bare::ffi::errno
API 參考只有英文版,由標準函式庫原始碼中的英文文件註解產生。
the C library's errno and Windows' GetLastError
as the last #[errno] call left them.
The thread may run runtime code between a C call's return and the next
line (it may wait out a collection there), and that code may change
errno. #[errno] on the declaration (or its extern block) saves both
first; these read the saved values, so they are right whenever they
run.
Functions
errnoSource
pub fn errno() -> c_int errno as the last #[errno] call on this thread left it.
set_errnoSource
pub fn set_errno(v: c_int) Set errno, both the saved value and the C library's (for C functions
that only report errors through it, such as strtol: set 0 first).
last_errorSource
pub fn last_error() -> u32 Windows' GetLastError as the last #[errno] call on this thread
left it; 0 elsewhere.
set_last_errorSource
pub fn set_last_error(v: u32) Set the saved GetLastError value and, on Windows, the thread's own
(SetLastError).