Skip to content

Commit

Permalink
Merge pull request ceph#36924 from ddiss/sigabbrev_np
Browse files Browse the repository at this point in the history
cmake: detect and use sigdescr_np() if available

Reviewed-by: Kefu Chai <[email protected]>
Reviewed-by: Nathan Cutler <[email protected]>
  • Loading branch information
tchaikov authored Sep 6, 2020
2 parents babb98d + b9b6faf commit 2931862
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmake/modules/CephChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ check_function_exists(strerror_r HAVE_Strerror_R)
check_function_exists(name_to_handle_at HAVE_NAME_TO_HANDLE_AT)
check_function_exists(pipe2 HAVE_PIPE2)
check_function_exists(accept4 HAVE_ACCEPT4)
check_function_exists(sigdescr_np HAVE_SIGDESCR_NP)

include(CMakePushCheckState)
cmake_push_check_state(RESET)
Expand Down
8 changes: 5 additions & 3 deletions src/global/signal_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

typedef void (*signal_handler_t)(int);

#ifndef HAVE_REENTRANT_STRSIGNAL
# define sig_str(signum) sys_siglist[signum]
#else
#ifdef HAVE_SIGDESCR_NP
# define sig_str(signum) sigdescr_np(signum)
#elif HAVE_REENTRANT_STRSIGNAL
# define sig_str(signum) strsignal(signum)
#else
# define sig_str(signum) sys_siglist[signum]
#endif

void install_sighandler(int signum, signal_handler_t handler, int flags);
Expand Down
3 changes: 3 additions & 0 deletions src/include/config-h.in.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@
/* Define to 1 if you have sched.h. */
#cmakedefine HAVE_SCHED 1

/* Define to 1 if you have sigdescr_np. */
#cmakedefine HAVE_SIGDESCR_NP 1

/* Support SSE (Streaming SIMD Extensions) instructions */
#cmakedefine HAVE_SSE

Expand Down

0 comments on commit 2931862

Please sign in to comment.