Deleted Added
sdiff udiff text old ( 252429 ) new ( 287292 )
full compact
1/*
2 * Copyright (c) 1985, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31static char sccsid[] = "@(#)signal.c 8.1 (Berkeley) 6/4/93";
32#endif /* LIBC_SCCS and not lint */
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/lib/libc/gen/signal.c 287292 2015-08-29 14:25:01Z kib $");
35
36/*
37 * Almost backwards compatible signal.
38 */
39#include "namespace.h"
40#include <signal.h>
41#include "un-namespace.h"
42#include "libc_private.h"
43
44sigset_t _sigintr __hidden; /* shared with siginterrupt */
45
46sig_t
47signal(int s, sig_t a)
48{
49 struct sigaction sa, osa;
50
51 sa.sa_handler = a;
52 sigemptyset(&sa.sa_mask);
53 sa.sa_flags = 0;
54 if (!sigismember(&_sigintr, s))
55 sa.sa_flags |= SA_RESTART;
56 if (__libc_sigaction(s, &sa, &osa) < 0)
57 return (SIG_ERR);
58 return (osa.sa_handler);
59}