Subject: bug#15023: Re[2]: bug#15023: Coreutils on IRIX

From: "Rainer M. Canavan" <[email-masked]>
Date: Thu, 8 Aug 2013 01:40:45 +0200 (CEST)

Paul Eggert <[email-masked]> wrote:
Thanks, this is a tricky area, but does the following
patch fix that first problem?  If not, can you suggest
something similar?  I'm hoping that IRIX <sys/time.h>
#defines _SYS_TIME_H -- or perhaps it defines some other
symbol.

diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 09c9601..c953428 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -27,8 +27,11 @@
 /* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>.
    Simply delegate to the system's header in this case; it is a no-op.
    Without this extra ifdef, the C++ gettimeofday declaration below
-   would be a forward declaration in gnulib's nested <sys/time.h>.  */
-#ifdef _CYGWIN_SYS_TIME_H
+   would be a forward declaration in gnulib's nested <sys/time.h>.
+
+   On IRIX, <sys/time.h> also includes itself recursively via <sys/select.h>.
+   Again, delegate to the system's header in this case.  */
+#if defined _CYGWIN_SYS_TIME_H || (defined __sgi && defined _SYS_TIME_H)
 # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
 #else

That patch doesn't apply to 8.21, and despite building a current
automake and autoconf, bootstrapping the current git version fails.
I think the result should look like this in 8.21:
 
/* The include_next requires a split double-inclusion guard.  */
/* #if @HAVE_SYS_TIME_H@*/
#if defined _CYGWIN_SYS_TIME_H || (defined __sgi && defined _SYS_TIME_H)
# @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@
#endif

This results in a different Error lib/gettime.c:

c99  -I. -I./lib  -Ilib -I./lib -Isrc -I./src -I/usr/nekoware/include   -O3 -mips4 -OPT:Olimit=0:roundoff=3 -TARG:platform=IP27:proc=r10000 -n32 -c -o lib/gettime.o lib/gettime.c

