docs

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).