source: mainline/uspace/lib/posix/signal.h@ da084d9

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since da084d9 was 491e1ee, checked in by Petr Koupy <petr.koupy@…>, 14 years ago

Unified usage of LIBPOSIX_INTERNAL macro.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 * Copyright (c) 2011 Jiri Zarevucky
3 * 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 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup libposix
30 * @{
31 */
32/** @file
33 */
34
35#ifndef POSIX_SIGNAL_H_
36#define POSIX_SIGNAL_H_
37
38#include "libc/errno.h"
39
40/* HelenOS doesn't have signals, so calls to functions of this header
41 * are just replaced with their respective failure return value.
42 *
43 * Other macros and constants are here just to satisfy the symbol resolver
44 * and have no practical value whatsoever, until HelenOS implements some
45 * equivalent of signals. Maybe something neat based on IPC will be devised
46 * in the future?
47 */
48
49#undef SIG_DFL
50#define SIG_DFL ((void (*)(int)) 0)
51#undef SIG_ERR
52#define SIG_ERR ((void (*)(int)) 0)
53#undef SIG_IGN
54#define SIG_IGN ((void (*)(int)) 0)
55
56#define signal(sig,func) (errno = ENOTSUP, SIG_ERR)
57#define raise(sig) ((int) -1)
58
59typedef int posix_sig_atomic_t;
60
61/* full POSIX set */
62enum {
63 SIGABRT,
64 SIGALRM,
65 SIGBUS,
66 SIGCHLD,
67 SIGCONT,
68 SIGFPE,
69 SIGHUP,
70 SIGILL,
71 SIGINT,
72 SIGKILL,
73 SIGPIPE,
74 SIGQUIT,
75 SIGSEGV,
76 SIGSTOP,
77 SIGTERM,
78 SIGTSTP,
79 SIGTTIN,
80 SIGTTOU,
81 SIGUSR1,
82 SIGUSR2,
83 SIGPOLL,
84 SIGPROF,
85 SIGSYS,
86 SIGTRAP,
87 SIGURG,
88 SIGVTALRM,
89 SIGXCPU,
90 SIGXFSZ
91};
92
93#ifndef LIBPOSIX_INTERNAL
94 #define sig_atomic_t posix_sig_atomic_t
95#endif
96
97#endif /* POSIX_SIGNAL_H_ */
98
99/** @}
100 */
Note: See TracBrowser for help on using the repository browser.