Module: LinuxStat::Sysconf
- Defined in:
- ext/sysconf/sysconf.c
Class Method Summary collapse
- .child_max ⇒ Object
- .expr_nest_max ⇒ Object
- .get_euid ⇒ Object
- .get_gid ⇒ Object
- .get_login ⇒ Object
- .get_uid ⇒ Object
- .get_user ⇒ Object
- .hostname ⇒ Object
- .hostname_max ⇒ Object
- .line_max ⇒ Object
- .login_name_max ⇒ Object
- .open_max ⇒ Object
- .pagesize ⇒ Object
- .posix_version ⇒ Object
- .processor_configured ⇒ Object
- .processor_online ⇒ Object
- .sc_clk_tck ⇒ Object
- .stream_max ⇒ Object
- .tty_name_max ⇒ Object
Class Method Details
.child_max ⇒ Object
21 22 23 24 25 26 |
# File 'ext/sysconf/sysconf.c', line 21
static VALUE getChildMax(volatile VALUE obj) {
long long int val = sysconf(_SC_CHILD_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.expr_nest_max ⇒ Object
84 85 86 87 88 89 |
# File 'ext/sysconf/sysconf.c', line 84
static VALUE getExprNestMax(volatile VALUE obj) {
long long val = sysconf(_SC_EXPR_NEST_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.get_euid ⇒ Object
118 119 120 |
# File 'ext/sysconf/sysconf.c', line 118
static VALUE getEUID(volatile VALUE obj) {
return UINT2NUM((unsigned int) geteuid()) ;
}
|
.get_gid ⇒ Object
114 115 116 |
# File 'ext/sysconf/sysconf.c', line 114
static VALUE getGID(VALUE obj) {
return UINT2NUM((unsigned int) getgid()) ;
}
|
.get_login ⇒ Object
105 106 107 108 |
# File 'ext/sysconf/sysconf.c', line 105 static VALUE getUser(volatile VALUE obj) { char *name = getlogin() ; return name ? rb_str_new_cstr(name) : rb_str_new_cstr("") ; } |
.get_uid ⇒ Object
110 111 112 |
# File 'ext/sysconf/sysconf.c', line 110
static VALUE getUID(volatile VALUE obj) {
return UINT2NUM((unsigned int) getuid()) ;
}
|
.get_user ⇒ Object
105 106 107 108 |
# File 'ext/sysconf/sysconf.c', line 105 static VALUE getUser(volatile VALUE obj) { char *name = getlogin() ; return name ? rb_str_new_cstr(name) : rb_str_new_cstr("") ; } |
.hostname ⇒ Object
122 123 124 125 126 127 128 129 |
# File 'ext/sysconf/sysconf.c', line 122 static VALUE getHostname(volatile VALUE obj) { int h_max = sysconf(_SC_HOST_NAME_MAX) + 1 ; char hostname[h_max] ; char status = gethostname(hostname, h_max) ; return (status < 0) ? rb_str_new_cstr("") : rb_str_new_cstr(hostname) ; } |
.hostname_max ⇒ Object
28 29 30 31 32 33 |
# File 'ext/sysconf/sysconf.c', line 28
static VALUE getHostnameMax(volatile VALUE obj) {
long long val = sysconf(_SC_HOST_NAME_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.line_max ⇒ Object
77 78 79 80 81 82 |
# File 'ext/sysconf/sysconf.c', line 77
static VALUE getLineMax(volatile VALUE obj) {
long long val = sysconf(_SC_LINE_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.login_name_max ⇒ Object
35 36 37 38 39 40 |
# File 'ext/sysconf/sysconf.c', line 35
static VALUE getLoginNameMax(volatile VALUE obj) {
long long val = sysconf(_SC_LOGIN_NAME_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.open_max ⇒ Object
42 43 44 45 46 47 |
# File 'ext/sysconf/sysconf.c', line 42
static VALUE getOpenMax(volatile VALUE obj) {
long long val = sysconf(_SC_OPEN_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.pagesize ⇒ Object
49 50 51 52 53 54 |
# File 'ext/sysconf/sysconf.c', line 49
static VALUE getPageSize(volatile VALUE obj) {
int val = sysconf(_SC_PAGESIZE) ;
if (val < 0) return Qnil ;
return INT2FIX(val) ;
}
|
.posix_version ⇒ Object
70 71 72 73 74 75 |
# File 'ext/sysconf/sysconf.c', line 70
static VALUE getPosixVersion(volatile VALUE obj) {
long long val = sysconf(_SC_VERSION) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.processor_configured ⇒ Object
91 92 93 94 95 96 |
# File 'ext/sysconf/sysconf.c', line 91
static VALUE getProcessorConfigured(volatile VALUE obj) {
long val = sysconf(_SC_NPROCESSORS_CONF) ;
if (val < 0) return Qnil ;
return LONG2NUM(val) ;
}
|
.processor_online ⇒ Object
98 99 100 101 102 103 |
# File 'ext/sysconf/sysconf.c', line 98
static VALUE getProcessorOnline(volatile VALUE obj) {
long val = sysconf(_SC_NPROCESSORS_ONLN) ;
if (val < 0) return Qnil ;
return LONG2NUM(val) ;
}
|
.sc_clk_tck ⇒ Object
14 15 16 17 18 19 |
# File 'ext/sysconf/sysconf.c', line 14
static VALUE getTick(volatile VALUE obj) {
int val = sysconf(_SC_CLK_TCK) ;
if (val < 0) return Qnil ;
return INT2FIX(val) ;
}
|
.stream_max ⇒ Object
56 57 58 59 60 61 |
# File 'ext/sysconf/sysconf.c', line 56
static VALUE getStreamMax(volatile VALUE obj) {
long long val = sysconf(_SC_STREAM_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|
.tty_name_max ⇒ Object
63 64 65 66 67 68 |
# File 'ext/sysconf/sysconf.c', line 63
static VALUE getTTYNameMax(volatile VALUE obj) {
long long val = sysconf(_SC_TTY_NAME_MAX) ;
if (val < 0) return Qnil ;
return LL2NUM(val) ;
}
|