Bug#891505: glibc: Causes FTBFS of gcc-8 on hurd-i386

2018-02-27 Thread Svante Signell
On Mon, 2018-02-26 at 23:55 +0100, Samuel Thibault wrote:
> Svante Signell, on lun. 26 févr. 2018 11:22:22 +0100, wrote:
> > creates a defect gen-sysinfo.go file when libc0.3 >= 2.26-* is installed.
> 
> A lot of cleanup has happened, yes. The question is what actually made
> gcc-8 to break. Just looking at the diff of the build logs, there's
> 
>   could not determine number of signals
...
> To confirm this hypothesis, you could modify your
> /usr/include/i386-gnu/bits/signum-generic.h
> from
>   #define _NSIG  (__SIGRTMAX + 1)
> to 
>   #define _NSIG  32

You mean 33, right?

With that change the number of signals are correctly calculated. However, there
are still problems with the negative values of _EMIG_* error for Errno()

sysinfo.go:3399:35: error: integer constant overflow
 const EMIG_DESTROY_REQUEST = Errno(_EMIG_DESTROY_REQUEST)
   ^
sysinfo.go:3413:26: error: integer constant overflow
 const EMIG_BAD_ID = Errno(_EMIG_BAD_ID)
  ^
sysinfo.go:3414:31: error: integer constant overflow
 const EMIG_SERVER_DIED = Errno(_EMIG_SERVER_DIED)
   ^
sysinfo.go:3425:32: error: integer constant overflow
 const EMIG_REMOTE_ERROR = Errno(_EMIG_REMOTE_ERROR)
^
sysinfo.go:3429:30: error: integer constant overflow
 const EMIG_TYPE_ERROR = Errno(_EMIG_TYPE_ERROR)
  ^
sysinfo.go:3460:28: error: integer constant overflow
 const EMIG_NO_REPLY = Errno(_EMIG_NO_REPLY)
^
sysinfo.go:3473:34: error: integer constant overflow
 const EMIG_REPLY_MISMATCH = Errno(_EMIG_REPLY_MISMATCH)
  ^
sysinfo.go:3475:33: error: integer constant overflow
 const EMIG_BAD_ARGUMENTS = Errno(_EMIG_BAD_ARGUMENTS)
 ^
sysinfo.go:3540:29: error: integer constant overflow
 const EMIG_EXCEPTION = Errno(_EMIG_EXCEPTION)
 ^
sysinfo.go:3564:35: error: integer constant overflow
 const EMIG_ARRAY_TOO_LARGE = Errno(_EMIG_ARRAY_TOO_LARGE)



Bug#891505: glibc: Causes FTBFS of gcc-8 on hurd-i386

2018-02-26 Thread Svante Signell
On Mon, 2018-02-26 at 11:52 +0100, Samuel Thibault wrote:
> Svante Signell, on lun. 26 févr. 2018 11:49:46 +0100, wrote:
> > Ok, here it is. Be prepared that there are duplicates tough, since the
> > entries
> > are generated in different order. (I've made a partial edit by moving around
> > stuff, but that is not complete)
> 
> Rather than moving around by hand, please just process it through
> "sort", so we are sure that there is no manual editting error, for
> instance
> 
> -// unknowndefine SIGRTMAX (__libc_current_sigrtmax ())// unknowndefine REG_GS
> REG_GS
> +// unknowndefine REG_GS REG_GS
> 
> looks very suspicious.

Attached is a diff file of the sorted entries.--- nOK/gen-sysinfo.go.sorted	2018-02-26 12:03:02.446185024 +0100
+++ OK/gen-sysinfo.go.sorted	2018-02-26 12:03:09.162185200 +0100
@@ -1,4 +1,3 @@
-
 const _ACCESSPERMS = (_S_IRWXU|_S_IRWXG|_S_IRWXO)
 const _AF_APPLETALK = _PF_APPLETALK
 const _AF_CCITT = _PF_CCITT
