From patchwork Sun Mar 4 03:05:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 26185 Received: (qmail 31184 invoked by alias); 4 Mar 2018 03:05:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 31175 invoked by uid 89); 4 Mar 2018 03:05:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy=PORT X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd, commited] hurd: Make almost all hurd headers includable in all standards Date: Sun, 4 Mar 2018 04:05:01 +0100 Message-Id: <20180304030501.25340-1-samuel.thibault@ens-lyon.org> * hurd/hurd.h: Include * hurd/hurd/fd.h: Include and (_hurd_fd_read, _hurd_fd_write): Use __loff_t instead of loff_t. * hurd/hurd/signal.h: Include and . [!defined __USE_GNU]: Do not #error out. (struct hurd_sigstate): Use _NSIG instead of NSIG. * hurd/hurd/sigpreempt.h (__need_size_t): Define. Include and (struct hurd_signal_preemptor, hurd_catch_signal): Use __sighandler_t instead of sighandler_t. --- ChangeLog | 11 +++++++++++ hurd/hurd.h | 1 + hurd/hurd/fd.h | 6 ++++-- hurd/hurd/signal.h | 10 ++++------ hurd/hurd/sigpreempt.h | 15 +++++++++------ 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33d3008a91..2810a9cb28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,17 @@ * 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 + * hurd/hurd/fd.h: Include and + (_hurd_fd_read, _hurd_fd_write): Use __loff_t instead of loff_t. + * hurd/hurd/signal.h: Include and + . + [!defined __USE_GNU]: Do not #error out. + (struct hurd_sigstate): Use _NSIG instead of NSIG. + * hurd/hurd/sigpreempt.h (__need_size_t): Define. + Include and + (struct hurd_signal_preemptor, hurd_catch_signal): Use __sighandler_t + instead of sighandler_t. 2018-03-03 Andreas Schwab diff --git a/hurd/hurd.h b/hurd/hurd.h index a0e2444632..029a7ebc59 100644 --- a/hurd/hurd.h +++ b/hurd/hurd.h @@ -41,6 +41,7 @@ #include #include +#include #ifndef _HURD_H_EXTERN_INLINE #define _HURD_H_EXTERN_INLINE __extern_inline diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h index 5d51c11e6a..5a067d4888 100644 --- a/hurd/hurd/fd.h +++ b/hurd/hurd/fd.h @@ -26,7 +26,9 @@ #include #include #include +#include #include +#include /* 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, diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h index 53234724a4..9cb5f3cfc4 100644 --- a/hurd/hurd/signal.h +++ b/hurd/hurd/signal.h @@ -20,10 +20,6 @@ #define _HURD_SIGNAL_H 1 #include -/* Make sure 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 #include #include +#include +#include #include #include /* 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 . @@ -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. */ diff --git a/hurd/hurd/sigpreempt.h b/hurd/hurd/sigpreempt.h index d5a0abb729..d059408fb8 100644 --- a/hurd/hurd/sigpreempt.h +++ b/hurd/hurd/sigpreempt.h @@ -19,8 +19,11 @@ #ifndef _HURD_SIGPREEMPT_H #define _HURD_SIGPREEMPT_H 1 +#define __need_size_t +#include #include -#include /* For sigset_t, sighandler_t, SIG_ERR. */ +#include /* For sighandler_t, SIG_ERR. */ +#include struct hurd_sigstate; /* */ struct hurd_signal_detail; /* */ @@ -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'. */