End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Etc.sysconf
sysconf(p1)
ext/etc/etc.c
View on GitHub ↗
static VALUE
etc_sysconf(VALUE obj, VALUE arg)
{
int name;
long ret;
name = NUM2INT(arg);
errno = 0;
ret = sysconf(name);
if (ret == -1) {
if (errno == 0) /* no limit */
return Qnil;
rb_sys_fail("sysconf");
}
return LONG2NUM(ret);
}
Returns system configuration variable using sysconf().
name should be a constant under Etc which begins with SC_.
The return value is an integer or nil. nil means indefinite limit. (sysconf() returns -1 but errno is not set.)
Example
Etc.sysconf(Etc::SC_ARG_MAX) #=> 2097152 Etc.sysconf(Etc::SC_LOGIN_NAME_MAX) #=> 256