]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Make almost all hurd headers includable in all standards
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 4 Mar 2018 02:44:14 +0000 (03:44 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 4 Mar 2018 03:03:13 +0000 (04:03 +0100)
* hurd/hurd.h: Include <bits/types/sigset_t.h>
* hurd/hurd/fd.h: Include <sys/select.h> and <bits/types/sigset_t.h>
(_hurd_fd_read, _hurd_fd_write): Use __loff_t instead of loff_t.
* hurd/hurd/signal.h: Include <bits/types/stack_t.h> and
<bits/types/sigset_t.h>.
[!defined __USE_GNU]: Do not #error out.
(struct hurd_sigstate): Use _NSIG instead of NSIG.
* hurd/hurd/sigpreempt.h (__need_size_t): Define.
Include <stddef.h> and <bits/types/sigset_t.h>
(struct hurd_signal_preemptor, hurd_catch_signal): Use __sighandler_t
instead of sighandler_t.

ChangeLog
hurd/hurd.h
hurd/hurd/fd.h
hurd/hurd/signal.h
hurd/hurd/sigpreempt.h

index 33d3008a91b7b886940301ca0697f6fcd252aa93..2810a9cb2894c78d0cbf71ab9ad262c23bfe272a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * mach/mach/mig_support.h [defined __USE_GNU]: Do not #error out.
        * scripts/check-installed-headers.sh: Do not ignore Hurd and Mach
        headers.
+       * hurd/hurd.h: Include <bits/types/sigset_t.h>
+       * hurd/hurd/fd.h: Include <sys/select.h> and <bits/types/sigset_t.h>
+       (_hurd_fd_read, _hurd_fd_write): Use __loff_t instead of loff_t.
+       * hurd/hurd/signal.h: Include <bits/types/stack_t.h> and
+       <bits/types/sigset_t.h>.
+       [!defined __USE_GNU]: Do not #error out.
+       (struct hurd_sigstate): Use _NSIG instead of NSIG.
+       * hurd/hurd/sigpreempt.h (__need_size_t): Define.
+       Include <stddef.h> and <bits/types/sigset_t.h>
+       (struct hurd_signal_preemptor, hurd_catch_signal): Use __sighandler_t
+       instead of sighandler_t.
 
 2018-03-03  Andreas Schwab  <schwab@linux-m68k.org>
 
index a0e2444632486bd6d3e6db002c05b10b13b6a2f3..029a7ebc595b7bb49a789dc63021db0590db1327 100644 (file)
@@ -41,6 +41,7 @@
 #include <hurd/port.h>
 
 #include <errno.h>
+#include <bits/types/sigset_t.h>
 
 #ifndef _HURD_H_EXTERN_INLINE
 #define _HURD_H_EXTERN_INLINE __extern_inline
index 5d51c11e6a8859d48b91d73b2620a269336e063e..5a067d48884394047f16e548c2381434ea33f47e 100644 (file)
@@ -26,7 +26,9 @@
 #include <hurd/hurd_types.h>
 #include <hurd/port.h>
 #include <sys/socket.h>
+#include <sys/select.h>
 #include <fcntl.h>
+#include <bits/types/sigset_t.h>
 
 
 /* Structure representing a file descriptor.  */
@@ -252,9 +254,9 @@ extern error_t _hurd_fd_close (struct hurd_fd *fd);
    If successful, stores the amount actually read or written in *NBYTES.  */
 
 extern error_t _hurd_fd_read (struct hurd_fd *fd,
-                             void *buf, size_t *nbytes, loff_t offset);
+                             void *buf, size_t *nbytes, __loff_t offset);
 extern error_t _hurd_fd_write (struct hurd_fd *fd,
-                              const void *buf, size_t *nbytes, loff_t offset);
+                              const void *buf, size_t *nbytes, __loff_t offset);
 
 
 /* Call *RPC on PORT and/or CTTY; if a call on CTTY returns EBACKGROUND,
index 53234724a407b3d79ac08a302ecb06b41d0baa1e..9cb5f3cfc4c2f83af67bd41ad4c2883d40ae9335 100644 (file)
 
 #define        _HURD_SIGNAL_H  1
 #include <features.h>
-/* Make sure <signal.h> is going to define NSIG.  */
-#ifndef __USE_GNU
-#error "Must have `_GNU_SOURCE' feature test macro to use this file"
-#endif
 
 #define __need_size_t
 #define __need_NULL
@@ -35,6 +31,8 @@
 #include <hurd/hurd_types.h>
 #include <signal.h>
 #include <errno.h>
+#include <bits/types/stack_t.h>
+#include <bits/types/sigset_t.h>
 #include <hurd/msg.h>
 
 #include <cthreads.h>          /* For `struct mutex'.  */
@@ -74,7 +72,7 @@ struct hurd_sigstate
 
     sigset_t blocked;          /* What signals are blocked.  */
     sigset_t pending;          /* Pending signals, possibly blocked.  */
-    struct sigaction actions[NSIG];
+    struct sigaction actions[_NSIG];
     stack_t sigaltstack;
 
     /* Chain of thread-local signal preemptors; see <hurd/sigpreempt.h>.
@@ -84,7 +82,7 @@ struct hurd_sigstate
     struct hurd_signal_preemptor *preemptors;
 
     /* For each signal that may be pending, the details to deliver it with.  */
-    struct hurd_signal_detail pending_data[NSIG];
+    struct hurd_signal_detail pending_data[_NSIG];
 
     /* If `suspended' is set when this thread gets a signal,
        the signal thread sends an empty message to it.  */
index d5a0abb729655aec9293bbe3d797a27fc369fb50..d059408fb8d4ad8055e434c0b94b7bcde113b14d 100644 (file)
 #ifndef        _HURD_SIGPREEMPT_H
 
 #define        _HURD_SIGPREEMPT_H      1
+#define __need_size_t
+#include <stddef.h>
 #include <errno.h>
-#include <signal.h>            /* For sigset_t, sighandler_t, SIG_ERR.  */
+#include <signal.h>            /* For sighandler_t, SIG_ERR.  */
+#include <bits/types/sigset_t.h>
 struct hurd_sigstate;          /* <hurd/signal.h> */
 struct hurd_signal_detail;     /* <hurd/signal.h> */
 
@@ -37,11 +40,11 @@ struct hurd_signal_preemptor
        is tried, or the normal handling is done for the signal (which may
        have been changed by the preemptor function).  Otherwise, the signal
        is processed as if the return value were its handler setting.  */
-    sighandler_t (*preemptor) (struct hurd_signal_preemptor *preemptor,
-                              struct hurd_sigstate *ss,
-                              int *signo, struct hurd_signal_detail *detail);
+    __sighandler_t (*preemptor) (struct hurd_signal_preemptor *preemptor,
+                                struct hurd_sigstate *ss,
+                                int *signo, struct hurd_signal_detail *detail);
     /* If PREEMPTOR is null, act as if it returned HANDLER.  */
-    sighandler_t handler;
+    __sighandler_t handler;
 
     struct hurd_signal_preemptor *next;        /* List structure.  */
   };
@@ -78,7 +81,7 @@ void hurd_unpreempt_signals (struct hurd_signal_preemptor *preemptor);
 error_t hurd_catch_signal (sigset_t sigset,
                           unsigned long int first, unsigned long int last,
                           error_t (*operate) (struct hurd_signal_preemptor *),
-                          sighandler_t handler);
+                          __sighandler_t handler);
 
 
 /* Convenience functions using `hurd_catch_signal'.  */