Move posix_signal declaration internal with prefix ruby_

This commit is contained in:
Nobuyoshi Nakada 2023-07-17 21:31:59 +09:00
parent 2476b1ee0b
commit 1c4a523006
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
4 changed files with 6 additions and 8 deletions

View File

@ -113,12 +113,6 @@ RBIMPL_ATTR_NONNULL(())
*/
VALUE rb_f_kill(int argc, const VALUE *argv);
/* This must be private, @shyouhei guesses. */
#ifdef POSIX_SIGNAL
#define posix_signal ruby_posix_signal
void (*posix_signal(int, void (*)(int)))(int);
#endif
RBIMPL_ATTR_PURE()
/**
* Queries the name of the signal. It returns for instance `"KILL"` for

View File

@ -13,6 +13,10 @@
extern int ruby_enable_coredump;
int rb_get_next_signal(void);
#ifdef POSIX_SIGNAL
void (*ruby_posix_signal(int, void (*)(int)))(int);
#endif
RUBY_SYMBOL_EXPORT_BEGIN
/* signal.c (export) */
int rb_grantpt(int fd);

View File

@ -628,7 +628,7 @@ ruby_signal(int signum, sighandler_t handler)
}
sighandler_t
posix_signal(int signum, sighandler_t handler)
ruby_posix_signal(int signum, sighandler_t handler)
{
return ruby_signal(signum, handler);
}

View File

@ -737,7 +737,7 @@ Init_native_thread(rb_thread_t *main_th)
rb_bug("pthread_key_create failed (ruby_current_ec_key)");
}
#endif
posix_signal(SIGVTALRM, null_func);
ruby_posix_signal(SIGVTALRM, null_func);
// setup main thread
main_th->nt->thread_id = pthread_self();