cc-1204 c99: WARNING File = ./lib/sys/time.h, Line = 399
  The indicated declaration is not visible outside of the function.

  _GL_FUNCDECL_RPL (gettimeofday, int,
  ^

cc-1070 c99: ERROR File = lib/gettime.c, Line = 41
  The indicated type is incomplete.

      struct timeval tv;
                     ^

1 error detected in the compilation of "lib/gettime.c".

Output of c99  -I. -I./lib  -Ilib -I./lib -Isrc -I./src -I/usr/nekoware/include   -O3 -mips4 -OPT:Olimit=0:roundoff=3 -TARG:platform=IP27:proc=r10000 -n32 -c -E lib/gettime.c
below.

rainer

#line 1 "lib/gettime.c"

#line 1 "./lib/config.h"

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
#line 3027 "./lib/config.h"

 

 

 

#line 3062 "./lib/config.h"

 

 

 

 

 

 

 
#line 3147 "./lib/config.h"

#line 3166 "./lib/config.h"

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
#line 21 "lib/gettime.c"

#line 1 "lib/timespec.h"

#line 1 "./lib/time.h"

 
#line 36 "./lib/time.h"

#line 1 "lib/time.h"

 

#line 1 "./lib/time.h"

 

#line 1 "/usr/include/time.h"

#line 1 "/usr/include/internal/time_core.h"

#ident "$Revision: 1.7 $"

 

#line 1 "/usr/include/standards.h"

#ident "$Id: standards.h,v 1.22 2002/08/07 14:51:48 raji Exp $"

 

#line 85 "/usr/include/standards.h"

#line 111 "/usr/include/standards.h"

 
#line 143 "/usr/include/standards.h"

#line 157 "/usr/include/standards.h"

#line 166 "/usr/include/standards.h"

#line 182 "/usr/include/standards.h"

 

#line 235 "/usr/include/standards.h"

 

#line 33 "/usr/include/internal/time_core.h"
#line 1 "/usr/include/internal/sgimacros.h"

 

#line 82 "/usr/include/internal/sgimacros.h"

#line 98 "/usr/include/internal/sgimacros.h"

#line 107 "/usr/include/internal/sgimacros.h"

#line 34 "/usr/include/internal/time_core.h"
#line 1 "./lib/sys/types.h"

 
#line 1 "lib/sys/types.h"

 
#line 1 "./lib/sys/types.h"

 
#line 1 "/usr/include/sys/types.h"

 

#ident	"$Revision: 3.148 $"

#line 1 "/usr/include/sgidefs.h"

#ident "$Revision: 1.11 $"

 

 

 

 

#line 135 "/usr/include/sgidefs.h"

typedef int __int32_t;
typedef unsigned  __uint32_t;

#line 145 "/usr/include/sgidefs.h"

typedef long long __int64_t;
typedef unsigned long long  __uint64_t;

#line 215 "/usr/include/sgidefs.h"

typedef __int32_t __psint_t;
typedef __uint32_t __psunsigned_t;

#line 239 "/usr/include/sgidefs.h"

typedef __int32_t __scint_t;
typedef __uint32_t __scunsigned_t;

#line 31 "/usr/include/sys/types.h"

typedef unsigned char   uchar_t;
typedef unsigned short  ushort_t;
typedef unsigned int    uint_t;
typedef unsigned long   ulong_t;

#line 1 "/usr/include/sys/pthread.h"

typedef unsigned int 		pthread_t;		 

typedef struct { long __D[5]; } pthread_attr_t;		 
typedef struct { long __D[8]; } pthread_mutex_t;	 
typedef struct { long __D[2]; } pthread_mutexattr_t;	 
typedef struct { long __D[8]; } pthread_cond_t;		 
typedef struct { long __D[2]; } pthread_condattr_t;	 
typedef struct { long __D[16]; } pthread_rwlock_t;	 
typedef struct { long __D[4]; } pthread_rwlockattr_t;	 
typedef int			pthread_key_t;		 
typedef int			pthread_once_t;		 
typedef struct { long __D[2]; } pthread_barrierattr_t;	 
typedef struct { long __D[16]; } pthread_barrier_t;	 
typedef struct { long __D[4]; } pthread_spinlock_t;	 

#line 42 "/usr/include/sys/types.h"

typedef long blksize_t;
typedef long suseconds_t;

typedef	long	xtiscalar_t;
typedef	unsigned long	xtiuscalar_t;

typedef xtiscalar_t t_scalar_t;
typedef xtiuscalar_t t_uscalar_t;

typedef	char *		addr_t;		 
typedef	char *		caddr_t;	 

typedef	__int64_t	daddr_t;	 

typedef	long		pgno_t;		 
typedef	__uint32_t	pfn_t;		 
typedef	short		cnt_t;		 
typedef unsigned long	basictime_t;
typedef __int64_t	micro_t;

typedef __int32_t	pgcnt_t;	 

typedef enum { B_FALSE, B_TRUE } boolean_t;

typedef long			id_t;	 

 

typedef ulong_t	major_t;	 
typedef ulong_t	minor_t;	 

typedef	ushort_t o_mode_t;		 
typedef short	o_dev_t;		 
typedef	ushort_t o_uid_t;		 
typedef	o_uid_t	o_gid_t;		 
typedef	short	o_nlink_t;		 
typedef short	o_pid_t;		 
typedef __uint32_t o_ino_t;		 

typedef	unsigned long	mode_t;		 
typedef	unsigned long	dev_t;		 
typedef	long		uid_t;
typedef	long		gid_t;
typedef unsigned long	nlink_t;	 
typedef long		pid_t;		 
#line 148 "/usr/include/sys/types.h"

typedef int tid_t;                       

typedef dev_t	vertex_hdl_t;		 

typedef	__uint64_t	ino_t;		 

typedef __uint64_t	ino64_t;	 

#line 167 "/usr/include/sys/types.h"
typedef __int64_t	off_t;		 

typedef	__int64_t	off64_t;	 

typedef __scint_t	__scoff_t;	 

typedef __scoff_t	scoff_t;	 

typedef	__int64_t	blkcnt64_t;
typedef	__uint64_t	fsblkcnt64_t;
typedef	__uint64_t	fsfilcnt64_t;

typedef	__int64_t	blkcnt_t;	 
typedef	__uint64_t	fsblkcnt_t;	 
typedef	__uint64_t	fsfilcnt_t;	 

typedef	long		swblk_t;
typedef	unsigned long	paddr_t;	 
typedef	unsigned long	iopaddr_t;	 
typedef	int		key_t;		 
typedef	unsigned char	use_t;		 
typedef	long		sysid_t;
typedef	short		index_t;

typedef signed short	nasid_t;         
typedef signed short	cnodeid_t;	 
typedef	signed char  	partid_t;	 
typedef signed short 	moduleid_t;	 
typedef signed short 	cmoduleid_t;	 
typedef	uchar_t		clusterid_t;	 

typedef unsigned int 	lock_t;		 
typedef	signed short	cpuid_t;	 
typedef	unsigned char	pri_t;		 
typedef __uint64_t	accum_t;	 
typedef __int64_t	prid_t;		 
typedef __int64_t	ash_t;		 
typedef short		cell_t;		 
typedef int		credid_t;	 
typedef __int64_t	jid_t;		 

typedef __int32_t	ncpus_t;
typedef	__uint64_t	id_type_t;

typedef unsigned int size_t;

typedef int    ssize_t;

typedef	long		time_t;		 

typedef	long		clock_t;  

typedef long wchar_t;

typedef int             clockid_t;

typedef int		timer_t;

typedef	unsigned int	useconds_t;

typedef __scunsigned_t	bitnum_t;	 
typedef __scunsigned_t	bitlen_t;	 

typedef int processorid_t;		 
typedef int toid_t;			 
typedef	long *qaddr_t;		       
typedef __uint32_t inst_t;		 

typedef __uint64_t machreg_t;

typedef __uint64_t fpreg_t;

typedef signed char             int8_t;
typedef unsigned char           uint8_t;
typedef signed short            int16_t;
typedef unsigned short          uint16_t;
typedef signed int              int32_t;
typedef unsigned int            uint32_t;
typedef __int64_t 		int64_t;
typedef __uint64_t		uint64_t;
typedef __int64_t 		intmax_t;
typedef __uint64_t		uintmax_t;
typedef signed long int         intptr_t;
typedef unsigned long int       uintptr_t;

typedef	unsigned char	u_int8_t;
typedef	unsigned short	u_int16_t;
typedef	__uint32_t	u_int32_t;

 
typedef	long	hostid_t;

 
#line 1 "/usr/include/sys/bsd_types.h"

#ident	"$Revision: 1.2 $"

typedef	struct { int r[1]; } *	physadr;
typedef	unsigned char	unchar;
typedef	unsigned char	u_char;
typedef	unsigned short	ushort;
typedef	unsigned short	u_short;
typedef	unsigned int	uint;
typedef	unsigned int	u_int;
typedef	unsigned long	ulong;
typedef	unsigned long	u_long;
typedef	struct	_quad { long val[2]; } quad;

#line 1 "./lib/sys/select.h"

 
#line 52 "./lib/sys/select.h"

#line 1 "lib/sys/select.h"

 
#line 66 "lib/sys/select.h"

#line 1 "./lib/sys/types.h"

 
#line 1 "lib/sys/types.h"

 
#line 1 "./lib/sys/types.h"

 
#line 1 "/usr/include/sys/types.h"

 

#line 28 "./lib/sys/types.h"

#line 43 "./lib/sys/types.h"

#line 28 "lib/sys/types.h"

#line 28 "./lib/sys/types.h"

#line 73 "lib/sys/select.h"

#line 1 "./lib/sys/time.h"

 

 

 

 

#line 163 "./lib/sys/time.h"

#line 181 "./lib/sys/time.h"

#line 206 "./lib/sys/time.h"

#line 224 "./lib/sys/time.h"

#line 249 "./lib/sys/time.h"

#line 277 "./lib/sys/time.h"

#line 305 "./lib/sys/time.h"

 
#line 319 "./lib/sys/time.h"

#line 336 "./lib/sys/time.h"

#line 357 "./lib/sys/time.h"

#line 367 "./lib/sys/time.h"

#line 388 "./lib/sys/time.h"

#line 399 "./lib/sys/time.h"
extern int rpl_gettimeofday (struct timeval *restrict, void *restrict);

extern int _gl_cxxalias_dummy;
#line 415 "./lib/sys/time.h"
extern int _gl_cxxalias_dummy;
#line 423 "./lib/sys/time.h"

#line 514 "./lib/sys/time.h"

#line 83 "lib/sys/select.h"

 
#line 1 "./lib/sys/select.h"

 
#line 66 "./lib/sys/select.h"

#line 1 "./lib/sys/types.h"

#line 73 "./lib/sys/select.h"

 

#line 1 "/usr/include/sys/select.h"

 

#ident	"$Revision: 1.18 $"

 

typedef	long	fd_mask_t;
typedef	unsigned long	ufd_mask_t;

typedef struct fd_set {

	fd_mask_t	fds_bits[(((1024)+(((int)(sizeof(fd_mask_t) * 8))-1))/((int)(sizeof(fd_mask_t) * 8)))];
} fd_set;

#line 1 "./lib/string.h"

 
#line 1 "lib/string.h"

 
#line 1 "./lib/string.h"

 
#line 1 "/usr/include/string.h"

#line 1 "/usr/include/internal/string_core.h"

#ident "$Revision: 1.5 $"

 

 

#line 50 "/usr/include/internal/string_core.h"

extern void *memcpy(void * __restrict, const void * __restrict, size_t);
extern void *memmove(void *, const void *, size_t);
extern char *strcpy(char * __restrict, const char * __restrict);
extern char *strncpy(char * __restrict, const char * __restrict, size_t);

extern char *strcat(char * __restrict, const char * __restrict);
extern char *strncat(char * __restrict, const char * __restrict, size_t);

extern void *memccpy(void *, const void *, int, size_t);
extern int memcmp(const void *, const void *, size_t);
extern int strcmp(const char *, const char *);
extern int strcoll(const char *, const char *);
extern int strncmp(const char *, const char *, size_t);
extern size_t strxfrm(char * __restrict, const char * __restrict, size_t);

extern void *memchr(const void *, int, size_t);
extern char *strchr(const char *, int);

extern size_t strcspn(const char *, const char *);
#pragma int_to_unsigned strcspn

extern char *strpbrk(const char *, const char *);
extern char *strrchr(const char *, int);

extern size_t strspn(const char *, const char *);
#pragma int_to_unsigned strspn

extern char *strstr(const char *, const char *);

extern char *strtok(char * __restrict, const char * __restrict);

extern void *memset(void *, int, size_t);
extern char *strerror(int);
extern size_t strlen(const char *);
#pragma int_to_unsigned strlen

extern int ffs(int);
 
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *,
		 size_t);

