Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-02 17:38:16 -05:00
|
|
|
/*
|
2017-07-10 15:28:55 -04:00
|
|
|
* Copyright (c) 2011, 2012, 2013, 2014, 2016, 2017 Jonas 'Sortie' Termansen.
|
Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-02 17:38:16 -05:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* signal.h
|
|
|
|
* Signal API.
|
|
|
|
*/
|
2011-09-15 16:38:40 -04:00
|
|
|
|
2022-07-07 19:09:15 -04:00
|
|
|
#ifndef _INCLUDE_SIGNAL_H
|
|
|
|
#define _INCLUDE_SIGNAL_H
|
2011-09-15 16:38:40 -04:00
|
|
|
|
2013-10-13 07:04:27 -04:00
|
|
|
#include <sys/cdefs.h>
|
2013-09-23 10:37:33 -04:00
|
|
|
|
2017-07-10 15:28:55 -04:00
|
|
|
#if __USE_SORTIX || __USE_POSIX
|
2013-09-23 10:37:33 -04:00
|
|
|
#include <sys/__/types.h>
|
2017-07-10 15:28:55 -04:00
|
|
|
#endif
|
2013-09-23 10:37:33 -04:00
|
|
|
|
2017-07-10 15:28:55 -04:00
|
|
|
#if __USE_SORTIX || __USE_POSIX
|
2016-04-30 12:10:49 -04:00
|
|
|
#if !defined(__is_sortix_libk) && !defined(__is_sortix_kernel)
|
2013-08-31 07:15:53 -04:00
|
|
|
#include <__/pthread.h>
|
|
|
|
#endif
|
2017-07-10 15:28:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <sortix/signal.h>
|
2013-08-31 07:15:53 -04:00
|
|
|
|
2017-07-10 15:28:55 -04:00
|
|
|
#if __USE_SORTIX || __USE_POSIX
|
2013-08-04 14:24:59 -04:00
|
|
|
#include <sortix/sigaction.h>
|
|
|
|
#include <sortix/sigevent.h>
|
|
|
|
#include <sortix/siginfo.h>
|
|
|
|
#include <sortix/sigprocmask.h>
|
|
|
|
#include <sortix/sigset.h>
|
|
|
|
#include <sortix/sigval.h>
|
|
|
|
#include <sortix/stack.h>
|
|
|
|
#include <sortix/timespec.h>
|
|
|
|
#include <sortix/ucontext.h>
|
2015-05-13 12:11:02 -04:00
|
|
|
#endif
|
2013-10-13 17:49:34 -04:00
|
|
|
|
2017-07-10 15:28:55 -04:00
|
|
|
#if __USE_SORTIX || __USE_POSIX
|
|
|
|
|
2013-12-26 19:44:03 -05:00
|
|
|
#ifndef __uid_t_defined
|
|
|
|
#define __uid_t_defined
|
|
|
|
typedef __uid_t uid_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __pid_t_defined
|
|
|
|
#define __pid_t_defined
|
|
|
|
typedef __pid_t pid_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __size_t_defined
|
|
|
|
#define __size_t_defined
|
|
|
|
#define __need_size_t
|
|
|
|
#include <stddef.h>
|
|
|
|
#endif
|
|
|
|
|
2016-04-30 12:10:49 -04:00
|
|
|
#if !defined(__is_sortix_libk) && !defined(__is_sortix_kernel)
|
2013-08-31 07:15:53 -04:00
|
|
|
|
|
|
|
#ifndef __pthread_attr_t_defined
|
|
|
|
#define __pthread_attr_t_defined
|
|
|
|
typedef __pthread_attr_t pthread_attr_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __pthread_t_defined
|
|
|
|
#define __pthread_t_defined
|
|
|
|
typedef __pthread_t pthread_t;
|
|
|
|
#endif
|
|
|
|
|
2017-07-10 15:28:55 -04:00
|
|
|
#endif /* !defined(__is_sortix_libk) && !defined(__is_sortix_kernel) */
|
2013-10-13 17:49:34 -04:00
|
|
|
|
2013-08-04 14:24:59 -04:00
|
|
|
#define NSIG __SIG_MAX_NUM
|
2011-09-15 16:38:40 -04:00
|
|
|
|
2017-07-10 15:28:55 -04:00
|
|
|
#endif /* __USE_SORTIX || __USE_POSIX */
|
|
|
|
|
2013-01-14 08:41:44 -05:00
|
|
|
typedef int sig_atomic_t;
|
2011-09-15 16:38:40 -04:00
|
|
|
|
2013-08-04 14:24:59 -04:00
|
|
|
#define MINSIGSTKSZ 2048
|
|
|
|
#define SIGSTKSZ 8192
|
2013-10-13 17:49:34 -04:00
|
|
|
|
2017-07-10 15:28:55 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int raise(int sig);
|
|
|
|
void (*signal(int, void (*)(int)))(int);
|
|
|
|
|
|
|
|
#if __USE_SORTIX || __USE_POSIX
|
2013-10-13 17:49:34 -04:00
|
|
|
int kill(pid_t, int);
|
|
|
|
int killpg(pid_t, int);
|
|
|
|
void psiginfo(const siginfo_t*, const char*);
|
|
|
|
void psignal(int, const char*);
|
2013-08-31 07:15:53 -04:00
|
|
|
/* TODO: int pthread_kill(pthread_t, int); */
|
2014-01-10 10:16:30 -05:00
|
|
|
int pthread_sigmask(int, const sigset_t* __restrict, sigset_t* __restrict);
|
2013-10-13 17:49:34 -04:00
|
|
|
int sigaction(int, const struct sigaction* __restrict, struct sigaction* __restrict);
|
|
|
|
int sigaddset(sigset_t*, int);
|
|
|
|
int sigaltstack(const stack_t* __restrict, stack_t* __restrict);
|
2013-07-27 10:28:58 -04:00
|
|
|
int sigandset(sigset_t*, const sigset_t*, const sigset_t*);
|
2013-10-13 17:49:34 -04:00
|
|
|
int sigdelset(sigset_t*, int);
|
|
|
|
int sigemptyset(sigset_t*);
|
|
|
|
int sigfillset(sigset_t*);
|
2013-07-27 10:28:58 -04:00
|
|
|
int sigisemptyset(const sigset_t*);
|
2013-10-13 17:49:34 -04:00
|
|
|
int sigismember(const sigset_t*, int);
|
2013-07-27 10:28:58 -04:00
|
|
|
int signotset(sigset_t*, const sigset_t*);
|
|
|
|
int sigorset(sigset_t*, const sigset_t*, const sigset_t*);
|
2013-10-13 17:49:34 -04:00
|
|
|
int sigpending(sigset_t*);
|
|
|
|
int sigprocmask(int, const sigset_t* __restrict, sigset_t* __restrict);
|
2013-08-04 14:24:59 -04:00
|
|
|
/* TODO: int sigqueue(pid_t, int, const union sigval); */
|
2013-10-13 17:49:34 -04:00
|
|
|
int sigsuspend(const sigset_t*);
|
2013-08-04 14:24:59 -04:00
|
|
|
/* TODO: int sigtimedwait(const sigset_t* __restrict, siginfo_t* __restrict,
|
|
|
|
const struct timespec* __restrict); */
|
|
|
|
/* TODO: int sigwait(const sigset_t* __restrict, int* __restrict); */
|
|
|
|
/* TODO: int sigwaitinfo(const sigset_t* __restrict, siginfo_t* __restrict); */
|
2017-07-10 15:28:55 -04:00
|
|
|
#endif
|
2011-09-15 16:38:40 -04:00
|
|
|
|
2015-05-13 12:11:02 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
2011-09-15 16:38:40 -04:00
|
|
|
|
|
|
|
#endif
|