about summary refs log tree commit diff
path: root/REORG.TODO/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h')
-rw-r--r--REORG.TODO/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/REORG.TODO/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h b/REORG.TODO/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h
new file mode 100644
index 0000000000..0d4857b16e
--- /dev/null
+++ b/REORG.TODO/sysdeps/unix/sysv/linux/bits/types/sigevent_t.h
@@ -0,0 +1,48 @@
+#ifndef __sigevent_t_defined
+#define __sigevent_t_defined 1
+
+#include <bits/wordsize.h>
+#include <bits/types.h>
+#include <bits/types/sigval_t.h>
+
+#define __SIGEV_MAX_SIZE	64
+#if __WORDSIZE == 64
+# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+#else
+# define __SIGEV_PAD_SIZE	((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+#endif
+
+/* Forward declaration.  */
+#ifndef __have_pthread_attr_t
+typedef union pthread_attr_t pthread_attr_t;
+# define __have_pthread_attr_t	1
+#endif
+
+/* Structure to transport application-defined values with signals.  */
+typedef struct sigevent
+  {
+    sigval_t sigev_value;
+    int sigev_signo;
+    int sigev_notify;
+
+    union
+      {
+	int _pad[__SIGEV_PAD_SIZE];
+
+	/* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+	   thread to receive the signal.  */
+	__pid_t _tid;
+
+	struct
+	  {
+	    void (*_function) (sigval_t);	/* Function to start.  */
+	    pthread_attr_t *_attribute;		/* Thread attributes.  */
+	  } _sigev_thread;
+      } _sigev_un;
+  } sigevent_t;
+
+/* POSIX names to access some of the members.  */
+#define sigev_notify_function   _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif