From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13500 invoked by alias); 7 Jan 2010 01:38:51 -0000 Received: (qmail 13482 invoked by uid 22791); 7 Jan 2010 01:38:50 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jan 2010 01:38:43 +0000 Received: from sunsite.mff.cuni.cz (localhost [127.0.0.1]) by sunsite.mff.cuni.cz (8.14.3/8.14.3) with ESMTP id o071cO7T001650; Thu, 7 Jan 2010 02:38:24 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.14.3/8.14.3/Submit) id o071cNf4001649; Thu, 7 Jan 2010 02:38:23 +0100 Date: Thu, 07 Jan 2010 01:38:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [RFC PATCH] Some POSIX 2008 header fixes Message-ID: <20100107013823.GF2855@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00000.txt.bz2 Hi! This is meant just as a material for discussion, I went through a few headers and where I've noticed stuff was either added in POSIX 2008, or moved from XSI to base, I've made a change. I haven't been hiding any prototypes etc. that were removed from the standard. I'm unsure about intptr_t in unistd.h and isnan in math.h, the former is #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED, but seems to be in base unistd.h already in POSIX 2003 and maybe earlier, similarly isnan is #if defined __USE_MISC || defined __USE_XOPEN, eventhough POSIX 2003 and POSIX 2008 have it in base. [jy][01n] which are in the same bits/mathcalls.h #ifdef are correct with __USE_XOPEN though, as they are XSI extension even in POSIX 2008. 2010-01-07 Jakub Jelinek [BZ #11125] * signal/signal.h (ucontext_t): Provide even for _POSIX_C_SOURCE >= 200809L. * stdlib/stdlib.h (sys/wait.h): Likewise. (getsubopt): Likewise. * io/fcntl.h (sys/stat.h, SEEK_SET, SEEK_CUR, SEEK_END): Likewise. * posix/glob.h (size_t): Likewise. * posix/sys/wait.h (idtype_t, waitid): Likewise. * sys/types.h (id_t, clock_t): Likewise. * libio/stdio.h (va_list): Likewise. (off_t, off64_t, ssize_t): Provide for _POSIX_C_SOURCE >= 200809L. --- libc/signal/signal.h.jj 2009-05-16 19:23:37.000000000 +0200 +++ libc/signal/signal.h 2010-01-07 01:40:33.000000000 +0100 @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-2003, 2004, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1991-2003, 2004, 2007, 2009, 2010 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -61,8 +62,6 @@ typedef __sigset_t sigset_t; # ifndef __pid_t_defined typedef __pid_t pid_t; # define __pid_t_defined -#endif -#ifdef __USE_XOPEN # endif # ifndef __uid_t_defined typedef __uid_t uid_t; @@ -354,7 +353,7 @@ extern int sigreturn (struct sigcontext extern int siginterrupt (int __sig, int __interrupt) __THROW; # include -# ifdef __USE_XOPEN +# if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* This will define `ucontext_t' and `mcontext_t'. */ # include # endif --- libc/stdlib/stdlib.h.jj 2009-11-02 13:54:31.000000000 +0100 +++ libc/stdlib/stdlib.h 2010-01-07 01:46:06.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1991-2007, 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -37,7 +37,7 @@ __BEGIN_DECLS #ifndef __need_malloc_and_calloc #define _STDLIB_H 1 -#if defined __USE_XOPEN && !defined _SYS_WAIT_H +#if (defined __USE_XOPEN || defined __USE_XOPEN2K8) && !defined _SYS_WAIT_H /* XPG requires a few symbols from being defined. */ # include # include @@ -880,7 +880,7 @@ extern int rpmatch (__const char *__resp #endif -#ifdef __USE_XOPEN_EXTENDED +#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Parse comma separated suboption from *OPTIONP and match against strings in TOKENS. If found return index and set *VALUEP to optional value introduced by an equal sign. If the suboption is --- libc/libio/stdio.h.jj 2009-05-16 19:23:35.000000000 +0200 +++ libc/libio/stdio.h 2010-01-07 01:59:04.000000000 +0100 @@ -1,5 +1,5 @@ /* Define ISO C stdio on top of C++ iostreams. - Copyright (C) 1991, 1994-2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 1991, 1994-2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -74,7 +74,7 @@ typedef struct _IO_FILE __FILE; #include -#ifdef __USE_XOPEN +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 # ifdef __GNUC__ # ifndef _VA_LIST_DEFINED typedef _G_va_list va_list; @@ -85,6 +85,26 @@ typedef _G_va_list va_list; # endif #endif +#ifdef __USE_XOPEN2K8 +# ifndef __off_t_defined +# ifndef __USE_FILE_OFFSET64 +typedef __off_t off_t; +# else +typedef __off64_t off_t; +# endif +# define __off_t_defined +# endif +# if defined __USE_LARGEFILE64 && !defined __off64_t_defined +typedef __off64_t off64_t; +# define __off64_t_defined +# endif + +# ifndef __ssize_t_defined +typedef __ssize_t ssize_t; +# define __ssize_t_defined +# endif +#endif + /* The type of the second argument to `fgetpos' and `fsetpos'. */ __BEGIN_NAMESPACE_STD #ifndef __USE_FILE_OFFSET64 --- libc/io/fcntl.h.jj 2009-05-16 19:23:35.000000000 +0200 +++ libc/io/fcntl.h 2010-01-07 02:02:59.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007, 2009 +/* Copyright (C) 1991,1992,1994-2001,2003,2004,2005,2006,2007,2009,2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -34,7 +34,7 @@ __BEGIN_DECLS #include /* For XPG all symbols from should also be available. */ -#ifdef __USE_XOPEN +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 # include #endif @@ -50,7 +50,8 @@ __BEGIN_DECLS #endif /* Use misc. */ /* XPG wants the following symbols. */ -#ifdef __USE_XOPEN /* has the same definitions. */ +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 + /* has the same definitions. */ # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Seek from end of file. */ --- libc/posix/glob.h.jj 2009-05-16 19:23:37.000000000 +0200 +++ libc/posix/glob.h 2010-01-07 02:11:23.000000000 +0100 @@ -1,4 +1,5 @@ -/* Copyright (C) 1991,92,95-98,2000,2001,2004 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,95-98,2000,2001,2004,2010 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,7 +28,7 @@ __BEGIN_DECLS #ifndef __size_t # if defined __GNUC__ && __GNUC__ >= 2 typedef __SIZE_TYPE__ __size_t; -# ifdef __USE_XOPEN +# if defined __USE_XOPEN || defined __USE_XOPEN2K8 typedef __SIZE_TYPE__ size_t; # endif # else --- libc/posix/sys/types.h.jj 2009-05-16 19:23:37.000000000 +0200 +++ libc/posix/sys/types.h 2010-01-07 02:19:06.000000000 +0100 @@ -1,5 +1,5 @@ -/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006 - Free Software Foundation, Inc. +/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006, + 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -101,7 +101,8 @@ typedef __pid_t pid_t; # define __pid_t_defined #endif -#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __id_t_defined +#if (defined __USE_SVID || defined __USE_XOPEN || __USE_XOPEN2K8) \ + && !defined __id_t_defined typedef __id_t id_t; # define __id_t_defined #endif @@ -124,7 +125,7 @@ typedef __key_t key_t; # define __key_t_defined #endif -#ifdef __USE_XOPEN +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 # define __need_clock_t #endif #define __need_time_t --- libc/posix/sys/wait.h.jj 2009-05-17 13:19:03.000000000 +0200 +++ libc/posix/sys/wait.h 2010-01-07 02:15:22.000000000 +0100 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007,2009 +/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007,2009,2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -98,7 +98,7 @@ typedef union #endif /* The following values are used by the `waitid' function. */ -#if defined __USE_SVID || defined __USE_XOPEN +#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8 typedef enum { P_ALL, /* Wait for any child. */ @@ -138,7 +138,7 @@ extern __pid_t wait (__WAIT_STATUS __sta __THROW. */ extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options); -#if defined __USE_SVID || defined __USE_XOPEN +#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8 # define __need_siginfo_t # include /* Wait for a childing matching IDTYPE and ID to change the status and Jakub