extern  size_t strlcat(char *, const char *,
		 size_t);
extern  size_t strlcpy(char *, const char *,
		 size_t);

#pragma optional strlcat
#pragma optional strlcpy

extern char *strdup(const char *);

extern char *strtok_r(char *, const char *, char **);

#pragma intrinsic (strcpy)  
#pragma intrinsic (strcmp)  
#pragma intrinsic (strlen)  

#pragma intrinsic (memcpy)
#pragma intrinsic (memmove)
#pragma intrinsic (memset)

#pragma intrinsic (memcmp)

#line 234 "/usr/include/internal/string_core.h"

#line 5 "/usr/include/string.h"

#line 28 "./lib/string.h"

#line 1 "/usr/include/stddef.h"

#line 1 "/usr/include/internal/stddef_core.h"

 

#ident "$Revision: 1.2 $"

typedef int 	ptrdiff_t;

#line 51 "/usr/include/internal/stddef_core.h"

#line 65 "/usr/include/internal/stddef_core.h"

#line 5 "/usr/include/stddef.h"

#line 34 "./lib/string.h"

 

#line 311 "./lib/string.h"

#line 323 "./lib/string.h"

#line 340 "./lib/string.h"

#line 361 "./lib/string.h"

#line 371 "./lib/string.h"

