Module: FFI::LastError

Defined in:
ext/ffi_c/LastError.c

Class Method Summary collapse

Class Method Details

.errorObject



110
111
112
113
114
# File 'ext/ffi_c/LastError.c', line 110

static VALUE
get_last_error(VALUE self)
{
    return INT2NUM(thread_data_get()->td_errno);
}

.error=(error) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
128
# File 'ext/ffi_c/LastError.c', line 117

static VALUE
set_last_error(VALUE self, VALUE error)
{

#ifdef _WIN32
    SetLastError(NUM2INT(error));
#else
    errno = NUM2INT(error);
#endif

    return Qnil;
}