@@ -180,8 +179,6 @@
 const __BITS_BYTESWAP_H = 1
 const __BITS_CONDITION_ATTR_H = 1
 const __BITS_CONDITION_H = 1
-const __BITS_CPU_SET_H = 1
-const __BITS_ERRNO_H = 1
 const ___BITS_IOCTLS_H = 1
 const __BITS_MUTEX_ATTR_H = 1
 const __BITS_MUTEX_H = 1
@@ -190,36 +187,23 @@
 const __BITS_POSIX2_LIM_H = 1
 const __BITS_POSIX_OPT_H = 1
 const __BITS_PTHREAD_H = 1
-const __BITS_PTHREADTYPES_ARCH_H = 1
 const __BITS_PTHREADTYPES_H = 1
 const __BITS_RWLOCK_ATTR_H = 1
-const __BITS_SCHED_H = 1
 const __BITS_SEMAPHORE_H = 1
 const __BITS_SIGCONTEXT_H = 1
-const __BITS_SIGEVENT_CONSTS_H = 1
-const __BITS_SIGINFO_CONSTS_H = 1
-const __BITS_SIGNUM_GENERIC_H = 1
-const __BITS_SIGNUM_H = 1
 const __BITS_SIGSTACK_H = 1
 const __BITS_SIGTHREAD_H = 1
 const __BITS_SOCKADDR_H = 1
 const ___BITS_SOCKET_H = 1
 const __BITS_SPIN_LOCK_H = 1
-const __BITS_SS_FLAGS_H = 1
 const __BITS_STAT_H = 1
-const __BITS_STDINT_INTN_H = 1
-const __BITS_STDINT_UINTN_H = 1
 const __BITS_SYSMACROS_H = 1
 const __BITS_THREAD_ATTR_H = 1
 const __BITS_THREAD_SPECIFIC_H = 1
 const __BITS_TIME_H = 1
 const __BITS_TYPES_H = 1
 const __BITS_TYPESIZES_H = 1
-const __BITS_TYPES___LOCALE_T_H = 1
-const __BITS_TYPES_LOCALE_T_H = 1
 const __BITS_UINTN_IDENTITY_H = 1
-const __BITS_UIO_EXT_H = 1
-const __BITS_UIO_LIM_H = 1
 const __BITS_WCHAR_H = 1
 const ___BIT_TYPES_DEFINED__ = 1
 const _BRKINT = (1 << 1)
@@ -702,7 +686,6 @@
 const _ETXTBSY = 1073741850
 const _EUSERS = 1073741892
 const _EVENP = 0x0080
-const _EWOULDBLOCK = _EAGAIN
 const _EXDEV = 1073741842
 const _EXPR_NEST_MAX = __POSIX2_EXPR_NEST_MAX
 const _EXTA = 19200
@@ -856,7 +839,6 @@
 const _FNOCTTY = _O_NOCTTY
 const _FNONBLOCK = _O_NONBLOCK
 const _F_OK = 0
-const ___FORCE_ERROR_T_CODES_SIGNED = -1
 const _FPC_DE = 0x0002
 const _FPC_DM = _FPC_DE
 const _FPC_IC = 0x1000
@@ -948,15 +930,11 @@
 const ___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1
 const ___GCC_IEC_559 = 2
 const ___GCC_IEC_559_COMPLEX = 2
-const __GETOPT_CORE_H = 1
-const __GETOPT_POSIX_H = 1
 const ___GLIBC__ = 2
 const ___glibc_c99_flexarr_available = 1
-const ___GLIBC_MINOR__ = 26
-const ___GLIBC_USE_DEPRECATED_GETS = 0
+const ___GLIBC_MINOR__ = 25
 const ___GLIBC_USE_IEC_60559_BFP_EXT = 1
 const ___GLIBC_USE_IEC_60559_FUNCS_EXT = 1
-const ___GLIBC_USE_IEC_60559_TYPES_EXT = 1
 const ___GLIBC_USE_LIB_EXT2 = 1
 const ___GNU__ = 1
 const ___GNUC__ = 8