#line 386 "./lib/string.h"

#line 401 "./lib/string.h"

#line 419 "./lib/string.h"

extern int _gl_cxxalias_dummy;
#line 432 "./lib/string.h"
extern int _gl_cxxalias_dummy;
#line 440 "./lib/string.h"

#line 476 "./lib/string.h"

extern void * mempcpy (void *restrict __dest, void const *restrict __src, size_t __n);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 497 "./lib/string.h"

extern void * memrchr (void const *, int, size_t);

extern int _gl_cxxalias_dummy;
#line 516 "./lib/string.h"
extern int _gl_cxxalias_dummy;
#line 525 "./lib/string.h"

extern void * rawmemchr (void const *__s, int __c_in);

extern int _gl_cxxalias_dummy;
#line 546 "./lib/string.h"
extern int _gl_cxxalias_dummy;
#line 555 "./lib/string.h"

extern char * stpcpy (char *restrict __dst, char const *restrict __src);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 573 "./lib/string.h"

#line 591 "./lib/string.h"
extern char * stpncpy (char *restrict __dst, char const *restrict __src, size_t __n);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 608 "./lib/string.h"

#line 618 "./lib/string.h"

#line 632 "./lib/string.h"
extern char * strchrnul (char const *__s, int __c_in);

extern int _gl_cxxalias_dummy;
#line 648 "./lib/string.h"
extern int _gl_cxxalias_dummy;
#line 657 "./lib/string.h"

#line 675 "./lib/string.h"
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 685 "./lib/string.h"

#line 693 "./lib/string.h"
extern char * rpl_strncat (char *dest, const char *src, size_t n);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 707 "./lib/string.h"

#line 720 "./lib/string.h"
extern char * strndup (char const *__string, size_t __n);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 733 "./lib/string.h"

#line 749 "./lib/string.h"
extern size_t strnlen (char const *__string, size_t __maxlen);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 763 "./lib/string.h"

#line 775 "./lib/string.h"

#line 783 "./lib/string.h"

extern int _gl_cxxalias_dummy;
#line 795 "./lib/string.h"
extern int _gl_cxxalias_dummy;
#line 814 "./lib/string.h"

#line 824 "./lib/string.h"

#line 834 "./lib/string.h"

#line 873 "./lib/string.h"

#line 884 "./lib/string.h"

extern int _gl_cxxalias_dummy;
#line 897 "./lib/string.h"
extern int _gl_cxxalias_dummy;
#line 912 "./lib/string.h"

#line 961 "./lib/string.h"

#line 1024 "./lib/string.h"

 
#line 1044 "./lib/string.h"
extern size_t mbslen (const char *string);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;

#line 1059 "./lib/string.h"

#line 1081 "./lib/string.h"

#line 1103 "./lib/string.h"

extern char * mbsstr (const char *haystack, const char *needle)
     
     ;

extern int mbscasecmp (const char *s1, const char *s2)
     
     ;

#line 1140 "./lib/string.h"

#line 1154 "./lib/string.h"

#line 1165 "./lib/string.h"

#line 1176 "./lib/string.h"

#line 1198 "./lib/string.h"

#line 1209 "./lib/string.h"

#line 1228 "./lib/string.h"

#line 1249 "./lib/string.h"

#line 1257 "./lib/string.h"
extern char * rpl_strerror (int);
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 1269 "./lib/string.h"

#line 1298 "./lib/string.h"

#line 1308 "./lib/string.h"
extern char * strsignal (int __sig);

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 1322 "./lib/string.h"

#line 1338 "./lib/string.h"

#line 28 "lib/string.h"

#line 28 "./lib/string.h"

#line 81 "/usr/include/sys/select.h"

#line 94 "/usr/include/sys/select.h"

#line 106 "/usr/include/sys/select.h"

typedef	long	fd_mask;

#line 95 "./lib/sys/select.h"

#line 1 "./lib/signal.h"

#line 39 "./lib/signal.h"

#line 1 "./lib/sys/types.h"

#line 50 "./lib/signal.h"

#line 1 "lib/signal.h"

 

#line 1 "./lib/signal.h"

 

#line 1 "/usr/include/signal.h"

#line 1 "/usr/include/internal/signal_core.h"

#ident "$Revision: 1.5 $"

 

#line 1 "/usr/include/sys/signal.h"

 

#ident	"$Revision: 3.148 $"

 
#line 73 "/usr/include/sys/signal.h"

#line 1 "./lib/sys/types.h"

#line 82 "/usr/include/sys/signal.h"

 

typedef void	(*SIG_PF) ();

#line 1 "/usr/include/sys/sigevent.h"

#ident	"$Revision: 1.9 $"

#line 1 "./lib/sys/types.h"

#line 31 "/usr/include/sys/sigevent.h"

typedef union sigval {
	int	sival_int;
	void	*sival_ptr;
} sigval_t;
#line 48 "/usr/include/sys/sigevent.h"

typedef union notifyinfo {
	int	nisigno;			 
	void	(*nifunc) (sigval_t);	 	 
} notifyinfo_t;

typedef struct sigevent {
	int			sigev_notify;
	notifyinfo_t		sigev_notifyinfo;
	sigval_t		sigev_value;
	void 			(*sigev_notify_function) (sigval_t);
        pthread_attr_t 		*sigev_notify_attributes;
	unsigned long		sigev_reserved[11];
	unsigned long		sigev_pad[6];
} sigevent_t;

#line 117 "/usr/include/sys/signal.h"

#line 1 "/usr/include/sys/siginfo.h"

 

#ident "$Revision: 1.28 $"

 

typedef struct __siginfo {
	int	si_signo;		 
	int 	si_code;		 
	int	si_errno;		 
	union {

		int	si_pad[((128 / sizeof(__int32_t)) - 3)];	 

		struct {			 
			pid_t	__pid;		 
			union {
				struct {
					uid_t	__uid;
				} __kill;
				struct {
					clock_t __utime;
					int __status;
					clock_t __stime;
					int __swap;
				} __cld;
			} __pdata;
		} __proc;			

		struct {	 
			void 	*__addr;	 
		} __fault;

		struct {			 
		 
			int	__fd;	 
			long	__band;
		} __file;

		union sigval	__value;

	} __data;

} siginfo_t;

#line 109 "/usr/include/sys/siginfo.h"

#line 117 "/usr/include/sys/siginfo.h"

 
#line 140 "/usr/include/sys/siginfo.h"

#line 155 "/usr/include/sys/siginfo.h"

 
#line 174 "/usr/include/sys/siginfo.h"

 
#line 196 "/usr/include/sys/siginfo.h"

#line 209 "/usr/include/sys/siginfo.h"

#line 124 "/usr/include/sys/signal.h"

typedef struct {                 
        __uint32_t __sigbits[4];
} sigset_t;

typedef union __sighandler {
    	void (*sa_handler1)();  

    	void (*sa_sigaction1)(int, siginfo_t *, void *);

} __sighandler_t;

