Method: ConcurrentSHM::SharedMemory#size

Defined in:
ext/concurrent-shm/posix.c

#sizeInteger

The size of the shared memory space using ‘fstat`.

Returns:

  • (Integer)

Raises:

  • (Errno::EBADF)

    if the receivers ‘fileno` is not a valid file descriptor



113
114
115
116
117
118
119
# File 'ext/concurrent-shm/posix.c', line 113

static VALUE shared_memory_size(VALUE self)
{
    struct stat stat;
    VALUE fd = rb_funcall(self, rb_intern("fileno"), 0);
    chk_err(fstat, (FIX2INT(fd), &stat), "fd=%d", FIX2INT(fd));
    return INT2FIX(stat.st_size);
}