@@ -987,7 +965,6 @@
 const _HAVE_FACCESSAT = 1
 const _HAVE_FCHMODAT = 1
 const _HAVE_FCHOWNAT = 1
-const ___HAVE_GENERIC_SELECTION = 1
 const _HAVE_GETIPINFO = 1
 const _HAVE_GETXATTR = 1
 const _HAVE_INTTYPES_H = 1
@@ -1019,10 +996,14 @@
 const _HAVE_SEM_TIMEDWAIT = 1
 const _HAVE_SETENV = 1
 const _HAVE_SETXATTR = 1
+const ___have_sigevent_t = 1
+const ___have_siginfo_t = 1
+const ___have_sigval_t = 1
 const _HAVE_SINL = 1
 const _HAVE_STDINT_H = 1
 const _HAVE_STDLIB_H = 1
 const _HAVE_STRERROR_R = 1
+const __HAVE_STRING_ARCH_mempcpy = 1
 const _HAVE_STRING_H = 1
 const _HAVE_STRINGS_H = 1
 const _HAVE_STRSIGNAL = 1
@@ -1221,7 +1202,6 @@
 const _IOC_INOUT = 3
 const _IOC_OUT = 1
 const _IOC_VOID = 0
-const ___iovec_defined = 1
 const _IP_ADD_MEMBERSHIP = 12
 const _IPDEFTTL = 64
 const _IP_DF = 0x4000
@@ -1583,8 +1563,7 @@
 const ___NETINET_IP_H = 1
 const __NETINET_TCP_H = 1
 const __NET_ROUTE_H = 1
-const ___NGREG = 19
-const _NGREG = ___NGREG
+const _NGREG = 19
 const _NGROUPS_MAX = 256
 const _NI_DGRAM = 16
 const _NI_IDN = 32
@@ -1611,8 +1590,8 @@
 const _NOHANG = 0x0100
 const _NOKERNINFO = (1 << 25)
 const _NO_RECOVERY = 3
+const __NSIG = 33
 const _NSIG = __NSIG
-const __NSIG = (___SIGRTMAX + 1)
 const _NSS_BUFLEN_GROUP = 1024
 const _NSS_BUFLEN_PASSWD = 1024
 const _NZERO = 20
@@ -2059,7 +2038,6 @@
 const _RTMSG_NEWROUTE = 0x21
 const _RTMSG_NEWRULE = 0x31
 const _RUSAGE_CHILDREN = -1
-const ___rusage_defined = 1
 const _RUSAGE_SELF = 0
 const _SA_INTERRUPT = 0
 const _SA_NOCLDSTOP = 0x0008
@@ -2378,13 +2356,11 @@
 const _S_IFREG = ___S_IFREG
 const ___S_IFSO

Bug#891505: glibc: Causes FTBFS of gcc-8 on hurd-i386

2018-02-26 Thread Svante Signell
Source: glibc
Version: 2.26-6
Severity: important
Affects: gcc-8 glibc-2.26-*
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

glibc versions > 2.25-6 breaks all builds of gcc-8-*/gccgo on GNU/Hurd due to
that -fdump-go-spec is broken.

>From the buildd logs of gcc-8:
8-20180218-1 (sid)  Maybe-Failed 2018-02-18 19:12:07
8-20180207-2 (sid)  Maybe-Failed 2018-02-07 23:22:42
8-20180130-1 (experimental) Maybe-Failed 2018-01-30 22:09:03
8-20180123-1 (experimental) Maybe-Failed 2018-01-24 08:22:30
8-20180110-1 (experimental) Maybe-Failed 2018-01-13 12:14:53
Maybe-Failed 2018-01-13 02:51:42
8-20171229-1 (experimental) Maybe-Successful 2018-01-02 03:39:06