typedef struct sigaction {
	int sa_flags;			 
    	__sighandler_t sa_sighandler;	 
	sigset_t sa_mask;		 
					 
	int sa_resv[2];
} sigaction_t;

 
#line 178 "/usr/include/sys/signal.h"

 

					 

struct sigstack {
	void	*ss_sp;			 
	int	ss_onstack;		 
};

#line 1 "/usr/include/sys/ucontext.h"

 

#ident "$Revision: 1.37 $"

#line 44 "/usr/include/sys/ucontext.h"

#line 1 "./lib/sys/types.h"

#line 47 "/usr/include/sys/ucontext.h"

#line 54 "/usr/include/sys/ucontext.h"

typedef struct _sigaltstack {
	void	*ss_sp;
	size_t	ss_size;
	int	ss_flags;
} stack_t;
#line 69 "/usr/include/sys/ucontext.h"

#line 116 "/usr/include/sys/ucontext.h"

typedef machreg_t greg_t;

typedef greg_t gregset_t[37];

typedef struct __fpregset {
	union {
		double		__fp_dregs[32];

		struct {
			__uint32_t	_fp_fill;
			float		_fp_fregs;
		} __fp_fregs[32];
#line 150 "/usr/include/sys/ucontext.h"
		machreg_t	__fp_regs[32];
	} __fp_r;
	__uint32_t 	__fp_csr;
	__uint32_t	__fp_pad;
} fpregset_t;

typedef struct {
	gregset_t	__gregs;	 
	fpregset_t 	__fpregs;	 
} mcontext_t;

typedef struct __ucontext {
	unsigned long	uc_flags;
	struct __ucontext *uc_link;
	sigset_t   	uc_sigmask;
	stack_t 	uc_stack;
	mcontext_t 	uc_mcontext;
	long		uc_filler[49];
} ucontext_t;

 

#line 250 "/usr/include/sys/ucontext.h"

#line 289 "/usr/include/sys/ucontext.h"

#line 341 "/usr/include/sys/ucontext.h"

#line 224 "/usr/include/sys/signal.h"

#line 277 "/usr/include/sys/signal.h"

extern void	(*bsd_signal(int, void (*)(int)))(int);
extern int	killpg(pid_t, int);
extern int	sigstack(struct sigstack *, struct sigstack *);

extern void	(*signal(int,void (*)()))();

 
typedef struct sigcontext {
	__uint32_t	sc_regmask;	 
	__uint32_t	sc_status;	 
	__uint64_t	sc_pc;		 

	__uint64_t	sc_regs[32];	 

	__uint64_t	sc_fpregs[32];	 
	__uint32_t	sc_ownedfp;	 
	__uint32_t	sc_fpc_csr;	 
	__uint32_t	sc_fpc_eir;	 
					 
	__uint32_t	sc_ssflags;	 
	__uint64_t	sc_mdhi;	 
	__uint64_t	sc_mdlo;

	__uint64_t	sc_cause;	 
	__uint64_t	sc_badvaddr;	 
	__uint64_t	sc_triggersave;	 
	sigset_t	sc_sigset;	 
	__uint64_t	sc_fp_rounded_result;	 
	__uint64_t	sc_pad[31];
} sigcontext_t;

 

#line 370 "/usr/include/sys/signal.h"

#line 383 "/usr/include/sys/signal.h"

#line 398 "/usr/include/sys/signal.h"

#line 120 "/usr/include/internal/signal_core.h"

typedef int 	sig_atomic_t;
extern int raise(int);

extern int kill(pid_t, int);

extern int sigaction(int, const struct sigaction *, struct sigaction *);
extern int sigpending(sigset_t *);
extern int sigprocmask(int, const sigset_t *, sigset_t *);
extern int sigsuspend(const sigset_t *);
extern int sigaddset(sigset_t *, int);
extern int sigdelset(sigset_t *, int);
extern int sigemptyset(sigset_t *);
extern int sigfillset(sigset_t *);
extern int sigismember(const sigset_t *, int);

#line 1 "/usr/include/sys/timespec.h"

#ident	"$Revision: 1.11 $"

#line 1 "./lib/sys/types.h"

#line 42 "/usr/include/sys/timespec.h"

typedef struct timespec {

	time_t  tv_sec;		 

	long    tv_nsec;

} timespec_t;

#line 155 "/usr/include/internal/signal_core.h"

extern int sigqueue(pid_t , int, const union sigval);
extern int sigwaitinfo(const sigset_t *, siginfo_t *);
extern int sigtimedwait(const sigset_t *, siginfo_t *, const timespec_t *);
extern int sigwait(const sigset_t *, int *);

#line 1 "./lib/sys/types.h"

#line 169 "/usr/include/internal/signal_core.h"

