Module: FFI::LastError
Relationships & Source Files | |
Defined in: | ext/ffi_c/LastError.c |
Overview
This module defines a couple of method to set and get errno for current thread.
Class Attribute Summary
- .error rw mod_func
- .error(error) rw mod_func
- .winapi_error rw mod_func
- .error(error) rw mod_func
Class Attribute Details
.error (rw, mod_func)
Get({errno} value.)
# File 'ext/ffi_c/LastError.c', line 147
static VALUE get_last_error(VALUE self) { return INT2NUM(thread_data_get()->td_errno); }
.error(error) (rw, mod_func)
Set({errno} value.)
# File 'ext/ffi_c/LastError.c', line 173
static VALUE set_last_error(VALUE self, VALUE error) { #ifdef _WIN32 SetLastError(NUM2INT(error)); #else errno = NUM2INT(error); #endif return Qnil; }
.winapi_error (rw, mod_func)
Get(+GetLastError()+ value. Only Windows or Cygwin.)
# File 'ext/ffi_c/LastError.c', line 159
static VALUE get_last_winapi_error(VALUE self) { return INT2NUM(thread_data_get()->td_winapi_errno); }
.error(error) (rw, mod_func)
Set(+GetLastError()+ value. Only on Windows and Cygwin.)
# File 'ext/ffi_c/LastError.c', line 192
static VALUE set_last_winapi_error(VALUE self, VALUE error) { SetLastError(NUM2INT(error)); return Qnil; }