Toolchain package versions: 2018-01-24
binutils_2.29.1-13 dpkg-dev_1.19.0.4 g++-7_7.2.0-19 gcc-7_7.2.0-19 gnumach-
dev_2:1.8+git20171101-1 hurd-dev_1:0.9.git20180108-1 libc0.3-dev_2.26-3
libstdc++-7-dev_7.2.0-19 libstdc++6_7.2.0-19
Toolchain package versions: 2018-01-02
binutils_2.29.1-12 dpkg-dev_1.19.0.4 g++-7_7.2.0-18 gcc-7_7.2.0-18 gnumach-
dev_2:1.8+git20171101-1 hurd-dev_1:0.9.git20171119-3 libc0.3-dev_2.25-6
libstdc++-7-dev_7.2.0-18 libstdc++6_7.2.0-18

The packages in the build environment was downgraded for the failing build and
the only package affecting the build was the libc version.

On gcc-8-8-20171229 the command:

/home/srs/DEBs/gcc-8/gcc-8-8-20171229/build/./gcc/xgcc -B/home/srs/DEBs/gcc-
8/gcc-8-8-20171229/build/./gcc/ -B/usr/i686-gnu/bin/ -B/usr/i686-gnu/lib/ 
-isystem /usr/i686-gnu/include -isystem /usr/i686-gnu/sys-include -isystem
/home/srs/DEBs/gcc-8/gcc-8-8-20171229/build/sys-include-DHAVE_CONFIG_H -I. 
-I../../../src/libgo  -I ../../../src/libgo/runtime 
-I../../../src/libgo/../libffi/include -I../libffi/include -pthread  
-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O 
-fdump-go-spec=tmp-gen-sysinfo.go -std=gnu99 -S -o sysinfo.s
../../../src/libgo/sysinfo.c
rm -f sysinfo.s
/bin/bash ../../../src/libgo/mvifdiff.sh tmp-gen-sysinfo.go gen-sysinfo.go

creates a defect gen-sysinfo.go file when libc0.3 >= 2.26-* is installed.

Attached is a diff of gen-sysinfo generated with glibc-2.26-6 and glibc-2.25-5
installed: (edited to show only a subset of the diff)

Thanks!--- nOK/gen-sysinfo.go	2018-02-26 10:39:57.970054114 +0100
+++ OK/gen-sysinfo.go	2018-02-26 01:07:07.0 +0100
@@ -137,3 +137,4 @@
 // unknowndefine DT_WHT DT_WHT
 // unknowndefine SSIZE_MAX LONG_MAX
 // unknowndefine NULL ((void *)0)
+// unknowndefine EPERM _HURD_ERRNO (1)
...
+// unknowndefine ENOTRECOVERABLE _HURD_ERRNO (121)
 // unknowndefine errno (*__errno_location ())
 // unknowndefine O_READ O_RDONLY
 // unknowndefine O_WRITE O_WRONLY
@@ -156,6 +259,7 @@
 // unknowndefine SIG_DFL ((__sighandler_t) 0)
 // unknowndefine SIG_IGN ((__sighandler_t) 1)
 // unknowndefine SIG_HOLD ((__sighandler_t) 2)
+// unknowndefine SIGABRT SIGIOT
 // unknowndefine SI_ASYNCIO SI_ASYNCIO
 // unknowndefine SI_MESGQ SI_MESGQ
 // unknowndefine SI_TIMER SI_TIMER
@@ -196,6 +300,7 @@
 // unknowndefine POLL_ERR POLL_ERR
 // unknowndefine POLL_PRI POLL_PRI
 // unknowndefine POLL_HUP POLL_HUP
+// unknowndefine SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE / sizeof (int)) - 3)
 // unknowndefine SIGEV_SIGNAL SIGEV_SIGNAL
 // unknowndefine SIGEV_NONE SIGEV_NONE
 // unknowndefine SIGEV_THREAD SIGEV_THREAD
@@ -211,8 +316,7 @@
 // unknowndefine NULL ((void *)0)
 // unknowndefine SS_ONSTACK SS_ONSTACK
 // unknowndefine SS_DISABLE SS_DISABLE