extern int pthread_kill(pthread_t, int);
extern int pthread_sigmask(int, const sigset_t *, sigset_t *);

extern int sigpause(int);

extern void (*sigset(int,void (*)()))();

extern int sighold(int);
extern int sigrelse(int);
extern int sigignore(int);
extern int siginterrupt(int, int);

extern int _sigaltstack(const stack_t *, stack_t *);
#line 199 "/usr/include/internal/signal_core.h"

extern char *_sys_siglist[];
extern int _sys_nsig;

#line 1 "./lib/sys/types.h"

#line 211 "/usr/include/internal/signal_core.h"
#line 1 "/usr/include/sys/procset.h"

 

#ident "$Revision: 1.12 $"

#line 1 "./lib/sys/types.h"

#line 25 "/usr/include/sys/procset.h"

 

typedef enum idtype

{
	P_PID,		 
	P_PPID,		 
	P_PGID,		 
			 
	P_SID,		 
	P_CID,		 
	P_UID,		 
	P_GID,		 
	P_ALL		 
} idtype_t;

typedef enum idop {
	POP_DIFF,	 

	POP_AND,	 

	POP_OR,		 

	POP_XOR		 

} idop_t;

typedef struct procset {
	idop_t		p_op;	 

	idtype_t	p_lidtype;

	id_t		p_lid;	 

	idtype_t	p_ridtype;

	id_t		p_rid;	 
} procset_t;

#line 114 "/usr/include/sys/procset.h"

#line 125 "/usr/include/sys/procset.h"

#line 212 "/usr/include/internal/signal_core.h"

extern int (*ssignal(int, int (*)(int)))(int);
extern int gsignal(int);
extern int sigsend(idtype_t, id_t, int);
extern int sigsendset(const procset_t *, int);

 

extern int sgi_altersigs(int, sigset_t *, int[]);
extern int sgi_sigffset(sigset_t *, int);
extern int sgi_dumpset(sigset_t *);

#line 5 "/usr/include/signal.h"

#line 37 "./lib/signal.h"

#line 37 "lib/signal.h"

#line 53 "./lib/signal.h"

 
#line 324 "./lib/signal.h"

#line 336 "./lib/signal.h"

#line 353 "./lib/signal.h"

#line 374 "./lib/signal.h"

#line 384 "./lib/signal.h"

#line 396 "./lib/signal.h"

#line 404 "./lib/signal.h"

typedef void (*sighandler_t) (int);
#line 418 "./lib/signal.h"

#line 429 "./lib/signal.h"

#line 465 "./lib/signal.h"

#line 479 "./lib/signal.h"
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 488 "./lib/signal.h"

#line 509 "./lib/signal.h"

#line 520 "./lib/signal.h"
extern int _gl_cxxalias_dummy;
extern int _gl_cxxalias_dummy;

#line 532 "./lib/signal.h"
extern int _gl_cxxalias_dummy;
extern int _gl_cxxalias_dummy;

#line 545 "./lib/signal.h"
extern int _gl_cxxalias_dummy;
extern int _gl_cxxalias_dummy;

#line 558 "./lib/signal.h"
extern int _gl_cxxalias_dummy;
extern int _gl_cxxalias_dummy;

#line 570 "./lib/signal.h"
extern int _gl_cxxalias_dummy;
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
extern int _gl_cxxalias_dummy;

#line 592 "./lib/signal.h"
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;

typedef void (*_gl_function_taking_int_returning_void_t) (int);
#line 617 "./lib/signal.h"
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;

#line 664 "./lib/signal.h"

#line 738 "./lib/signal.h"

extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;

#line 750 "./lib/signal.h"

#line 104 "./lib/sys/select.h"

#line 131 "./lib/sys/select.h"

#line 388 "./lib/sys/select.h"

#line 405 "./lib/sys/select.h"

#line 426 "./lib/sys/select.h"

#line 436 "./lib/sys/select.h"

#line 467 "./lib/sys/select.h"

#line 549 "./lib/sys/select.h"

#line 581 "./lib/sys/select.h"

#line 593 "./lib/sys/select.h"
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 607 "./lib/sys/select.h"

#line 95 "lib/sys/select.h"

#line 1 "./lib/signal.h"

#line 39 "./lib/signal.h"

#line 104 "lib/sys/select.h"

#line 55 "./lib/sys/select.h"

#line 45 "/usr/include/sys/bsd_types.h"

#line 407 "/usr/include/sys/types.h"

typedef __uint64_t k_sigset_t;	 
#line 419 "/usr/include/sys/types.h"

#line 537 "/usr/include/sys/types.h"

#line 28 "./lib/sys/types.h"

#line 28 "lib/sys/types.h"

#line 28 "./lib/sys/types.h"

