summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/posix/sigset.h
blob: 6f46f611048769d2db6521abdd265bda6b9e660e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
 * @file
 * 
 * @brief POSIX Signal Sets Management Helper
 *
 * This file defines the interface to implementation helper for management
 * of POSIX Signal Sets.
 */

/*
 *  COPYRIGHT (c) 1989-2011.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.org/license/LICENSE.
 */

#ifndef _RTEMS_POSIX_SIGSET_H
#define _RTEMS_POSIX_SIGSET_H

#include <stdbool.h>
#include <signal.h>

/*
 *  Currently 32 signals numbered 1-32 are defined
 */

#define SIGNAL_EMPTY_MASK  0x00000000L
#define SIGNAL_ALL_MASK    0xffffffffL

static inline sigset_t signo_to_mask(
  uint32_t sig
)
{
  return 1u << (sig - 1);
}

static inline bool is_valid_signo(
  int signo
)
{
  return ((signo) >= 1 && (signo) <= 32 );
}

#endif