-// unknowndefine SIGRTMIN (__libc_current_sigrtmin ())
-// unknowndefine SIGRTMAX (__libc_current_sigrtmax ())// unknowndefine REG_GS REG_GS
+// unknowndefine REG_GS REG_GS
 // unknowndefine REG_FS REG_FS
 // unknowndefine REG_ES REG_ES
 // unknowndefine REG_DS REG_DS


Bug#724681: eglibc: Bug in sysdeps/mach/hurd/sendmsg.c: patch tg-sendmsg-SCM_RIGHTS.diff

2013-09-26 Thread Svante Signell
Source: eglibc
Version: 2.17-93
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

The attached diff (one-liner) to the patch tg-sendmsg-SCM_RIGHTS.diff
fixes the error codes resulting from the HURD_DPORT_USE macro in
connection to the compound statement construct. From
http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/Statement-Exprs.html#Statement-Exprs
the following text is found:

The last thing in the compound statement should be an expression
followed by a semicolon; the value of this subexpression serves as the
value of the entire construct. (If you use some other kind of statement
last within the braces, the construct has type void, and thus
effectively no value.)

Since the last expression in the compound expression ends with fds[i] =
descriptor-flags; the flags of the descriptor will be returned as err,
not the result of the call to __io_restrict_auth()

Normally, these flags are zero so the return value is zero too, but as
found in one test case for glib2.0, e.g. 36.4-3, gio/tests/socket.c:
/socket/unix-connection-ancillary-data the flag for fds[0] is one. On
Hurd, the error code for one is EKERN_INVALID_ADDRESS, resulting in a
fail instead of a success!

(It looks like passing of file desciptor flags via fds[i] is
non-functional, to be verified, that would require a change of the
patch for both sendmsg.c and recvmsg.c)
--- ../tg-sendmsg-SCM_RIGHTS.diff.old	2012-07-26 08:14:15.0 +0200
+++ ../tg-sendmsg-SCM_RIGHTS.diff	2013-09-26 13:07:23.0 +0200
@@ -165,7 +165,7 @@ Subject: [PATCH] Add support to send fil
int i;
  
/* Find the total number of bytes to be written.  */
-@@ -100,6 +105,46 @@
+@@ -100,6 +105,45 @@
  	}
  }
  
@@ -199,8 +199,7 @@ Subject: [PATCH] Add support to send fil
 +	 0, 0, 0, 0);
 +		   if (! err)
 +		 nports++;
-+		   /* We pass the flags in the control data.  */
-+		   fds[i] = descriptor-flags;
++		   err;
 +		 }));
 +
 +	  if (err)
@@ -212,7 +211,7 @@ Subject: [PATCH] Add support to send fil
if (addr)
  {
if (addr-sun_family == AF_LOCAL)
-@@ -109,9 +154,8 @@
+@@ -109,9 +153,8 @@
  	  file_t file = __file_name_lookup (addr-sun_path, 0, 0);
  	  if (file == MACH_PORT_NULL)
  	{
@@ -224,7 +223,7 @@ Subject: [PATCH] Add support to send fil
  	}
  	  err = __ifsock_getsockaddr (file, aport);
  	  __mach_port_deallocate (__mach_task_self (), file);
-@@ -119,11 +163,7 @@
+@@ -119,11 +162,7 @@
  	/* The file did not grok the ifsock protocol.  */
  	err = ENOTSOCK;
  	  if (err)
@@ -237,7 +236,7 @@ Subject: [PATCH] Add support to send fil
  	}
else
  	err = EIEIO;
-@@ -142,8 +182,9 @@
+@@ -142,8 +181,9 @@
  			  /* Send the data.  */
  			  err = __socket_send (port, aport,
  		   flags, data.ptr, len,
@@ -249,7 +248,7 @@ Subject: [PATCH] Add support to send fil
  		   message-msg_control,
  		   message-msg_controllen,
  		   amount);
