Sha256: f7519ae1e255cec6fed6648b63cad3739c43272b375217a1147c4edc7d4fac6a
Contents?: true
Size: 334 Bytes
Versions: 7
Compression:
Stored size: 334 Bytes
Contents
static VALUE getSectorSize(volatile VALUE obj, volatile VALUE path) { char *dev = StringValuePtr(path) ; unsigned int fd = open(dev, O_RDONLY | O_NONBLOCK) ; if(fd < 0) return Qnil ; unsigned int sSize = 0 ; short status = ioctl(fd, BLKSSZGET, &sSize) ; close(fd) ; if(status < 0) return Qnil ; return UINT2NUM(sSize) ; }
Version data entries
7 entries across 7 versions & 1 rubygems