Skip to contents

A function declared with errno = TRUE has errno cleared before each call and saved immediately after it, before R runs anything that could change it; on Windows the same declaration saves GetLastError() too. ffi_errno() and ffi_last_error() return the values the latest such call saved.

Usage

ffi_errno()

ffi_last_error()

Value

ffi_errno(): an integer, 0 until a call has saved one. ffi_last_error(): a double, NA on platforms other than Windows.

Details

A library linked to a C runtime other than the one R uses has an errno of its own, which zuffi cannot read.

Examples

ffi_errno()
#> [1] 0