-@@ -152,11 +193,19 @@
+@@ -152,11 +192,19 @@
  			}
  			  err;
  			}));


[Fwd: Re: eglibc 2.14 for wheezy?]

2012-04-14 Thread Svante Signell
Hello, I was recommended to forward my question here. What is the
current plan? The wheezy release is not too far away.
Please Cc: any replies, I'm not subscribed.

Thank you for your time!
 Forwarded Message 
From: Svante Signell svante.sign...@telia.com
Reply-to: svante.sign...@telia.com
To: debian-de...@lists.debian.org
Subject: Re: eglibc 2.14 for wheezy?
Date: Sat, 14 Apr 2012 20:37:14 +0200

On Sat, 2012-04-14 at 20:27 +0200, Cyril Brulebois wrote:
 Svante Signell svante.sign...@telia.com (14/04/2012):
  As the title says, are there plans to use eglibc 2.14 for wheezy??
  It has been out for some time now.
 
 Again, ask the maintainers. Not dd@.

OK, I will, where?






-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1334429196.2822.15.camel@x60



Bug#527589: Outdated header file /usr/include/bits/sched.h for GNU/Hurd!?

2011-01-31 Thread Svante Signell
On Sun, 2011-01-30 at 15:19 +0100, Samuel Thibault wrote:
 I've completed Aurelien's any/submitted-sched_h.diff patch in my tree, I'll
 commit it after the squeeze release.

Looks like there is a patch from 2009 in addition to the one from 2007:

http://lists.debian.org/debian-glibc/2007/12/msg00130.html

http://lists.debian.org/debian-glibc/2009/11/msg00282.html

BTW: Is there a Mach/Hurd function in libc0.3 replacing iopl and
ioperm? 




-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1296478709.5584.155.ca...@s1499.it.kth.se



Bug#527589: Outdated header file /usr/include/bits/sched.h for GNU/Hurd!?

2011-01-30 Thread Svante Signell
severity 527589 important
Package: libc0.3-dev
Tags: patch
Version: 2.11.2-10

Looks like the GNU/Hurd header file /usr/include/bits/sched.h is
outdated compared to the GNU/Linux version. Attached is a diff between
the two files. The missing definitions of __CPU_ZERO_S and __CPU_SET_S
is affecting the build of at least two packages: x86info and erlang.

In case the Linux version of the header file is not correct to use for
Hurd then it would be interesting to know how the Hurd version should
look like!

--- hurd_bits_sched.h	2011-01-28 23:27:43.0 +0100
+++ linux_bits_sched.h	2011-01-23 21:26:16.0 +0100
@@ -1,6 +1,7 @@
 /* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
-   Copyright (C) 1996, 1997, 2001, 2003, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009
+   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
@@ -29,12 +30,64 @@
 #define SCHED_OTHER	0
 #define SCHED_FIFO	1
 #define SCHED_RR	2
+#ifdef __USE_GNU
+# define SCHED_BATCH	3
+#endif
 
-/* Data structure to describe a process' schedulability.  */
+#ifdef __USE_MISC
+/* Cloning flags.  */
+# define CSIGNAL   0x00ff /* Signal mask to be sent at exit.  */
+# define CLONE_VM  0x0100 /* Set if VM shared between processes.  */
+# define CLONE_FS  0x0200 /* Set if fs info shared between processes.  */
+# define CLONE_FILES   0x0400 /* Set if open files shared between processes.  */
+# define CLONE_SIGHAND 0x0800 /* Set if signal handlers shared.  */
+# define CLONE_PTRACE  0x2000 /* Set if tracing continues on the child.  */
+# define CLONE_VFORK   0x4000 /* Set if the parent wants the child to
+ wake it up on mm_release.  */
+# define CLONE_PARENT  0x8000 /* Set if we want to have the same
+ parent as the cloner.  */
+# define CLONE_THREAD  0x0001 /* Set to add to same thread group.  */
+# define CLONE_NEWNS   0x0002 /* Set to create new namespace.  */
+# define CLONE_SYSVSEM 0x0004 /* Set to shared SVID SEM_UNDO semantics.  */
+# define CLONE_SETTLS  0x0008 /* Set TLS info.  */
+# define CLONE_PARENT_SETTID 0x0010 /* Store TID in userlevel buffer
+	   before MM copy.  */
+# define CLONE_CHILD_CLEARTID 0x0020 /* Register exit futex and memory
+	location to clear.  */
+# define CLONE_DETACHED 0x0040 /* Create clone detached.  */
+# define CLONE_UNTRACED 0x0080 /* Set if the tracing process can't
+  force CLONE_PTRACE on this clone.  */
+# define CLONE_CHILD_SETTID 0x0100 /* Store TID in userlevel buffer in
+	  the child.  */
+# define CLONE_NEWUTS	0x0400	/* New utsname group.  */
+# define CLONE_NEWIPC	0x0800	/* New ipcs.  */
+# define CLONE_NEWUSER	0x1000	/* New user namespace.  */
+# define CLONE_NEWPID	0x2000	/* New pid namespace.  */
+# define CLONE_NEWNET	0x4000	/* New network namespace.  */
+# define CLONE_IO	0x8000	/* Clone I/O context.  */
+#endif
+
+/* The official definition.  */
 struct sched_param
