This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 082/114] Add <sys/signal.h> header for Phoenix.


From: Kuba Sejdak <jakub.sejdak@phoesys.com>

---
 newlib/libc/sys/phoenix/sys/signal.h | 99 ++++++++++++++++++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 newlib/libc/sys/phoenix/sys/signal.h

diff --git a/newlib/libc/sys/phoenix/sys/signal.h b/newlib/libc/sys/phoenix/sys/signal.h
new file mode 100644
index 0000000..a412ca2
--- /dev/null
+++ b/newlib/libc/sys/phoenix/sys/signal.h
@@ -0,0 +1,99 @@
+/* Copyright (C) 2012-2016 Phoenix Systems (http://www.phoesys.com/).
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Written 2000 by Werner Almesberger */
+/* Copied from Linux, modified for Phoenix-RTOS. */
+
+#ifndef _SYS_SIGNAL_H
+#define _SYS_SIGNAL_H
+
+#include <phoenix/signal.h>
+#include <sys/types.h>
+
+typedef void (*_sig_func_ptr)(int);
+typedef _sig_func_ptr		__sighandler_t;
+typedef _sig_func_ptr 		sighandler_t;
+typedef unsigned long		sigset_t;
+
+#define SIGEV_NONE		1		/* No asynchronous notification shall be delivered when the event of interest occurs. */
+#define SIGEV_SIGNAL	2		/* A queued signal, with an application defined value, shall be delivered when the event of interest occurs. */
+#define SIGEV_THREAD	3		/* A notification function shall be called to perform notification. */
+
+union sigval {
+	int sival_int;				/* Integer signal value */
+	void *sival_ptr;			/* Pointer signal value */
+};
+
+struct sigevent {
+	int sigev_notify;				/* Notification type */
+	int sigev_signo;				/* Signal number */
+	union sigval sigev_value;		/* Signal value */
+#if defined(_POSIX_THREADS)
+	void (*sigev_notify_function)(union sigval);	/* Notification function */
+	pthread_attr_t  *sigev_notify_attributes;		/* Notification Attributes */
+#endif
+};
+
+#define SI_USER			1		/* Sent by a user. kill(), abort(), etc */
+#define SI_QUEUE		2		/* Sent by sigqueue() */
+#define SI_TIMER		3		/* Sent by expiration of a timer_settime() timer */
+#define SI_ASYNCIO		4		/* Indicates completion of asycnhronous IO */
+#define SI_MESGQ		5		/* Indicates arrival of a message at an empty queue */
+
+typedef struct {
+	int si_signo;				/* Signal number */
+	int si_code;				/* Cause of the signal */
+	union sigval si_value;		/* Signal value */
+} siginfo_t;
+
+#define SA_NOCLDSTOP	1		/* Do not generate SIGCHLD when children stop */
+#define SA_SIGINFO		2		/* Invoke the signal catching function with three arguments instead of one. */
+#define SA_RESTART		4 
+
+struct sigaction {
+	int sa_flags;				/* Special flags to affect behavior of signal */
+	sigset_t sa_mask;			/* Additional set of signals to be blocked during execution of signal-catching function. */
+	union {
+		_sig_func_ptr _handler;	/* SIG_DFL, SIG_IGN, or pointer to a function */
+		void (*_sigaction)(int, siginfo_t *, void *);
+	} _signal_handlers;
+};
+
+#define sa_handler		_signal_handlers._handler
+#define sa_sigaction	_signal_handlers._sigaction
+
+#define SIG_SETMASK		0		/* Set mask with sigprocmask() */
+#define SIG_BLOCK		1		/* Set of signals to block */
+#define SIG_UNBLOCK		2		/* Set of signals to, well, unblock */
+
+int kill(pid_t pid, int sig);
+int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact);
+int sigaddset(sigset_t *set, int signum);
+int sigdelset(sigset_t *set, int signum);
+int sigismember(const sigset_t *set, int signum);
+int sigfillset(sigset_t *set);
+int sigemptyset(sigset_t *set);
+int sigpending(sigset_t *set);
+int sigsuspend(const sigset_t *mask);
+int sigpause(int sigmask);
+int sigprocmask(int how, const sigset_t *set, sigset_t *oldset);
+int sigblock(int mask);
+int sigmask(int signum);
+int sigsetmask(int mask);
+
+#endif
-- 
2.5.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]