diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-07-14 06:18:56 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-14 06:18:56 -0700 |
commit | 0b830828cbace15b524b28b04aa6716cb57ed589 (patch) | |
tree | fc07c77a1f82d9028619fc33a3be85d63257cbae /sysif.c | |
parent | 1bdccc66b8af56dc408b57b2b5842f5d5d7af5b7 (diff) | |
download | txr-0b830828cbace15b524b28b04aa6716cb57ed589.tar.gz txr-0b830828cbace15b524b28b04aa6716cb57ed589.tar.bz2 txr-0b830828cbace15b524b28b04aa6716cb57ed589.zip |
sysif: create rlim struct even without HAVE_RLIM.
The reason for this change is that we don't want syntax
like #S(rlim cur 0 max 0) to fail to read in a build of
TXR that happens not to have detected getrlimit.
* sysif.c (rlim_s, cur_s, max_s, rlim_st): Define variables
unconditionally.
(sysif_init): Initialize variables unconditionally.
Diffstat (limited to 'sysif.c')
-rw-r--r-- | sysif.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -152,10 +152,8 @@ val flock_s, type_s, whence_s, start_s, len_s, pid_s; val dlhandle_s, dlsym_s; #endif -#if HAVE_RLIMIT val rlim_s, cur_s, max_s; static val rlim_st; -#endif struct cobj_class *dir_cls; @@ -3095,13 +3093,13 @@ void sysif_init(void) reg_varl(intern(lit("dt-lnk"), user_package), num_fast(DT_LNK)); reg_varl(intern(lit("dt-sock"), user_package), num_fast(DT_SOCK)); -#if HAVE_RLIMIT rlim_s = intern(lit("rlim"), user_package); cur_s = intern(lit("cur"), user_package); max_s = intern(lit("max"), user_package); rlim_st = make_struct_type(rlim_s, nil, nil, list(cur_s, max_s, nao), nil, nil, nil, nil); +#if HAVE_RLIMIT reg_fun(intern(lit("getrlimit"), user_package), func_n2o(getrlimit_wrap, 1)); reg_fun(intern(lit("setrlimit"), user_package), func_n2(setrlimit_wrap)); reg_varl(intern(lit("rlim-saved-max"), user_package), num_fast(RLIM_SAVED_MAX)); |