xref: /third_party/musl/porting/linux/user/src/signal/signal.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/porting/linux/user/src/signal/
1570af302Sopenharmony_ci#include <signal.h>
2570af302Sopenharmony_ci
3570af302Sopenharmony_civoid (*signal(int sig, void (*func)(int)))(int)
4570af302Sopenharmony_ci{
5570af302Sopenharmony_ci	struct sigaction sa_old, sa = { .sa_handler = func, .sa_flags = SA_RESTART };
6570af302Sopenharmony_ci	if (__sigaction(sig, &sa, &sa_old) < 0)
7570af302Sopenharmony_ci		return SIG_ERR;
8570af302Sopenharmony_ci	return sa_old.sa_handler;
9570af302Sopenharmony_ci}
10570af302Sopenharmony_ci
11570af302Sopenharmony_ciweak_alias(signal, bsd_signal);
12570af302Sopenharmony_ciweak_alias(signal, __sysv_signal);
13

Indexes created Thu Nov 07 10:32:03 CST 2024