Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
otp_src_26.0.2-erts-symbols.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File otp_src_26.0.2-erts-symbols.patch of Package erlang
diff -Ndurp otp_src_26.0.2/erts/emulator/beam/erl_async.c otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_async.c --- otp_src_26.0.2/erts/emulator/beam/erl_async.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_async.c 2023-08-29 22:01:13.089328571 +0300 @@ -513,6 +513,7 @@ int erts_async_ready_clean(void *varq, v ** The port data gives a fair distribution grom port pointer ** to unsigned integer - to be used in key for driver_async below. */ +__attribute__((externally_visible)) unsigned int driver_async_port_key(ErlDrvPort port) { ErlDrvTermData td = driver_mk_port(port); @@ -536,6 +537,7 @@ unsigned int driver_async_port_key(ErlDr ** async_data data to pass to invoke function ** async_free function for release async_data in case of failure */ +__attribute__((externally_visible)) long driver_async(ErlDrvPort ix, unsigned int* key, void (*async_invoke)(void*), void* async_data, void (*async_free)(void*)) diff -Ndurp otp_src_26.0.2/erts/emulator/beam/erl_drv_thread.c otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_drv_thread.c --- otp_src_26.0.2/erts/emulator/beam/erl_drv_thread.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_drv_thread.c 2023-08-29 22:01:13.089328571 +0300 @@ -148,6 +148,7 @@ void erl_drv_thr_init(void) * either the erl_threads.h or the ethread.h interface. */ +__attribute__((externally_visible)) ErlDrvMutex * erl_drv_mutex_create(char *name) { @@ -178,6 +179,7 @@ erl_drv_mutex_create(char *name) return dmtx; } +__attribute__((externally_visible)) void erl_drv_mutex_destroy(ErlDrvMutex *dmtx) { @@ -192,12 +194,14 @@ erl_drv_mutex_destroy(ErlDrvMutex *dmtx) } +__attribute__((externally_visible)) char * erl_drv_mutex_name(ErlDrvMutex *dmtx) { return dmtx ? dmtx->name : NULL; } +__attribute__((externally_visible)) int erl_drv_mutex_trylock(ErlDrvMutex *dmtx) { @@ -214,6 +218,7 @@ erl_drv_mutex_trylock(ErlDrvMutex *dmtx) return res; } +__attribute__((externally_visible)) void erl_drv_mutex_lock(ErlDrvMutex *dmtx) { @@ -231,6 +236,7 @@ erl_drv_mutex_lock(ErlDrvMutex *dmtx) #endif } +__attribute__((externally_visible)) void erl_drv_mutex_unlock(ErlDrvMutex *dmtx) { @@ -245,6 +251,7 @@ erl_drv_mutex_unlock(ErlDrvMutex *dmtx) ethr_mutex_unlock(&dmtx->mtx); } +__attribute__((externally_visible)) ErlDrvCond * erl_drv_cond_create(char *name) { @@ -268,6 +275,7 @@ erl_drv_cond_create(char *name) return dcnd; } +__attribute__((externally_visible)) void erl_drv_cond_destroy(ErlDrvCond *dcnd) { @@ -277,12 +285,14 @@ erl_drv_cond_destroy(ErlDrvCond *dcnd) erts_free(ERTS_ALC_T_DRV_CND, (void *) dcnd); } +__attribute__((externally_visible)) char * erl_drv_cond_name(ErlDrvCond *dcnd) { return dcnd ? dcnd->name : NULL; } +__attribute__((externally_visible)) void erl_drv_cond_signal(ErlDrvCond *dcnd) { @@ -291,6 +301,7 @@ erl_drv_cond_signal(ErlDrvCond *dcnd) ethr_cond_signal(&dcnd->cnd); } +__attribute__((externally_visible)) void erl_drv_cond_broadcast(ErlDrvCond *dcnd) { @@ -300,6 +311,7 @@ erl_drv_cond_broadcast(ErlDrvCond *dcnd) } +__attribute__((externally_visible)) void erl_drv_cond_wait(ErlDrvCond *dcnd, ErlDrvMutex *dmtx) { @@ -321,6 +333,7 @@ erl_drv_cond_wait(ErlDrvCond *dcnd, ErlD } } +__attribute__((externally_visible)) ErlDrvRWLock * erl_drv_rwlock_create(char *name) { @@ -346,6 +359,7 @@ erl_drv_rwlock_create(char *name) return drwlck; } +__attribute__((externally_visible)) void erl_drv_rwlock_destroy(ErlDrvRWLock *drwlck) { @@ -359,12 +373,14 @@ erl_drv_rwlock_destroy(ErlDrvRWLock *drw erts_free(ERTS_ALC_T_DRV_RWLCK, (void *) drwlck); } +__attribute__((externally_visible)) char * erl_drv_rwlock_name(ErlDrvRWLock *drwlck) { return drwlck ? drwlck->name : NULL; } +__attribute__((externally_visible)) int erl_drv_rwlock_tryrlock(ErlDrvRWLock *drwlck) { @@ -378,6 +394,7 @@ erl_drv_rwlock_tryrlock(ErlDrvRWLock *dr return res; } +__attribute__((externally_visible)) void erl_drv_rwlock_rlock(ErlDrvRWLock *drwlck) { @@ -392,6 +409,7 @@ erl_drv_rwlock_rlock(ErlDrvRWLock *drwlc #endif } +__attribute__((externally_visible)) void erl_drv_rwlock_runlock(ErlDrvRWLock *drwlck) { @@ -403,6 +421,7 @@ erl_drv_rwlock_runlock(ErlDrvRWLock *drw ethr_rwmutex_runlock(&drwlck->rwmtx); } +__attribute__((externally_visible)) int erl_drv_rwlock_tryrwlock(ErlDrvRWLock *drwlck) { @@ -416,6 +435,7 @@ erl_drv_rwlock_tryrwlock(ErlDrvRWLock *d return res; } +__attribute__((externally_visible)) void erl_drv_rwlock_rwlock(ErlDrvRWLock *drwlck) { @@ -430,6 +450,7 @@ erl_drv_rwlock_rwlock(ErlDrvRWLock *drwl #endif } +__attribute__((externally_visible)) void erl_drv_rwlock_rwunlock(ErlDrvRWLock *drwlck) { @@ -441,6 +462,7 @@ erl_drv_rwlock_rwunlock(ErlDrvRWLock *dr ethr_rwmutex_rwunlock(&drwlck->rwmtx); } +__attribute__((externally_visible)) int erl_drv_tsd_key_create(char *name, ErlDrvTSDKey *key) { @@ -513,6 +535,7 @@ erl_drv_tsd_key_create(char *name, ErlDr return res; } +__attribute__((externally_visible)) void erl_drv_tsd_key_destroy(ErlDrvTSDKey key) { @@ -535,6 +558,7 @@ erl_drv_tsd_key_destroy(ErlDrvTSDKey key #define ERL_DRV_TSD__ (dtid->tsd) #define ERL_DRV_TSD_LEN__ (dtid->tsd_len) +__attribute__((externally_visible)) void erl_drv_tsd_set(ErlDrvTSDKey key, void *data) { @@ -563,6 +587,7 @@ erl_drv_tsd_set(ErlDrvTSDKey key, void * ERL_DRV_TSD__[key] = data; } +__attribute__((externally_visible)) void * erl_drv_tsd_get(ErlDrvTSDKey key) { @@ -579,6 +604,7 @@ erl_drv_tsd_get(ErlDrvTSDKey key) #undef ERL_DRV_TSD_LEN__ #undef ERL_DRV_TSD__ +__attribute__((externally_visible)) ErlDrvThreadOpts * erl_drv_thread_opts_create(char *name) { @@ -590,6 +616,7 @@ erl_drv_thread_opts_create(char *name) return opts; } +__attribute__((externally_visible)) void erl_drv_thread_opts_destroy(ErlDrvThreadOpts *opts) { @@ -598,6 +625,7 @@ erl_drv_thread_opts_destroy(ErlDrvThread erts_free(ERTS_ALC_T_DRV_THR_OPTS, opts); } +__attribute__((externally_visible)) int erl_drv_thread_create(char *name, ErlDrvTid *tid, @@ -650,6 +678,7 @@ erl_drv_thread_create(char *name, return 0; } +__attribute__((externally_visible)) char * erl_drv_thread_name(ErlDrvTid tid) { @@ -658,6 +687,7 @@ erl_drv_thread_name(ErlDrvTid tid) } +__attribute__((externally_visible)) ErlDrvTid erl_drv_thread_self(void) { @@ -681,6 +711,7 @@ erl_drv_thread_self(void) return (ErlDrvTid) dtid; } +__attribute__((externally_visible)) int erl_drv_equal_tids(ErlDrvTid tid1, ErlDrvTid tid2) { @@ -699,6 +730,7 @@ erl_drv_equal_tids(ErlDrvTid tid1, ErlDr return res; } +__attribute__((externally_visible)) void erl_drv_thread_exit(void *res) { @@ -710,6 +742,7 @@ erl_drv_thread_exit(void *res) fatal_error(EACCES, "erl_drv_thread_exit()"); } +__attribute__((externally_visible)) int erl_drv_thread_join(ErlDrvTid tid, void **respp) { diff -Ndurp otp_src_26.0.2/erts/emulator/beam/erl_init.c otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_init.c --- otp_src_26.0.2/erts/emulator/beam/erl_init.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_init.c 2023-08-29 22:03:35.598323593 +0300 @@ -2692,6 +2692,7 @@ __decl_noreturn void __noreturn erts_exi } /* Exit without flushing */ +__attribute__((externally_visible)) __decl_noreturn void __noreturn erts_exit(int n, const char *fmt, ...) { va_list args1, args2; @@ -2707,6 +2708,7 @@ __decl_noreturn void __noreturn erts_exi * work properly if called by its own without proper initialization * as made in erts_halt(). */ +__attribute__((externally_visible)) __decl_noreturn void __noreturn erts_flush_exit(int n, char *fmt, ...) { va_list args1, args2; diff -Ndurp otp_src_26.0.2/erts/emulator/beam/erl_nif.c otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_nif.c --- otp_src_26.0.2/erts/emulator/beam/erl_nif.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_nif.c 2023-08-29 22:13:24.817968897 +0300 @@ -601,21 +601,25 @@ static void cache_env(ErlNifEnv* env) } } +__attribute__((externally_visible)) void* enif_priv_data(ErlNifEnv* env) { return env->mod_nif->priv_data; } +__attribute__((externally_visible)) void* enif_alloc(size_t size) { return erts_alloc_fnf(ERTS_ALC_T_NIF, (Uint) size); } +__attribute__((externally_visible)) void* enif_realloc(void* ptr, size_t size) { return erts_realloc_fnf(ERTS_ALC_T_NIF, ptr, size); } +__attribute__((externally_visible)) void enif_free(void* ptr) { erts_free(ERTS_ALC_T_NIF, ptr); @@ -661,6 +665,7 @@ setup_nif_env(struct enif_msg_environmen #endif } +__attribute__((externally_visible)) ErlNifEnv* enif_alloc_env(void) { struct enif_msg_environment_t* msg_env = @@ -668,6 +673,7 @@ ErlNifEnv* enif_alloc_env(void) setup_nif_env(msg_env, NULL, NULL); return &msg_env->env; } +__attribute__((externally_visible)) void enif_free_env(ErlNifEnv* env) { enif_clear_env(env); @@ -692,6 +698,7 @@ static ERTS_INLINE void clear_offheap(Er oh->overhead = 0; } +__attribute__((externally_visible)) void enif_clear_env(ErlNifEnv* env) { struct enif_msg_environment_t* menv = (struct enif_msg_environment_t*)env; @@ -845,6 +852,7 @@ static ERTS_INLINE ERL_NIF_TERM make_cop return copy_struct(src_term, sz, &hp, &MSO(dst_env->proc)); } +__attribute__((externally_visible)) int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid, ErlNifEnv* msg_env, ERL_NIF_TERM msg) { @@ -1074,6 +1082,7 @@ done: return 1; } +__attribute__((externally_visible)) int enif_port_command(ErlNifEnv *env, const ErlNifPort* to_port, ErlNifEnv *msg_env, ERL_NIF_TERM msg) @@ -1148,6 +1157,7 @@ static Eterm call_whereis(ErlNifEnv *env return res; } +__attribute__((externally_visible)) int enif_whereis_pid(ErlNifEnv *env, ERL_NIF_TERM name, ErlNifPid *pid) { Eterm res; @@ -1160,6 +1170,7 @@ int enif_whereis_pid(ErlNifEnv *env, ERL return enif_get_local_pid(env, res, pid); } +__attribute__((externally_visible)) int enif_whereis_port(ErlNifEnv *env, ERL_NIF_TERM name, ErlNifPort *port) { Eterm res; @@ -1172,6 +1183,7 @@ int enif_whereis_port(ErlNifEnv *env, ER return enif_get_local_port(env, res, port); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_copy(ErlNifEnv* dst_env, ERL_NIF_TERM src_term) { return make_copy(dst_env, src_term, NULL); @@ -1184,6 +1196,7 @@ static int is_offheap(const ErlOffHeap* } #endif +__attribute__((externally_visible)) ErlNifPid* enif_self(ErlNifEnv* caller_env, ErlNifPid* pid) { if (caller_env->proc->common.id == ERTS_INVALID_PID) @@ -1192,6 +1205,7 @@ ErlNifPid* enif_self(ErlNifEnv* caller_e return pid; } +__attribute__((externally_visible)) int enif_get_local_pid(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPid* pid) { if (is_internal_pid(term)) { @@ -1201,17 +1215,20 @@ int enif_get_local_pid(ErlNifEnv* env, E return 0; } +__attribute__((externally_visible)) void enif_set_pid_undefined(ErlNifPid* pid) { pid->pid = am_undefined; } +__attribute__((externally_visible)) int enif_is_pid_undefined(const ErlNifPid* pid) { ASSERT(pid->pid == am_undefined || is_internal_pid(pid->pid)); return pid->pid == am_undefined; } +__attribute__((externally_visible)) int enif_get_local_port(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifPort* port) { if (is_internal_port(term)) { @@ -1221,61 +1238,73 @@ int enif_get_local_port(ErlNifEnv* env, return 0; } +__attribute__((externally_visible)) int enif_is_atom(ErlNifEnv* env, ERL_NIF_TERM term) { return is_atom(term); } +__attribute__((externally_visible)) int enif_is_binary(ErlNifEnv* env, ERL_NIF_TERM term) { return is_binary(term) && (binary_bitsize(term) % 8 == 0); } +__attribute__((externally_visible)) int enif_is_empty_list(ErlNifEnv* env, ERL_NIF_TERM term) { return is_nil(term); } +__attribute__((externally_visible)) int enif_is_fun(ErlNifEnv* env, ERL_NIF_TERM term) { return is_any_fun(term); } +__attribute__((externally_visible)) int enif_is_pid(ErlNifEnv* env, ERL_NIF_TERM term) { return is_pid(term); } +__attribute__((externally_visible)) int enif_is_port(ErlNifEnv* env, ERL_NIF_TERM term) { return is_port(term); } +__attribute__((externally_visible)) int enif_is_ref(ErlNifEnv* env, ERL_NIF_TERM term) { return is_ref(term); } +__attribute__((externally_visible)) int enif_is_tuple(ErlNifEnv* env, ERL_NIF_TERM term) { return is_tuple(term); } +__attribute__((externally_visible)) int enif_is_list(ErlNifEnv* env, ERL_NIF_TERM term) { return is_list(term) || is_nil(term); } +__attribute__((externally_visible)) int enif_is_exception(ErlNifEnv* env, ERL_NIF_TERM term) { return env->exception_thrown && term == THE_NON_VALUE; } +__attribute__((externally_visible)) int enif_is_number(ErlNifEnv* env, ERL_NIF_TERM term) { return is_number(term); } +__attribute__((externally_visible)) ErlNifTermType enif_term_type(ErlNifEnv* env, ERL_NIF_TERM term) { (void)env; @@ -1321,6 +1350,7 @@ static void aligned_binary_dtor(struct e erts_free_aligned_binary_bytes_extra((byte*)obj, obj->allocator); } +__attribute__((externally_visible)) int enif_inspect_binary(ErlNifEnv* env, Eterm bin_term, ErlNifBinary* bin) { ErtsAlcType_t allocator = is_proc_bound(env) ? ERTS_ALC_T_TMP : ERTS_ALC_T_NIF; @@ -1356,6 +1386,7 @@ int enif_inspect_binary(ErlNifEnv* env, return 1; } +__attribute__((externally_visible)) int enif_inspect_iolist_as_binary(ErlNifEnv* env, Eterm term, ErlNifBinary* bin) { ErlDrvSizeT sz; @@ -1380,6 +1411,7 @@ int enif_inspect_iolist_as_binary(ErlNif return 1; } +__attribute__((externally_visible)) int enif_alloc_binary(size_t size, ErlNifBinary* bin) { Binary* refbin; @@ -1395,6 +1427,7 @@ int enif_alloc_binary(size_t size, ErlNi return 1; } +__attribute__((externally_visible)) int enif_realloc_binary(ErlNifBinary* bin, size_t size) { if (bin->ref_bin != NULL) { @@ -1420,6 +1453,7 @@ int enif_realloc_binary(ErlNifBinary* bi } +__attribute__((externally_visible)) void enif_release_binary(ErlNifBinary* bin) { if (bin->ref_bin != NULL) { @@ -1432,6 +1466,7 @@ void enif_release_binary(ErlNifBinary* b #endif } +__attribute__((externally_visible)) unsigned char* enif_make_new_binary(ErlNifEnv* env, size_t size, ERL_NIF_TERM* termp) { @@ -1441,6 +1476,7 @@ unsigned char* enif_make_new_binary(ErlN return binary_bytes(*termp); } +__attribute__((externally_visible)) int enif_term_to_binary(ErlNifEnv *dst_env, ERL_NIF_TERM term, ErlNifBinary *bin) { @@ -1473,6 +1509,7 @@ int enif_term_to_binary(ErlNifEnv *dst_e return 1; } +__attribute__((externally_visible)) size_t enif_binary_to_term(ErlNifEnv *dst_env, const unsigned char* data, size_t data_sz, @@ -1513,11 +1550,13 @@ size_t enif_binary_to_term(ErlNifEnv *ds return bp - data; } +__attribute__((externally_visible)) int enif_is_identical(Eterm lhs, Eterm rhs) { return EQ(lhs,rhs); } +__attribute__((externally_visible)) int enif_compare(Eterm lhs, Eterm rhs) { Sint result = CMP(lhs,rhs); @@ -1531,6 +1570,7 @@ int enif_compare(Eterm lhs, Eterm rhs) return result; } +__attribute__((externally_visible)) ErlNifUInt64 enif_hash(ErlNifHash type, Eterm term, ErlNifUInt64 salt) { switch (type) { @@ -1547,6 +1587,7 @@ ErlNifUInt64 enif_hash(ErlNifHash type, } } +__attribute__((externally_visible)) int enif_get_tuple(ErlNifEnv* env, Eterm tpl, int* arity, const Eterm** array) { Eterm* ptr; @@ -1559,6 +1600,7 @@ int enif_get_tuple(ErlNifEnv* env, Eterm return 1; } +__attribute__((externally_visible)) int enif_get_string(ErlNifEnv *env, ERL_NIF_TERM list, char *buf, unsigned len, ErlNifCharEncoding encoding) { @@ -1619,6 +1661,7 @@ int enif_get_string(ErlNifEnv *env, ERL_ return 0; } +__attribute__((externally_visible)) int enif_get_string_length(ErlNifEnv *env, ERL_NIF_TERM list, unsigned *len, ErlNifCharEncoding encoding) { @@ -1659,6 +1702,7 @@ int enif_get_string_length(ErlNifEnv *en return 0; } +__attribute__((externally_visible)) Eterm enif_make_binary(ErlNifEnv* env, ErlNifBinary* bin) { Eterm bin_term; @@ -1708,6 +1752,7 @@ Eterm enif_make_binary(ErlNifEnv* env, E return bin_term; } +__attribute__((externally_visible)) Eterm enif_make_sub_binary(ErlNifEnv* env, ERL_NIF_TERM bin_term, size_t pos, size_t size) { @@ -1736,11 +1781,13 @@ Eterm enif_make_sub_binary(ErlNifEnv* en } +__attribute__((externally_visible)) Eterm enif_make_badarg(ErlNifEnv* env) { return enif_raise_exception(env, am_badarg); } +__attribute__((externally_visible)) Eterm enif_raise_exception(ErlNifEnv* env, ERL_NIF_TERM reason) { env->exception_thrown = 1; @@ -1748,6 +1795,7 @@ Eterm enif_raise_exception(ErlNifEnv* en BIF_ERROR(env->proc, EXC_ERROR); } +__attribute__((externally_visible)) int enif_has_pending_exception(ErlNifEnv* env, ERL_NIF_TERM* reason) { if (env->exception_thrown && reason != NULL) @@ -1755,6 +1803,7 @@ int enif_has_pending_exception(ErlNifEnv return env->exception_thrown; } +__attribute__((externally_visible)) int enif_get_atom(ErlNifEnv* env, Eterm atom, char* buf, unsigned len, ErlNifCharEncoding encoding) { @@ -1788,6 +1837,7 @@ int enif_get_atom(ErlNifEnv* env, Eterm return 0; } +__attribute__((externally_visible)) int enif_get_int(ErlNifEnv* env, Eterm term, int* ip) { #if SIZEOF_INT == ERTS_SIZEOF_ETERM @@ -1805,6 +1855,7 @@ int enif_get_int(ErlNifEnv* env, Eterm t #endif } +__attribute__((externally_visible)) int enif_get_uint(ErlNifEnv* env, Eterm term, unsigned* ip) { #if SIZEOF_INT == ERTS_SIZEOF_ETERM @@ -1820,6 +1871,7 @@ int enif_get_uint(ErlNifEnv* env, Eterm #endif } +__attribute__((externally_visible)) int enif_get_long(ErlNifEnv* env, Eterm term, long* ip) { #if SIZEOF_LONG == ERTS_SIZEOF_ETERM @@ -1838,6 +1890,7 @@ int enif_get_long(ErlNifEnv* env, Eterm #endif } +__attribute__((externally_visible)) int enif_get_ulong(ErlNifEnv* env, Eterm term, unsigned long* ip) { #if SIZEOF_LONG == ERTS_SIZEOF_ETERM @@ -1858,17 +1911,20 @@ int enif_get_ulong(ErlNifEnv* env, Eterm } #if HAVE_INT64 && SIZEOF_LONG != 8 +__attribute__((externally_visible)) int enif_get_int64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifSInt64* ip) { return term_to_Sint64(term, ip); } +__attribute__((externally_visible)) int enif_get_uint64(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifUInt64* ip) { return term_to_Uint64(term, ip); } #endif /* HAVE_INT64 && SIZEOF_LONG != 8 */ +__attribute__((externally_visible)) int enif_get_double(ErlNifEnv* env, ERL_NIF_TERM term, double* dp) { FloatDef f; @@ -1880,6 +1936,7 @@ int enif_get_double(ErlNifEnv* env, ERL_ return 1; } +__attribute__((externally_visible)) int enif_get_atom_length(ErlNifEnv* env, Eterm atom, unsigned* len, ErlNifCharEncoding encoding) { @@ -1901,6 +1958,7 @@ int enif_get_atom_length(ErlNifEnv* env, return 0; } +__attribute__((externally_visible)) int enif_get_list_cell(ErlNifEnv* env, Eterm term, Eterm* head, Eterm* tail) { Eterm* val; @@ -1911,6 +1969,7 @@ int enif_get_list_cell(ErlNifEnv* env, E return 1; } +__attribute__((externally_visible)) int enif_get_list_length(ErlNifEnv* env, Eterm term, unsigned* len) { Sint i; @@ -1923,6 +1982,7 @@ int enif_get_list_length(ErlNifEnv* env, return 1; } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_int(ErlNifEnv* env, int i) { #if SIZEOF_INT == ERTS_SIZEOF_ETERM @@ -1933,6 +1993,7 @@ ERL_NIF_TERM enif_make_int(ErlNifEnv* en #endif } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_uint(ErlNifEnv* env, unsigned i) { #if SIZEOF_INT == ERTS_SIZEOF_ETERM @@ -1943,6 +2004,7 @@ ERL_NIF_TERM enif_make_uint(ErlNifEnv* e #endif } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_long(ErlNifEnv* env, long i) { #if SIZEOF_LONG < ERTS_SIZEOF_ETERM @@ -1962,6 +2024,7 @@ ERL_NIF_TERM enif_make_long(ErlNifEnv* e #endif } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_ulong(ErlNifEnv* env, unsigned long i) { if (IS_USMALL(0,i)) { @@ -1978,6 +2041,7 @@ ERL_NIF_TERM enif_make_ulong(ErlNifEnv* } #if HAVE_INT64 && SIZEOF_LONG != 8 +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_int64(ErlNifEnv* env, ErlNifSInt64 i) { Uint* hp; @@ -1987,6 +2051,7 @@ ERL_NIF_TERM enif_make_int64(ErlNifEnv* return erts_bld_sint64(&hp, NULL, i); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_uint64(ErlNifEnv* env, ErlNifUInt64 i) { Uint* hp; @@ -1997,6 +2062,7 @@ ERL_NIF_TERM enif_make_uint64(ErlNifEnv* } #endif /* HAVE_INT64 && SIZEOF_LONG != 8 */ +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_double(ErlNifEnv* env, double d) { Eterm* hp; @@ -2010,11 +2076,13 @@ ERL_NIF_TERM enif_make_double(ErlNifEnv* return make_float(hp); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_atom(ErlNifEnv *env, const char *name) { return enif_make_atom_len(env, name, sys_strlen(name)); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_atom_len(ErlNifEnv *env, const char *name, size_t len) { ERL_NIF_TERM atom = THE_NON_VALUE; @@ -2024,12 +2092,14 @@ ERL_NIF_TERM enif_make_atom_len(ErlNifEn return atom; } +__attribute__((externally_visible)) int enif_make_new_atom(ErlNifEnv *env, const char *name, ERL_NIF_TERM *atom, ErlNifCharEncoding encoding) { return enif_make_new_atom_len(env, name, sys_strlen(name), atom, encoding); } +__attribute__((externally_visible)) int enif_make_new_atom_len(ErlNifEnv *env, const char *name, size_t len, ERL_NIF_TERM *atom, ErlNifCharEncoding encoding) { @@ -2046,12 +2116,14 @@ int enif_make_new_atom_len(ErlNifEnv *en return 1; } +__attribute__((externally_visible)) int enif_make_existing_atom(ErlNifEnv *env, const char *name, ERL_NIF_TERM *atom, ErlNifCharEncoding encoding) { return enif_make_existing_atom_len(env, name, sys_strlen(name), atom, encoding); } +__attribute__((externally_visible)) int enif_make_existing_atom_len(ErlNifEnv *env, const char *name, size_t len, ERL_NIF_TERM *atom, ErlNifCharEncoding encoding) { @@ -2068,6 +2140,7 @@ int enif_make_existing_atom_len(ErlNifEn return 0; } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_tuple(ErlNifEnv* env, unsigned cnt, ...) { if (cnt == 0) { @@ -2092,6 +2165,7 @@ ERL_NIF_TERM enif_make_tuple(ErlNifEnv* } } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_tuple_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt) { if (cnt == 0) { @@ -2113,6 +2187,7 @@ ERL_NIF_TERM enif_make_tuple_from_array( } } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_list_cell(ErlNifEnv* env, Eterm car, Eterm cdr) { Eterm* hp = alloc_heap(env,2); @@ -2125,6 +2200,7 @@ ERL_NIF_TERM enif_make_list_cell(ErlNifE return ret; } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_list(ErlNifEnv* env, unsigned cnt, ...) { if (cnt == 0) { @@ -2154,6 +2230,7 @@ ERL_NIF_TERM enif_make_list(ErlNifEnv* e } } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_list_from_array(ErlNifEnv* env, const ERL_NIF_TERM arr[], unsigned cnt) { #ifdef ERTS_NIF_ASSERT_IN_ENV @@ -2176,12 +2253,14 @@ ERL_NIF_TERM enif_make_list_from_array(E return ret; } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_string(ErlNifEnv *env, const char *string, ErlNifCharEncoding encoding) { return enif_make_string_len(env, string, sys_strlen(string), encoding); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_string_len(ErlNifEnv *env, const char *string, size_t len, ErlNifCharEncoding encoding) { @@ -2204,17 +2283,20 @@ ERL_NIF_TERM enif_make_string_len(ErlNif return enif_make_badarg(env); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_ref(ErlNifEnv* env) { Eterm* hp = alloc_heap(env, ERTS_REF_THING_SIZE); return erts_make_ref_in_buffer(hp); } +__attribute__((externally_visible)) void enif_system_info(ErlNifSysInfo *sip, size_t si_size) { driver_system_info(sip, si_size); } +__attribute__((externally_visible)) int enif_make_reverse_list(ErlNifEnv* env, ERL_NIF_TERM term, ERL_NIF_TERM *list) { Eterm *listptr, ret, *hp; @@ -2234,6 +2316,7 @@ int enif_make_reverse_list(ErlNifEnv* en return 1; } +__attribute__((externally_visible)) int enif_is_current_process_alive(ErlNifEnv* env) { Process *c_p; @@ -2253,6 +2336,7 @@ int enif_is_current_process_alive(ErlNif return !ERTS_PROC_IS_EXITING(c_p); } +__attribute__((externally_visible)) int enif_is_process_alive(ErlNifEnv* env, ErlNifPid *proc) { int scheduler; @@ -2270,6 +2354,7 @@ int enif_is_process_alive(ErlNifEnv* env } } +__attribute__((externally_visible)) int enif_is_port_alive(ErlNifEnv *env, ErlNifPort *port) { int scheduler; @@ -2289,6 +2374,7 @@ int enif_is_port_alive(ErlNifEnv *env, E } } +__attribute__((externally_visible)) ERL_NIF_TERM enif_now_time(ErlNifEnv *env) { @@ -2299,6 +2385,7 @@ enif_now_time(ErlNifEnv *env) return TUPLE3(hp, make_small(mega), make_small(sec), make_small(micro)); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_cpu_time(ErlNifEnv *env) { @@ -2313,6 +2400,7 @@ enif_cpu_time(ErlNifEnv *env) #endif } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_unique_integer(ErlNifEnv *env, ErlNifUniqueInteger properties) { @@ -2335,56 +2423,93 @@ enif_make_unique_integer(ErlNifEnv *env, } } +__attribute__((externally_visible)) ErlNifMutex* enif_mutex_create(char *name) { return erl_drv_mutex_create(name); } +__attribute__((externally_visible)) void enif_mutex_destroy(ErlNifMutex *mtx) { erl_drv_mutex_destroy(mtx); } +__attribute__((externally_visible)) int enif_mutex_trylock(ErlNifMutex *mtx) { return erl_drv_mutex_trylock(mtx); } +__attribute__((externally_visible)) void enif_mutex_lock(ErlNifMutex *mtx) { erl_drv_mutex_lock(mtx); } +__attribute__((externally_visible)) void enif_mutex_unlock(ErlNifMutex *mtx) { erl_drv_mutex_unlock(mtx); } +__attribute__((externally_visible)) ErlNifCond* enif_cond_create(char *name) { return erl_drv_cond_create(name); } +__attribute__((externally_visible)) void enif_cond_destroy(ErlNifCond *cnd) { erl_drv_cond_destroy(cnd); } +__attribute__((externally_visible)) void enif_cond_signal(ErlNifCond *cnd) { erl_drv_cond_signal(cnd); } +__attribute__((externally_visible)) void enif_cond_broadcast(ErlNifCond *cnd) { erl_drv_cond_broadcast(cnd); } +__attribute__((externally_visible)) void enif_cond_wait(ErlNifCond *cnd, ErlNifMutex *mtx) { erl_drv_cond_wait(cnd,mtx); } +__attribute__((externally_visible)) ErlNifRWLock* enif_rwlock_create(char *name) { return erl_drv_rwlock_create(name); } +__attribute__((externally_visible)) void enif_rwlock_destroy(ErlNifRWLock *rwlck) { erl_drv_rwlock_destroy(rwlck); } +__attribute__((externally_visible)) int enif_rwlock_tryrlock(ErlNifRWLock *rwlck) { return erl_drv_rwlock_tryrlock(rwlck); } +__attribute__((externally_visible)) void enif_rwlock_rlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rlock(rwlck); } +__attribute__((externally_visible)) void enif_rwlock_runlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_runlock(rwlck); } +__attribute__((externally_visible)) int enif_rwlock_tryrwlock(ErlNifRWLock *rwlck) { return erl_drv_rwlock_tryrwlock(rwlck); } +__attribute__((externally_visible)) void enif_rwlock_rwlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rwlock(rwlck); } +__attribute__((externally_visible)) void enif_rwlock_rwunlock(ErlNifRWLock *rwlck) { erl_drv_rwlock_rwunlock(rwlck); } +__attribute__((externally_visible)) int enif_tsd_key_create(char *name, ErlNifTSDKey *key) { return erl_drv_tsd_key_create(name,key); } +__attribute__((externally_visible)) void enif_tsd_key_destroy(ErlNifTSDKey key) { erl_drv_tsd_key_destroy(key); } +__attribute__((externally_visible)) void enif_tsd_set(ErlNifTSDKey key, void *data) { erl_drv_tsd_set(key,data); } +__attribute__((externally_visible)) void* enif_tsd_get(ErlNifTSDKey key) { return erl_drv_tsd_get(key); } +__attribute__((externally_visible)) ErlNifThreadOpts* enif_thread_opts_create(char *name) { return (ErlNifThreadOpts*) erl_drv_thread_opts_create(name); } +__attribute__((externally_visible)) void enif_thread_opts_destroy(ErlNifThreadOpts *opts) { erl_drv_thread_opts_destroy((ErlDrvThreadOpts*)opts); } +__attribute__((externally_visible)) int enif_thread_create(char *name, ErlNifTid *tid, void* (*func)(void *), void *args, ErlNifThreadOpts *opts) { return erl_drv_thread_create(name,tid,func,args,(ErlDrvThreadOpts*)opts); } +__attribute__((externally_visible)) ErlNifTid enif_thread_self(void) { return erl_drv_thread_self(); } +__attribute__((externally_visible)) int enif_equal_tids(ErlNifTid tid1, ErlNifTid tid2) { return erl_drv_equal_tids(tid1,tid2); } +__attribute__((externally_visible)) void enif_thread_exit(void *resp) { erl_drv_thread_exit(resp); } +__attribute__((externally_visible)) int enif_thread_join(ErlNifTid tid, void **respp) { return erl_drv_thread_join(tid,respp); } +__attribute__((externally_visible)) char* enif_mutex_name(ErlNifMutex *mtx) {return erl_drv_mutex_name(mtx); } +__attribute__((externally_visible)) char* enif_cond_name(ErlNifCond *cnd) { return erl_drv_cond_name(cnd); } +__attribute__((externally_visible)) char* enif_rwlock_name(ErlNifRWLock* rwlck) { return erl_drv_rwlock_name(rwlck); } +__attribute__((externally_visible)) char* enif_thread_name(ErlNifTid tid) { return erl_drv_thread_name(tid); } +__attribute__((externally_visible)) int enif_getenv(const char *key, char *value, size_t *value_size) { return erl_drv_getenv(key, value, value_size); } +__attribute__((externally_visible)) ErlNifTime enif_monotonic_time(ErlNifTimeUnit time_unit) { return (ErlNifTime) erts_napi_monotonic_time((int) time_unit); } +__attribute__((externally_visible)) ErlNifTime enif_time_offset(ErlNifTimeUnit time_unit) { return (ErlNifTime) erts_napi_time_offset((int) time_unit); } +__attribute__((externally_visible)) ErlNifTime enif_convert_time_unit(ErlNifTime val, ErlNifTimeUnit from, @@ -2395,6 +2520,7 @@ enif_convert_time_unit(ErlNifTime val, (int) to); } +__attribute__((externally_visible)) int enif_fprintf(FILE* filep, const char* format, ...) { int ret; @@ -2405,11 +2531,13 @@ int enif_fprintf(FILE* filep, const char return ret; } +__attribute__((externally_visible)) int enif_vfprintf(FILE* filep, const char *format, va_list ap) { return erts_vfprintf(filep, format, ap); } +__attribute__((externally_visible)) int enif_snprintf(char *buffer, size_t size, const char* format, ...) { int ret; @@ -2420,6 +2548,7 @@ int enif_snprintf(char *buffer, size_t s return ret; } +__attribute__((externally_visible)) int enif_vsnprintf(char* buffer, size_t size, const char *format, va_list ap) { return erts_vsnprintf(buffer, size, format, ap); @@ -2646,6 +2775,7 @@ done: return type; } +__attribute__((externally_visible)) ErlNifResourceType* enif_open_resource_type(ErlNifEnv* env, const char* module_str, @@ -2659,6 +2789,7 @@ enif_open_resource_type(ErlNifEnv* env, return open_resource_type(env, name_str, &init, flags, tried, 1); } +__attribute__((externally_visible)) ErlNifResourceType* enif_open_resource_type_x(ErlNifEnv* env, const char* name_str, @@ -2669,6 +2800,7 @@ enif_open_resource_type_x(ErlNifEnv* env return open_resource_type(env, name_str, init, flags, tried, 3); } +__attribute__((externally_visible)) ErlNifResourceType* enif_init_resource_type(ErlNifEnv* env, const char* name_str, @@ -2991,6 +3123,7 @@ void erts_fire_nif_monitor(ErtsMonitor * } } +__attribute__((externally_visible)) void* enif_alloc_resource(ErlNifResourceType* type, size_t data_sz) { size_t magic_sz = offsetof(ErtsResource,data); @@ -3034,6 +3167,7 @@ void* enif_alloc_resource(ErlNifResource return resource->data; } +__attribute__((externally_visible)) void enif_release_resource(void* obj) { ErtsResource* resource = DATA_TO_RESOURCE(obj); @@ -3047,6 +3181,7 @@ void enif_release_resource(void* obj) erts_bin_release(&bin->binary); } +__attribute__((externally_visible)) void enif_keep_resource(void* obj) { ErtsResource* resource = DATA_TO_RESOURCE(obj); @@ -3067,6 +3202,7 @@ Eterm erts_bld_resource_ref(Eterm** hpp, return erts_mk_magic_ref(hpp, oh, &bin->binary); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_resource(ErlNifEnv* env, void* obj) { ErtsResource* resource = DATA_TO_RESOURCE(obj); @@ -3076,6 +3212,7 @@ ERL_NIF_TERM enif_make_resource(ErlNifEn return erts_mk_magic_ref(&hp, &MSO(env->proc), &bin->binary); } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_resource_binary(ErlNifEnv* env, void* obj, const void* data, size_t size) { @@ -3099,6 +3236,7 @@ ERL_NIF_TERM enif_make_resource_binary(E return make_binary(hp); } +__attribute__((externally_visible)) int enif_get_resource(ErlNifEnv* env, ERL_NIF_TERM term, ErlNifResourceType* type, void** objp) { @@ -3131,6 +3269,7 @@ int enif_get_resource(ErlNifEnv* env, ER return 1; } +__attribute__((externally_visible)) size_t enif_sizeof_resource(void* obj) { ErtsResource* resource = DATA_TO_RESOURCE(obj); @@ -3143,6 +3282,7 @@ size_t enif_sizeof_resource(void* obj) } } +__attribute__((externally_visible)) int enif_dynamic_resource_call(ErlNifEnv* caller_env, ERL_NIF_TERM rt_module_atom, ERL_NIF_TERM rt_name_atom, @@ -3172,6 +3312,7 @@ int enif_dynamic_resource_call(ErlNifEnv } +__attribute__((externally_visible)) void* enif_dlopen(const char* lib, void (*err_handler)(void*,const char*), void* err_arg) { @@ -3193,6 +3334,7 @@ void* enif_dlopen(const char* lib, return handle; } +__attribute__((externally_visible)) void* enif_dlsym(void* handle, const char* symbol, void (*err_handler)(void*,const char*), void* err_arg) { @@ -3208,6 +3350,7 @@ void* enif_dlsym(void* handle, const cha return ret; } +__attribute__((externally_visible)) int enif_consume_timeslice(ErlNifEnv* env, int percent) { Process *proc; @@ -3406,6 +3549,7 @@ execute_nif(ErlNifEnv* env, int argc, co return result; } +__attribute__((externally_visible)) ERL_NIF_TERM enif_schedule_nif(ErlNifEnv* env, const char* fun_name, int flags, ERL_NIF_TERM (*fp)(ErlNifEnv*, int, const ERL_NIF_TERM[]), @@ -3452,6 +3596,7 @@ enif_schedule_nif(ErlNifEnv* env, const return result; } +__attribute__((externally_visible)) int enif_thread_type(void) { @@ -3475,11 +3620,13 @@ enif_thread_type(void) /* Maps */ +__attribute__((externally_visible)) int enif_is_map(ErlNifEnv* env, ERL_NIF_TERM term) { return is_map(term); } +__attribute__((externally_visible)) int enif_get_map_size(ErlNifEnv* env, ERL_NIF_TERM term, size_t *size) { if (is_flatmap(term)) { @@ -3495,6 +3642,7 @@ int enif_get_map_size(ErlNifEnv* env, ER return 0; } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_new_map(ErlNifEnv* env) { Eterm* hp = alloc_heap(env,MAP_HEADER_FLATMAP_SZ); @@ -3510,6 +3658,7 @@ ERL_NIF_TERM enif_make_new_map(ErlNifEnv return make_flatmap(mp); } +__attribute__((externally_visible)) int enif_make_map_from_arrays(ErlNifEnv *env, ERL_NIF_TERM keys[], ERL_NIF_TERM values[], @@ -3548,6 +3697,7 @@ int enif_make_map_from_arrays(ErlNifEnv return succeeded; } +__attribute__((externally_visible)) int enif_make_map_put(ErlNifEnv* env, Eterm map_in, Eterm key, @@ -3567,6 +3717,7 @@ int enif_make_map_put(ErlNifEnv* env, return 1; } +__attribute__((externally_visible)) int enif_get_map_value(ErlNifEnv* env, Eterm map, Eterm key, @@ -3584,6 +3735,7 @@ int enif_get_map_value(ErlNifEnv* env, return 0; } +__attribute__((externally_visible)) int enif_make_map_update(ErlNifEnv* env, Eterm map_in, Eterm key, @@ -3605,6 +3757,7 @@ int enif_make_map_update(ErlNifEnv* env, return res; } +__attribute__((externally_visible)) int enif_make_map_remove(ErlNifEnv* env, Eterm map_in, Eterm key, @@ -3619,6 +3772,7 @@ int enif_make_map_remove(ErlNifEnv* env, return 1; } +__attribute__((externally_visible)) int enif_map_iterator_create(ErlNifEnv *env, Eterm map, ErlNifMapIterator *iter, @@ -3677,6 +3831,7 @@ error: return 0; } +__attribute__((externally_visible)) void enif_map_iterator_destroy(ErlNifEnv *env, ErlNifMapIterator *iter) { if (is_hashmap(iter->map)) { @@ -3691,6 +3846,7 @@ void enif_map_iterator_destroy(ErlNifEnv #endif } +__attribute__((externally_visible)) int enif_map_iterator_is_tail(ErlNifEnv *env, ErlNifMapIterator *iter) { ASSERT(iter); @@ -3705,6 +3861,7 @@ int enif_map_iterator_is_tail(ErlNifEnv } } +__attribute__((externally_visible)) int enif_map_iterator_is_head(ErlNifEnv *env, ErlNifMapIterator *iter) { ASSERT(iter); @@ -3720,6 +3877,7 @@ int enif_map_iterator_is_head(ErlNifEnv } +__attribute__((externally_visible)) int enif_map_iterator_next(ErlNifEnv *env, ErlNifMapIterator *iter) { ASSERT(iter); @@ -3746,6 +3904,7 @@ int enif_map_iterator_next(ErlNifEnv *en } } +__attribute__((externally_visible)) int enif_map_iterator_prev(ErlNifEnv *env, ErlNifMapIterator *iter) { ASSERT(iter); @@ -3772,6 +3931,7 @@ int enif_map_iterator_prev(ErlNifEnv *en } } +__attribute__((externally_visible)) int enif_map_iterator_get_pair(ErlNifEnv *env, ErlNifMapIterator *iter, Eterm *key, @@ -3800,6 +3960,7 @@ int enif_map_iterator_get_pair(ErlNifEnv return 0; } +__attribute__((externally_visible)) int enif_monitor_process(ErlNifEnv* env, void* obj, const ErlNifPid* target_pid, ErlNifMonitor* monitor) { @@ -3859,12 +4020,14 @@ int enif_monitor_process(ErlNifEnv* env, return 0; } +__attribute__((externally_visible)) ERL_NIF_TERM enif_make_monitor_term(ErlNifEnv* env, const ErlNifMonitor* monitor) { Eterm* hp = alloc_heap(env, ERTS_REF_THING_SIZE); return erts_driver_monitor_to_ref(hp, monitor); } +__attribute__((externally_visible)) int enif_demonitor_process(ErlNifEnv* env, void* obj, const ErlNifMonitor* monitor) { ErtsResource* rsrc = DATA_TO_RESOURCE(obj); @@ -3900,6 +4063,7 @@ int enif_demonitor_process(ErlNifEnv* en return 0; } +__attribute__((externally_visible)) int enif_compare_monitors(const ErlNifMonitor *monitor1, const ErlNifMonitor *monitor2) { @@ -3907,6 +4071,7 @@ int enif_compare_monitors(const ErlNifMo ERTS_REF_THING_SIZE*sizeof(Eterm)); } +__attribute__((externally_visible)) ErlNifIOQueue *enif_ioq_create(ErlNifIOQueueOpts opts) { ErlNifIOQueue *q; @@ -3921,6 +4086,7 @@ ErlNifIOQueue *enif_ioq_create(ErlNifIOQ return q; } +__attribute__((externally_visible)) void enif_ioq_destroy(ErlNifIOQueue *q) { erts_ioq_clear(q); @@ -3931,6 +4097,7 @@ void enif_ioq_destroy(ErlNifIOQueue *q) * such to perform a proper free. */ #define ERL_NIF_IOVEC_FLAGS_PREALLOC (1 << 0) +__attribute__((externally_visible)) void enif_free_iovec(ErlNifIOVec *iov) { int i; @@ -4220,6 +4387,7 @@ static int create_iovec_from_slice(ErlNi return 1; } +__attribute__((externally_visible)) int enif_inspect_iovec(ErlNifEnv *env, size_t max_elements, ERL_NIF_TERM list, ERL_NIF_TERM *tail, ErlNifIOVec **iov) { @@ -4237,6 +4405,7 @@ int enif_inspect_iovec(ErlNifEnv *env, s } /* */ +__attribute__((externally_visible)) int enif_ioq_enqv(ErlNifIOQueue *q, ErlNifIOVec *iov, size_t skip) { if(skip <= iov->size) { @@ -4246,6 +4415,7 @@ int enif_ioq_enqv(ErlNifIOQueue *q, ErlN return 0; } +__attribute__((externally_visible)) int enif_ioq_enq_binary(ErlNifIOQueue *q, ErlNifBinary *bin, size_t skip) { ErlNifIOVec vec = {1, bin->size, NULL, NULL, ERL_NIF_IOVEC_FLAGS_PREALLOC }; @@ -4262,11 +4432,13 @@ int enif_ioq_enq_binary(ErlNifIOQueue *q return res; } +__attribute__((externally_visible)) size_t enif_ioq_size(ErlNifIOQueue *q) { return erts_ioq_size(q); } +__attribute__((externally_visible)) int enif_ioq_deq(ErlNifIOQueue *q, size_t elems, size_t *size) { if (erts_ioq_deq(q, elems) == -1) @@ -4276,6 +4448,7 @@ int enif_ioq_deq(ErlNifIOQueue *q, size_ return 1; } +__attribute__((externally_visible)) int enif_ioq_peek_head(ErlNifEnv *env, ErlNifIOQueue *q, size_t *size, ERL_NIF_TERM *bin_term) { SysIOVec *iov_entry; Binary *ref_bin; @@ -4325,6 +4498,7 @@ int enif_ioq_peek_head(ErlNifEnv *env, E return 1; } +__attribute__((externally_visible)) SysIOVec *enif_ioq_peek(ErlNifIOQueue *q, int *iovlen) { return erts_ioq_peekq(q, iovlen); diff -Ndurp otp_src_26.0.2/erts/emulator/beam/erl_port_task.c otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_port_task.c --- otp_src_26.0.2/erts/emulator/beam/erl_port_task.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_port_task.c 2023-08-29 22:01:13.097328403 +0300 @@ -761,6 +761,7 @@ enqueue_proc2port_data(Port *pp, * as a write-read request. */ +__attribute__((externally_visible)) void erl_drv_busy_msgq_limits(ErlDrvPort dport, ErlDrvSizeT *lowp, ErlDrvSizeT *highp) { @@ -1269,6 +1270,7 @@ select_task_for_exec(Port *pp, * Cut time slice */ +__attribute__((externally_visible)) int erl_drv_consume_timeslice(ErlDrvPort dprt, int percent) { diff -Ndurp otp_src_26.0.2/erts/emulator/beam/erl_posix_str.c otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_posix_str.c --- otp_src_26.0.2/erts/emulator/beam/erl_posix_str.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/beam/erl_posix_str.c 2023-08-29 22:01:13.097328403 +0300 @@ -46,6 +46,7 @@ *---------------------------------------------------------------------- */ +__attribute__((externally_visible)) char * erl_errno_id(int error /* Posix error number (as from errno). */) { diff -Ndurp otp_src_26.0.2/erts/emulator/beam/io.c otp_src_26.0.2-erts-symbols/erts/emulator/beam/io.c --- otp_src_26.0.2/erts/emulator/beam/io.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/beam/io.c 2023-08-29 22:01:13.097328403 +0300 @@ -73,6 +73,7 @@ static erts_tsd_key_t driver_list_last_e ErtsPTab erts_port erts_align_attribute(ERTS_CACHE_LINE_SIZE); /* The port table */ +__attribute__((externally_visible)) const ErlDrvTermData driver_term_nil = (ErlDrvTermData)NIL; const Port erts_invalid_port = {{ERTS_INVALID_PORT}}; @@ -188,6 +189,7 @@ typedef struct line_buf_context { dtrace_proc_str((PID), process_str); \ dtrace_port_str((PORT), port_str); +__attribute__((externally_visible)) void dtrace_drvport_str(ErlDrvPort drvport, char *port_buf) { @@ -759,6 +761,7 @@ ERTS_SCHED_PREF_QUICK_ALLOC_IMPL(xports_ * Historical reason: to be used with inet_drv for creating * accept sockets inorder to avoid a global table. */ +__attribute__((externally_visible)) ErlDrvPort driver_create_port(ErlDrvPort creator_port_ix, /* Creating port */ ErlDrvTermData pid, /* Owner/Caller */ @@ -5180,6 +5183,7 @@ print_port_info(Port *p, fmtfn_t to, voi } } +__attribute__((externally_visible)) void set_busy_port(ErlDrvPort dprt, int on) { @@ -5290,6 +5294,7 @@ erts_port_resume_procs(Port *prt) } } +__attribute__((externally_visible)) void set_port_control_flags(ErlDrvPort port_num, int flags) { Port *prt = erts_drvport2port(port_num); @@ -5297,6 +5302,7 @@ void set_port_control_flags(ErlDrvPort p prt->control_flags = flags; } +__attribute__((externally_visible)) int get_port_flags(ErlDrvPort ix) { int flags; @@ -5497,6 +5503,7 @@ erts_free_port_names(ErtsPortNames *pnp) erts_free(ERTS_ALC_T_PORT_NAMES, pnp); } +__attribute__((externally_visible)) ErlDrvTermData driver_mk_term_nil(void) { return driver_term_nil; @@ -6228,6 +6235,7 @@ done: return res; } +__attribute__((externally_visible)) int erl_drv_output_term(ErlDrvTermData port_id, ErlDrvTermData* data, int len) { /* May be called from arbitrary thread */ @@ -6244,6 +6252,7 @@ int erl_drv_output_term(ErlDrvTermData p * removal in OTP-R17. It is replaced by erl_drv_output_term() * above. */ +__attribute__((externally_visible)) int driver_output_term(ErlDrvPort drvport, ErlDrvTermData* data, int len) { @@ -6263,6 +6272,7 @@ driver_output_term(ErlDrvPort drvport, E return driver_deliver_term(prt, ERTS_PORT_GET_CONNECTED(prt), data, len); } +__attribute__((externally_visible)) int erl_drv_send_term(ErlDrvTermData port_id, ErlDrvTermData to, ErlDrvTermData* data, @@ -6280,6 +6290,7 @@ int erl_drv_send_term(ErlDrvTermData por * driver_send_term() is deprecated, and has been scheduled for * removal in OTP-R17. It is replaced by erl_drv_send_term() above. */ +__attribute__((externally_visible)) int driver_send_term(ErlDrvPort drvport, ErlDrvTermData to, @@ -6313,6 +6324,7 @@ driver_send_term(ErlDrvPort drvport, * and data is len length of bin starting from offset offs. */ +__attribute__((externally_visible)) int driver_output_binary(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen, ErlDrvBinary* bin, ErlDrvSizeT offs, ErlDrvSizeT len) { @@ -6357,6 +6369,7 @@ int driver_output_binary(ErlDrvPort ix, ** Example: if hlen = 3 then the port owner will receive the data ** [H1,H2,H3 | T] */ +__attribute__((externally_visible)) int driver_output2(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen, char* buf, ErlDrvSizeT len) { @@ -6408,12 +6421,14 @@ int driver_output2(ErlDrvPort ix, char* /* Interface functions available to driver writers */ +__attribute__((externally_visible)) int driver_output(ErlDrvPort ix, char* buf, ErlDrvSizeT len) { ERTS_CHK_NO_PROC_LOCKS; return driver_output2(ix, NULL, 0, buf, len); } +__attribute__((externally_visible)) int driver_outputv(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen, ErlIOVec* vec, ErlDrvSizeT skip) { @@ -6476,6 +6491,7 @@ int driver_outputv(ErlDrvPort ix, char* ** input is a vector a buffer and a max length ** return bytes copied */ +__attribute__((externally_visible)) ErlDrvSizeT driver_vec_to_buf(ErlIOVec *vec, char *buf, ErlDrvSizeT len) { SysIOVec* iov = vec->iov; @@ -6502,6 +6518,7 @@ ErlDrvSizeT driver_vec_to_buf(ErlIOVec * * reference count on driver binaries... */ +__attribute__((externally_visible)) ErlDrvSInt driver_binary_get_refc(ErlDrvBinary *dbp) { @@ -6509,6 +6526,7 @@ driver_binary_get_refc(ErlDrvBinary *dbp return (ErlDrvSInt) erts_refc_read(&bp->intern.refc, 1); } +__attribute__((externally_visible)) ErlDrvSInt driver_binary_inc_refc(ErlDrvBinary *dbp) { @@ -6516,6 +6534,7 @@ driver_binary_inc_refc(ErlDrvBinary *dbp return (ErlDrvSInt) erts_refc_inctest(&bp->intern.refc, 2); } +__attribute__((externally_visible)) ErlDrvSInt driver_binary_dec_refc(ErlDrvBinary *dbp) { @@ -6528,6 +6547,7 @@ driver_binary_dec_refc(ErlDrvBinary *dbp ** Allocation/Deallocation of binary objects */ +__attribute__((externally_visible)) ErlDrvBinary* driver_alloc_binary(ErlDrvSizeT size) { @@ -6541,6 +6561,7 @@ driver_alloc_binary(ErlDrvSizeT size) /* Reallocate space held by binary */ +__attribute__((externally_visible)) ErlDrvBinary* driver_realloc_binary(ErlDrvBinary* bin, ErlDrvSizeT size) { Binary* oldbin; @@ -6558,6 +6579,7 @@ ErlDrvBinary* driver_realloc_binary(ErlD } +__attribute__((externally_visible)) void driver_free_binary(ErlDrvBinary* dbin) { Binary *bin; @@ -6573,16 +6595,19 @@ void driver_free_binary(ErlDrvBinary* db * Allocation/deallocation of memory for drivers */ +__attribute__((externally_visible)) void *driver_alloc(ErlDrvSizeT size) { return erts_alloc_fnf(ERTS_ALC_T_DRV, (Uint) size); } +__attribute__((externally_visible)) void *driver_realloc(void *ptr, ErlDrvSizeT size) { return erts_realloc_fnf(ERTS_ALC_T_DRV, ptr, (Uint) size); } +__attribute__((externally_visible)) void driver_free(void *ptr) { erts_free(ERTS_ALC_T_DRV, ptr); @@ -6679,6 +6704,7 @@ static void driver_monitor_unlock_pdl(Po * exported driver_pdl_* functions ... */ +__attribute__((externally_visible)) ErlDrvPDL driver_pdl_create(ErlDrvPort dp) { @@ -6699,6 +6725,7 @@ driver_pdl_create(ErlDrvPort dp) return pdl; } +__attribute__((externally_visible)) void driver_pdl_lock(ErlDrvPDL pdl) { @@ -6709,6 +6736,7 @@ driver_pdl_lock(ErlDrvPDL pdl) erts_mtx_lock(&pdl->mtx); } +__attribute__((externally_visible)) void driver_pdl_unlock(ErlDrvPDL pdl) { @@ -6722,12 +6750,14 @@ driver_pdl_unlock(ErlDrvPDL pdl) pdl_destroy(pdl); } +__attribute__((externally_visible)) ErlDrvSInt driver_pdl_get_refc(ErlDrvPDL pdl) { return pdl_read_refc(pdl); } +__attribute__((externally_visible)) ErlDrvSInt driver_pdl_inc_refc(ErlDrvPDL pdl) { @@ -6739,6 +6769,7 @@ driver_pdl_inc_refc(ErlDrvPDL pdl) return refc; } +__attribute__((externally_visible)) ErlDrvSInt driver_pdl_dec_refc(ErlDrvPDL pdl) { @@ -6753,6 +6784,7 @@ driver_pdl_dec_refc(ErlDrvPDL pdl) } /* Put elements from vec at q tail */ +__attribute__((externally_visible)) int driver_enqv(ErlDrvPort ix, ErlIOVec* vec, ErlDrvSizeT skip) { ASSERT(vec->size >= skip); @@ -6760,6 +6792,7 @@ int driver_enqv(ErlDrvPort ix, ErlIOVec* } /* Put elements from vec at q head */ +__attribute__((externally_visible)) int driver_pushqv(ErlDrvPort ix, ErlIOVec* vec, ErlDrvSizeT skip) { ASSERT(vec->size >= skip); @@ -6770,6 +6803,7 @@ int driver_pushqv(ErlDrvPort ix, ErlIOVe ** Remove size bytes from queue head ** Return number of bytes that remain in queue */ +__attribute__((externally_visible)) ErlDrvSizeT driver_deq(ErlDrvPort ix, ErlDrvSizeT size) { ErlPortIOQueue *q = drvport2ioq(ix); @@ -6779,17 +6813,20 @@ ErlDrvSizeT driver_deq(ErlDrvPort ix, Er } +__attribute__((externally_visible)) ErlDrvSizeT driver_peekqv(ErlDrvPort ix, ErlIOVec *ev) { return erts_ioq_peekqv(drvport2ioq(ix), (ErtsIOVec*)ev); } +__attribute__((externally_visible)) SysIOVec* driver_peekq(ErlDrvPort ix, int* vlenp) /* length of io-vector */ { return erts_ioq_peekq(drvport2ioq(ix), vlenp); } +__attribute__((externally_visible)) ErlDrvSizeT driver_sizeq(ErlDrvPort ix) { ErlPortIOQueue *q = drvport2ioq(ix); @@ -6803,6 +6840,7 @@ ErlDrvSizeT driver_sizeq(ErlDrvPort ix) /* Utils */ /* Enqueue a binary */ +__attribute__((externally_visible)) int driver_enq_bin(ErlDrvPort ix, ErlDrvBinary* bin, ErlDrvSizeT offs, ErlDrvSizeT len) { @@ -6821,6 +6859,7 @@ int driver_enq_bin(ErlDrvPort ix, ErlDrv return driver_enqv(ix, &ev, 0); } +__attribute__((externally_visible)) int driver_enq(ErlDrvPort ix, char* buffer, ErlDrvSizeT len) { int code; @@ -6837,6 +6876,7 @@ int driver_enq(ErlDrvPort ix, char* buff return code; } +__attribute__((externally_visible)) int driver_pushq_bin(ErlDrvPort ix, ErlDrvBinary* bin, ErlDrvSizeT offs, ErlDrvSizeT len) { @@ -6855,6 +6895,7 @@ int driver_pushq_bin(ErlDrvPort ix, ErlD return driver_pushqv(ix, &ev, 0); } +__attribute__((externally_visible)) int driver_pushq(ErlDrvPort ix, char* buffer, ErlDrvSizeT len) { int code; @@ -6872,6 +6913,7 @@ int driver_pushq(ErlDrvPort ix, char* bu return code; } +__attribute__((externally_visible)) int driver_set_timer(ErlDrvPort ix, unsigned long t) { Port* prt = erts_drvport2port(ix); @@ -6888,6 +6930,7 @@ int driver_set_timer(ErlDrvPort ix, unsi return 0; } +__attribute__((externally_visible)) int driver_cancel_timer(ErlDrvPort ix) { Port* prt = erts_drvport2port(ix); @@ -6898,6 +6941,7 @@ int driver_cancel_timer(ErlDrvPort ix) return 0; } +__attribute__((externally_visible)) int driver_read_timer(ErlDrvPort ix, unsigned long* t) { @@ -6919,6 +6963,7 @@ driver_read_timer(ErlDrvPort ix, unsigne return 0; } +__attribute__((externally_visible)) int driver_get_now(ErlDrvNowData *now_data) { @@ -7006,6 +7051,7 @@ static int do_driver_monitor_process(Por /* * This can be called from a non scheduler thread iff a port_data_lock exists */ +__attribute__((externally_visible)) int driver_monitor_process(ErlDrvPort drvport, ErlDrvTermData process, ErlDrvMonitor *monitor) @@ -7046,6 +7092,7 @@ static int do_driver_demonitor_process(P return 0; } +__attribute__((externally_visible)) int driver_demonitor_process(ErlDrvPort drvport, const ErlDrvMonitor *monitor) { @@ -7084,6 +7131,7 @@ static ErlDrvTermData do_driver_get_moni } +__attribute__((externally_visible)) ErlDrvTermData driver_get_monitored_process(ErlDrvPort drvport, const ErlDrvMonitor *monitor) { @@ -7105,6 +7153,7 @@ ErlDrvTermData driver_get_monitored_proc return ret; } +__attribute__((externally_visible)) int driver_compare_monitors(const ErlDrvMonitor *monitor1, const ErlDrvMonitor *monitor2) { @@ -7197,6 +7246,7 @@ driver_failure_term(ErlDrvPort ix, Eterm ** Do a (soft) exit. unlink the connected process before doing ** driver posix error or (normal) */ +__attribute__((externally_visible)) int driver_exit(ErlDrvPort ix, int err) { Port* prt = erts_drvport2port(ix); @@ -7221,11 +7271,13 @@ int driver_exit(ErlDrvPort ix, int err) } +__attribute__((externally_visible)) int driver_failure(ErlDrvPort ix, int code) { return driver_failure_term(ix, make_small(code), code == 0); } +__attribute__((externally_visible)) int driver_failure_atom(ErlDrvPort ix, char* string) { return driver_failure_term(ix, @@ -7236,11 +7288,13 @@ int driver_failure_atom(ErlDrvPort ix, c 0); } +__attribute__((externally_visible)) int driver_failure_posix(ErlDrvPort ix, int err) { return driver_failure_atom(ix, erl_errno_id(err)); } +__attribute__((externally_visible)) int driver_failure_eof(ErlDrvPort ix) { return driver_failure_term(ix, NIL, 1); @@ -7248,6 +7302,7 @@ int driver_failure_eof(ErlDrvPort ix) +__attribute__((externally_visible)) ErlDrvTermData driver_mk_atom(char* string) { Eterm am = erts_atom_put((byte *) string, @@ -7258,6 +7313,7 @@ ErlDrvTermData driver_mk_atom(char* stri return (ErlDrvTermData) am; } +__attribute__((externally_visible)) ErlDrvTermData driver_mk_port(ErlDrvPort ix) { Port* prt = erts_drvport2port(ix); @@ -7267,6 +7323,7 @@ ErlDrvTermData driver_mk_port(ErlDrvPort return (ErlDrvTermData) prt->common.id; } +__attribute__((externally_visible)) ErlDrvTermData driver_connected(ErlDrvPort ix) { Port* prt = erts_drvport2port(ix); @@ -7277,6 +7334,7 @@ ErlDrvTermData driver_connected(ErlDrvPo return ERTS_PORT_GET_CONNECTED(prt); } +__attribute__((externally_visible)) ErlDrvTermData driver_caller(ErlDrvPort ix) { Port* prt = erts_drvport2port(ix); @@ -7287,6 +7345,7 @@ ErlDrvTermData driver_caller(ErlDrvPort return prt->caller; } +__attribute__((externally_visible)) int driver_lock_driver(ErlDrvPort ix) { Port* prt = erts_drvport2port(ix); @@ -7342,6 +7401,7 @@ static void maybe_unlock_driver_list(int Writing code using these interfaces spanning several driver callbacks between loading/lookup and error handling may give undesired results... */ +__attribute__((externally_visible)) void *driver_dl_open(char * path) { void *ptr; @@ -7362,6 +7422,7 @@ void *driver_dl_open(char * path) } } +__attribute__((externally_visible)) void *driver_dl_sym(void * handle, char *func_name) { void *ptr; @@ -7382,6 +7443,7 @@ void *driver_dl_sym(void * handle, char } } +__attribute__((externally_visible)) int driver_dl_close(void *handle) { int res; @@ -7391,6 +7453,7 @@ int driver_dl_close(void *handle) return res; } +__attribute__((externally_visible)) char *driver_dl_error(void) { char *res; @@ -7406,6 +7469,7 @@ char *driver_dl_error(void) (offsetof(ErlDrvSysInfo, LAST_FIELD) \ + sizeof(((ErlDrvSysInfo *) 0)->LAST_FIELD)) +__attribute__((externally_visible)) void driver_system_info(ErlDrvSysInfo *sip, size_t si_size) { @@ -7595,6 +7659,7 @@ erts_destroy_driver(erts_driver_t *drv) * Exposed in the driver interface, and therefore possibly locking directly. */ +__attribute__((externally_visible)) void add_driver_entry(ErlDrvEntry *drv){ void *rec_lock; rec_lock = erts_tsd_get(driver_list_lock_status_key); @@ -7653,6 +7718,7 @@ int erts_add_driver_entry(ErlDrvEntry *d } /* Not allowed for dynamic drivers */ +__attribute__((externally_visible)) int remove_driver_entry(ErlDrvEntry *drv) { erts_driver_t *dp; @@ -7695,11 +7761,13 @@ int remove_driver_entry(ErlDrvEntry *drv /* very useful function that can be used in entries that are not used * so that not every driver writer must supply a personal version */ +__attribute__((externally_visible)) int null_func(void) { return 0; } +__attribute__((externally_visible)) int erl_drv_putenv(const char *key, char *value) { @@ -7713,6 +7781,7 @@ erl_drv_putenv(const char *key, char *va } } +__attribute__((externally_visible)) int erl_drv_getenv(const char *key, char *value, size_t *value_size) { diff -Ndurp otp_src_26.0.2/erts/emulator/sys/common/erl_check_io.c otp_src_26.0.2-erts-symbols/erts/emulator/sys/common/erl_check_io.c --- otp_src_26.0.2/erts/emulator/sys/common/erl_check_io.c 2023-06-28 13:02:50.000000000 +0300 +++ otp_src_26.0.2-erts-symbols/erts/emulator/sys/common/erl_check_io.c 2023-08-29 22:01:13.097328403 +0300 @@ -805,6 +805,7 @@ check_fd_cleanup(ErtsDrvEventState *stat # define MUST_DEFER(MAY_SLEEP) (MAY_SLEEP) #endif +__attribute__((externally_visible)) int driver_select(ErlDrvPort ix, ErlDrvEvent e, int mode, int on) {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor