diff options
Diffstat (limited to 'erts/emulator/sys')
-rw-r--r-- | erts/emulator/sys/common/erl_mmap.c | 12 | ||||
-rw-r--r-- | erts/emulator/sys/common/erl_mmap.h | 4 | ||||
-rw-r--r-- | erts/emulator/sys/unix/sys.c | 10 | ||||
-rw-r--r-- | erts/emulator/sys/win32/sys_env.c | 18 |
4 files changed, 36 insertions, 8 deletions
diff --git a/erts/emulator/sys/common/erl_mmap.c b/erts/emulator/sys/common/erl_mmap.c index a9da7430fb..3f6813e1a5 100644 --- a/erts/emulator/sys/common/erl_mmap.c +++ b/erts/emulator/sys/common/erl_mmap.c @@ -2057,7 +2057,7 @@ static struct { Eterm scs; Eterm sco; Eterm scrpm; - Eterm scmgc; + Eterm scrfsd; int is_initialized; erts_mtx_t init_mutex; @@ -2090,7 +2090,7 @@ static void init_atoms(void) AM_INIT(scs); AM_INIT(sco); AM_INIT(scrpm); - AM_INIT(scmgc); + AM_INIT(scrfsd); am.is_initialized = 1; } erts_mtx_unlock(&am.init_mutex); @@ -2121,7 +2121,7 @@ erts_mmap_init(ErtsMMapInit *init) #if defined(HARD_DEBUG) || 0 erts_fprintf(stderr, "erts_mmap: scs = %bpu\n", init->scs); erts_fprintf(stderr, "erts_mmap: sco = %i\n", init->sco); - erts_fprintf(stderr, "erts_mmap: scmgc = %i\n", init->scmgc); + erts_fprintf(stderr, "erts_mmap: scrfsd = %i\n", init->scrfsd); #endif erts_page_inv_mask = pagesize - 1; if (pagesize & erts_page_inv_mask) @@ -2234,7 +2234,7 @@ erts_mmap_init(ErtsMMapInit *init) mmap_state.no_os_mmap = init->sco; - desc_size = init->scmgc; + desc_size = init->scrfsd; if (desc_size < 100) desc_size = 100; desc_size *= sizeof(ErtsFreeSegDesc); @@ -2418,7 +2418,7 @@ Eterm erts_mmap_info_options(char *prefix, if (mmap_state.supercarrier) { erts_print(to, arg, "%ssco: %T\n", prefix, sco); erts_print(to, arg, "%sscrpm: %T\n", prefix, scrpm); - erts_print(to, arg, "%sscmgc: %beu\n", prefix, mmap_state.desc.reserved); + erts_print(to, arg, "%sscrfsd: %beu\n", prefix, mmap_state.desc.reserved); } } @@ -2429,7 +2429,7 @@ Eterm erts_mmap_info_options(char *prefix, res = NIL; if (mmap_state.supercarrier) { - add_2tup(hpp, szp, &res, am.scmgc, + add_2tup(hpp, szp, &res, am.scrfsd, erts_bld_uint(hpp,szp, mmap_state.desc.reserved)); add_2tup(hpp, szp, &res, am.scrpm, scrpm); add_2tup(hpp, szp, &res, am.sco, sco); diff --git a/erts/emulator/sys/common/erl_mmap.h b/erts/emulator/sys/common/erl_mmap.h index e6934dbb26..778a8e0e80 100644 --- a/erts/emulator/sys/common/erl_mmap.h +++ b/erts/emulator/sys/common/erl_mmap.h @@ -45,8 +45,8 @@ typedef struct { } predefined_area; UWord scs; /* super carrier size */ int sco; /* super carrier only? */ - Uint scmgc; /* super carrier: max guaranteed (number of) carriers */ - int scrpm; + UWord scrfsd; /* super carrier reserved free segment descriptors */ + int scrpm; /* super carrier reserve physical memory */ }ErtsMMapInit; #define ERTS_MMAP_INIT_DEFAULT_INITER \ diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c index 401b37b9d2..61f9f6a59a 100644 --- a/erts/emulator/sys/unix/sys.c +++ b/erts/emulator/sys/unix/sys.c @@ -2489,6 +2489,16 @@ erts_sys_getenv(char *key, char *value, size_t *size) return res; } +int +erts_sys_unsetenv(char *key) +{ + int res; + erts_smp_rwmtx_rwlock(&environ_rwmtx); + res = unsetenv(key); + erts_smp_rwmtx_rwunlock(&environ_rwmtx); + return res; +} + void sys_init_io(void) { diff --git a/erts/emulator/sys/win32/sys_env.c b/erts/emulator/sys/win32/sys_env.c index 754f4c6e4c..9f977ad6c8 100644 --- a/erts/emulator/sys/win32/sys_env.c +++ b/erts/emulator/sys/win32/sys_env.c @@ -141,6 +141,24 @@ void fini_getenv_state(GETENV_STATE *state) erts_smp_rwmtx_runlock(&environ_rwmtx);
}
+int erts_sys_unsetenv(char *key)
+{
+ int res = 0;
+ WCHAR *wkey = (WCHAR *) key;
+
+ SetLastError(0);
+ erts_smp_rwmtx_rlock(&environ_rwmtx);
+ GetEnvironmentVariableW(wkey,
+ NULL,
+ 0);
+ if (GetLastError() != ERROR_ENVVAR_NOT_FOUND) {
+ res = (SetEnvironmentVariableW(wkey,
+ NULL) ? 0 : 1);
+ }
+ erts_smp_rwmtx_runlock(&environ_rwmtx);
+ return res;
+}
+
char*
win_build_environment(char* new_env)
{
|