-{
-  int __sched_priority;
-};
+  {
+int __sched_priority;
+  };
+
+__BEGIN_DECLS
+
+#ifdef __USE_MISC
+/* Clone current process.  */
+extern int clone (int (*__fn) (void *__arg), void *__child_stack,
+		  int __flags, void *__arg, ...) __THROW;
+
+/* Unshare the specified resources.  */
+extern int unshare (int __flags) __THROW;
+
+/* Get index of currently used CPU.  */
+extern int sched_getcpu (void) __THROW;
+#endif
+
+__END_DECLS
 
 #endif	/* need schedparam */
 
@@ -56,7 +109,7 @@
 # define __CPU_SETSIZE	1024
 # define __NCPUBITS	(8 * sizeof (__cpu_mask))
 
-/* Type for array elements in 'cpu_set'.  */
+/* Type for array elements in 'cpu_set_t'.  */
 typedef unsigned long int __cpu_mask;
 
 /* Basic access functions.  */
@@ -70,30 +123,83 @@
 } cpu_set_t;
 
 /* Access functions for CPU masks.  */
-# define __CPU_ZERO(cpusetp) \
+# if __GNUC_PREREQ (2, 91)
+#  define __CPU_ZERO_S(setsize, cpusetp) \
+  do __builtin_memset (cpusetp, '\0', setsize); while (0)
+# else
+#  define __CPU_ZERO_S(setsize, cpusetp) \
   do {	  \
-unsigned int __i;			  \
-cpu_set *__arr = (cpusetp);		  \
-for (__i = 0; __i  sizeof (cpu_set) / sizeof (__cpu_mask); ++__i)	  \
-  __arr-__bits[__i] = 0;		  \
+size_t __i;  \
+size_t __imax = (setsize) / sizeof (__cpu_mask);			  \
+__cpu_mask *__bits = (cpusetp)-__bits;  \
+for (__i = 0; __i  __imax; ++__i)	  \
+  __bits[__i] = 0;			  \
   } while (0)
-# define __CPU_SET(cpu, cpusetp) \
-  ((cpusetp)-__bits[__CPUELT (cpu)] |= __CPUMASK (cpu))
-# define __CPU_CLR(cpu, cpusetp) \
-  ((cpusetp)-__bits[__CPUELT (cpu)] = ~__CPUMASK (cpu))
-# define __CPU_ISSET(cpu, cpusetp) \
-  (((cpusetp)-__bits[__CPUELT (cpu)]  __CPUMASK (cpu)) != 0)
+# endif
+# define