#line 35 "/usr/include/internal/time_core.h"

#line 53 "/usr/include/internal/time_core.h"

#line 63 "/usr/include/internal/time_core.h"

#line 73 "/usr/include/internal/time_core.h"

#line 1 "/usr/include/sys/ptimers.h"

#ident "$Id: ptimers.h,v 1.5 2002/08/07 15:19:38 murthy Exp $"

typedef struct itimerspec {
	timespec_t it_interval;	 
	timespec_t it_value;	 
} itimerspec_t;

 

#line 61 "/usr/include/sys/ptimers.h"

#line 82 "/usr/include/internal/time_core.h"

#line 93 "/usr/include/internal/time_core.h"

struct	tm {	 
	int	tm_sec;
	int	tm_min;
	int	tm_hour;
	int	tm_mday;
	int	tm_mon;
	int	tm_year;
	int	tm_wday;
	int	tm_yday;
	int	tm_isdst;
};

 

extern clock_t clock(void);			
extern double difftime(time_t, time_t);		
extern time_t mktime(struct tm *);		
extern time_t time(time_t *);			

extern char *asctime(const struct tm *);		
extern char *ctime (const time_t *);		
extern struct tm *gmtime(const time_t *);		
extern struct tm *localtime(const time_t *);	
extern size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict);

extern uint64_t rdrtc(void);

#pragma optional rdrtc

extern void tzset(void);
extern char *tzname[2];

extern long _sysconf(int);

struct sigevent;
extern int clock_settime(clockid_t, const timespec_t *);
extern int clock_gettime(clockid_t, timespec_t *);
extern int clock_getres(clockid_t, timespec_t *);
extern int nanosleep(const timespec_t *, timespec_t *);
extern int timer_create(clockid_t, struct sigevent *, timer_t *);
extern int timer_delete(timer_t);
extern int timer_settime(timer_t, int, const struct itimerspec *, struct itimerspec *);
extern int timer_gettime(timer_t, struct itimerspec *);
extern int timer_getoverrun(timer_t);

#pragma optional nanosleep

extern time_t timezone;
extern int daylight;
extern char *strptime(const char *, const char *, struct tm *);

extern struct tm *getdate(const char *);
extern int getdate_err;

extern int cftime(char *, char *, const  time_t *);
extern int ascftime(char *, const char *, const struct tm *);
extern time_t altzone;

extern char *asctime_r(const struct tm *, char *);
extern char *ctime_r(const  time_t *, char *);
extern struct tm *gmtime_r(const  time_t *,
                           struct tm *);
extern struct tm *localtime_r(const  time_t *,
                              struct tm *);

#line 5 "/usr/include/time.h"

#line 34 "./lib/time.h"

#line 34 "lib/time.h"

#line 40 "./lib/time.h"

#line 300 "./lib/time.h"

#line 312 "./lib/time.h"

#line 329 "./lib/time.h"

#line 350 "./lib/time.h"

#line 360 "./lib/time.h"

#line 400 "./lib/time.h"

struct __time_t_must_be_integral {
  unsigned int __floating_time_t_unsupported : (time_t) 1;
};

extern int rpl_nanosleep (struct timespec const *__rqtp, struct timespec *__rmtp);

extern int _gl_cxxalias_dummy;
#line 435 "./lib/time.h"
extern int _gl_cxxalias_dummy;

extern time_t rpl_mktime (struct tm *__tp);
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;

#line 472 "./lib/time.h"
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
#line 494 "./lib/time.h"
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;

#line 517 "./lib/time.h"

#line 535 "./lib/time.h"

#line 559 "./lib/time.h"

#line 23 "lib/timespec.h"

static  int
timespec_cmp (struct timespec a, struct timespec b)
{
  return (a.tv_sec < b.tv_sec ? -1
          : a.tv_sec > b.tv_sec ? 1
          : (int) (a.tv_nsec - b.tv_nsec));
}

static  int
timespec_sign (struct timespec a)
{
  return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
}

struct timespec timespec_add (struct timespec, struct timespec)
  ;
struct timespec timespec_sub (struct timespec, struct timespec)
  ;
struct timespec dtotimespec (double)
  ;

static  double
timespectod (struct timespec a)
{
  return a.tv_sec + a.tv_nsec / 1e9;
}

void gettime (struct timespec *);
int settime (struct timespec const *);

#line 23 "lib/gettime.c"

void
gettime (struct timespec *ts)
{

  if (clock_gettime (1, ts) == 0)
    return;

  {
    struct timeval tv;
    rpl_gettimeofday (&tv, 0L);
    ts->tv_sec = tv.tv_sec;
    ts->tv_nsec = tv.tv_usec * 1000;
  }

}