Deleted Added
sdiff udiff text old ( 1574 ) new ( 17141 )
full compact
1/*
2 * Copyright (c) 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

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

33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)sigcompat.c 8.1 (Berkeley) 6/2/93";
36#endif /* LIBC_SCCS and not lint */
37
38#include <sys/param.h>
39#include <signal.h>
40
41int
42sigvec(signo, sv, osv)
43 int signo;
44 struct sigvec *sv, *osv;
45{
46 int ret;
47
48 if (sv)
49 sv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */
50 ret = sigaction(signo, (struct sigaction *)sv, (struct sigaction *)osv);
51 if (ret == 0 && osv)
52 osv->sv_flags ^= SV_INTERRUPT; /* !SA_INTERRUPT */
53 return (ret);
54}
55
56int
57sigsetmask(mask)
58 int mask;
59{
60 int omask, n;
61
62 n = sigprocmask(SIG_SETMASK, (sigset_t *) &mask, (sigset_t *) &omask);
63 if (n)
64 return (n);
65 return (omask);
66}
67
68int
69sigblock(mask)
70 int mask;
71{
72 int omask, n;
73
74 n = sigprocmask(SIG_BLOCK, (sigset_t *) &mask, (sigset_t *) &omask);
75 if (n)
76 return (n);
77 return (omask);
78}
79
80int
81sigpause(mask)
82 int mask;
83{
84 return (sigsuspend((sigset_t *)&mask));
85}