summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits')
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/confname.h675
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/dirent.h53
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/elfclass.h79
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/errno.h184
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/fcntl.h267
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/in.h194
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctl-types.h87
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctls.h305
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ipc.h54
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/local_lim.h99
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/mman.h186
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/msq.h68
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/netdb.h61
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/poll.h43
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/posix_opt.h82
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/resource.h240
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sched.h153
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sem.h74
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/shm.h77
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigaction.h94
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigcontext.h24
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/siginfo.h497
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/signum.h90
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigset.h139
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigstack.h78
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/socket.h336
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stat.h230
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statfs.h68
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statvfs.h134
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stropts.h256
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/syslog-path.h29
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/termios.h241
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/time.h207
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/types.h350
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/typesizes.h67
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/uio.h93
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmp.h125
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmpx.h126
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utsname.h26
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitflags.h35
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitstatus.h116
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/xtitypes.h1
42 files changed, 6343 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/confname.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/confname.h
new file mode 100644
index 0000000000..46f7a58313
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/confname.h
@@ -0,0 +1,675 @@
+/* `sysconf', `pathconf', and `confstr' NAME values. OpenSolaris version.
+ Copyright (C) 1993,1995-1998,2000,2001,2003,2004,2007,2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
+/* Values for the NAME argument to `pathconf' and `fpathconf'. */
+enum
+ {
+ _PC_LINK_MAX = 1,
+#define _PC_LINK_MAX _PC_LINK_MAX
+ _PC_MAX_CANON = 2,
+#define _PC_MAX_CANON _PC_MAX_CANON
+ _PC_MAX_INPUT = 3,
+#define _PC_MAX_INPUT _PC_MAX_INPUT
+ _PC_NAME_MAX = 4,
+#define _PC_NAME_MAX _PC_NAME_MAX
+ _PC_PATH_MAX = 5,
+#define _PC_PATH_MAX _PC_PATH_MAX
+ _PC_PIPE_BUF = 6,
+#define _PC_PIPE_BUF _PC_PIPE_BUF
+ _PC_NO_TRUNC = 7,
+#define _PC_NO_TRUNC _PC_NO_TRUNC
+ _PC_VDISABLE = 8,
+#define _PC_VDISABLE _PC_VDISABLE
+ _PC_CHOWN_RESTRICTED = 9,
+#define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
+ _PC_ASYNC_IO = 10,
+#define _PC_ASYNC_IO _PC_ASYNC_IO
+ _PC_PRIO_IO = 11,
+#define _PC_PRIO_IO _PC_PRIO_IO
+ _PC_SYNC_IO = 12,
+#define _PC_SYNC_IO _PC_SYNC_IO
+ _PC_ALLOC_SIZE_MIN = 13,
+#define _PC_ALLOC_SIZE_MIN _PC_ALLOC_SIZE_MIN
+ _PC_REC_INCR_XFER_SIZE = 14,
+#define _PC_REC_INCR_XFER_SIZE _PC_REC_INCR_XFER_SIZE
+ _PC_REC_MAX_XFER_SIZE = 15,
+#define _PC_REC_MAX_XFER_SIZE _PC_REC_MAX_XFER_SIZE
+ _PC_REC_MIN_XFER_SIZE = 16,
+#define _PC_REC_MIN_XFER_SIZE _PC_REC_MIN_XFER_SIZE
+ _PC_REC_XFER_ALIGN = 17,
+#define _PC_REC_XFER_ALIGN _PC_REC_XFER_ALIGN
+ _PC_SYMLINK_MAX = 18,
+#define _PC_SYMLINK_MAX _PC_SYMLINK_MAX
+ _PC_2_SYMLINKS = 19,
+#define _PC_2_SYMLINKS _PC_2_SYMLINKS
+
+/* OpenSolaris extensions. */
+ _PC_ACL_ENABLED = 20,
+#define _PC_ACL_ENABLED _PC_ACL_ENABLED
+ _PC_MIN_HOLE_SIZE = 21,
+#define _PC_MIN_HOLE_SIZE _PC_MIN_HOLE_SIZE
+ _PC_CASE_BEHAVIOR = 22,
+#define _PC_CASE_BEHAVIOR _PC_CASE_BEHAVIOR
+ _PC_SATTR_ENABLED = 23,
+#define _PC_SATTR_ENABLED _PC_SATTR_ENABLED
+ _PC_SATTR_EXISTS = 24,
+#define _PC_SATTR_EXISTS _PC_SATTR_EXISTS
+
+ _PC_FILESIZEBITS = 67,
+#define _PC_FILESIZEBITS _PC_FILESIZEBITS
+
+ _PC_XATTR_ENABLED = 100,
+#define PC_XATTR_ENABLED PC_XATTR_ENABLED
+ _PC_XATTR_EXISTS = 101,
+#define _PC_XATTR_EXISTS _PC_XATTR_EXISTS
+
+/* These are found in GNU libc but not OpenSolaris. */
+
+ _PC_SOCK_MAXBUF = 5501,
+#define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF
+ };
+
+/* Values for the argument to `sysconf'. */
+enum
+ {
+ _SC_ARG_MAX = 1,
+#define _SC_ARG_MAX _SC_ARG_MAX
+ _SC_CHILD_MAX = 2,
+#define _SC_CHILD_MAX _SC_CHILD_MAX
+ _SC_CLK_TCK = 3,
+#define _SC_CLK_TCK _SC_CLK_TCK
+ _SC_NGROUPS_MAX = 4,
+#define _SC_NGROUPS_MAX _SC_NGROUPS_MAX
+ _SC_OPEN_MAX = 5,
+#define _SC_OPEN_MAX _SC_OPEN_MAX
+ _SC_JOB_CONTROL = 6,
+#define _SC_JOB_CONTROL _SC_JOB_CONTROL
+ _SC_SAVED_IDS = 7,
+#define _SC_SAVED_IDS _SC_SAVED_IDS
+ _SC_VERSION = 8,
+#define _SC_VERSION _SC_VERSION
+ _SC_PASS_MAX = 9,
+#define _SC_PASS_MAX _SC_PASS_MAX
+ _SC_LOGNAME_MAX = 10,
+#define _SC_LOGNAME_MAX _SC_LOGNAME_MAX
+ _SC_PAGESIZE = 11,
+#define _SC_PAGESIZE _SC_PAGESIZE
+#define _SC_PAGE_SIZE _SC_PAGESIZE
+ _SC_XOPEN_VERSION = 12,
+#define _SC_XOPEN_VERSION _SC_XOPEN_VERSION
+/* _SC_NACLS_MAX = 13 */
+ _SC_NPROCESSORS_CONF = 14,
+#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF
+ _SC_NPROCESSORS_ONLN = 15,
+#define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN
+ _SC_STREAM_MAX = 16,
+#define _SC_STREAM_MAX _SC_STREAM_MAX
+ _SC_TZNAME_MAX = 17,
+#define _SC_TZNAME_MAX _SC_TZNAME_MAX
+ _SC_AIO_LISTIO_MAX = 18,
+#define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX
+ _SC_AIO_MAX = 19,
+#define _SC_AIO_MAX _SC_AIO_MAX
+ _SC_AIO_PRIO_DELTA_MAX = 20,
+#define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX
+ _SC_ASYNCHRONOUS_IO = 21,
+#define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO
+ _SC_DELAYTIMER_MAX = 22,
+#define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX
+ _SC_FSYNC = 23,
+#define _SC_FSYNC _SC_FSYNC
+ _SC_MAPPED_FILES = 24,
+#define _SC_MAPPED_FILES _SC_MAPPED_FILES
+ _SC_MEMLOCK = 25,
+#define _SC_MEMLOCK _SC_MEMLOCK
+ _SC_MEMLOCK_RANGE = 26,
+#define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE
+ _SC_MEMORY_PROTECTION = 27,
+#define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION
+ _SC_MESSAGE_PASSING = 28,
+#define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING
+ _SC_MQ_OPEN_MAX = 29,
+#define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX
+ _SC_MQ_PRIO_MAX = 30,
+#define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX
+ _SC_PRIORITIZED_IO = 31,
+#define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO
+ _SC_PRIORITY_SCHEDULING = 32,
+#define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING
+ _SC_REALTIME_SIGNALS = 33,
+#define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS
+ _SC_RTSIG_MAX = 34,
+#define _SC_RTSIG_MAX _SC_RTSIG_MAX
+ _SC_SEMAPHORES = 35,
+#define _SC_SEMAPHORES _SC_SEMAPHORES
+ _SC_SEM_NSEMS_MAX = 36,
+#define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX
+ _SC_SEM_VALUE_MAX = 37,
+#define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX
+ _SC_SHARED_MEMORY_OBJECTS = 38,
+#define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS
+ _SC_SIGQUEUE_MAX = 39,
+#define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX
+ _SC_SIGRT_MIN = 40,
+#define _SC_SIGRT_MIN _SC_SIGRT_MIN
+ _SC_SIGRT_MAX = 41,
+#define _SC_SIGRT_MAX _SC_SIGRT_MAX
+ _SC_SYNCHRONIZED_IO = 42,
+#define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO
+ _SC_TIMERS = 43,
+#define _SC_TIMERS _SC_TIMERS
+ _SC_TIMER_MAX = 44,
+#define _SC_TIMER_MAX _SC_TIMER_MAX
+ _SC_2_C_BIND = 45,
+#define _SC_2_C_BIND _SC_2_C_BIND
+ _SC_2_C_DEV = 46,
+#define _SC_2_C_DEV _SC_2_C_DEV
+ _SC_2_C_VERSION = 47,
+#define _SC_2_C_VERSION _SC_2_C_VERSION
+ _SC_2_FORT_DEV = 48,
+#define _SC_2_FORT_DEV _SC_2_FORT_DEV
+ _SC_2_FORT_RUN = 49,
+#define _SC_2_FORT_RUN _SC_2_FORT_RUN
+ _SC_2_LOCALEDEF = 50,
+#define _SC_2_LOCALEDEF _SC_2_LOCALEDEF
+ _SC_2_SW_DEV = 51,
+#define _SC_2_SW_DEV _SC_2_SW_DEV
+ _SC_2_UPE = 52,
+#define _SC_2_UPE _SC_2_UPE
+ _SC_2_VERSION = 53,
+#define _SC_2_VERSION _SC_2_VERSION
+ _SC_BC_BASE_MAX = 54,
+#define _SC_BC_BASE_MAX _SC_BC_BASE_MAX
+ _SC_BC_DIM_MAX = 55,
+#define _SC_BC_DIM_MAX _SC_BC_DIM_MAX
+ _SC_BC_SCALE_MAX = 56,
+#define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX
+ _SC_BC_STRING_MAX = 57,
+#define _SC_BC_STRING_MAX _SC_BC_STRING_MAX
+ _SC_COLL_WEIGHTS_MAX = 58,
+#define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX
+ _SC_EXPR_NEST_MAX = 59,
+#define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX
+ _SC_LINE_MAX = 60,
+#define _SC_LINE_MAX _SC_LINE_MAX
+ _SC_RE_DUP_MAX = 61,
+#define _SC_RE_DUP_MAX _SC_RE_DUP_MAX
+ _SC_XOPEN_CRYPT = 62,
+#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
+ _SC_XOPEN_ENH_I18N = 63,
+#define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N
+ _SC_XOPEN_SHM = 64,
+#define _SC_XOPEN_SHM _SC_XOPEN_SHM
+
+ _SC_2_CHAR_TERM = 66,
+#define _SC_2_CHAR_TERM _SC_2_CHAR_TERM
+ _SC_XOPEN_XCU_VERSION = 67,
+#define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION
+
+ _SC_ATEXIT_MAX,
+#define _SC_ATEXIT_MAX _SC_ATEXIT_MAX
+ _SC_IOV_MAX = 77,
+#define _SC_IOV_MAX _SC_IOV_MAX
+ _SC_UIO_MAXIOV = _SC_IOV_MAX,
+#define _SC_UIO_MAXIOV _SC_UIO_MAXIOV
+ _SC_XOPEN_UNIX = 78,
+#define _SC_XOPEN_UNIX _SC_XOPEN_UNIX
+ _SC_T_IOV_MAX = 79,
+#define _SC_T_IOV_MAX _SC_T_IOV_MAX
+
+ _SC_PHYS_PAGES = 500,
+#define _SC_PHYS_PAGES _SC_PHYS_PAGES
+ _SC_AVPHYS_PAGES = 501,
+#define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES
+
+/* These are found in OpenSolaris but not GNU libc. */
+ _SC_COHER_BLKSZ = 503,
+#define _SC_COHER_BLKSZ _SC_COHER_BLKSZ
+ _SC_SPLIT_CACHE = 504,
+#define _SC_SPLIT_CACHE _SC_SPLIT_CACHE
+ _SC_ICACHE_SZ = 505,
+#define _SC_ICACHE_SZ _SC_ICACHE_SZ
+ _SC_DCACHE_SZ = 506,
+#define _SC_DCACHE_SZ _SC_DCACHE_SZ
+ _SC_ICACHE_LINESZ = 507,
+#define _SC_ICACHE_LINESZ _SC_ICACHE_LINESZ
+ _SC_DCACHE_LINESZ = 508,
+#define _SC_DCACHE_LINESZ _SC_DCACHE_LINESZ
+ _SC_ICACHE_BLKSZ = 509,
+#define _SC_ICACHE_BLKSZ _SC_ICACHE_BLKSZ
+ _SC_DCACHE_BLKSZ = 510,
+#define _SC_DCACHE_BLKSZ _SC_DCACHE_BLKSZ
+ _SC_DCACHE_TBLKSZ = 511,
+#define _SC_DCACHE_TBLKSZ _SC_DCACHE_TBLKSZ
+ _SC_ICACHE_ASSOC = 512,
+#define _SC_ICACHE_ASSOC _SC_ICACHE_ASSOC
+ _SC_DCACHE_ASSOC = 513,
+#define _SC_DCACHE_ASSOC _SC_DCACHE_ASSOC
+ _SC_MAXPID = 514,
+#define _SC_MAXPID _SC_MAXPID
+ _SC_STACK_PROT = 515,
+#define _SC_STACK_PROT _SC_STACK_PROT
+ _SC_NPROCESSORS_MAX = 516,
+#define _SC_NPROCESSORS_MAX _SC_NPROCESSORS_MAX
+ _SC_CPUID_MAX = 517,
+#define _SC_CPUID_MAX _SC_CPUID_MAX
+ _SC_EPHID_MAX = 518,
+#define _SC_EPHID_MAX _SC_EPHID_MAX
+
+ _SC_THREAD_DESTRUCTOR_ITERATIONS = 568,
+#define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
+ _SC_GETGR_R_SIZE_MAX = 569,
+#define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX
+ _SC_GETPW_R_SIZE_MAX = 570,
+#define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX
+ _SC_LOGIN_NAME_MAX = 571,
+#define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX
+ _SC_THREAD_KEYS_MAX = 572,
+#define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX
+ _SC_THREAD_STACK_MIN = 573,
+#define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN
+ _SC_THREAD_THREADS_MAX = 574,
+#define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX
+ _SC_TTY_NAME_MAX = 575,
+#define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX
+ _SC_THREADS = 576,
+#define _SC_THREADS _SC_THREADS
+ _SC_THREAD_ATTR_STACKADDR = 577,
+#define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR
+ _SC_THREAD_ATTR_STACKSIZE = 578,
+#define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE
+ _SC_THREAD_PRIORITY_SCHEDULING = 579,
+#define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING
+ _SC_THREAD_PRIO_INHERIT = 580,
+#define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT
+ _SC_THREAD_PRIO_PROTECT = 581,
+#define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT
+ _SC_THREAD_PROCESS_SHARED = 582,
+#define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED
+ _SC_THREAD_SAFE_FUNCTIONS = 583,
+#define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS
+
+ _SC_XOPEN_LEGACY = 717,
+#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
+ _SC_XOPEN_REALTIME = 718,
+#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
+ _SC_XOPEN_REALTIME_THREADS = 719,
+#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
+ _SC_XBS5_ILP32_OFF32 = 720,
+#define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32
+ _SC_XBS5_ILP32_OFFBIG = 721,
+#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
+ _SC_XBS5_LP64_OFF64 = 722,
+#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
+ _SC_XBS5_LPBIG_OFFBIG = 723,
+#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
+ _SC_2_PBS = 724,
+#define _SC_2_PBS _SC_2_PBS
+ _SC_2_PBS_ACCOUNTING = 725,
+#define _SC_2_PBS_ACCOUNTING _SC_2_PBS_ACCOUNTING
+ _SC_2_PBS_CHECKPOINT = 726,
+#define _SC_2_PBS_CHECKPOINT _SC_2_PBS_CHECKPOINT
+/* 727 */
+ _SC_2_PBS_LOCATE = 728,
+#define _SC_2_PBS_LOCATE _SC_2_PBS_LOCATE
+ _SC_2_PBS_MESSAGE = 729,
+#define _SC_2_PBS_MESSAGE _SC_2_PBS_MESSAGE
+ _SC_2_PBS_TRACK = 730,
+#define _SC_2_PBS_TRACK _SC_2_PBS_TRACK
+ _SC_ADVISORY_INFO = 731,
+#define _SC_ADVISORY_INFO _SC_ADVISORY_INFO
+ _SC_BARRIERS = 732,
+#define _SC_BARRIERS _SC_BARRIERS
+ _SC_CLOCK_SELECTION = 733,
+#define _SC_CLOCK_SELECTION _SC_CLOCK_SELECTION
+ _SC_CPUTIME = 734,
+#define _SC_CPUTIME _SC_CPUTIME
+ _SC_HOST_NAME_MAX = 735,
+#define _SC_HOST_NAME_MAX _SC_HOST_NAME_MAX
+ _SC_MONOTONIC_CLOCK = 736,
+#define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK
+ _SC_READER_WRITER_LOCKS = 737,
+#define _SC_READER_WRITER_LOCKS _SC_READER_WRITER_LOCKS
+ _SC_REGEXP = 738,
+#define _SC_REGEXP _SC_REGEXP
+ _SC_SHELL = 739,
+#define _SC_SHELL _SC_SHELL
+ _SC_SPAWN = 740,
+#define _SC_SPAWN _SC_SPAWN
+ _SC_SPIN_LOCKS = 741,
+#define _SC_SPIN_LOCKS _SC_SPIN_LOCKS
+ _SC_SPORADIC_SERVER = 742,
+#define _SC_SPORADIC_SERVER _SC_SPORADIC_SERVER
+ _SC_SS_REPL_MAX = 743,
+#define _SC_SS_REPL_MAX _SC_SS_REPL_MAX /* OpenSolaris */
+ _SC_SYMLOOP_MAX = 744,
+#define _SC_SYMLOOP_MAX _SC_SYMLOOP_MAX
+ _SC_THREAD_CPUTIME = 745,
+#define _SC_THREAD_CPUTIME _SC_THREAD_CPUTIME
+ _SC_THREAD_SPORADIC_SERVER = 746,
+#define _SC_THREAD_SPORADIC_SERVER _SC_THREAD_SPORADIC_SERVER
+ _SC_TIMEOUTS = 747,
+#define _SC_TIMEOUTS _SC_TIMEOUTS
+ _SC_TRACE = 748,
+#define _SC_TRACE _SC_TRACE
+ _SC_TRACE_EVENT_FILTER = 749,
+#define _SC_TRACE_EVENT_FILTER _SC_TRACE_EVENT_FILTER
+ _SC_TRACE_EVENT_NAME_MAX = 750,
+#define _SC_TRACE_EVENT_NAME_MAX _SC_TRACE_EVENT_NAME_MAX /* OpenSolaris */
+ _SC_TRACE_INHERIT = 751,
+#define _SC_TRACE_INHERIT _SC_TRACE_INHERIT
+ _SC_TRACE_LOG = 752,
+#define _SC_TRACE_LOG _SC_TRACE_LOG
+ _SC_TRACE_NAME_MAX = 753,
+#define _SC_TRACE_NAME_MAX _SC_TRACE_NAME_MAX /* OpenSolaris */
+ _SC_TRACE_SYS_MAX = 754,
+#define _SC_TRACE_SYS_MAX _SC_TRACE_SYS_MAX /* OpenSolaris */
+ _SC_TRACE_USER_EVENT_MAX = 755,
+#define _SC_TRACE_USER_EVENT_MAX _SC_TRACE_USER_EVENT_MAX /* OpenSolaris */
+ _SC_TYPED_MEMORY_OBJECTS = 756,
+#define _SC_TYPED_MEMORY_OBJECTS _SC_TYPED_MEMORY_OBJECTS
+ _SC_V6_ILP32_OFF32 = 757,
+#define _SC_V6_ILP32_OFF32 _SC_V6_ILP32_OFF32
+ _SC_V6_ILP32_OFFBIG = 758,
+#define _SC_V6_ILP32_OFFBIG _SC_V6_ILP32_OFFBIG
+ _SC_V6_LP64_OFF64 = 759,
+#define _SC_V6_LP64_OFF64 _SC_V6_LP64_OFF64
+ _SC_V6_LPBIG_OFFBIG = 760,
+#define _SC_V6_LPBIG_OFFBIG _SC_V6_LPBIG_OFFBIG
+ _SC_XOPEN_STREAMS = 761,
+#define _SC_XOPEN_STREAMS _SC_XOPEN_STREAMS /* OpenSolaris */
+ _SC_IPV6 = 762,
+#define _SC_IPV6 _SC_IPV6
+ _SC_RAW_SOCKETS = 763,
+#define _SC_RAW_SOCKETS _SC_RAW_SOCKETS
+
+/* These are found in GNU libc but not OpenSolaris. */
+
+ _SC_EQUIV_CLASS_MAX = 5601,
+#define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX
+ _SC_CHARCLASS_NAME_MAX,
+#define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX
+
+ _SC_PII,
+#define _SC_PII _SC_PII
+ _SC_PII_XTI,
+#define _SC_PII_XTI _SC_PII_XTI
+ _SC_PII_SOCKET,
+#define _SC_PII_SOCKET _SC_PII_SOCKET
+ _SC_PII_INTERNET,
+#define _SC_PII_INTERNET _SC_PII_INTERNET
+ _SC_PII_OSI,
+#define _SC_PII_OSI _SC_PII_OSI
+ _SC_POLL,
+#define _SC_POLL _SC_POLL
+ _SC_SELECT,
+#define _SC_SELECT _SC_SELECT
+ _SC_PII_INTERNET_STREAM,
+#define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM
+ _SC_PII_INTERNET_DGRAM,
+#define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM
+ _SC_PII_OSI_COTS,
+#define _SC_PII_OSI_COTS _SC_PII_OSI_COTS
+ _SC_PII_OSI_CLTS,
+#define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS
+ _SC_PII_OSI_M,
+#define _SC_PII_OSI_M _SC_PII_OSI_M
+
+ _SC_XOPEN_XPG2,
+#define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2
+ _SC_XOPEN_XPG3,
+#define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3
+ _SC_XOPEN_XPG4,
+#define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4
+
+ _SC_CHAR_BIT,
+#define _SC_CHAR_BIT _SC_CHAR_BIT
+ _SC_CHAR_MAX,
+#define _SC_CHAR_MAX _SC_CHAR_MAX
+ _SC_CHAR_MIN,
+#define _SC_CHAR_MIN _SC_CHAR_MIN
+ _SC_INT_MAX,
+#define _SC_INT_MAX _SC_INT_MAX
+ _SC_INT_MIN,
+#define _SC_INT_MIN _SC_INT_MIN
+ _SC_LONG_BIT,
+#define _SC_LONG_BIT _SC_LONG_BIT
+ _SC_WORD_BIT,
+#define _SC_WORD_BIT _SC_WORD_BIT
+ _SC_MB_LEN_MAX,
+#define _SC_MB_LEN_MAX _SC_MB_LEN_MAX
+ _SC_NZERO,
+#define _SC_NZERO _SC_NZERO
+ _SC_SSIZE_MAX,
+#define _SC_SSIZE_MAX _SC_SSIZE_MAX
+ _SC_SCHAR_MAX,
+#define _SC_SCHAR_MAX _SC_SCHAR_MAX
+ _SC_SCHAR_MIN,
+#define _SC_SCHAR_MIN _SC_SCHAR_MIN
+ _SC_SHRT_MAX,
+#define _SC_SHRT_MAX _SC_SHRT_MAX
+ _SC_SHRT_MIN,
+#define _SC_SHRT_MIN _SC_SHRT_MIN
+ _SC_UCHAR_MAX,
+#define _SC_UCHAR_MAX _SC_UCHAR_MAX
+ _SC_UINT_MAX,
+#define _SC_UINT_MAX _SC_UINT_MAX
+ _SC_ULONG_MAX,
+#define _SC_ULONG_MAX _SC_ULONG_MAX
+ _SC_USHRT_MAX,
+#define _SC_USHRT_MAX _SC_USHRT_MAX
+
+ _SC_NL_ARGMAX,
+#define _SC_NL_ARGMAX _SC_NL_ARGMAX
+ _SC_NL_LANGMAX,
+#define _SC_NL_LANGMAX _SC_NL_LANGMAX
+ _SC_NL_MSGMAX,
+#define _SC_NL_MSGMAX _SC_NL_MSGMAX
+ _SC_NL_NMAX,
+#define _SC_NL_NMAX _SC_NL_NMAX
+ _SC_NL_SETMAX,
+#define _SC_NL_SETMAX _SC_NL_SETMAX
+ _SC_NL_TEXTMAX,
+#define _SC_NL_TEXTMAX _SC_NL_TEXTMAX
+
+ _SC_BASE,
+#define _SC_BASE _SC_BASE
+ _SC_C_LANG_SUPPORT,
+#define _SC_C_LANG_SUPPORT _SC_C_LANG_SUPPORT
+ _SC_C_LANG_SUPPORT_R,
+#define _SC_C_LANG_SUPPORT_R _SC_C_LANG_SUPPORT_R
+ _SC_DEVICE_IO,
+#define _SC_DEVICE_IO _SC_DEVICE_IO
+ _SC_DEVICE_SPECIFIC,
+#define _SC_DEVICE_SPECIFIC _SC_DEVICE_SPECIFIC
+ _SC_DEVICE_SPECIFIC_R,
+#define _SC_DEVICE_SPECIFIC_R _SC_DEVICE_SPECIFIC_R
+ _SC_FD_MGMT,
+#define _SC_FD_MGMT _SC_FD_MGMT
+ _SC_FIFO,
+#define _SC_FIFO _SC_FIFO
+ _SC_PIPE,
+#define _SC_PIPE _SC_PIPE
+ _SC_FILE_ATTRIBUTES,
+#define _SC_FILE_ATTRIBUTES _SC_FILE_ATTRIBUTES
+ _SC_FILE_LOCKING,
+#define _SC_FILE_LOCKING _SC_FILE_LOCKING
+ _SC_FILE_SYSTEM,
+#define _SC_FILE_SYSTEM _SC_FILE_SYSTEM
+ _SC_MULTI_PROCESS,
+#define _SC_MULTI_PROCESS _SC_MULTI_PROCESS
+ _SC_SINGLE_PROCESS,
+#define _SC_SINGLE_PROCESS _SC_SINGLE_PROCESS
+ _SC_NETWORKING,
+#define _SC_NETWORKING _SC_NETWORKING
+ _SC_REGEX_VERSION,
+#define _SC_REGEX_VERSION _SC_REGEX_VERSION
+ _SC_SIGNALS,
+#define _SC_SIGNALS _SC_SIGNALS
+ _SC_SYSTEM_DATABASE,
+#define _SC_SYSTEM_DATABASE _SC_SYSTEM_DATABASE
+ _SC_SYSTEM_DATABASE_R,
+#define _SC_SYSTEM_DATABASE_R _SC_SYSTEM_DATABASE_R
+ _SC_USER_GROUPS,
+#define _SC_USER_GROUPS _SC_USER_GROUPS
+ _SC_USER_GROUPS_R,
+#define _SC_USER_GROUPS_R _SC_USER_GROUPS_R
+ _SC_STREAMS,
+#define _SC_STREAMS _SC_STREAMS
+
+ _SC_LEVEL1_ICACHE_SIZE,
+#define _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_SIZE
+ _SC_LEVEL1_ICACHE_ASSOC,
+#define _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_ASSOC
+ _SC_LEVEL1_ICACHE_LINESIZE,
+#define _SC_LEVEL1_ICACHE_LINESIZE _SC_LEVEL1_ICACHE_LINESIZE
+ _SC_LEVEL1_DCACHE_SIZE,
+#define _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_SIZE
+ _SC_LEVEL1_DCACHE_ASSOC,
+#define _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_ASSOC
+ _SC_LEVEL1_DCACHE_LINESIZE,
+#define _SC_LEVEL1_DCACHE_LINESIZE _SC_LEVEL1_DCACHE_LINESIZE
+ _SC_LEVEL2_CACHE_SIZE,
+#define _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_SIZE
+ _SC_LEVEL2_CACHE_ASSOC,
+#define _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_ASSOC
+ _SC_LEVEL2_CACHE_LINESIZE,
+#define _SC_LEVEL2_CACHE_LINESIZE _SC_LEVEL2_CACHE_LINESIZE
+ _SC_LEVEL3_CACHE_SIZE,
+#define _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_SIZE
+ _SC_LEVEL3_CACHE_ASSOC,
+#define _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_ASSOC
+ _SC_LEVEL3_CACHE_LINESIZE,
+#define _SC_LEVEL3_CACHE_LINESIZE _SC_LEVEL3_CACHE_LINESIZE
+ _SC_LEVEL4_CACHE_SIZE,
+#define _SC_LEVEL4_CACHE_SIZE _SC_LEVEL4_CACHE_SIZE
+ _SC_LEVEL4_CACHE_ASSOC,
+#define _SC_LEVEL4_CACHE_ASSOC _SC_LEVEL4_CACHE_ASSOC
+ _SC_LEVEL4_CACHE_LINESIZE,
+#define _SC_LEVEL4_CACHE_LINESIZE _SC_LEVEL4_CACHE_LINESIZE
+ };
+
+/* Values for the NAME argument to `confstr'. */
+enum
+ {
+ _CS_PATH = 65, /* The default search path. */
+#define _CS_PATH _CS_PATH
+
+ _CS_LFS_CFLAGS = 68,
+#define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
+ _CS_LFS_LDFLAGS = 69,
+#define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS
+ _CS_LFS_LIBS = 70,
+#define _CS_LFS_LIBS _CS_LFS_LIBS
+ _CS_LFS_LINTFLAGS = 71,
+#define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS
+ _CS_LFS64_CFLAGS = 72,
+#define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS
+ _CS_LFS64_LDFLAGS = 73,
+#define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
+ _CS_LFS64_LIBS = 74,
+#define _CS_LFS64_LIBS _CS_LFS64_LIBS
+ _CS_LFS64_LINTFLAGS = 75,
+#define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
+
+ _CS_XBS5_ILP32_OFF32_CFLAGS = 700,
+#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+ _CS_XBS5_ILP32_OFF32_LDFLAGS = 701,
+#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+ _CS_XBS5_ILP32_OFF32_LIBS = 702,
+#define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+ _CS_XBS5_ILP32_OFF32_LINTFLAGS = 703,
+#define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+/* 704 */
+ _CS_XBS5_ILP32_OFFBIG_CFLAGS = 705,
+#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LDFLAGS = 706,
+#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LIBS = 707,
+#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+ _CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 708,
+#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+ _CS_XBS5_LP64_OFF64_CFLAGS = 709,
+#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+ _CS_XBS5_LP64_OFF64_LDFLAGS = 710,
+#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+ _CS_XBS5_LP64_OFF64_LIBS = 711,
+#define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+ _CS_XBS5_LP64_OFF64_LINTFLAGS = 712,
+#define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_CFLAGS = 713,
+#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 714,
+#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LIBS = 715,
+#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+ _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 716,
+#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+
+ _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 800,
+#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V6_ILP32_OFF32_CFLAGS
+ _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 801,
+#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
+ _CS_POSIX_V6_ILP32_OFF32_LIBS = 802,
+#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V6_ILP32_OFF32_LIBS
+ _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 803,
+#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 804,
+#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 805,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
+ _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 806,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V6_ILP32_OFFBIG_LIBS
+ _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 807,
+#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
+ _CS_POSIX_V6_LP64_OFF64_CFLAGS = 808,
+#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V6_LP64_OFF64_CFLAGS
+ _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 809,
+#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V6_LP64_OFF64_LDFLAGS
+ _CS_POSIX_V6_LP64_OFF64_LIBS = 810,
+#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V6_LP64_OFF64_LIBS
+ _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 811,
+#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 812,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 813,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 814,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
+ _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 815,
+#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
+ _CS_V6_WIDTH_RESTRICTED_ENVS = 816,
+#define _CS_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
+#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_V6_WIDTH_RESTRICTED_ENVS
+
+/* These are found in GNU libc but not OpenSolaris. */
+
+ _CS_GNU_LIBC_VERSION = 5701,
+#define _CS_GNU_LIBC_VERSION _CS_GNU_LIBC_VERSION
+ _CS_GNU_LIBPTHREAD_VERSION
+#define _CS_GNU_LIBPTHREAD_VERSION _CS_GNU_LIBPTHREAD_VERSION
+ };
+
+#define _ACL_ACLENT_ENABLED 1
+#define _ACL_ACE_ENABLED 2
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/dirent.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/dirent.h
new file mode 100644
index 0000000000..eaa6ac6118
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/dirent.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1996, 1997, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+
+typedef struct dirent
+ {
+#ifndef __USE_FILE_OFFSET64
+ __ino_t d_ino;
+ __off_t d_off;
+#else
+ __ino64_t d_ino;
+ __off64_t d_off;
+#endif
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ } dirent_t;
+
+#ifdef __USE_LARGEFILE64
+typedef struct dirent64
+ {
+ __ino64_t d_ino;
+ __off64_t d_off;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ } dirent64_t;
+#endif
+
+#define d_fileno d_ino /* Backwards compatibility. */
+
+#undef _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/elfclass.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/elfclass.h
new file mode 100644
index 0000000000..04a76f59b3
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/elfclass.h
@@ -0,0 +1,79 @@
+/* This file specifies the native word size of the machine, which indicates
+ the ELF file class used for executables and shared objects on this
+ machine. */
+
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* The entries in the .hash table always have a size of 32 bits. */
+typedef uint32_t Elf_Symndx;
+
+typedef struct
+ {
+ Elf32_Sword eb_tag;
+ union
+ {
+ Elf32_Word eb_val;
+ Elf32_Addr eb_ptr;
+ Elf32_Off eb_off;
+ } eb_un;
+ } Elf32_Boot;
+
+typedef struct
+ {
+ Elf64_Xword eb_tag;
+ union
+ {
+ Elf64_Xword eb_val;
+ Elf64_Addr eb_ptr;
+ Elf64_Off eb_off;
+ } eb_un;
+ } Elf64_Boot;
+
+typedef uint64_t Elf32_Lword;
+typedef uint64_t Elf64_Lword;
+
+#define DT_SUNW_AUXILIARY 0x6000000d
+#define DT_SUNW_RTLDINF 0x6000000e
+#define DT_SUNW_FILTER 0x6000000f
+#define DT_SUNW_CAP 0x60000010
+#define DT_SUNW_SYMTAB 0x60000011
+#define DT_SUNW_SYMSZ 0x60000012
+#define DT_SUNW_ENCODING 0x60000013
+#define DT_SUNW_SORTENT 0x60000013
+#define DT_SUNW_SYMSORT 0x60000014
+#define DT_SUNW_SYMSORTSZ 0x60000015
+#define DT_SUNW_TLSSORT 0x60000016
+#define DT_SUNW_TLSSORTSZ 0x60000017
+#define DT_SUNW_STRPAD 0x60000019
+#define DT_SUNW_LDMACH 0x6000001b
+
+#define NT_PRSTATUS 1
+#define NT_PRFPREG 2
+#define NT_PRPSINFO 3
+#define NT_PRXREG 4
+#define NT_PLATFORM 5
+#define NT_AUXV 6
+#define NT_GWINDOWS 7
+#define NT_ASRS 8
+#define NT_LDT 9
+#define NT_PSTATUS 10
+#define NT_PSINFO 13
+#define NT_PRCRED 14
+#define NT_UTSNAME 15
+#define NT_LWPSTATUS 16
+#define NT_LWPSINFO 17
+#define NT_PRPRIV 18
+#define NT_PRPRIVINFO 19
+#define NT_CONTENT 20
+#define NT_ZONENAME 21
+#define NT_NUM 21
+
+#define LM_ID_BASE 0
+#define LM_ID_LDSO 1
+#define LM_ID_NUM 2
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/errno.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/errno.h
new file mode 100644
index 0000000000..b1d9413d89
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/errno.h
@@ -0,0 +1,184 @@
+/* Copyright (C) 1991, 1994, 1996, 1997, 1998, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* This file defines the `errno' constants. */
+
+#if !defined __Emath_defined && (defined _ERRNO_H || defined __need_Emath)
+#undef __need_Emath
+#define __Emath_defined 1
+
+# define EDOM 33 /* Math argument out of domain of function. */
+# define EILSEQ 88 /* Illegal byte sequence. */
+# define ERANGE 34 /* Math result not representable. */
+#endif
+
+#ifdef _ERRNO_H
+/* All error codes the system knows about. */
+
+# define EPERM 1 /* Not super-user. */
+# define ENOENT 2 /* No such file or directory. */
+# define ESRCH 3 /* No such process. */
+# define EINTR 4 /* Interrupted system call. */
+# define EIO 5 /* I/O error. */
+# define ENXIO 6 /* No such device or address. */
+# define E2BIG 7 /* Arg list too long. */
+# define ENOEXEC 8 /* Exec format error. */
+# define EBADF 9 /* Bad file number. */
+# define ECHILD 10 /* No children. */
+# define EAGAIN 11 /* Resource temporarily unavailable. */
+# define EWOULDBLOCK EAGAIN
+# define ENOMEM 12 /* Not enough core. */
+# define EACCES 13 /* Permission denied. */
+# define EFAULT 14 /* Bad address. */
+# define ENOTBLK 15 /* Block device required. */
+# define EBUSY 16 /* Mount device busy. */
+# define EEXIST 17 /* File exists. */
+# define EXDEV 18 /* Cross-device link. */
+# define ENODEV 19 /* No such device. */
+# define ENOTDIR 20 /* Not a directory. */
+# define EISDIR 21 /* Is a directory. */
+# define EINVAL 22 /* Invalid argument. */
+# define ENFILE 23 /* File table overflow. */
+# define EMFILE 24 /* Too many open files. */
+# define ENOTTY 25 /* Inappropriate ioctl for device. */
+# define ETXTBSY 26 /* Text file busy. */
+# define EFBIG 27 /* File too large. */
+# define ENOSPC 28 /* No space left on device. */
+# define ESPIPE 29 /* Illegal seek. */
+# define EROFS 30 /* Read only file system. */
+# define EMLINK 31 /* Too many links. */
+# define EPIPE 32 /* Broken pipe. */
+# define ENOMSG 35 /* No message of desired type. */
+# define EIDRM 36 /* Identifier removed. */
+# define ECHRNG 37 /* Channel number out of range. */
+# define EL2NSYNC 38 /* Level 2 not synchronized. */
+# define EL3HLT 39 /* Level 3 halted. */
+# define EL3RST 40 /* Level 3 reset. */
+# define ELNRNG 41 /* Link number out of range. */
+# define EUNATCH 42 /* Protocol driver not attached. */
+# define ENOCSI 43 /* No CSI structure available. */
+# define EL2HLT 44 /* Level 2 halted. */
+# define EDEADLK 45 /* Deadlock condition. */
+# define ENOLCK 46 /* No record locks available. */
+# define ECANCELED 47 /* Operation canceled. */
+# define ENOTSUP 48 /* Operation not supported. */
+
+/* Filesystem Quotas. */
+# define EDQUOT 49 /* Disc quota exceeded. */
+
+/* Convergent Error Returns. */
+# define EBADE 50 /* Invalid exchange. */
+# define EBADR 51 /* Invalid request descriptor. */
+# define EXFULL 52 /* Exchange full. */
+# define ENOANO 53 /* No anode. */
+# define EBADRQC 54 /* Invalid request code. */
+# define EBADSLT 55 /* Invalid slot. */
+# define EDEADLOCK 56 /* File locking deadlock error. */
+
+# define EBFONT 57 /* Bad font file fmt. */
+
+# define EOWNERDEAD 58 /* Process died with the lock. */
+# define ENOTRECOVERABLE 59 /* Lock is not recoverable. */
+
+/* STREAM problems. */
+# define ENOSTR 60 /* Device not a stream. */
+# define ENODATA 61 /* No data (for no delay io). */
+# define ETIME 62 /* Timer expired. */
+# define ENOSR 63 /* Out of streams resources. */
+
+# define ENONET 64 /* Machine is not on the network. */
+# define ENOPKG 65 /* Package not installed. */
+# define EREMOTE 66 /* The object is remote. */
+# define ENOLINK 67 /* The link has been severed. */
+# define EADV 68 /* Advertise error. */
+# define ESRMNT 69 /* Srmount error. */
+
+# define ECOMM 70 /* Communication error on send. */
+# define EPROTO 71 /* Protocol error. */
+# define ELOCKUNMAPPED 72 /* locked lock was unmapped. */
+# define ENOTACTIVE 73 /* Facility is not active. */
+# define EMULTIHOP 74 /* Multihop attempted. */
+# define EBADMSG 77 /* Trying to read unreadable message. */
+# define ENAMETOOLONG 78 /* Path name is too long. */
+# define EOVERFLOW 79 /* Value too large to be stored in data type.*/
+# define ENOTUNIQ 80 /* Given log. name not unique. */
+# define EBADFD 81 /* F.d. invalid for this operation. */
+# define EREMCHG 82 /* Remote address changed. */
+
+/* Shared library problems. */
+# define ELIBACC 83 /* Can't access a needed shared lib. */
+# define ELIBBAD 84 /* Accessing a corrupted shared lib. */
+# define ELIBSCN 85 /* .lib section in a.out corrupted. */
+# define ELIBMAX 86 /* Attempting to link in too many libs. */
+# define ELIBEXEC 87 /* Attempting to exec a shared library. */
+# define ENOSYS 89 /* Unsupported file system operation. */
+# define ELOOP 90 /* Symbolic link loop. */
+# define ERESTART 91 /* Restartable system call. */
+# define ESTRPIPE 92 /* If pipe/FIFO, don't sleep in stream head. */
+# define ENOTEMPTY 93 /* Directory not empty. */
+# define EUSERS 94 /* Too many users (for UFS). */
+
+/* BSD Networking Software: argument errors. */
+# define ENOTSOCK 95 /* Socket operation on non-socket. */
+# define EDESTADDRREQ 96 /* Destination address required. */
+# define EMSGSIZE 97 /* Message too long. */
+# define EPROTOTYPE 98 /* Protocol wrong type for socket. */
+# define ENOPROTOOPT 99 /* Protocol not available. */
+# define EPROTONOSUPPORT 120 /* Protocol not supported. */
+# define ESOCKTNOSUPPORT 121 /* Socket type not supported. */
+# define EOPNOTSUPP 122 /* Operation not supported on socket. */
+# define EPFNOSUPPORT 123 /* Protocol family not supported. */
+# define EAFNOSUPPORT 124 /* Address family not supported by
+ protocol family. */
+# define EADDRINUSE 125 /* Address already in use. */
+# define EADDRNOTAVAIL 126 /* Can't assign requested address. */
+/* BSD Networking Software: operational errors. */
+# define ENETDOWN 127 /* Network is down. */
+# define ENETUNREACH 128 /* Network is unreachable. */
+# define ENETRESET 129 /* Network dropped connection because
+ of reset. */
+# define ECONNABORTED 130 /* Software caused connection abort. */
+# define ECONNRESET 131 /* Connection reset by peer. */
+# define ENOBUFS 132 /* No buffer space available. */
+# define EISCONN 133 /* Socket is already connected. */
+# define ENOTCONN 134 /* Socket is not connected. */
+/* XENIX has 135 - 142. */
+# define ESHUTDOWN 143 /* Can't send after socket shutdown. */
+# define ETOOMANYREFS 144 /* Too many references: can't splice. */
+# define ETIMEDOUT 145 /* Connection timed out. */
+# define ECONNREFUSED 146 /* Connection refused. */
+# define EHOSTDOWN 147 /* Host is down. */
+# define EHOSTUNREACH 148 /* No route to host. */
+# define EALREADY 149 /* operation already in progress. */
+# define EINPROGRESS 150 /* operation now in progress. */
+
+/* SUN Network File System. */
+# define ESTALE 151 /* Stale NFS file handle. */
+
+# ifndef __ASSEMBLER__
+/* Function to get address of global `errno' variable. */
+extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+
+# if !defined _LIBC || defined _LIBC_REENTRANT
+/* When using threads, errno is a per-thread value. */
+# define errno (*__errno_location ())
+# endif
+# endif /* !__ASSEMBLER__ */
+
+#endif /* _ERRNO_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/fcntl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/fcntl.h
new file mode 100644
index 0000000000..de499417b2
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/fcntl.h
@@ -0,0 +1,267 @@
+/* O_*, F_*, FD_* bit values for OpenSolaris.
+ Copyright (C) 2001, 2002, 2004, 2006, 2007, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <sys/types.h>
+#include <bits/wordsize.h>
+#ifdef __USE_GNU
+# include <bits/uio.h>
+#endif
+
+
+/* open/fcntl */
+#define O_RDONLY 0
+#define O_WRONLY 1
+#define O_RDWR 2
+#define O_ACCMODE 3
+#define O_NDELAY 0x04
+#define O_APPEND 0x08
+#define O_SYNC 0x10
+#define O_NONBLOCK 0x80
+#define O_CREAT 0x100
+#define O_TRUNC 0x200
+#define O_EXCL 0x400
+#define O_NOCTTY 0x800
+#define O_PRIV 0x1000
+#define O_XATTR 0x4000
+#define O_NOFOLLOW 0x20000
+#define O_NOLINKS 0x40000
+
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC 0x40 /* Synchronize data. */
+# define O_RSYNC 0x8000 /* Synchronize read operations. */
+#endif
+#define O_FSYNC O_SYNC
+
+#ifdef __USE_GNU
+#define O_DIRECT 0x1000000
+#define O_DIRECTORY 0x2000000
+#endif
+
+#ifdef __USE_LARGEFILE64
+# if __WORDSIZE == 64
+# define O_LARGEFILE 0
+# else
+# define O_LARGEFILE 0x2000
+# endif
+#endif
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#if __WORDSIZE == 64
+# define F_GETLK 14 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+# define F_ALLOCSP 10 /* Allocate file space. */
+# define F_FREESP 11 /* Free file space. */
+# define F_SETLK_NBMAND 42 /* Private. */
+/* Not necessary, we always have 64-bit offsets. */
+# define F_GETLK64 F_GETLK /* Get record locking info. */
+# define F_SETLK64 F_SETLK /* Set record locking info (non-blocking). */
+# define F_SETLKW64 F_SETLKW /* Set record locking info (blocking). */
+# define F_ALLOCSP64 F_ALLOCSP /* Allocate file space. */
+# define F_FREESP64 F_FREESP /* Free file space. */
+# define F_SETLK64_NBMAND F_SETLK_NBMAND /* Private. */
+#else
+# ifndef __USE_FILE_OFFSET64
+# define F_GETLK 14 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+# define F_ALLOCSP 10 /* Allocate file space. */
+# define F_FREESP 11 /* Free file space. */
+# define F_SETLK_NBMAND 42 /* Private. */
+# else
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
+# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
+# define F_ALLOCSP F_ALLOCSP64 /* Allocate file space. */
+# define F_FREESP F_FREESP64 /* Free file space. */
+# define F_SETLK_NBMAND F_SETLK64_NBMAND /* Private. */
+# endif
+# define F_GETLK64 33 /* Get record locking info. */
+# define F_SETLK64 34 /* Set record locking info (non-blocking). */
+# define F_SETLKW64 35 /* Set record locking info (blocking). */
+# define F_ALLOCSP64 28 /* Allocate file space. */
+# define F_FREESP64 27 /* Free file space. */
+# define F_SETLK64_NBMAND 44 /* Private. */
+#endif
+
+/* OpenSolaris-specific */
+#define F_GETXFL 45
+#define F_CHKFL 8
+#define F_DUP2FD 9
+#define F_ISSTREAM 13
+#define F_PRIV 15
+#define F_NPRIV 16
+#define F_QUOTACTL 17
+#define F_BLOCKS 18
+#define F_BLKSIZE 19
+#define F_GETOWN 23
+#define F_SETOWN 24
+#define F_REVOKE 25
+#define F_HASREMOTELOCKS 26
+
+#define F_SHARE 40
+#define F_UNSHARE 41
+#define F_SHARE_NBMAND 43
+
+typedef struct fshare
+{
+ short f_access;
+ short f_deny;
+ int f_id;
+} fshare_t;
+
+/* f_access values */
+#define F_RDACC 0x1
+#define F_WRACC 0x2
+#define F_RWACC 0x3
+#define F_RMACC 0x4
+#define F_MDACC 0x20
+
+/* f_deny values */
+#define F_NODNY 0x0
+#define F_RDDNY 0x1
+#define F_WRDNY 0x2
+#define F_RWDNY 0x3
+#define F_RMDNY 0x4
+#define F_COMPAT 0x8
+#define F_MANDDNY 0x10
+
+#define F_BADFD 46
+
+/* For F_[GET|SET]FD. */
+# define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+# define F_RDLCK 1 /* Read lock. */
+# define F_WRLCK 2 /* Write lock. */
+# define F_UNLCK 3 /* Remove lock. */
+/* OpenSolaris-specific */
+#define F_UNLKSYS 4
+
+typedef struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ int l_sysid;
+ __pid_t l_pid; /* Process holding the lock. */
+ long l_pad[4];
+ } flock_t;
+
+#ifdef _SYSCALL32
+typedef struct flock32
+ {
+ __int16_t l_type;
+ __int16_t l_whence;
+ __off_t l_start;
+ __off_t l_len;
+ __int32_t l_sysid;
+ __pid_t l_pid;
+ __int32_t l_pad[4];
+ } flock32_t;
+#endif
+
+#ifdef __USE_LARGEFILE64
+typedef struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ int l_sysid;
+ __pid_t l_pid; /* Process holding the lock. */
+ long l_pad[4];
+ } flock64_t;
+#endif
+
+/* OpenSolaris direct i/o */
+#define DIRECTIO_OFF (0)
+#define DIRECTIO_ON (1)
+
+/* OpenSolaris-specific seek flags */
+#define SEEK_DATA 3
+#define SEEK_HOLE 4
+
+/* at-file support */
+#ifdef __USE_ATFILE
+# define __AT_DEFINED
+# define AT_FDCWD 0xffd19553 /* Special value used to indicate
+ the *at functions should use the
+ current working directory. */
+# define AT_SYMLINK_NOFOLLOW 0x1000 /* Do not follow symbolic links. */
+# define AT_REMOVEDIR 0x1 /* Remove directory instead of
+ unlinking file. */
+# define AT_EACCESS 010 /* Test access permitted for
+ effective IDs, not real IDs. */
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FOPEN 0xffffffff
+# define FREAD 0x01
+# define FWRITE 0x02
+# define NDELAY 0x04
+# define FNDELAY NDELAY
+# define FAPPEND 0x08
+# define FSYNC 0x10
+# define FFSYNC FSYNC
+# define FREVOKED 0x20
+# define FDSYNC 0x40
+# define FNONBLOCK 0x80
+# define FCREAT 0x0100
+# define FTRUNC 0x0200
+# define FEXCL 0x0400
+# define FASYNC 0x1000
+# define FOFFMAX 0x2000
+# define FXATTR 0x4000
+# define FNOCTTY 0x0800
+# define FRSYNC 0x8000
+# define FNODSYNC 0x10000
+# define FNOFOLLOW 0x20000
+# define FNOLINKS 0x40000
+# define FIGNORECASE 0x80000
+# define FXATTRDIROPEN 0x100000
+#endif /* Use BSD. */
+
+/* Advise to `posix_fadvise'. */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/in.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/in.h
new file mode 100644
index 0000000000..cef1f59c31
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/in.h
@@ -0,0 +1,194 @@
+/* Copyright (C) 1991-1999, 2000, 2004, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Linux version. */
+
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
+
+/* Really these belong in the enum in netinet/in.h. */
+#define IPPROTO_GGP 3
+#define IPPROTO_HELLO 63
+#define IPPROTO_ND 77
+#define IPPROTO_EON 80
+
+#define IPPORT_CHARGEN 19
+
+/* Options for use with `getsockopt' and `setsockopt' at the IP level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IP_OPTIONS 1 /* ip_opts; IP per-packet options. */
+#define IP_HDRINCL 2 /* int; Header is included with data. */
+#define IP_TOS 3 /* int; IP type of service and precedence. */
+#define IP_TTL 4 /* int; IP time to live. */
+#define IP_RECVOPTS 5 /* bool; Receive all IP options w/datagram. */
+#define IP_RECVRETOPTS 6 /* bool; Receive IP options for response. */
+#define IP_RECVDSTADDR 7 /* int; Receive IP dst addr w/datagram. */
+#define IP_RETOPTS 8 /* ip_opts; Set/get IP per-packet options. */
+#define IP_RECVIF 9 /* int; Receive the inbound interface index. */
+#define IP_RECVSLLA 10 /* sockaddr_dl; Get source link layer address. */
+#define IP_RECVTTL 11 /* u_char; Get TTL for inbound packet. */
+#define IP_MULTICAST_IF 16 /* in_addr; set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 17 /* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 18 /* i_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 19 /* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 20 /* ip_mreq; drop an IP group membership */
+#define IP_UNBLOCK_SOURCE 21 /* ip_mreq_source: unblock data from source */
+#define IP_BLOCK_SOURCE 22 /* ip_mreq_source: block data from source */
+#define IP_ADD_SOURCE_MEMBERSHIP 23 /* ip_mreq_source: join source group */
+#define IP_DROP_SOURCE_MEMBERSHIP 24 /* ip_mreq_source: leave source group */
+#define IP_NEXTHOP 25 /* send directly to next hop */
+#define IP_PKTINFO 26 /* specify src address and/or index */
+#define IP_RECVPKTINFO 26 /* recv dest/matched addr and index */
+#define IP_SEC_OPT 34 /* used to set IPSEC options */
+
+/* ipsec */
+#define IPSEC_PREF_NEVER 0x01
+#define IPSEC_PREF_REQUIRED 0x02
+#define IPSEC_PREF_UNIQUE 0x04
+
+typedef struct ipsec_req
+ {
+ unsigned int ipsr_ah_req; /* AH request */
+ unsigned int ipsr_esp_req; /* ESP request */
+ unsigned int ipsr_self_encap_req; /* Self-Encap request */
+ unsigned int ipsr_auth_alg; /* Auth algs for AH */
+ unsigned int ipsr_esp_alg; /* Encr algs for ESP */
+ unsigned int ipsr_esp_auth_alg; /* Auth algs for ESP */
+ }
+ipsec_req_t;
+
+#define MCAST_JOIN_GROUP 41 /* group_req: join any-source group */
+#define MCAST_LEAVE_GROUP 42 /* group_req: leave any-source group */
+#define MCAST_BLOCK_SOURCE 43 /* group_source_req: block from given group */
+#define MCAST_UNBLOCK_SOURCE 44 /* group_source_req: unblock from given group*/
+#define MCAST_JOIN_SOURCE_GROUP 45 /* group_source_req: join source-spec gr */
+#define MCAST_LEAVE_SOURCE_GROUP 46 /* group_source_req: leave source-spec gr*/
+
+#define MCAST_INCLUDE 1
+#define MCAST_EXCLUDE 2
+
+#define IP_BOUND_IF 65 /* bind socket to an ifindex */
+#define IP_UNSPEC_SRC 66 /* use unspecified source address */
+#define IP_BROADCAST_TTL 67 /* use specific TTL for broadcast */
+#define IP_DONTFAILOVER_IF 68 /* no failover */
+#define IP_DHCPINIT_IF 69 /* accept all unicast DHCP traffic */
+#define IP_REUSEADDR 260
+#define IP_DONTROUTE 261
+#define IP_BROADCAST 262
+
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+//#define IP_MAX_MEMBERSHIPS 20
+
+/* Structure used for IP_PKTINFO. */
+struct in_pktinfo
+ {
+ unsigned int ipi_ifindex; /* Interface index */
+ struct in_addr ipi_spec_dst; /* Routing destination address */
+ struct in_addr ipi_addr; /* Header destination address */
+ };
+
+/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IPV6_UNICAST_HOPS 5
+#define IPV6_MULTICAST_IF 6
+#define IPV6_MULTICAST_HOPS 7
+#define IPV6_MULTICAST_LOOP 8
+#define IPV6_JOIN_GROUP 9
+#define IPV6_LEAVE_GROUP 10
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#define IPV6_PKTINFO 11
+#define IPV6_HOPLIMIT 12
+#define IPV6_NEXTHOP 13
+#define IPV6_HOPOPTS 14
+#define IPV6_DSTOPTS 15
+#define IPV6_RTHDR 16
+#define IPV6_RTHDRDSTOPTS 17
+#define IPV6_RECVPKTINFO 18
+#define IPV6_RECVHOPLIMIT 19
+#define IPV6_RECVHOPOPTS 20
+
+#define IPV6_RECVRTHDR 22
+#define IPV6_RECVRTHDRDSTOPTS 23
+#define IPV6_CHECKSUM 24
+#define IPV6_RECVTCLASS 25
+
+#define IPV6_USE_MIN_MTU 32
+#define IPV6_DONTFRAG 33
+#define IPV6_SEC_OPT 34
+#define IPV6_SRC_PREFERENCES 35
+#define IPV6_RECVPATHMTU 36
+#define IPV6_PATHMTU 37
+#define IPV6_TCLASS 38
+#define IPV6_V6ONLY 39
+#define IPV6_RECVDSTOPTS 40
+
+/* IPV6_SRC_PREFERENCES */
+#define IPV6_PREFER_SRC_HOME 0x01
+#define IPV6_PREFER_SRC_COA 0x02
+#define IPV6_PREFER_SRC_PUBLIC 0x04
+#define IPV6_PREFER_SRC_TMP 0x08
+#define IPV6_PREFER_SRC_NONCGA 0x10
+#define IPV6_PREFER_SRC_CGA 0x20
+#define IPV6_PREFER_SRC_MIPMASK (IPV6_PREFER_SRC_HOME | IPV6_PREFER_SRC_COA)
+#define IPV6_PREFER_SRC_MIPDEFAULT IPV6_PREFER_SRC_HOME
+#define IPV6_PREFER_SRC_TMPMASK (IPV6_PREFER_SRC_PUBLIC | IPV6_PREFER_SRC_TMP)
+#define IPV6_PREFER_SRC_TMPDEFAULT IPV6_PREFER_SRC_PUBLIC
+#define IPV6_PREFER_SRC_CGAMASK (IPV6_PREFER_SRC_NONCGA | IPV6_PREFER_SRC_CGA)
+#define IPV6_PREFER_SRC_CGADEFAULT IPV6_PREFER_SRC_NONCGA
+#define IPV6_PREFER_SRC_MASK (IPV6_PREFER_SRC_MIPMASK |\
+ IPV6_PREFER_SRC_TMPMASK | IPV6_PREFER_SRC_CGAMASK)
+#define IPV6_PREFER_SRC_DEFAULT (IPV6_PREFER_SRC_MIPDEFAULT |\
+ IPV6_PREFER_SRC_TMPDEFAULT | IPV6_PREFER_SRC_CGADEFAULT)
+
+#define IPV6_BOUND_IF 65
+#define IPV6_UNSPEC_SRC 66
+#define IPV6_BOUND_PIF 67
+#define IPV6_DONTFAILOVER_IF 68
+
+#define IPV6_RTHDR_TYPE_0 0
+
+#include <endian.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+# define IPV6_FLOWINFO_FLOWLABEL 0x000fffffU
+# define IPV6_FLOWINFO_TCLASS 0x0ff00000U
+#else
+# define IPV6_FLOWINFO_FLOWLABEL 0xffff0f00U
+# define IPV6_FLOWINFO_TCLASS 0x0000f00fU
+#endif
+
+typedef __uint32_t ipaddr_t;
+typedef struct in6_addr in6_addr_t;
+
+#define IN_CLASSE(i) IN_BADCLASS(i)
+#define IN_CLASSE_NET 0xffffffffU
+
+#define IN6_V4MAPPED_TO_INADDR(v6, v4) \
+ ((v4)->s_addr = (v6)->in6_u.u6_addr32[3])
+#define IN6_V4MAPPED_TO_IPADDR(v6, v4) \
+ ((v4) = (v6)->in6_u.u6_addr32[3])
+
+#ifdef __USE_MISC
+# define _S6_un in6_u
+# define _S6_u32 u6_addr32
+#endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctl-types.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctl-types.h
new file mode 100644
index 0000000000..dcd0375811
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctl-types.h
@@ -0,0 +1,87 @@
+/* Structure types for pre-termios terminal ioctls. OpenSolaris version.
+ Copyright (C) 1996, 1997, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Type of ARG for TIOCGETC and TIOCSETC requests. */
+struct tchars
+{
+ char t_intrc; /* Interrupt character. */
+ char t_quitc; /* Quit character. */
+ char t_startc; /* Start-output character. */
+ char t_stopc; /* Stop-output character. */
+ char t_eofc; /* End-of-file character. */
+ char t_brkc; /* Input delimiter character. */
+};
+
+/* Type of ARG for TIOCGLTC and TIOCSLTC requests. */
+struct ltchars
+{
+ char t_suspc; /* Suspend character. */
+ char t_dsuspc; /* Delayed suspend character. */
+ char t_rprntc; /* Reprint-line character. */
+ char t_flushc; /* Flush-output character. */
+ char t_werasc; /* Word-erase character. */
+ char t_lnextc; /* Literal-next character. */
+};
+
+/* Type of ARG for TIOCGETP and TIOCSETP requests (and gtty and stty). */
+struct sgttyb
+{
+ char sg_ispeed; /* Input speed. */
+ char sg_ospeed; /* Output speed. */
+ char sg_erase; /* Erase character. */
+ char sg_kill; /* Kill character. */
+ int sg_flags; /* Mode flags. */
+};
+
+/* Type of ARG for TIOCGWINSZ and TIOCSWINSZ requests. */
+struct winsize
+{
+ unsigned short int ws_row; /* Rows, in characters. */
+ unsigned short int ws_col; /* Columns, in characters. */
+
+ /* These are not actually used. */
+ unsigned short int ws_xpixel; /* Horizontal pixels. */
+ unsigned short int ws_ypixel; /* Vertical pixels. */
+};
+
+#define NCC 8
+#define _NCC NCC
+struct termio
+{
+ unsigned short int c_iflag;
+ unsigned short int c_oflag;
+ unsigned short int c_cflag;
+ unsigned short int c_lflag;
+ char c_line;
+ unsigned char c_cc[NCC];
+};
+
+struct termcb
+{
+ char st_flgs;
+ char st_termt;
+ char st_crow;
+ char st_ccol;
+ char st_vrow;
+ char st_lrow;
+};
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctls.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctls.h
new file mode 100644
index 0000000000..8995b59992
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ioctls.h
@@ -0,0 +1,305 @@
+/* Copyright (C) 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+#define IOCPARM_MASK 0xff
+#define IOC_VOID 0x20000000
+#define IOC_OUT 0x40000000
+#define IOC_IN 0x80000000
+#define IOC_INOUT (IOC_IN|IOC_OUT)
+
+#define _IOC(inout,group,num,len) \
+ (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))
+#define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0)
+#define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t))
+#define _IORN(g,n,t) _IOC(IOC_OUT, (g), (n), (t))
+#define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t))
+#define _IOWN(g,n,t) _IOC(IOC_IN, (g), (n), (t))
+#define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t))
+#define _IOWRN(g,n,t) _IOC(IOC_INOUT, (g), (n), (t))
+
+
+#define SIOCSHIWAT _IOW('s', 0, int)
+#define SIOCGHIWAT _IOR('s', 1, int)
+#define SIOCSLOWAT _IOW('s', 2, int)
+#define SIOCGLOWAT _IOR('s', 3, int)
+#define SIOCATMARK _IOR('s', 7, int)
+#define SIOCSPGRP _IOW('s', 8, int)
+#define SIOCGPGRP _IOR('s', 9, int)
+
+#define SIOCGETNAME _IOR('s', 52, struct sockaddr)
+#define SIOCGETPEER _IOR('s', 53, struct sockaddr)
+#define IF_UNITSEL _IOW('s', 54, int)
+#define SIOCXPROTO _IO('s', 55)
+
+
+#define SIOCADDRT _IOWN('r', 10, 48)
+#define SIOCDELRT _IOWN('r', 11, 48)
+#define SIOCGETVIFCNT _IOWR('r', 20, struct sioc_vif_req)
+#define SIOCGETSGCNT _IOWR('r', 21, struct sioc_sg_req)
+#define SIOCGETLSGCNT _IOWR('r', 21, struct sioc_lsg_req)
+
+
+#define SIOCSIFADDR _IOW('i', 12, struct ifreq)
+#define SIOCGIFADDR _IOWR('i', 13, struct ifreq)
+#define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq)
+#define SIOCGIFDSTADDR _IOWR('i', 15, struct ifreq)
+#define SIOCSIFFLAGS _IOW('i', 16, struct ifreq)
+#define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq)
+#define SIOCSIFMEM _IOW('i', 18, struct ifreq)
+#define SIOCGIFMEM _IOWR('i', 19, struct ifreq)
+#define O_SIOCGIFCONF _IOWRN('i', 20, 8)
+#define SIOCSIFMTU _IOW('i', 21, struct ifreq)
+#define SIOCGIFMTU _IOWR('i', 22, struct ifreq)
+#define SIOCGIFBRDADDR _IOWR('i', 23, struct ifreq)
+#define SIOCSIFBRDADDR _IOW('i', 24, struct ifreq)
+#define SIOCGIFNETMASK _IOWR('i', 25, struct ifreq)
+#define SIOCSIFNETMASK _IOW('i', 26, struct ifreq)
+#define SIOCGIFMETRIC _IOWR('i', 27, struct ifreq)
+#define SIOCSIFMETRIC _IOW('i', 28, struct ifreq)
+
+#define SIOCSARP _IOW('i', 30, struct arpreq)
+#define SIOCGARP _IOWR('i', 31, struct arpreq)
+#define SIOCDARP _IOW('i', 32, struct arpreq)
+#define SIOCUPPER _IOW('i', 40, struct ifreq)
+#define SIOCLOWER _IOW('i', 41, struct ifreq)
+#define SIOCSETSYNC _IOW('i', 44, struct ifreq)
+#define SIOCGETSYNC _IOWR('i', 45, struct ifreq)
+#define SIOCSSDSTATS _IOWR('i', 46, struct ifreq)
+#define SIOCSSESTATS _IOWR('i', 47, struct ifreq)
+#define SIOCSPROMISC _IOW('i', 48, int)
+#define SIOCADDMULTI _IOW('i', 49, struct ifreq)
+#define SIOCDELMULTI _IOW('i', 50, struct ifreq)
+
+
+#define SIOCIFDETACH _IOW('i', 56, struct ifreq)
+#define SIOCGENPSTATS _IOWR('i', 57, struct ifreq)
+
+#define SIOCX25XMT _IOWR('i', 59, struct ifreq)
+#define SIOCX25RCV _IOWR('i', 60, struct ifreq)
+#define SIOCX25TBL _IOWR('i', 61, struct ifreq)
+
+#define SIOCSLGETREQ _IOWR('i', 71, struct ifreq)
+#define SIOCSLSTAT _IOW('i', 72, struct ifreq)
+#define SIOCSIFNAME _IOW('i', 73, struct ifreq)
+
+#define SIOCGENADDR _IOWR('i', 85, struct ifreq)
+
+#define SIOCGIFNUM _IOR('i', 87, int)
+#define SIOCGIFMUXID _IOWR('i', 88, struct ifreq)
+#define SIOCSIFMUXID _IOW('i', 89, struct ifreq)
+#define SIOCGIFINDEX _IOWR('i', 90, struct ifreq)
+#define SIOCSIFINDEX _IOW('i', 91, struct ifreq)
+#define SIOCGIFCONF _IOWRN('i', 92, 8)
+
+#define SIOCLIFREMOVEIF _IOW('i', 110, struct lifreq)
+#define SIOCLIFADDIF _IOWR('i', 111, struct lifreq)
+#define SIOCSLIFADDR _IOW('i', 112, struct lifreq)
+#define SIOCGLIFADDR _IOWR('i', 113, struct lifreq)
+#define SIOCSLIFDSTADDR _IOW('i', 114, struct lifreq)
+#define SIOCGLIFDSTADDR _IOWR('i', 115, struct lifreq)
+#define SIOCSLIFFLAGS _IOW('i', 116, struct lifreq)
+#define SIOCGLIFFLAGS _IOWR('i', 117, struct lifreq)
+
+#define O_SIOCGLIFCONF _IOWRN('i', 120, 16)
+#define SIOCSLIFMTU _IOW('i', 121, struct lifreq)
+#define SIOCGLIFMTU _IOWR('i', 122, struct lifreq)
+#define SIOCGLIFBRDADDR _IOWR('i', 123, struct lifreq)
+#define SIOCSLIFBRDADDR _IOW('i', 124, struct lifreq)
+#define SIOCGLIFNETMASK _IOWR('i', 125, struct lifreq)
+#define SIOCSLIFNETMASK _IOW('i', 126, struct lifreq)
+#define SIOCGLIFMETRIC _IOWR('i', 127, struct lifreq)
+#define SIOCSLIFMETRIC _IOW('i', 128, struct lifreq)
+#define SIOCSLIFNAME _IOWR('i', 129, struct lifreq)
+#define SIOCGLIFNUM _IOWR('i', 130, struct lifnum)
+#define SIOCGLIFMUXID _IOWR('i', 131, struct lifreq)
+#define SIOCSLIFMUXID _IOW('i', 132, struct lifreq)
+#define SIOCGLIFINDEX _IOWR('i', 133, struct lifreq)
+#define SIOCSLIFINDEX _IOW('i', 134, struct lifreq)
+#define SIOCSLIFTOKEN _IOW('i', 135, struct lifreq)
+#define SIOCGLIFTOKEN _IOWR('i', 136, struct lifreq)
+#define SIOCSLIFSUBNET _IOW('i', 137, struct lifreq)
+#define SIOCGLIFSUBNET _IOWR('i', 138, struct lifreq)
+#define SIOCSLIFLNKINFO _IOW('i', 139, struct lifreq)
+#define SIOCGLIFLNKINFO _IOWR('i', 140, struct lifreq)
+#define SIOCLIFDELND _IOW('i', 141, struct lifreq)
+#define SIOCLIFGETND _IOWR('i', 142, struct lifreq)
+#define SIOCLIFSETND _IOW('i', 143, struct lifreq)
+#define SIOCTMYADDR _IOWR('i', 144, struct sioc_addrreq)
+#define SIOCTONLINK _IOWR('i', 145, struct sioc_addrreq)
+#define SIOCTMYSITE _IOWR('i', 146, struct sioc_addrreq)
+#define SIOCGTUNPARAM _IOR('i', 147, struct iftun_req)
+#define SIOCSTUNPARAM _IOW('i', 148, struct iftun_req)
+#define SIOCFIPSECONFIG _IOW('i', 149, 0)
+#define SIOCSIPSECONFIG _IOW('i', 150, 0)
+#define SIOCDIPSECONFIG _IOW('i', 151, 0)
+#define SIOCLIPSECONFIG _IOW('i', 152, 0)
+#define SIOCLIFFAILOVER _IOW('i', 153, struct lifreq)
+#define SIOCLIFFAILBACK _IOW('i', 154, struct lifreq)
+#define SIOCSLIFGROUPNAME _IOW('i', 155, struct lifreq)
+#define SIOCGLIFGROUPNAME _IOWR('i', 156, struct lifreq)
+#define SIOCGLIFOINDEX _IOWR('i', 157, struct lifreq)
+#define SIOCSLIFOINDEX _IOWR('i', 161, struct lifreq)
+#define SIOCGIP6ADDRPOLICY _IOWRN('i', 162, 0)
+#define SIOCSIP6ADDRPOLICY _IOWN('i', 163, 0)
+#define SIOCGDSTINFO _IOWRN('i', 164, 0)
+#define SIOCGLIFCONF _IOWRN('i', 165, 16)
+#define SIOCSXARP _IOW('i', 166, struct xarpreq)
+#define SIOCGXARP _IOWR('i', 167, struct xarpreq)
+#define SIOCDXARP _IOW('i', 168, struct xarpreq)
+#define _SIOCSOCKFALLBACK _IOW('i', 169, 0)
+#define SIOCGLIFZONE _IOWR('i', 170, struct lifreq)
+#define SIOCSLIFZONE _IOW('i', 171, struct lifreq)
+#define SIOCSCTPSOPT _IOWN('i', 172, 16)
+#define SIOCSCTPGOPT _IOWRN('i', 173, 16)
+#define SIOCSCTPPEELOFF _IOWR('i', 174, int)
+#define SIOCGLIFUSESRC _IOWR('i', 175, struct lifreq)
+#define SIOCSLIFUSESRC _IOW('i', 176, struct lifreq)
+#define SIOCGLIFSRCOF _IOWRN('i', 177, 16)
+#define SIOCGMSFILTER _IOWR('i', 178, 0)
+#define SIOCSMSFILTER _IOW('i', 179, 0)
+#define SIOCGIPMSFILTER _IOWR('i', 180, 0)
+#define SIOCSIPMSFILTER _IOW('i', 181, 0)
+#define SIOCSIPMPFAILBACK _IOW('i', 182, int)
+#define SIOCSENABLESDP _IOWR('i', 183, int)
+
+
+#define FIOCLEX _IO('f', 1)
+#define FIONCLEX _IO('f', 2)
+
+#define _FIOISBUSY _IO('f', 75)
+#define _FIODIRECTIO _IO('f', 76)
+#define _FIOTUNE _IO('f', 77)
+
+#define _FIOLOGENABLE _IO('f', 87)
+#define _FIOLOGDISABLE _IO('f', 88)
+#define _FIOSNAPSHOTCREATE _IO('f', 89)
+#define _FIOSNAPSHOTDELETE _IO('f', 90)
+#define _FIOGETSUPERBLOCK _IO('f', 91)
+#define _FIOGETMAXPHYS _IO('f', 92)
+#define _FIO_SET_LUFS_DEBUG _IO('f', 93)
+#define _FIO_SET_LUFS_ERROR _IO('f', 94)
+#define _FIO_GET_TOP_STATS _IO('f', 95)
+#define _FIOSNAPSHOTCREATE_MULTI _IO('f', 96)
+#define _FIO_SEEK_DATA _IO('f', 97)
+#define _FIO_SEEK_HOLE _IO('f', 98)
+#define _FIO_COMPRESSED _IO('f', 99)
+
+#define FIONREAD _IOR('f', 127, int)
+#define FIONBIO _IOW('f', 126, int)
+#define FIOASYNC _IOW('f', 125, int)
+#define FIOSETOWN _IOW('f', 124, int)
+#define FIOGETOWN _IOR('f', 123, int)
+
+
+#ifndef IOCTYPE
+#define IOCTYPE 0xff00
+#endif
+
+
+#ifndef _TIOC
+# define _TIOC ('T'<<8)
+# define TIOC _TIOC
+#endif
+
+#define TCGETA (_TIOC|1)
+#define TCSETA (_TIOC|2)
+#define TCSETAW (_TIOC|3)
+#define TCSETAF (_TIOC|4)
+#define TCSBRK (_TIOC|5)
+#define TCXONC (_TIOC|6)
+#define TCFLSH (_TIOC|7)
+#define TIOCKBON (_TIOC|8)
+#define TIOCKBOF (_TIOC|9)
+#define KBENABLED (_TIOC|10)
+
+#define TCGETS (_TIOC|13)
+#define TCSETS (_TIOC|14)
+#define TCSETSW (_TIOC|15)
+#define TCSETSF (_TIOC|16)
+
+#define TCDSET (_TIOC|32)
+#define RTS_TOG (_TIOC|33)
+
+#define TIOCSWINSZ (_TIOC|103)
+#define TIOCGWINSZ (_TIOC|104)
+#define TIOCGSOFTCAR (_TIOC|105)
+#define TIOCSSOFTCAR (_TIOC|106)
+
+#define TIOCSETLD (_TIOC|123)
+#define TIOCGETLD (_TIOC|124)
+
+
+#define tIOC ('t'<<8)
+
+#define TIOCGETD (tIOC|0)
+#define TIOCSETD (tIOC|1)
+#define TIOCHPCL (tIOC|2)
+#define TIOCGETP (tIOC|8)
+#define TIOCSETP (tIOC|9)
+#define TIOCSETN (tIOC|10)
+#define TIOCEXCL (tIOC|13)
+#define TIOCNXCL (tIOC|14)
+#define TIOCFLUSH (tIOC|16)
+#define TIOCSETC (tIOC|17)
+#define TIOCGETC (tIOC|18)
+
+#define TIOCGPGRP (tIOC|20)
+#define TIOCSPGRP (tIOC|21)
+#define TIOCGSID (tIOC|22)
+#define TIOCSTI (tIOC|23)
+
+#define TIOCMSET (tIOC|26)
+#define TIOCMBIS (tIOC|27)
+#define TIOCMBIC (tIOC|28)
+#define TIOCMGET (tIOC|29)
+#define TIOCREMOTE (tIOC|30)
+#define TIOCSIGNAL (tIOC|31)
+
+#define TIOCLBIS (tIOC|127)
+#define TIOCLBIC (tIOC|126)
+#define TIOCLSET (tIOC|125)
+#define TIOCLGET (tIOC|124)
+#define TIOCSBRK (tIOC|123)
+#define TIOCCBRK (tIOC|122)
+#define TIOCSDTR (tIOC|121)
+#define TIOCCDTR (tIOC|120)
+#define TIOCSLTC (tIOC|117)
+#define TIOCGLTC (tIOC|116)
+#define TIOCOUTQ (tIOC|115)
+#define TIOCNOTTY (tIOC|113)
+#define TIOCSCTTY (tIOC|132)
+#define TIOCSTOP (tIOC|111)
+#define TIOCSTART (tIOC|110)
+#define TIOCSILOOP (tIOC|109)
+
+
+#define TIOCM_LE 0001
+#define TIOCM_DTR 0002
+#define TIOCM_RTS 0004
+#define TIOCM_ST 0010
+#define TIOCM_SR 0020
+#define TIOCM_CTS 0040
+#define TIOCM_CAR 0100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RNG 0200
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_DSR 0400
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ipc.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ipc.h
new file mode 100644
index 0000000000..bf887832e2
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/ipc.h
@@ -0,0 +1,54 @@
+/* Copyright (C) 1995, 1996, 1997, 1999, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'. */
+#define IPC_ALLOC 0100000 /* entry currently allocated */
+#define IPC_CREAT 0001000 /* create key if key does not exist */
+#define IPC_EXCL 0002000 /* fail if key exists */
+#define IPC_NOWAIT 0004000 /* return error on wait */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'. */
+#define IPC_RMID 10 /* remove identifier */
+#define IPC_SET 11 /* set `ipc_perm' options */
+#define IPC_STAT 12 /* get `ipc_perm' options */
+
+/* Special key values. */
+#define IPC_PRIVATE ((key_t) 0) /* private key */
+
+
+/* Data structure used to pass permission information to IPC operations. */
+struct ipc_perm
+ {
+ __uid_t uid; /* owner's user ID */
+ __gid_t gid; /* owner's group ID */
+ __uid_t cuid; /* creator's user ID */
+ __gid_t cgid; /* creator's group ID */
+ __mode_t mode; /* read/write permission */
+ unsigned int seq; /* slot usage sequence number */
+ __key_t key; /* key */
+#if __WORDSIZE == 32
+ int pad[4];
+#endif
+ };
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/local_lim.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/local_lim.h
new file mode 100644
index 0000000000..1e93857189
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/local_lim.h
@@ -0,0 +1,99 @@
+/* Minimum guaranteed maximum values for system limits. OpenSolaris version.
+ Copyright (C) 1993-1998,2000,2002,2003,2004,2008
+ 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* XXX: OpenSolaris doesn't define this but we do for compatibility. */
+#define NAME_MAX 255
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 16384
+
+/* Maximum number of POSIX timers available. */
+#define TIMER_MAX 256
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
+/* Maximum tty name length. */
+#define TTY_NAME_MAX 128
+#define TTYNAME_MAX TTY_NAME_MAX
+
+/* Maximum login name length. This is arbitrary. */
+#define LOGIN_NAME_MAX 256
+
+/* Maximum host name length. */
+#define HOST_NAME_MAX 64
+
+/* Maximum message queue priority level. */
+#define MQ_PRIO_MAX 32768
+
+/* Maximum number of characters in a path name. */
+#define PATH_MAX 1024
+
+/* Maximum number of files a process can have open. */
+#define OPEN_MAX 256
+
+#define NGROUPS_MAX 16
+
+/* XXX: The 64-bit case is larger but this should be enough for all. */
+#define ARG_MAX 1048320
+
+#define CHILD_MAX 25
+
+#define OPEN_MAX 256
+
+#define SYMLINK_MAX 1024
+
+#define MAX_CANON 256
+
+#define PATH_MAX 1024
+
+#define MAX_INPUT 512
+
+#define PIPE_BUF 5120
+
+#define PASS_MAX 256
+
+#define UID_MAX 2147483647
+
+#define LOGNAME_MAX 8
+
+/* Maximum message queue priority level. */
+#define MQ_PRIO_MAX 32768
+
+/* Maximum value the semaphore can have. */
+#define SEM_VALUE_MAX 2147483647
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/mman.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/mman.h
new file mode 100644
index 0000000000..529aa4f18e
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/mman.h
@@ -0,0 +1,186 @@
+/* Definitions for POSIX memory map interface. OpenSolaris version.
+ Copyright (C) 1997, 2000, 2003, 2005, 2006, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# define MAP_ANONYMOUS 0x100 /* Don't use a file. */
+# define MAP_ANON MAP_ANONYMOUS
+#endif
+
+/* These are OpenSolaris-specific. */
+#ifdef __USE_MISC
+# define MAP_NORESERVE 0x40 /* Don't check for reservations. */
+# define MAP_ALIGN 0x200 /* Address specifies alignment. */
+# define MAP_TEXT 0x200 /* Map code segment. */
+# define MAP_INITDATA 0x800 /* Map data segment. */
+# define MAP_RENAME 0x20 /* Rename private pages to file. */
+# define _MAP_NEW 0x80000000 /* Never use this. */
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* These are OpenSolaris-specific. */
+#ifdef __USE_MISC
+
+/* mctl functions */
+# define MC_SYNC 1
+# define MC_LOCK 2
+# define MC_UNLOCK 3
+# define MC_ADVISE 4
+# define MC_LOCKAS 5
+# define MC_UNLOCKAS 6
+# define MC_HAT_ADVISE 7
+
+/* MC_HAT_ADVISE arg */
+# define MHA_MAPSIZE_VA 0x1
+# define MHA_MAPSIZE_BSSBRK 0x2
+# define MHA_MAPSIZE_STACK 0x3
+
+# include <sys/types.h>
+
+# define MISYS_MEMINFO 0x0
+
+typedef struct meminfo
+ {
+ const uint64_t *mi_inaddr;
+ const unsigned int *mi_info_req;
+ uint64_t *mi_outdata;
+ unsigned int *mi_validity;
+ int mi_info_count;
+ } meminfo_t;
+
+/* info_req field */
+# define MEMINFO_SHIFT 16
+# define MEMINFO_MASK (0xFF << MEMINFO_SHIFT)
+# define MEMINFO_VPHYSICAL (0x01 << MEMINFO_SHIFT)
+# define MEMINFO_VLGRP (0x02 << MEMINFO_SHIFT)
+# define MEMINFO_VPAGESIZE (0x03 << MEMINFO_SHIFT)
+# define MEMINFO_VREPLCNT (0x04 << MEMINFO_SHIFT)
+# define MEMINFO_VREPL (0x05 << MEMINFO_SHIFT)
+# define MEMINFO_VREPL_LGRP (0x06 << MEMINFO_SHIFT)
+# define MEMINFO_PLGRP (0x07 << MEMINFO_SHIFT)
+
+/* max address count for meminfo */
+# define MAX_MEMINFO_CNT 256
+
+/* max request types */
+# define MAX_MEMINFO_REQ 31
+
+#endif /* __USE_MISC */
+
+/* Flags for `mlockall'. */
+#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+#define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+# define MREMAP_FIXED 2
+#endif
+
+/* Advice to `madvise'. */
+#ifdef __USE_MISC
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+#endif
+
+/* These are OpenSolaris-specific. */
+#ifdef __USE_MISC
+# define MADV_FREE 5
+# define MADV_ACCESS_DEFAULT 6
+# define MADV_ACCESS_LWP 7
+# define MADV_ACCESS_MANY 8
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
+
+#ifdef __USE_MISC
+# define PROC_TEXT (PROT_EXEC | PROT_READ)
+# define PROC_DATA (PROT_READ | PROT_WRITE | PROT_EXEC)
+/* GNU lbc (and probably others) use SHARED internally. */
+# ifndef _GNU_SOURCE
+# define SHARED 0x10
+# define PRIVATE 0x20
+# endif
+# define VALID_ATTR (PROT_READ | PROT_WRITE | PROT_EXEC | SHARED | PRIVATE)
+#endif
+
+struct memcntl_mha
+ {
+ unsigned int mha_cmd;
+ unsigned int mha_flags;
+ size_t mha_pagesize;
+ };
+
+__BEGIN_DECLS
+
+#if defined __USE_MISC
+extern int getpagesizes (size_t *__pagesize, int __nelem);
+extern int getpagesizes2 (size_t *__pagesize, int __nelem);
+extern int meminfo (const uint64_t *__inaddr, int,
+ const unsigned int *__addr_count, int __info_req, uint64_t *__info_count,
+ unsigned int *__outdata);
+extern int memcntl (__caddr_t addr, size_t len, int cmd, __caddr_t arg,
+ int attr, int mask);
+
+#endif
+
+__END_DECLS
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/msq.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/msq.h
new file mode 100644
index 0000000000..bff8102f84
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/msq.h
@@ -0,0 +1,68 @@
+/* Copyright (C) 1995, 1997, 2000, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MSG_H
+#error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+#define MSG_R 0400
+#define MSG_W 0200
+
+#define MSG_RWAIT 01000
+#define MSG_WWAIT 02000
+
+/* Define options for message queue functions. */
+#define MSG_NOERROR 010000 /* no error if message is too big */
+
+/* Types used in the structure definition. */
+typedef unsigned long msgqnum_t;
+typedef unsigned long msglen_t;
+
+struct msg;
+
+/* Structure of record for one message inside the kernel.
+ The type `struct __msg' is opaque. */
+struct msqid_ds
+{
+ struct ipc_perm msg_perm; /* structure describing operation permission */
+ struct msg *msg_first; /* pointer to first message on q */
+ struct msg *msg_last; /* pointer to last message on q */
+ msglen_t msg_cbytes; /* current # bytes on q */
+ msgqnum_t msg_qnum; /* number of messages currently on queue */
+ msglen_t msg_qbytes; /* max number of bytes allowed on queue */
+ __pid_t msg_lspid; /* pid of last msgsnd() */
+ __pid_t msg_lrpid; /* pid of last msgrcv() */
+ __time_t msg_stime; /* time of last msgsnd command */
+#if __WORDSIZE == 32
+ int32_t msg_pad1;
+#endif
+ __time_t msg_rtime; /* time of last msgrcv command */
+#if __WORDSIZE == 32
+ int32_t msg_pad2;
+#endif
+ __time_t msg_ctime; /* time of last change */
+#if __WORDSIZE == 32
+ int32_t msg_pad3;
+#endif
+ short msg_cv;
+ short msg_qnum_cv;
+ long msg_pad4[3];
+};
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/netdb.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/netdb.h
new file mode 100644
index 0000000000..de9e90f999
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/netdb.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network. NOTE: here a
+ poor assumption is made. The network number is expected to fit
+ into an unsigned long int variable. */
+struct netent
+{
+ char *n_name; /* Official name of network. */
+ char **n_aliases; /* Alias list. */
+ int n_addrtype; /* Net address type. */
+ uint32_t n_net; /* Network number. */
+};
+
+#define MAXALIASES 35
+#define MAXADDRS 35
+
+#ifdef __USE_MISC
+
+typedef struct ipsecalgent
+{
+ char **a_names;
+ int a_proto_num;
+ int a_alg_num;
+ char *a_mech_name;
+ int *a_block_sizes;
+ int *a_key_sizes;
+ int a_key_increment;
+} ipsecalgent_t;
+
+#define IPSEC_PROTO_AH 2
+#define IPSEC_PROTO_ESP 3
+
+#define MAXHOSTNAMELEN 256
+
+#ifdef __USE_MISC
+# define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG)
+#endif
+
+#endif /* __USE_MISC */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/poll.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/poll.h
new file mode 100644
index 0000000000..a83b1653d1
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/poll.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1997, 2001, 2006, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for. These bits may be set in `events'
+ to indicate the interesting event types; they will appear in `revents'
+ to indicate the status of the file descriptor. */
+#define POLLIN 0x001 /* There is data to read. */
+#define POLLPRI 0x002 /* There is urgent data to read. */
+#define POLLOUT 0x004 /* Writing now will not block. */
+#define POLLRDNORM 0x040 /* Normal data may be read. */
+#define POLLRDBAND 0x080 /* Priority data may be read. */
+#define POLLWRNORM POLLOUT /* Writing now will not block. */
+#define POLLWRBAND 0x100 /* Priority data may be written. */
+#define POLLNORM POLLRDNORM
+#define POLLREMOVE 0x800
+
+/* Event types always implicitly polled for. These bits need not be set in
+ `events', but they will appear in `revents' to indicate the status of
+ the file descriptor. */
+#define POLLERR 0x008 /* Error condition. */
+#define POLLHUP 0x010 /* Hung up. */
+#define POLLNVAL 0x020 /* Invalid polling request. */
+
+typedef struct pollfd pollfd_t;
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/posix_opt.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/posix_opt.h
new file mode 100644
index 0000000000..c28d50306c
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/posix_opt.h
@@ -0,0 +1,82 @@
+/* Define POSIX options for OpenSolaris.
+ Copyright (C) 2008 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
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _POSIX_OPT_H
+#define _POSIX_OPT_H
+
+#define _POSIX_ASYNCHRONOUS_IO 200112L
+#define _POSIX_FSYNC 200112L
+#define _POSIX_MAPPED_FILES 200112L
+#define _POSIX_MEMLOCK 200112L
+#define _POSIX_MEMLOCK_RANGE 200112L
+#define _POSIX_MEMORY_PROTECTION 200112L
+#define _POSIX_MESSAGE_PASSING 200112L
+#define _POSIX_PRIORITY_SCHEDULING 200112L
+#define _POSIX_REALTIME_SIGNALS 200112L
+#define _POSIX_SEMAPHORES 200112L
+#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
+#define _POSIX_SYNCHRONIZED_IO 200112L
+
+#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
+#define _POSIX_THREADS 200112L
+#define _POSIX_THREAD_ATTR_STACKADDR 200112L
+#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
+#define _POSIX_THREAD_PROCESS_SHARED 200112L
+#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
+#define _POSIX_TIMERS 200112L
+
+#define _POSIX_BARRIERS 200112L
+#define _POSIX_CLOCK_SELECTION 200112L
+#define _POSIX_IPV6 200112L
+#define _POSIX_MONOTONIC_CLOCK 200112L
+#define _POSIX_RAW_SOCKETS 200112L
+#define _POSIX_READER_WRITER_LOCKS 200112L
+#define _POSIX_SPAWN 200112L
+#define _POSIX_SPIN_LOCKS 200112L
+#define _POSIX_TIMEOUTS 200112L
+#define _POSIX2_CHAR_TERM 200112L
+
+#define _POSIX_THREAD_PRIO_INHERIT 200112L
+#define _POSIX_THREAD_PRIO_PROTECT 200112L
+
+#define _LFS_LARGEFILE 1
+#define _LFS64_LARGEFILE 1
+#define _LFS64_STDIO 11
+#define _LFS64_ASYNCHRONOUS_IO 1
+
+#define _POSIX_REGEXP 1
+#define _POSIX_SAVED_IDS 1
+#define _POSIX_SHELL 1
+#define _POSIX_JOB_CONTROL 1
+
+#define _POSIX_CPUTIME -1
+#define _POSIX_ADVISORY_INFO -1
+#define _POSIX_PRIORITIZED_IO -1
+#define _POSIX_SPORADIC_SERVER -1
+#define _POSIX_THREAD_CPUTIME -1
+#define _POSIX_THREAD_SPORADIC_SERVER -1
+#define _POSIX_TRACE -1
+#define _POSIX_TRACE_EVENT_FILTER -1
+#define _POSIX_TRACE_INHERIT -1
+#define _POSIX_TRACE_LOG -1
+#define _POSIX_TYPED_MEMORY_OBJECTS -1
+
+#define _POSIX_VDISABLE '\0'
+
+#endif /* _BITS_POSIX_OPT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/resource.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/resource.h
new file mode 100644
index 0000000000..6507772c1a
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/resource.h
@@ -0,0 +1,240 @@
+/* Bit values & structures for resource limits. OpenSolaris version.
+ Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_RESOURCE_H
+# error "Never use <bits/resource.h> directly; include <sys/resource.h> instead."
+#endif
+
+#include <bits/types.h>
+
+/* Transmute defines to enumerations. The macro re-definitions are
+ necessary because some programs want to test for operating system
+ features with #ifdef RUSAGE_SELF. In ISO C the reflexive
+ definition is a no-op. */
+
+/* Kinds of resource limit. */
+enum __rlimit_resource
+{
+ /* Per-process CPU limit, in seconds. */
+ RLIMIT_CPU = 0,
+#define RLIMIT_CPU RLIMIT_CPU
+
+ /* Largest file that can be created, in bytes. */
+ RLIMIT_FSIZE = 1,
+#define RLIMIT_FSIZE RLIMIT_FSIZE
+
+ /* Maximum size of data segment, in bytes. */
+ RLIMIT_DATA = 2,
+#define RLIMIT_DATA RLIMIT_DATA
+
+ /* Maximum size of stack segment, in bytes. */
+ RLIMIT_STACK = 3,
+#define RLIMIT_STACK RLIMIT_STACK
+
+ /* Largest core file that can be created, in bytes. */
+ RLIMIT_CORE = 4,
+#define RLIMIT_CORE RLIMIT_CORE
+
+ /* Number of open files. */
+ RLIMIT_NOFILE = 5,
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+
+ /* Maximum mapped memory. */
+ RLIMIT_AS = 6,
+#define RLIMIT_AS RLIMIT_AS
+#define RLIMIT_VMEM RLIMIT_AS
+
+ __RLIMIT_NLIMITS = 7,
+ __RLIM_NLIMITS = __RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS __RLIMIT_NLIMITS
+#define RLIM_NLIMITS __RLIM_NLIMITS
+};
+
+/* Type for resource quantity measurement. */
+#ifndef __USE_FILE_OFFSET64
+typedef __rlim_t rlim_t;
+#else
+typedef __rlim64_t rlim_t;
+#endif
+#ifdef _SYSCALL32
+typedef __uint32_t rlim32_t;
+#endif
+#ifdef __USE_LARGEFILE64
+typedef __rlim64_t rlim64_t;
+#endif
+
+/* Value to indicate that there is no limit. */
+#ifdef __USE_LARGEFILE64
+# define RLIM64_INFINITY ((rlim64_t)-3)
+# define RLIM64_SAVED_MAX ((rlim64_t)-2)
+# define RLIM64_SAVED_CUR ((rlim64_t)-1)
+#endif
+#if __WORDSIZE == 64
+# define RLIM_INFINITY ((rlim_t)-3l)
+# define RLIM_SAVED_MAX ((rlim_t)-2l)
+# define RLIM_SAVED_CUR ((rlim_t)-1l)
+#else
+# define RLIM_INFINITY 0x7FFFFFFF
+# define RLIM_SAVED_MAX 0x7FFFFFFE
+# define RLIM_SAVED_CUR 0x7FFFFFFD
+#endif
+#ifdef _SYSCALL32
+# define RLIM32_INFINITY 0x7FFFFFFF
+# define RLIM32_SAVED_MAX 0x7FFFFFFE
+# define RLIM32_SAVED_CUR 0x7FFFFFFD
+#endif
+
+#if __WORDSIZE == 64
+# define RLIM_SAVED(x) 1
+# define RLIM_NSAVED RLIM_NLIMITS
+#else
+# define RLIM_SAVED(x) (x <= RLIMIT_FSIZE)
+# define RLIM_NSAVED (RLIMIT_FSIZE + 1)
+#endif
+
+struct rlimit
+ {
+ /* The current (soft) limit. */
+ rlim_t rlim_cur;
+ /* The hard limit. */
+ rlim_t rlim_max;
+ };
+
+#ifdef _SYSCALL32
+struct rlimit32
+ {
+ rlim32_t rlim_cur;
+ rlim32_t rlim_max;
+};
+#endif
+
+#ifdef __USE_LARGEFILE64
+struct rlimit64
+ {
+ /* The current (soft) limit. */
+ rlim64_t rlim_cur;
+ /* The hard limit. */
+ rlim64_t rlim_max;
+ };
+#endif
+
+/* Whose usage statistics do you want? */
+enum __rusage_who
+{
+ /* The calling process. */
+ RUSAGE_SELF = 0,
+#define RUSAGE_SELF RUSAGE_SELF
+
+ /* The lwp. */
+ RUSAGE_LWP = 1,
+#define RUSAGE_LWP RUSAGE_LWP
+
+ /* All of its terminated child processes. */
+ RUSAGE_CHILDREN = 2
+#define RUSAGE_CHILDREN RUSAGE_CHILDREN
+};
+
+#define __need_timeval
+#define __need_itimerval
+#include <bits/time.h> /* For `struct timeval'. */
+
+/* Structure which says how much of each resource has been used. */
+struct rusage
+ {
+ /* Total amount of user time used. */
+ struct timeval ru_utime;
+ /* Total amount of system time used. */
+ struct timeval ru_stime;
+ /* Maximum resident set size (in kilobytes). */
+ long int ru_maxrss;
+ /* Amount of sharing of text segment memory
+ with other processes (kilobyte-seconds). */
+ long int ru_ixrss;
+ /* Amount of data segment memory used (kilobyte-seconds). */
+ long int ru_idrss;
+ /* Amount of stack memory used (kilobyte-seconds). */
+ long int ru_isrss;
+ /* Number of soft page faults (i.e. those serviced by reclaiming
+ a page from the list of pages awaiting reallocation. */
+ long int ru_minflt;
+ /* Number of hard page faults (i.e. those that required I/O). */
+ long int ru_majflt;
+ /* Number of times a process was swapped out of physical memory. */
+ long int ru_nswap;
+ /* Number of input operations via the file system. Note: This
+ and `ru_oublock' do not include operations with the cache. */
+ long int ru_inblock;
+ /* Number of output operations via the file system. */
+ long int ru_oublock;
+ /* Number of IPC messages sent. */
+ long int ru_msgsnd;
+ /* Number of IPC messages received. */
+ long int ru_msgrcv;
+ /* Number of signals delivered. */
+ long int ru_nsignals;
+ /* Number of voluntary context switches, i.e. because the process
+ gave up the process before it had to (usually to wait for some
+ resource to be available). */
+ long int ru_nvcsw;
+ /* Number of involuntary context switches, i.e. a higher priority process
+ became runnable or the current process used up its time slice. */
+ long int ru_nivcsw;
+ };
+
+/* The type of the WHICH argument to `getpriority' and `setpriority',
+ indicating what flavor of entity the WHO argument specifies. */
+enum __priority_which
+{
+ PRIO_PROCESS = 0, /* WHO is a process ID. */
+#define PRIO_PROCESS PRIO_PROCESS
+ PRIO_PGRP = 1, /* WHO is a process group ID. */
+#define PRIO_PGRP PRIO_PGRP
+ PRIO_USER = 2, /* WHO is a user ID. */
+#define PRIO_USER PRIO_USER
+ PRIO_GROUP = 3,
+#define PRIO_GROUP PRIO_GROUP
+ PRIO_SESSION = 4,
+#define PRIO_SESSION PRIO_SESSION
+ PRIO_LWP = 5,
+#define PRIO_LWP PRIO_LWP
+ PRIO_TASK = 6,
+#define PRIO_TASK PRIO_TASK
+ PRIO_PROJECT = 7,
+#define PRIO_PROJECT PRIO_PROJECT
+ PRIO_ZONE = 8,
+#define PRIO_ZONE PRIO_ZONE
+ PRIO_CONTRACT = 9,
+#define PRIO_CONTRACT PRIO_CONTRACT
+};
+
+enum
+{
+ _RUSAGESYS_GETRUSAGE = 0,
+#define _RUSAGESYS_GETRUSAGE _RUSAGESYS_GETRUSAGE
+ _RUSAGESYS_GETRUSAGE_CHLD = 1,
+#define _RUSAGESYS_GETRUSAGE_CHLD _RUSAGESYS_GETRUSAGE_CHLD
+ _RUSAGESYS_GETRUSAGE_LWP = 2,
+#define _RUSAGESYS_GETRUSAGE_LWP _RUSAGESYS_GETRUSAGE_LWP
+ _RUSAGESYS_GETVMUSAGE = 3
+#define _RUSAGESYS_GETVMUSAGE _RUSAGESYS_GETVMUSAGE
+};
+
+#define PRIO_MIN -20
+#define PRIO_MAX 20
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sched.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sched.h
new file mode 100644
index 0000000000..10a457ef58
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sched.h
@@ -0,0 +1,153 @@
+/* Definitions of constants and data structure for POSIX 1003.1b-1993
+ scheduling interface. OpenSolaris version.
+ Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __need_schedparam
+
+#ifndef _SCHED_H
+# error "Never include <bits/sched.h> directly; use <sched.h> instead."
+#endif
+
+
+/* Scheduling algorithms. */
+#define SCHED_OTHER 0
+#define SCHED_FIFO 1
+#define SCHED_RR 2
+#define SCHED_SYS 3
+#define SCHED_IA 4
+#define SCHED_FSS 5
+#define SCHED_FX 6
+#define _SCHED_NEXT 7
+
+/* The official definition. */
+struct sched_param
+ {
+ int __sched_priority;
+ int __sched_nicelim;
+ int __sched_nice;
+ int __sched_pad[6];
+ };
+
+#endif /* need schedparam */
+
+#if !defined __defined_schedparam \
+ && (defined __need_schedparam || defined _SCHED_H)
+# define __defined_schedparam 1
+/* Data structure to describe a process' schedulability. */
+struct __sched_param
+ {
+ int __sched_priority;
+ int __sched_nicelim;
+ int __sched_nice;
+ int __sched_pad[6];
+ };
+# undef __need_schedparam
+#endif
+
+
+#if defined _SCHED_H && !defined __cpu_set_t_defined
+# define __cpu_set_t_defined
+/* Size definition for CPU sets. */
+# define __CPU_SETSIZE 1024
+# define __NCPUBITS (8 * sizeof (__cpu_mask))
+
+/* Type for array elements in 'cpu_set_t'. */
+typedef unsigned long int __cpu_mask;
+
+/* Basic access functions. */
+# define __CPUELT(cpu) ((cpu) / __NCPUBITS)
+# define __CPUMASK(cpu) ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+
+/* Data structure to describe CPU mask. */
+typedef struct
+{
+ __cpu_mask __bits[__CPU_SETSIZE / __NCPUBITS];
+} cpu_set_t;
+
+/* Access functions for CPU masks. */
+# 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 { \
+ size_t __i; \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ cpu_set_t *__arr = (cpusetp); \
+ for (__i = 0; __i < __imax; ++__i) \
+ __arr->__bits[__i] = 0; \
+ } while (0)
+# endif
+# define __CPU_SET_S(cpu, setsize, cpusetp) \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? ((cpusetp)->__bits[__CPUELT (__cpu)] |= __CPUMASK (__cpu)) : 0; })
+# define __CPU_CLR_S(cpu, setsize, cpusetp) \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? ((cpusetp)->__bits[__CPUELT (__cpu)] &= ~__CPUMASK (__cpu)) : 0; })
+# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
+ ({ size_t __cpu = (cpu); \
+ __cpu < 8 * (setsize) \
+ ? (((cpusetp)->__bits[__CPUELT (__cpu)] & __CPUMASK (__cpu))) != 0 : 0; })
+
+# define __CPU_COUNT_S(setsize, cpusetp) \
+ __sched_cpucount (setsize, cpusetp)
+
+# if __GNUC_PREREQ (2, 91)
+# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+ (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0)
+# else
+# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
+ ({ cpu_set_t *__arr1 = (cpusetp1); \
+ cpu_set_t *__arr2 = (cpusetp2); \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ size_t __i; \
+ for (__i = 0; __i < __imax; ++__i) \
+ if (__arr1->__bits[__i] != __arr2->__bits[__i]) \
+ break; \
+ __i == __imax; })
+# endif
+
+# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
+ ({ cpu_set_t *__dest = (destset); \
+ cpu_set_t *__arr1 = (srcset1); \
+ cpu_set_t *__arr2 = (srcset2); \
+ size_t __imax = (setsize) / sizeof (__cpu_mask); \
+ size_t __i; \
+ for (__i = 0; __i < __imax; ++__i) \
+ __dest->__bits[__i] = __arr1->__bits[__i] op __arr2->__bits[__i]; \
+ __dest; })
+
+# define __CPU_ALLOC_SIZE(count) \
+ ((((count) + __NCPUBITS - 1) / __NCPUBITS) * 8)
+# define __CPU_ALLOC(count) __sched_cpualloc (count)
+# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
+
+__BEGIN_DECLS
+
+extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+ __THROW;
+extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
+extern void __sched_cpufree (cpu_set_t *__set) __THROW;
+
+__END_DECLS
+
+#endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sem.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sem.h
new file mode 100644
index 0000000000..1579ea1484
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sem.h
@@ -0,0 +1,74 @@
+/* Copyright (C) 1995, 1996, 1997, 1998, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+#define SEM_A 0200
+#define SEM_R 0400
+
+/* Flags for `semop'. */
+#define SEM_UNDO 010000 /* undo the operation on exit */
+
+/* Commands for `semctl'. */
+#define GETNCNT 3 /* get semncnt */
+#define GETPID 4 /* get sempid */
+#define GETVAL 5 /* get semval */
+#define GETALL 6 /* get all semval's */
+#define GETZCNT 7 /* get semzcnt */
+#define SETVAL 8 /* set semval */
+#define SETALL 9 /* set all semval's */
+
+
+/* Data structure describing a set of semaphores. */
+struct semid_ds
+{
+ struct ipc_perm sem_perm; /* operation permission struct */
+ struct sem *sem_base; /* ptr to first semaphore in set */
+ unsigned short sem_nsems; /* number of semaphores in set */
+ __time_t sem_otime; /* last semop() time */
+#if __WORDSIZE == 32
+ int32_t sem_pad1;
+#endif
+ __time_t sem_ctime; /* last time changed by semctl() */
+#if __WORDSIZE == 32
+ int32_t sem_pad2;
+#endif
+ int sem_binary; /* flag indicating semaphore type */
+ long sem_pad3[3];
+};
+
+/* The user should define a union like the following to use it for arguments
+ for `semctl'.
+
+ union semun
+ {
+ int val; <= value for SETVAL
+ struct semid_ds *buf; <= buffer for IPC_STAT & IPC_SET
+ unsigned short int *array; <= array for GETALL & SETALL
+ struct seminfo *__buf; <= buffer for IPC_INFO
+ };
+
+ Previous versions of this file used to define this union but this is
+ incorrect. One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+ one must define the union or not. */
+#define _SEM_SEMUN_UNDEFINED 1
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/shm.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/shm.h
new file mode 100644
index 0000000000..04ccac481c
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/shm.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <bits/wordsize.h>
+
+/* Permission flag for shmget. */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'. */
+#define SHM_RDONLY 010000 /* attach read-only else read-write */
+#define SHM_RND 020000 /* round attach address to SHMLBA */
+#define SHM_REMAP 040000 /* take-over region on attach */
+#define SHM_PAGEABLE 0100000 /*pageable ISM */
+
+/* Commands for `shmctl'. */
+#define SHM_LOCK 3 /* lock segment (root only) */
+#define SHM_UNLOCK 4 /* unlock segment (root only) */
+
+__BEGIN_DECLS
+
+/* Segment low boundary address multiple. */
+#define SHMLBA (__getpagesize ())
+extern int __getpagesize (void) __THROW __attribute__ ((__const__));
+
+
+/* Type to count number of attaches. */
+typedef unsigned long int shmatt_t;
+
+/* Data structure describing a set of semaphores. */
+struct shmid_ds
+ {
+ struct ipc_perm shm_perm; /* operation permission struct */
+ size_t shm_segsz; /* size of segment in bytes */
+ void *shm_amp; /* segment anon_map pointer */
+ unsigned short shm_lkcnt; /* number of times it is being locked */
+ __pid_t shm_cpid; /* pid of creator */
+ __pid_t shm_lpid; /* pid of last shmop */
+ shmatt_t shm_nattch; /* number of current attaches */
+ unsigned long shm_cnattch; /* number of ISM attaches */
+ __time_t shm_atime; /* time of last shmat() */
+#if __WORDSIZE == 32
+ __int32_t shm_pad1;
+#endif
+ __time_t shm_dtime; /* time of last shmdt() */
+#if __WORDSIZE == 32
+ __int32_t shm_pad2;
+#endif
+ __time_t shm_ctime; /* time of last change by shmctl() */
+#if __WORDSIZE == 32
+ __int32_t shm_pad3;
+ __int32_t shm_pad4[4];
+#endif
+ };
+
+__END_DECLS
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigaction.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigaction.h
new file mode 100644
index 0000000000..891c4e9726
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigaction.h
@@ -0,0 +1,94 @@
+/* The definitions for OpenSolaris's sigaction.
+ Copyright (C) 1993-1999, 2000, 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+#define __need_siginfo_t
+#include <bits/siginfo.h>
+
+/* Structure describing the action to be taken when a signal arrives. */
+struct sigaction
+{
+ int sa_flags;
+ union
+ {
+ void (*_handler)(int);
+ void (*_sigaction)(int, siginfo_t *, void *);
+ } _funcptr;
+#define sa_handler _funcptr._handler
+#define sa_sigaction _funcptr._sigaction
+ sigset_t sa_mask;
+#if __WORDSIZE == 32
+ int sa_resv[2];
+#endif
+};
+
+#ifdef _SYSCALL32
+
+# include <sys/types32.h>
+
+struct sigaction32
+ {
+ int32_t sa_flags;
+ union
+ {
+ caddr32_t _handler;
+ caddr32_t _sigaction;
+ } _funcptr;
+ sigset32_t sa_mask;
+ int32_t sa_resv[2];
+ };
+
+#endif
+
+/* Bits in `sa_flags'. */
+#define SA_NOCLDSTOP 0x00020000 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDWAIT 0x00010000 /* Don't send SIGCHLD when children stop. */
+#define SA_SIGINFO 0x00000008 /* Invoke signal-catching function with
+ three arguments instead of one. */
+#if defined __USE_UNIX98 || defined __USE_MISC
+#define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
+#define SA_RESTART 0x00000004 /* Restart syscall on signal return. */
+#define SA_NODEFER 0x00000010 /* Don't automatically block the signal when
+ its handler is being executed. */
+#define SA_RESETHAND 0x00000002
+#endif
+
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0 /* Historical no-op ("not SA_RESTART"). */
+
+/* Some aliases for the SA_ constants. */
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
+# define SA_STACK SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'. */
+#define SIG_BLOCK 1 /* Block signals. */
+#define SIG_UNBLOCK 2 /* Unblock signals. */
+#define SIG_SETMASK 3 /* Set the set of blocked signals. */
+
+#define SIGNO_MASK 0xFF
+#define SIGDEFER 0x100
+#define SIGHOLD 0x200
+#define SIGRELSE 0x400
+#define SIGIGNORE 0x800
+#define SIGPAUSE 0x1000
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigcontext.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigcontext.h
new file mode 100644
index 0000000000..9b4126819a
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigcontext.h
@@ -0,0 +1,24 @@
+/* Structure describing state saved while handling a signal. Stub version.
+ Copyright (C) 1991, 1994, 1997 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGNAL_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+struct sigcontext;
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/siginfo.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/siginfo.h
new file mode 100644
index 0000000000..57e9f54fe1
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/siginfo.h
@@ -0,0 +1,497 @@
+/* siginfo_t, sigevent and constants. OpenSolaris version.
+ Copyright (C) 1997-2002, 2003, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t \
+ && !defined __need_sigevent_t
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+#include <bits/wordsize.h>
+#include <features.h>
+
+/* This needs to be defined here because we only get timespec for certain
+ posix flags. */
+#if !defined __USE_POSIX199309 && !defined __USE_MISC
+struct __timespec
+ {
+ __time_t tv_sec; /* Seconds. */
+ long int tv_nsec; /* Nanoseconds. */
+ };
+#else
+# define __need_timespec
+# include <time.h>
+#endif
+
+#if (!defined __have_sigval_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t \
+ || defined __need_sigevent_t))
+# define __have_sigval_t 1
+
+/* Type for data associated with a signal. */
+union sigval
+{
+ int sival_int;
+ void *sival_ptr;
+};
+typedef union sigval sigval_t;
+
+# ifdef _SYSCALL32
+
+# include <sys/types32.h>
+
+union sigval32
+ {
+ __int32_t sival_int;
+ caddr32_t sival_ptr;
+ };
+
+# endif
+
+#endif
+
+#if (!defined __have_siginfo_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t 1
+
+# if __WORDSIZE == 64
+# define __SI_MAX_SIZE 256
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 4)
+# else
+# define __SI_MAX_SIZE 128
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
+# endif
+# define SI_MAXSZ __SI_MAX_SIZE
+# define SI_PAD __SI_PAD_SIZE
+
+typedef struct siginfo
+{
+ int si_signo;
+ int si_code;
+ int si_errno;
+# if __WORDSIZE == 64
+ int si_pad;
+# endif
+ union
+ {
+ int _pad[__SI_PAD_SIZE];
+
+ struct /* kill(), SIGCLD, siqqueue() */
+ {
+ __pid_t __pid; /* Sending process ID. */
+ union {
+ struct {
+ __uid_t __uid; /* Real user ID of sending process. */
+ union sigval __value;
+ } __kill;
+ struct {
+ __clock_t __utime;
+ int __status;
+ __clock_t __stime;
+ } __cld;
+ } __pdata;
+ ctid_t __ctid;
+ zoneid_t __zoneid;
+ } __proc;
+
+ struct /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
+ {
+ void *__addr;
+ int __trapno;
+ char *__pc;
+ } __fault;
+
+ struct /* SIGPOLL, SIGXFSZ */
+ {
+ int __fd;
+ long __band;
+ } __file;
+
+ struct /* SIGPROF */
+ {
+ char *__faddr;
+#if !defined __USE_POSIX199309 && !defined __USE_MISC
+ struct __timespec __tstamp;
+#else
+ struct timespec __tstamp;
+#endif
+ short __syscall;
+ char __nsysarg;
+ char __fault;
+ long __sysarg[8];
+ int __mstate[10];
+ } __prof;
+
+ struct /* SI_RCTL */
+ {
+ __int32_t __entity;
+ } __rctl;
+ } __data;
+} siginfo_t;
+
+# ifdef _SYSCALL32
+
+# include <sys/types32.h>
+
+typedef struct siginfo32
+{
+ int32_t si_signo;
+ int32_t si_code;
+ int32_t si_errno;
+ union
+ {
+ int32_t _pad[__SI_PAD_SIZE];
+
+ struct /* kill(), SIGCLD, siqqueue() */
+ {
+ pid32_t __pid; /* Sending process ID. */
+ union {
+ struct {
+ uid32_t __uid; /* Real user ID of sending process. */
+ union sigval32 __value;
+ } __kill;
+ struct {
+ clock32_t __utime;
+ int32_t __status;
+ clock32_t __stime;
+ } __cld;
+ } __pdata;
+ id32_t __ctid;
+ id32_t __zoneid;
+ } __proc;
+
+ struct /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
+ {
+ caddr32_t __addr;
+ int32_t __trapno;
+ caddr32_t __pc;
+ } __fault;
+
+ struct /* SIGPOLL, SIGXFSZ */
+ {
+ int32_t __fd;
+ int32_t __band;
+ } __file;
+
+ struct /* SIGPROF */
+ {
+ caddr32_t __faddr;
+ struct timespec32 __tstamp;
+ int16_t __syscall;
+ int8_t __nsysarg;
+ int8_t __fault;
+ int32_t __sysarg[8];
+ int32_t __mstate[10];
+ } __prof;
+
+ struct /* SI_RCTL */
+ {
+ int32_t __entity;
+ } __rctl;
+ } __data;
+} siginfo32_t;
+
+# endif /* _SYSCALL32 */
+
+# ifdef __USE_MISC
+
+typedef struct k_siginfo
+{
+ int si_signo;
+ int si_code;
+ int si_errno;
+# if __WORDSIZE == 64
+ int si_pad;
+# endif
+ union
+ {
+ struct
+ {
+ __pid_t __pid;
+ union
+ {
+ struct
+ {
+ __uid_t __uid;
+ union sigval __value;
+ } __kill;
+ struct
+ {
+ __clock_t __utime;
+ int __status;
+ __clock_t __stime;
+ } __cld;
+ } __pdata;
+ ctid_t __ctid;
+ zoneid_t __zoneid;
+ } __proc;
+
+ struct
+ {
+ void *__addr;
+ int __trapno;
+ char *__pc;
+ } __fault;
+
+ struct
+ {
+ int __fd;
+ long __band;
+ } __file;
+
+ struct
+ {
+ char *__faddr;
+
+ struct timespec __tstamp;
+ short __syscall;
+ char __nsysarg;
+ char __fault;
+ } __prof;
+
+ struct
+ {
+ int32_t __entity;
+ } __rctl;
+ } __data;
+ } k_siginfo_t;
+
+typedef struct sigqueue
+ {
+ struct sigqueue *sq_next;
+ k_siginfo_t sq_info;
+ void (*sq_func)(struct sigqueue *);
+ void *sq_backptr;
+ int sq_external;
+ } sigqueue_t;
+
+# endif /* __USE_MISC */
+
+# define SI_FROMUSER(sip) ((sip)->si_code <= 0)
+# define SI_FROMKERNEL(sip) ((sip)->si_code > 0)
+
+/* Values for `si_code'. Positive values are reserved for kernel-generated
+ signals. */
+enum
+{
+ SI_NOINFO = 32767, /* no signal information */
+# define SI_NOINFO SI_NOINFO
+ SI_DTRACE = 2050, /* kernel generated signal via DTrace action */
+# define SI_DTRACE SI_DTRACE
+ SI_RCTL = 2049, /* kernel generated signal via rctl action */
+# define SI_RCTL SI_RCTL
+ SI_USER = 0, /* user generated signal via kill() */
+# define SI_USER SI_USER
+ SI_LWP = -1, /* user generated signal via lwp_kill() */
+# define SI_LWP SI_LWP
+ SI_QUEUE = -2, /* user generated signal via sigqueue() */
+# define SI_QUEUE SI_QUEUE
+ SI_TIMER = -3, /* from timer expiration */
+# define SI_TIMER SI_TIMER
+ SI_ASYNCIO = -4, /* from asynchronous I/O completion */
+# define SI_ASYNCIO SI_ASYNCIO
+ SI_MESGQ = -5 /* from message arrival */
+};
+
+/* `si_code' values for SIGILL signal. */
+enum
+{
+ ILL_ILLOPC = 1, /* Illegal opcode. */
+# define ILL_ILLOPC ILL_ILLOPC
+ ILL_ILLOPN = 2, /* Illegal operand. */
+# define ILL_ILLOPN ILL_ILLOPN
+ ILL_ILLADR = 3, /* Illegal addressing mode. */
+# define ILL_ILLADR ILL_ILLADR
+ ILL_ILLTRP = 4, /* Illegal trap. */
+# define ILL_ILLTRP ILL_ILLTRP
+ ILL_PRVOPC = 5, /* Privileged opcode. */
+# define ILL_PRVOPC ILL_PRVOPC
+ ILL_PRVREG = 6, /* Privileged register. */
+# define ILL_PRVREG ILL_PRVREG
+ ILL_COPROC = 7, /* Coprocessor error. */
+# define ILL_COPROC ILL_COPROC
+ ILL_BADSTK = 8 /* Internal stack error. */
+# define ILL_BADSTK ILL_BADSTK
+};
+# define NSIGILL 8
+
+/* `si_code' values for SIGFPE signal. */
+enum
+{
+ FPE_INTDIV = 1, /* Integer divide by zero. */
+# define FPE_INTDIV FPE_INTDIV
+ FPE_INTOVF = 2, /* Integer overflow. */
+# define FPE_INTOVF FPE_INTOVF
+ FPE_FLTDIV = 3, /* Floating point divide by zero. */
+# define FPE_FLTDIV FPE_FLTDIV
+ FPE_FLTOVF = 4, /* Floating point overflow. */
+# define FPE_FLTOVF FPE_FLTOVF
+ FPE_FLTUND = 5, /* Floating point underflow. */
+# define FPE_FLTUND FPE_FLTUND
+ FPE_FLTRES = 6, /* Floating point inexact result. */
+# define FPE_FLTRES FPE_FLTRES
+ FPE_FLTINV = 7, /* Floating point invalid operation. */
+# define FPE_FLTINV FPE_FLTINV
+ FPE_FLTSUB = 8, /* Subscript out of range. */
+# define FPE_FLTSUB FPE_FLTSUB
+ FPE_FLTDEN = 9
+# define FPE_FLTDEN FPE_FLTDEN
+};
+# define NSIGFPE 9
+
+/* `si_code' values for SIGSEGV signal. */
+enum
+{
+ SEGV_MAPERR = 1, /* Address not mapped to object. */
+# define SEGV_MAPERR SEGV_MAPERR
+ SEGV_ACCERR = 2 /* Invalid permissions for mapped object. */
+# define SEGV_ACCERR SEGV_ACCERR
+};
+# define NSIGSEGV 2
+
+/* `si_code' values for SIGBUS signal. */
+enum
+{
+ BUS_ADRALN = 1, /* Invalid address alignment. */
+# define BUS_ADRALN BUS_ADRALN
+ BUS_ADRERR = 2, /* Non-existant physical address. */
+# define BUS_ADRERR BUS_ADRERR
+ BUS_OBJERR = 3 /* Object specific hardware error. */
+# define BUS_OBJERR BUS_OBJERR
+};
+# define NSIGBUS 3
+
+/* `si_code' values for SIGEMT signal. */
+enum
+{
+ EMT_CPCOVF = 1
+# define EMT_CPCOVF EMT_CPCOVF
+};
+# define NSIGEMT 1
+
+
+/* `si_code' values for SIGTRAP signal. */
+# define TRAP_BRKPT 1 /* breakpoint trap */
+# define TRAP_TRACE 2 /* trace trap */
+# define TRAP_RWATCH 3 /* read access watchpoint trap */
+# define TRAP_WWATCH 4 /* write access watchpoint trap */
+# define TRAP_XWATCH 5 /* execute access watchpoint trap */
+# define TRAP_DTRACE 6 /* problem with fasttrap DTrace provider */
+# define NSIGTRAP 6
+
+/* `si_code' values for SIGCHLD signal. */
+# define CLD_EXITED 1 /* child has exited */
+# define CLD_KILLED 2 /* child was killed */
+# define CLD_DUMPED 3 /* child has coredumped */
+# define CLD_TRAPPED 4 /* traced child has stopped */
+# define CLD_STOPPED 5 /* child has stopped on signal */
+# define CLD_CONTINUED 6 /* stopped child has continued */
+# define NSIGCLD 6
+
+/* `si_code' values for SIGPOLL signal. */
+# define POLL_IN 1 /* input available */
+# define POLL_OUT 2 /* output possible */
+# define POLL_MSG 3 /* message available */
+# define POLL_ERR 4 /* I/O error */
+# define POLL_PRI 5 /* high priority input available */
+# define POLL_HUP 6 /* device disconnected */
+# define NSIGPOLL 6
+
+/* SIGPROF signal codes */
+# define PROF_SIG 1 /* have to set code non-zero */
+# define NSIGPROF 1
+
+/* X/Open requires some more fields with fixed names. */
+# define si_pid __data.__proc.__pid
+# define si_ctid __data.__proc.__ctid
+# define si_zoneid __data.__proc.__zoneid
+# define si_status __data.__proc.__pdata.__cld.__status
+# define si_stime __data.__proc.__pdata.__cld.__stime
+# define si_utime __data.__proc.__pdata.__cld.__utime
+# define si_uid __data.__proc.__pdata.__kill.__uid
+# define si_value __data.__proc.__pdata.__kill.__value
+# define si_addr __data.__fault.__addr
+# define si_trapno __data.__fault.__trapno
+# define si_trapafter __data.__fault.__trapno
+# define si_pc __data.__fault.__pc
+# define si_fd __data.__file.__fd
+# define si_band __data.__file.__band
+# define si_tstamp __data.__prof.__tstamp
+# define si_syscall __data.__prof.__syscall
+# define si_nsysarg __data.__prof.__nsysarg
+# define si_sysarg __data.__prof.__sysarg
+# define si_fault __data.__prof.__fault
+# define si_faddr __data.__prof.__faddr
+# define si_mstate __data.__prof.__mstate
+# define si_entity __data.__rctl.__entity
+
+# undef __need_siginfo_t
+#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
+
+#if (defined _SIGNAL_H || defined __need_sigevent_t) \
+ && !defined __have_sigevent_t
+# define __have_sigevent_t 1
+
+/* Structure to transport application-defined values with signals. */
+# define __SIGEV_MAX_SIZE 64
+# if __WORDSIZE == 64
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4)
+# else
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+# endif
+
+typedef struct sigevent
+{
+ int sigev_notify;
+ int sigev_signo;
+ union sigval sigev_value;
+ void (*sigev_notify_function)(union sigval);
+ /*pthread_attr_t*/ void *sigev_notify_attributes;
+ int __sigev_pad2;
+} sigevent_t;
+
+#ifdef _SYSCALL32
+
+#include <sys/types32.h>
+
+struct sigevent32
+ {
+ __int32_t sigev_notify;
+ __int32_t sigev_signo;
+ union sigval32 sigev_value;
+ caddr32_t sigev_notify_function;
+ caddr32_t sigev_notify_attributes;
+ __int32_t __sigev_pad2;
+};
+
+#endif
+
+/* `sigev_notify' values. */
+enum
+{
+ SIGEV_NONE = 1, /* no notification */
+# define SIGEV_NONE SIGEV_NONE
+ SIGEV_SIGNAL = 2, /* queued signal notification */
+# define SIGEV_SIGNAL SIGEV_SIGNAL
+ SIGEV_THREAD = 3, /* call back from another thread */
+#define SIGEV_PORT SIGEV_PORT
+ SIGEV_PORT = 4 /* use event port for notification */
+#define SIGEV_PORT SIGEV_PORT
+};
+
+#endif /* have _SIGNAL_H. */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/signum.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/signum.h
new file mode 100644
index 0000000000..e9da43c7d6
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/signum.h
@@ -0,0 +1,90 @@
+/* Signal number definitions. OpenSolaris version.
+ Copyright (C) 1994, 1996, 1998, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifdef _SIGNAL_H
+
+/* Fake signal functions. */
+#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
+#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
+#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
+#define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+
+
+/* Signals. */
+#define SIGHUP 1 /* Hangup (POSIX). */
+#define SIGINT 2 /* Interrupt (ANSI). */
+#define SIGQUIT 3 /* Quit (POSIX). */
+#define SIGILL 4 /* Illegal instruction (ANSI). */
+#define SIGABRT SIGIOT /* Abort (ANSI). */
+#define SIGTRAP 5 /* Trace trap (POSIX). */
+#define SIGIOT 6 /* IOT trap (4.2 BSD). */
+#define SIGEMT 7 /* EMT trap (4.2 BSD). */
+#define SIGFPE 8 /* Floating-point exception (ANSI). */
+#define SIGKILL 9 /* Kill, unblockable (POSIX). */
+#define SIGBUS 10 /* Bus error (4.2 BSD). */
+#define SIGSEGV 11 /* Segmentation violation (ANSI). */
+#define SIGSYS 12 /* Bad argument to system call (4.2 BSD)*/
+#define SIGPIPE 13 /* Broken pipe (POSIX). */
+#define SIGALRM 14 /* Alarm clock (POSIX). */
+#define SIGTERM 15 /* Termination (ANSI). */
+#define SIGUSR1 16 /* User-defined signal 1 (POSIX). */
+#define SIGUSR2 17 /* User-defined signal 2 (POSIX). */
+#define SIGCHLD 18 /* Child status has changed (POSIX). */
+#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
+#define SIGPWR 19 /* Power failure restart (System V). */
+#define SIGWINCH 20 /* Window size change (4.3 BSD, Sun). */
+#define SIGURG 21 /* Urgent condition on socket (4.2 BSD).*/
+#define SIGPOLL 22 /* Pollable event occurred (System V). */
+#define SIGIO SIGPOLL /* I/O now possible (4.2 BSD). */
+#define SIGSTOP 23 /* Stop, unblockable (POSIX). */
+#define SIGTSTP 24 /* Keyboard stop (POSIX). */
+#define SIGCONT 25 /* Continue (POSIX). */
+#define SIGTTIN 26 /* Background read from tty (POSIX). */
+#define SIGTTOU 27 /* Background write to tty (POSIX). */
+#define SIGVTALRM 28 /* Virtual alarm clock (4.2 BSD). */
+#define SIGPROF 29 /* Profiling alarm clock (4.2 BSD). */
+#define SIGXCPU 30 /* CPU limit exceeded (4.2 BSD). */
+#define SIGXFSZ 31 /* File size limit exceeded (4.2 BSD). */
+/* The following signals are new in Solaris 2. */
+#define SIGWAITING 32 /* Process's lwps are blocked. */
+#define SIGLWP 33 /* Special signal used by thread library. */
+#define SIGFREEZE 34 /* Special signal used by CPR. */
+#define SIGTHAW 35 /* Special signal used by CPR. */
+#define SIGCANCEL 36 /* Reserved signal for thread cancellation */
+#define SIGLOST 37 /* Resource lost (eg, record-lock lost) */
+#define SIGXRES 38 /* Resource control exceeded */
+#define SIGJVM1 39 /* Reserved signal for Java Virtual Machine */
+#define SIGJVM2 40 /* Reserved signal for Java Virtual Machine */
+
+#define __SIGRTMIN 41 /* First (highest-priority) realtime signal */
+#define __SIGRTMAX 48 /* Last (lowest-priority) realtime signal */
+
+#define SIGRTMIN (__libc_current_sigrtmin ())
+#define SIGRTMAX (__libc_current_sigrtmax ())
+
+#endif /* <signal.h> included. */
+
+#define _NSIG 49 /* Biggest signal number + 1 */
+
+#ifdef __USE_MISC
+# define MAXSIG 48 /* Biggest signal number */
+#endif
+
+/* This is here for lack of a better location. */
+#define SIG2STR_MAX 32
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigset.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigset.h
new file mode 100644
index 0000000000..8a384bb185
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigset.h
@@ -0,0 +1,139 @@
+/* __sig_atomic_t, __sigset_t, and related definitions. OpenSolaris version.
+ Copyright (C) 1991, 1992, 1994, 1996, 1997, 2007, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SIGSET_H_types
+#define _SIGSET_H_types 1
+
+typedef int __sig_atomic_t;
+
+#define _SIGSET_NWORDS 4
+
+typedef struct
+ {
+ unsigned int __sigbits[_SIGSET_NWORDS];
+ } __sigset_t;
+
+#ifdef _SYSCALL32
+
+# include <sys/types32.h>
+
+typedef struct
+ {
+ uint32_t __sigbits[4];
+ } sigset32_t;
+
+#endif
+
+typedef struct
+ {
+ unsigned int __sigbits[2];
+ } k_sigset_t;
+
+#endif /* _SIGSET_H_types */
+
+/* We only want to define these functions if <signal.h> was actually
+ included; otherwise we were included just to define the types. Since we
+ are namespace-clean, it wouldn't hurt to define extra macros. But
+ trouble can be caused by functions being defined (e.g., any global
+ register vars declared later will cause compilation errors). */
+
+#if !defined _SIGSET_H_fns && defined _SIGNAL_H
+# define _SIGSET_H_fns 1
+
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE __extern_inline
+# endif
+
+/* Return a mask that includes the bit for SIG only. */
+# define __sigmask(sig) \
+ (((unsigned int) 1) << (((sig) - 1) % (8 * sizeof (unsigned int))))
+
+/* Return the word index for SIG. */
+# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned int)))
+
+# if defined __GNUC__ && __GNUC__ >= 2
+# define __sigemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__sigbits[__cnt] = 0; \
+ 0; }))
+# define __sigfillset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__sigbits[__cnt] = ~0UL; \
+ 0; }))
+
+# ifdef __USE_GNU
+/* The POSIX does not specify for handling the whole signal set in one
+ command. This is often wanted and so we define three more functions
+ here. */
+# define __sigisemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ const sigset_t *__set = (set); \
+ int __ret = __set->__sigbits[--__cnt]; \
+ while (!__ret && --__cnt >= 0) \
+ __ret = __set->__sigbits[__cnt]; \
+ __ret == 0; }))
+# define __sigandset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__sigbits[__cnt] = (__left->__sigbits[__cnt] \
+ & __right->__sigbits[__cnt]); \
+ 0; }))
+# define __sigorset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__sigbits[__cnt] = (__left->__sigbits[__cnt] \
+ | __right->__sigbits[__cnt]); \
+ 0; }))
+# endif
+# endif
+
+/* These functions needn't check for a bogus signal number -- error
+ checking is done in the non __ versions. */
+
+extern int __sigismember (__const __sigset_t *, int);
+extern int __sigaddset (__sigset_t *, int);
+extern int __sigdelset (__sigset_t *, int);
+
+# ifdef __USE_EXTERN_INLINES
+# define __SIGSETFN(NAME, BODY, CONST) \
+ _EXTERN_INLINE int \
+ NAME (CONST __sigset_t *__set, int __sig) \
+ { \
+ unsigned int __mask = __sigmask (__sig); \
+ unsigned int __word = __sigword (__sig); \
+ return BODY; \
+ }
+
+__SIGSETFN (__sigismember, (__set->__sigbits[__word] & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((__set->__sigbits[__word] |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((__set->__sigbits[__word] &= ~__mask), 0), )
+
+# undef __SIGSETFN
+# endif
+
+#endif /* ! _SIGSET_H_fns. */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigstack.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigstack.h
new file mode 100644
index 0000000000..ff9f1e2828
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/sigstack.h
@@ -0,0 +1,78 @@
+/* sigstack, sigaltstack definitions. OpenSolaris version.
+ Copyright (C) 1998, 1999, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined(_SIGNAL_H) && !defined(__need_stack_t)
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+#include <bits/types.h>
+
+#if !defined(__need_stack_t)
+
+/* Structure describing a signal stack (obsolete). */
+struct sigstack
+ {
+ void *ss_sp; /* Signal stack pointer. */
+ int ss_onstack; /* Nonzero if executing on this stack. */
+ };
+
+# ifdef _SYSCALL32
+
+# include <sys/types32.h>
+
+typedef struct sigaltstack32
+ {
+ caddr32_t ss_sp;
+ size32_t ss_size;
+ int32_t ss_flags;
+ } stack32_t;
+
+# endif
+
+
+/* Possible values for `ss_flags.'. */
+enum
+{
+ SS_ONSTACK = 1,
+# define SS_ONSTACK SS_ONSTACK
+ SS_DISABLE = 2
+# define SS_DISABLE SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler. */
+# define MINSIGSTKSZ 2048
+
+/* System default stack size. */
+# define SIGSTKSZ 8192
+
+#endif /* __need_stack_t */
+
+#if !defined(__stack_t_defined)
+# define __stack_t_defined
+# undef __need_stack_t
+
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ void *ss_sp;
+ __SIZE_TYPE__ ss_size;
+ int ss_flags;
+ } stack_t;
+
+#endif /* !defined(__stack_t_defined) */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/socket.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/socket.h
new file mode 100644
index 0000000000..dcf60da6fa
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/socket.h
@@ -0,0 +1,336 @@
+/* System-specific socket constants and types. OpenSolaris version.
+ Copyright (C) 1991, 1992, 1994-2001, 2004, 2006, 2007, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#ifndef _SYS_SOCKET_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+#define __SOCKADDR_IN6_EXTRA_FIELDS \
+ __uint32_t __sin6_src_id;
+
+/* Type for length arguments in socket calls. */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* Types of sockets. */
+enum __socket_type
+{
+ SOCK_STREAM = 2, /* Sequenced, reliable, connection-based
+ byte streams. */
+#define SOCK_STREAM SOCK_STREAM
+ SOCK_DGRAM = 1, /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+#define SOCK_DGRAM SOCK_DGRAM
+ SOCK_RAW = 4, /* Raw protocol interface. */
+#define SOCK_RAW SOCK_RAW
+ SOCK_RDM = 5, /* Reliably-delivered messages. */
+#define SOCK_RDM SOCK_RDM
+ SOCK_SEQPACKET = 6 /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+};
+
+/* Protocol families. */
+#define PF_UNSPEC 0 /* Unspecified. */
+#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
+#define PF_UNIX PF_LOCAL /* POSIX name for PF_LOCAL. */
+#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
+#define PF_INET 2 /* IP protocol family. */
+#define PF_IMPLINK 3 /* Arpanet imp addresses. */
+#define PF_PUP 4 /* PUP protocols: e.g. BSP. */
+#define PF_CHAOS 5 /* MIT CHAOS protocols. */
+#define PF_NS 6 /* XEROX NS protocols. */
+#define PF_NBS 7 /* NBS protocols. */
+#define PF_ECMA 8 /* European Computer Manufacturers. */
+#define PF_DATAKIT 9 /* Datakit protocols. */
+#define PF_CCITT 10 /* CCITT protocols, X.25 etc. */
+#define PF_SNA 11 /* Linux SNA Project */
+#define PF_DECnet 12 /* Reserved for DECnet project. */
+#define PF_DLI 13 /* Direct data link interface. */
+#define PF_LAT 14 /* LAT. */
+#define PF_HYLINK 15 /* NSC Hyperchannel. */
+#define PF_APPLETALK 16 /* Appletalk DDP. */
+#define PF_NIT 17 /* Network Interface Tap. */
+#define PF_802 18 /* IEEE 802.2, also ISO 8802. */
+#define PF_OSI 19 /* Umbrella for all families used. */
+#define PF_X25 20 /* Reserved for X.25 project. */
+#define PF_OSINET 21 /* AFI = 47, IDI = 4. */
+#define PF_GOSIP 22 /* U.S. Government OSI. */
+#define PF_IPX 23 /* Novell Internet Protocol. */
+#define PF_ROUTE 24 /* Internal Routing Protocol. */
+#define PF_LINK 25 /* Link-layer interface. */
+#define PF_INET6 26 /* IP version 6. */
+#define PF_KEY 27 /* PF_KEY key management API. */
+#define PF_NCA 28 /* NCA socket. */
+#define PF_POLICY 29 /* Security Policy DB socket. */
+#define PF_INET_OFFLOAD 30 /* Sun private; do not use. */
+#define PF_MAX 30 /* For now.. */
+
+/* Address families. */
+#define AF_UNSPEC PF_UNSPEC
+#define AF_UNIX PF_UNIX
+#define AF_LOCAL PF_LOCAL
+#define AF_INET PF_INET
+#define AF_IMPLINK PF_IMPLINK
+#define AF_PUP PF_PUP
+#define AF_CHAOS PF_CHAOS
+#define AF_NS PF_NBS
+#define AF_NBS PF_NBS
+#define AF_ECMA PF_ECMA
+#define AF_DATAKIT PF_DATAKIT
+#define AF_CCITT PF_CCITT
+#define AF_SNA PF_SNA
+#define AF_DECnet PF_DECnet
+#define AF_DLI PF_DLI
+#define AF_LAT PF_LAT
+#define AF_HYLINK PF_HYLINK
+#define AF_APPLETALK PF_APPLETALK
+#define AF_NIT PF_NIT
+#define AF_802 PF_802
+#define AF_X25 PF_X25
+#define AF_OSINET PF_OSINET
+#define AF_GOSIP PF_GOSIP
+#define AF_IPX PF_IPX
+#define AF_ROUTE PF_ROUTE
+#define AF_LINK PF_LINK
+#define AF_INET6 PF_INET6
+#define AF_KEY PF_X25
+#define AF_NCA PF_X25
+#define AF_POLICY PF_POLICY
+#define AF_INET_OFFLOAD PF_INET_OFFLOAD
+#define AF_MAX PF_MAX
+
+/* Socket level values. */
+#define SOL_SOCKET 0xFFFF
+#define SOL_IP 0 /* IPPROTO_IP */
+#define SOL_ICMP 1 /* IPPROTO_ICMP */
+#define SOL_TCP 6 /* IPPROTO_TCP */
+#define SOL_UDP 17 /* IPPROTO_UDP */
+#define SOL_IPV6 41 /* IPPROTO_IPV6 */
+#define SOL_ICMPV6 58 /* IPPROTO_ICMPV6 */
+#define SOL_SCTP 132 /* IPPROTO_SCTP */
+#define SOL_RAW 255 /* IPPROTO_RAW */
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address. */
+struct sockaddr
+ {
+ __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
+ char sa_data[14]; /* Address data. */
+ };
+
+
+/* Structure large enough to hold any socket address (with the historical
+ exception of AF_UNIX). We reserve 128 bytes. */
+#define _SS_MAXSIZE 256
+#define _SS_ALIGNSIZE (sizeof (sockaddr_maxalign_t))
+typedef double sockaddr_maxalign_t;
+#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (sa_family_t))
+#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (sa_family_t) + \
+ _SS_PAD1SIZE + _SS_ALIGNSIZE))
+
+struct sockaddr_storage
+ {
+ __SOCKADDR_COMMON (ss_); /* Address family, etc. */
+ char _ss_pad1[_SS_PAD1SIZE];
+ sockaddr_maxalign_t __ss_align; /* Force desired alignment. */
+ char _ss_pad2[_SS_PAD2SIZE];
+ };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al. */
+enum
+ {
+ MSG_OOB = 0x01, /* Process out-of-band data. */
+#define MSG_OOB MSG_OOB
+ MSG_PEEK = 0x02, /* Peek at incoming messages. */
+#define MSG_PEEK MSG_PEEK
+ MSG_DONTROUTE = 0x04, /* Don't use local routing. */
+#define MSG_DONTROUTE MSG_DONTROUTE
+#ifdef __USE_GNU
+ /* DECnet uses a different name. */
+ MSG_TRYHARD = MSG_DONTROUTE,
+# define MSG_TRYHARD MSG_DONTROUTE
+#endif
+ MSG_EOR = 0x08, /* End of record. */
+#define MSG_EOR MSG_EOR
+ MSG_CTRUNC = 0x10, /* Control data lost before delivery. */
+#define MSG_CTRUNC MSG_CTRUNC
+ MSG_TRUNC = 0x20,
+#define MSG_TRUNC MSG_TRUNC
+ MSG_WAITALL = 0x40, /* Wait for a full request. */
+#define MSG_WAITALL MSG_WAITALL
+ MSG_DONTWAIT = 0x80, /* Nonblocking IO. */
+#define MSG_DONTWAIT MSG_DONTWAIT
+ MSG_NOTIFICATION = 0x100, /* Notification, not data. */
+#define MSG_NOTIFICATION MSG_NOTIFICICATION
+ MSG_XPG4_2 = 0x8000, /* Private: XPG4.2 flag. */
+#define MSG_XPG4_2 MSG_XPG4_2
+
+/* The following are not supported by the OpenSolaris kernel. */
+ MSG_NOSIGNAL = 0x4000, /* Do not generate SIGPIPE. */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
+ };
+
+
+/* Structure describing messages sent by
+ `sendmsg' and received by `recvmsg'. */
+struct msghdr
+ {
+ void *msg_name; /* Address to send to/receive from. */
+ socklen_t msg_namelen; /* Length of address data. */
+
+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
+ size_t msg_iovlen; /* Number of elements in the vector. */
+
+ void *msg_control; /* Ancillary data (eg BSD filedesc passing). */
+ socklen_t msg_controllen; /* Ancillary data buffer length. */
+
+ int msg_flags; /* Flags on received message. */
+ };
+
+/* Structure used for storage of ancillary data object information. */
+struct cmsghdr
+ {
+ socklen_t cmsg_len; /* Length of data in cmsg_data plus length
+ of cmsghdr structure. */
+ int cmsg_level; /* Originating protocol. */
+ int cmsg_type; /* Protocol specific type. */
+ };
+
+/* Ancillary data object manipulation macros. */
+#if defined(__sparc__)
+# define _CMSG_HDR_ALIGNMENT 8
+#else
+# define _CMSG_HDR_ALIGNMENT 4
+#endif
+#define CMSG_ALIGN(len) (((uintptr_t)(len) + _CMSG_HDR_ALIGNMENT - 1) \
+ & ~(_CMSG_HDR_ALIGNMENT - 1))
+#define _CMSG_HDR_ALIGN(x) CMSG_ALIGN(x)
+#define CMSG_DATA(cmsg) ((unsigned char *) CMSG_ALIGN((struct cmsghdr *) (cmsg) + 1))
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+ + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+ struct cmsghdr *__cmsg) __THROW;
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE __extern_inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+ if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+ /* The kernel header does this so there may be a reason. */
+ return 0;
+
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+ /* No more entries. */
+ return 0;
+ return __cmsg;
+}
+#endif /* Use `extern inline'. */
+
+/* Socket options. */
+#define SO_DEBUG 0x0001 /* Turn on debugging info recording. */
+#define SO_ACCEPTCONN 0x0002 /* Socket has had listen(). */
+#define SO_REUSEADDR 0x0004 /* Allow local address reuse. */
+#define SO_KEEPALIVE 0x0008 /* Keep connections alive. */
+#define SO_DONTROUTE 0x0010 /* Just use interface addresses. */
+#define SO_BROADCAST 0x0020 /* Permit sending of broadcast msgs. */
+#define SO_USELOOPBACK 0x0040 /* Bypass hardware when possible. */
+#define SO_LINGER 0x0080 /* Linger on close if data present. */
+#define SO_OOBINLINE 0x0100 /* Leave received OOB data in line. */
+#define SO_DGRAM_ERRIND 0x0200 /* Application wants delayed error. */
+#define SO_RECVUCRED 0x0400 /* Application wants ucred of sender. */
+
+/* Socket options not kept in so_options. */
+#define SO_SNDBUF 0x1001 /* Send buffer size. */
+#define SO_RCVBUF 0x1002 /* Receive buffer size. */
+#define SO_SNDLOWAT 0x1003 /* Send low-water mark. */
+#define SO_RCVLOWAT 0x1004 /* Receive low-water mark. */
+#define SO_SNDTIMEO 0x1005 /* Send timeout. */
+#define SO_RCVTIMEO 0x1006 /* Receive timeout. */
+#define SO_ERROR 0x1007 /* Get error status and clear. */
+#define SO_TYPE 0x1008 /* Get socket type. */
+#define SO_PROTOTYPE 0x1009 /* Get/set protocol type. */
+#define SO_ANON_MLP 0x100a /* Create MLP on anonymous bind. */
+#define SO_MAC_EXEMPT 0x100b /* Allow dominated unlabeled peers. */
+#define SO_DOMAIN 0x100c /* Get socket domain. */
+/* SCM_RIGHTS = 0x1010 */
+#define SO_SECATTR 0x1011 /* Socket's security attributes. */
+/* SCM_UCRED = 0x1012 */
+#define SO_TIMESTAMP 0x1013 /* Sender's ucred. */
+#define SO_ALLZONES 0x1014 /* Bind in all zones. */
+#define SO_EXCLBIND 0x1015 /* Exclusive binding. */
+
+/* Socket level message types. */
+enum
+ {
+ SCM_RIGHTS = 0x1010, /* Transfer file descriptors. */
+#define SCM_RIGHTS SCM_RIGHTS
+ SCM_UCRED = 0x1012,
+#define SCM_UCRED SCM_UCRED
+ SCM_TIMESTAMP = SO_TIMESTAMP
+#define SCM_TIMESTAMP SCM_TIMESTAMP
+ };
+
+/* Structure used to manipulate the SO_LINGER option. */
+struct linger
+ {
+ int l_onoff; /* Nonzero to linger on close. */
+ int l_linger; /* Time to linger. */
+ };
+
+/* Socket versions. */
+#define SOV_STREAM 0 /* Not a socket - just a stream. */
+#define SOV_DEFAULT 1 /* Select based on so_default_version. */
+#define SOV_SOCKSTREAM 2 /* Socket plus streams operations. */
+#define SOV_SOCKBSD 3 /* Socket with no streams operations. */
+#define SOV_XPG4_2 4 /* Xnet socket. */
+
+#endif /* bits/socket.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stat.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stat.h
new file mode 100644
index 0000000000..b572984357
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stat.h
@@ -0,0 +1,230 @@
+/* Copyright (C) 1993, 96, 97, 98, 99, 2000, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+/* Length of array allocated for file system type name. */
+#define _ST_FSTYPSZ 16
+
+/* Structure describing file characteristics. */
+struct stat
+ {
+ __dev_t st_dev;
+#if __WORDSIZE == 32
+ long int st_pad1[3];
+#endif
+#ifndef __USE_FILE_OFFSET64
+ __ino_t st_ino; /* File serial number. */
+#else
+ __ino64_t st_ino; /* File serial number. */
+#endif
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ __dev_t st_rdev; /* Device number, if device. */
+#if __WORDSIZE == 32
+ long int st_pad2[2];
+#endif
+#ifndef __USE_FILE_OFFSET64
+ __off_t st_size; /* Size of file, in bytes. */
+#else
+ __off64_t st_size; /* Size of file, in bytes. */
+#endif
+#if __WORDSIZE == 32 && !defined(__USE_FILE_OFFSET64)
+ long int st_pad3;
+#endif
+#ifdef __USE_MISC
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int st_atime_usec;
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int st_mtime_usec;
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int st_ctime_usec;
+#endif
+ __blksize_t st_blksize; /* Optimal block size for I/O. */
+#define _STATBUF_ST_BLKSIZE /* Tell code we have this member. */
+
+#ifndef __USE_FILE_OFFSET64
+ __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */
+#else
+ __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */
+#endif
+ char st_fstype[_ST_FSTYPSZ];
+#if __WORDSIZE == 32
+ long int st_pad4[8];
+#endif
+ };
+
+#ifdef _SYSCALL32
+#include <sys/types32.h>
+
+struct stat32
+ {
+ __dev_t st_dev;
+ __int32_t st_pad1[3];
+ __ino_t st_ino;
+ __mode_t st_mode;
+ __nlink_t st_nlink;
+ __uid_t st_uid;
+ __gid_t st_gid;
+ __dev_t st_rdev;
+ __int32_t st_pad2[2];
+ __off_t st_size;
+ __int32_t st_pad3;
+ struct timespec32 st_atim;
+ struct timespec32 st_mtim;
+ struct timespec32 st_ctim;
+ __int32_t st_blksize;
+ __blkcnt_t st_blocks;
+ char st_fstype[_ST_FSTYPSZ];
+ __int32_t st_pad4[8];
+ };
+#endif /* _SYSCALL32 */
+
+#ifdef __USE_LARGEFILE64
+/* struct stat64 has the shape as stat */
+struct stat64
+ {
+ __dev_t st_dev; /* Device */
+#if __WORDSIZE == 32
+ long int st_pad1[3];
+#endif
+ __ino64_t st_ino; /* File serial number */
+ __mode_t st_mode; /* File mode */
+ __nlink_t st_nlink; /* Link count */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ __dev_t st_rdev; /* Device number, if device */
+#if __WORDSIZE == 32
+ long int st_pad2[2];
+#endif
+ __off64_t st_size; /* Size of file, in bytes. */
+#ifdef __USE_MISC
+ struct timespec st_atim; /* Time of last access. */
+ struct timespec st_mtim; /* Time of last modification. */
+ struct timespec st_ctim; /* Time of last status change. */
+# define st_atime st_atim.tv_sec /* Backward compatibility. */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+ __time_t st_atime; /* Time of last access */
+ unsigned long int st_atime_usec;
+ __time_t st_mtime; /* Time of last modification */
+ unsigned long int st_mtime_usec;
+ __time_t st_ctime; /* Time of last status change */
+ unsigned long int st_ctime_usec;
+#endif
+ __blksize_t st_blksize;
+ __blkcnt64_t st_blocks;
+ char st_fstype[_ST_FSTYPSZ];
+#if __WORDSIZE == 32
+ long int st_pad4[8];
+#endif
+};
+#endif
+
+#ifdef _SYSCALL32
+
+#include <sys/isa_defs.h>
+
+#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
+# pragma pack(4)
+#endif
+
+struct stat64_32
+ {
+ dev32_t st_dev;
+ int32_t st_pad1[3];
+ ino64_t st_ino;
+ mode32_t st_mode;
+ nlink32_t st_nlink;
+ uid32_t st_uid;
+ gid32_t st_gid;
+ dev32_t st_rdev;
+ int32_t st_pad2[2];
+ off64_t st_size;
+ struct timespec32 st_atim;
+ struct timespec32 st_mtim;
+ struct timespec32 st_ctim;
+ int32_t st_blksize;
+ blkcnt64_t st_blocks;
+ char st_fstype[_ST_FSTYPSZ];
+ int32_t st_pad4[8];
+ };
+
+#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
+# pragma pack()
+#endif
+
+#endif /* _SYSCALL32 */
+
+/* Tell code we have these members. */
+#define _STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+
+/* Encoding of the file mode. */
+
+#define __S_IFMT 0xF000 /* These bits determine file type. */
+
+/* File types. */
+#define __S_IFDIR 0x4000 /* Directory. */
+#define __S_IFCHR 0x2000 /* Character device. */
+#define __S_IFBLK 0x6000 /* Block device. */
+#define __S_IFREG 0x8000 /* Regular file. */
+#define __S_IFIFO 0x1000 /* FIFO. */
+#define __S_IFLNK 0xA000 /* Symbolic link. */
+#define __S_IFSOCK 0xC000 /* Socket. */
+#define S_IFDOOR 0xD000 /* Door. */
+#define S_IFPORT 0xE000 /* Event port. */
+
+/* POSIX.1b objects. */
+#define __S_TYPEISMQ(buf) (0)
+#define __S_TYPEISSEM(buf) (0)
+#define __S_TYPEISSHM(buf) (0)
+
+/* Protection bits. */
+
+#define __S_ISUID 0x800 /* Set user ID on execution. */
+#define __S_ISGID 0x400 /* Set group ID on execution. */
+#define __S_ISVTX 0x200 /* Save swapped text after use (sticky). */
+#define __S_IREAD 00400 /* Read by owner. */
+#define __S_IWRITE 00200 /* Write by owner. */
+#define __S_IEXEC 00100 /* Execute by owner. */
+
+#define _R3_MKNOD_VER 1 /* SVR3.0 mknod */
+#define _MKNOD_VER 2 /* current version of mknod */
+#define _R3_STAT_VER 1 /* SVR3.0 stat */
+#define _STAT_VER 2 /* current version of stat */
+
+#define S_IAMB 0x01FF
+
+#define S_ISDOOR(mode) (((mode) & 0xF000) == S_IFDOOR)
+#define S_ISPORT(mode) (((mode) & 0xF000) == S_IFPORT)
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statfs.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statfs.h
new file mode 100644
index 0000000000..51810ddae4
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statfs.h
@@ -0,0 +1,68 @@
+/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h>
+
+struct statfs
+ {
+ __SWORD_TYPE f_type;
+ __SWORD_TYPE f_bsize;
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+#endif
+ __UWORD_TYPE f_fsid;
+ __SWORD_TYPE f_namelen;
+ __SWORD_TYPE f_frsize;
+ __SWORD_TYPE f_spare[5];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+ {
+ __SWORD_TYPE f_type;
+ __SWORD_TYPE f_bsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __UWORD_TYPE f_fsid;
+ __SWORD_TYPE f_namelen;
+ __SWORD_TYPE f_frsize;
+ __SWORD_TYPE f_spare[5];
+ };
+#endif
+
+/* Tell code we have these members. */
+#define _STATFS_F_NAMELEN
+#define _STATFS_F_FRSIZE
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statvfs.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statvfs.h
new file mode 100644
index 0000000000..81eb6b9795
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/statvfs.h
@@ -0,0 +1,134 @@
+/* Copyright (C) 1997,1998,2000,2001,2002,2006,2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_STATVFS_H
+# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
+#endif
+
+#include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
+#include <bits/wordsize.h>
+#include <features.h>
+
+#define _FSTYPSZ 16
+#ifdef __USE_MISC
+# define FSTYPSZ _FSTYPSZ
+#endif
+
+typedef struct statvfs
+{
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+#ifdef __USE_FILE_OFFSET64
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+#else
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+ __fsfilcnt_t f_favail;
+#endif
+ unsigned long int f_fsid;
+ char f_basetype[_FSTYPSZ];
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ char f_fstr[32];
+#if __WORDSIZE == 32
+ unsigned long f_filler[16];
+#endif
+} statvfs_t;
+
+#ifdef _SYSCALL32
+typedef struct statvfs32
+{
+ __uint32_t f_bsize;
+ __uint32_t f_frsize;
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+ __fsfilcnt_t f_favail;
+ __uint32_t f_fsid;
+ char f_basetype[_FSTYPSZ];
+ __uint32_t f_flag;
+ __uint32_t f_namemax;
+ char f_fstr[32];
+ __uint32_t f_filler[16];
+} statvfs32_t;
+#endif
+
+#ifdef __USE_LARGEFILE64
+typedef struct statvfs64
+{
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+ unsigned long int f_fsid;
+ char f_basetype[_FSTYPSZ];
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ char f_fstr[32];
+#if __WORDSIZE == 32
+ unsigned long f_filler[16];
+#endif
+} statvfs64_t;
+#endif
+
+#ifdef _SYSCALL32
+typedef struct statvfs64_32
+{
+ __uint32_t f_bsize;
+ __uint32_t f_frsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+ __uint32_t f_fsid;
+ char f_basetype[_FSTYPSZ];
+ __uint32_t f_flag;
+ __uint32_t f_namemax;
+ char f_fstr[32];
+ __uint32_t f_filler[16];
+} statvfs64_32_t;
+#endif
+
+/* Definitions for the flag in `f_flag'. These definitions should be
+ kept in sync with the definitions in <sys/mount.h>. */
+enum
+{
+ ST_RDONLY = 1, /* Mount read-only. */
+#define ST_RDONLY ST_RDONLY
+ ST_NOSUID = 2, /* Ignore suid and sgid bits. */
+#define ST_NOSUID ST_NOSUID
+ ST_NOTRUNC = 4 /* Don't truncate long files. */
+#define ST_NOTRUNC ST_NOTRUNC
+};
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stropts.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stropts.h
new file mode 100644
index 0000000000..8b198e88cb
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/stropts.h
@@ -0,0 +1,256 @@
+/* Copyright (C) 1998, 1999, 2000, 2002, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STROPTS_H
+# error "Never include <bits/stropts.h> directly; use <stropts.h> instead."
+#endif
+
+#ifndef _BITS_STROPTS_H
+#define _BITS_STROPTS_H 1
+
+#include <bits/types.h>
+#include <features.h>
+
+/* Macros used as `request' argument to `ioctl'. */
+#define __SID ('S' << 8)
+
+#define I_NREAD (__SID | 1) /* Counts the number of data bytes in the data
+ block in the first message. */
+#define I_PUSH (__SID | 2) /* Push STREAMS module onto top of the current
+ STREAM, just below the STREAM head. */
+#define I_POP (__SID | 3) /* Remove STREAMS module from just below the
+ STREAM head. */
+#define I_LOOK (__SID | 4) /* Retrieve the name of the module just below
+ the STREAM head and place it in a character
+ string. */
+#define I_FLUSH (__SID | 5) /* Flush all input and/or output. */
+#define I_SRDOPT (__SID | 6) /* Sets the read mode. */
+#define I_GRDOPT (__SID | 7) /* Returns the current read mode setting. */
+#define I_STR (__SID | 8) /* Construct an internal STREAMS `ioctl'
+ message and send that message downstream. */
+#define I_SETSIG (__SID | 9) /* Inform the STREAM head that the process
+ wants the SIGPOLL signal issued. */
+#define I_GETSIG (__SID |10) /* Return the events for which the calling
+ process is currently registered to be sent
+ a SIGPOLL signal. */
+#define I_FIND (__SID |11) /* Compares the names of all modules currently
+ present in the STREAM to the name pointed to
+ by `arg'. */
+#define I_LINK (__SID |12) /* Connect two STREAMs. */
+#define I_UNLINK (__SID |13) /* Disconnects the two STREAMs. */
+#define I_PEEK (__SID |15) /* Allows a process to retrieve the information
+ in the first message on the STREAM head read
+ queue without taking the message off the
+ queue. */
+#define I_FDINSERT (__SID |16) /* Create a message from the specified
+ buffer(s), adds information about another
+ STREAM, and send the message downstream. */
+#define I_SENDFD (__SID |17) /* Requests the STREAM associated with `fildes'
+ to send a message, containing a file
+ pointer, to the STREAM head at the other end
+ of a STREAMS pipe. */
+#define I_RECVFD (__SID |14) /* Non-EFT definition. */
+#define I_SWROPT (__SID |19) /* Set the write mode. */
+#define I_GWROPT (__SID |20) /* Return the current write mode setting. */
+#define I_LIST (__SID |21) /* List all the module names on the STREAM, up
+ to and including the topmost driver name. */
+#define I_PLINK (__SID |22) /* Connect two STREAMs with a persistent
+ link. */
+#define I_PUNLINK (__SID |23) /* Disconnect the two STREAMs that were
+ connected with a persistent link. */
+#define I_FLUSHBAND (__SID |28) /* Flush only band specified. */
+#define I_CKBAND (__SID |29) /* Check if the message of a given priority
+ band exists on the STREAM head read
+ queue. */
+#define I_GETBAND (__SID |30) /* Return the priority band of the first
+ message on the STREAM head read queue. */
+#define I_ATMARK (__SID |31) /* See if the current message on the STREAM
+ head read queue is "marked" by some module
+ downstream. */
+#define I_SETCLTIME (__SID |32) /* Set the time the STREAM head will delay when
+ a STREAM is closing and there is data on
+ the write queues. */
+#define I_GETCLTIME (__SID |33) /* Get current value for closing timeout. */
+#define I_CANPUT (__SID |34) /* Check if a certain band is writable. */
+
+#define __I_PUSH_NOCTTY (__SID |047)
+
+#define _I_MUXID2FD (__SID |056)
+#define _I_INSERT (__SID |057)
+#define _I_REMOVE (__SID |060)
+#define _I_GETPEERCRED (__SID |061)
+#define _I_PLINK_LH (__SID |062)
+#define _I_CMD (__SID |063)
+
+
+/* Used in `I_LOOK' request. */
+#define FMNAMESZ 8 /* compatibility w/UnixWare/Solaris. */
+
+/* Flush options. */
+#define FLUSHR 0x01 /* Flush read queues. */
+#define FLUSHW 0x02 /* Flush write queues. */
+#define FLUSHRW 0x03 /* Flush read and write queues. */
+#ifdef __USE_GNU
+# define FLUSHBAND 0x04 /* Flush only specified band. */
+#endif
+
+/* Possible arguments for `I_SETSIG'. */
+#define S_INPUT 0x0001 /* A message, other than a high-priority
+ message, has arrived. */
+#define S_HIPRI 0x0002 /* A high-priority message is present. */
+#define S_OUTPUT 0x0004 /* The write queue for normal data is no longer
+ full. */
+#define S_MSG 0x0008 /* A STREAMS signal message that contains the
+ SIGPOLL signal reaches the front of the
+ STREAM head read queue. */
+#define S_ERROR 0x0010 /* Notification of an error condition. */
+#define S_HANGUP 0x0020 /* Notification of a hangup. */
+#define S_RDNORM 0x0040 /* A normal message has arrived. */
+#define S_WRNORM S_OUTPUT
+#define S_RDBAND 0x0080 /* A message with a non-zero priority has
+ arrived. */
+#define S_WRBAND 0x0100 /* The write queue for a non-zero priority
+ band is no longer full. */
+#define S_BANDURG 0x0200 /* When used in conjunction with S_RDBAND,
+ SIGURG is generated instead of SIGPOLL when
+ a priority message reaches the front of the
+ STREAM head read queue. */
+
+/* Option for `I_PEEK'. */
+#define RS_HIPRI 0x01 /* Only look for high-priority messages. */
+
+/* Options for `I_SRDOPT'. */
+#define RNORM 0x0000 /* Byte-STREAM mode, the default. */
+#define RMSGD 0x0001 /* Message-discard mode. */
+#define RMSGN 0x0002 /* Message-nondiscard mode. */
+#define RPROTDAT 0x0004 /* Deliver the control part of a message as
+ data. */
+#define RPROTDIS 0x0008 /* Discard the control part of a message,
+ delivering any data part. */
+#define RPROTNORM 0x0010 /* Fail `read' with EBADMSG if a message
+ containing a control part is at the front
+ of the STREAM head read queue. */
+#ifdef __USE_GNU
+# define RPROTMASK 0x001C /* The RPROT bits */
+#endif
+
+/* Possible mode for `I_SWROPT'. */
+#define SNDZERO 0x001 /* Send a zero-length message downstream when a
+ `write' of 0 bytes occurs. */
+#ifdef __USE_GNU
+# define SNDPIPE 0x002 /* Send SIGPIPE on write and putmsg if
+ sd_werror is set. */
+#endif
+
+/* Arguments for `I_ATMARK'. */
+#define ANYMARK 0x01 /* Check if the message is marked. */
+#define LASTMARK 0x02 /* Check if the message is the last one marked
+ on the queue. */
+
+/* Argument for `I_UNLINK'. */
+#ifdef __USE_GNU
+# define MUXID_ALL (-1) /* Unlink all STREAMs linked to the STREAM
+ associated with `fildes'. */
+#endif
+
+
+/* Macros for `getmsg', `getpmsg', `putmsg' and `putpmsg'. */
+#define MSG_HIPRI 0x01 /* Send/receive high priority message. */
+#define MSG_ANY 0x02 /* Receive any message. */
+#define MSG_BAND 0x04 /* Receive message from specified band. */
+
+/* Values returned by getmsg and getpmsg */
+#define MORECTL 1 /* More control information is left in
+ message. */
+#define MOREDATA 2 /* More data is left in message. */
+
+#ifdef __USE_MISC
+# define MSG_XPG4 0x08
+#endif
+
+
+/* Structure used for the I_FLUSHBAND ioctl on streams. */
+struct bandinfo
+ {
+ unsigned char bi_pri;
+ int bi_flag;
+ };
+
+struct strbuf
+ {
+ int maxlen; /* Maximum buffer length. */
+ int len; /* Length of data. */
+ char *buf; /* Pointer to buffer. */
+ };
+
+struct strpeek
+ {
+ struct strbuf ctlbuf;
+ struct strbuf databuf;
+ t_uscalar_t flags; /* UnixWare/Solaris compatibility. */
+ };
+
+struct strfdinsert
+ {
+ struct strbuf ctlbuf;
+ struct strbuf databuf;
+ t_uscalar_t flags; /* UnixWare/Solaris compatibility. */
+ int fildes;
+ int offset;
+ };
+
+struct strioctl
+ {
+ int ic_cmd;
+ int ic_timout;
+ int ic_len;
+ char *ic_dp;
+ };
+
+struct strrecvfd
+ {
+ int fd;
+ uid_t uid;
+ gid_t gid;
+ char __fill[8]; /* UnixWare/Solaris compatibility */
+ };
+
+
+struct str_mlist
+ {
+ char l_name[FMNAMESZ + 1];
+ };
+
+struct str_list
+ {
+ int sl_nmods;
+ struct str_mlist *sl_modlist;
+ };
+
+#ifdef __USE_MISC
+
+struct strmodconf
+ {
+ int pos;
+ __caddr_t mod_name;
+ };
+
+# define INFTIM -1
+#endif
+
+#endif /* bits/stropts.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/syslog-path.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/syslog-path.h
new file mode 100644
index 0000000000..3e9f79b7ff
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/syslog-path.h
@@ -0,0 +1,29 @@
+/* <bits/syslog-path.h> -- _PATH_LOG definition
+ Copyright (C) 2006 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_SYSLOG_H
+# error "Never include this file directly. Use <sys/syslog.h> instead"
+#endif
+
+#ifndef _BITS_SYSLOG_PATH_H
+#define _BITS_SYSLOG_PATH_H 1
+
+#define _PATH_LOG "/etc/.log"
+
+#endif /* bits/syslog-path.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/termios.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/termios.h
new file mode 100644
index 0000000000..49e030e888
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/termios.h
@@ -0,0 +1,241 @@
+/* termios type and macro definitions. OpenSolaris version.
+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _TERMIOS_H
+# error "Never include <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 19
+struct termios
+ {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* line discipline mode flags */
+ cc_t c_cc[NCCS]; /* control characters */
+ };
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VEOL 5
+#define VEOL2 6
+#define VMIN 4
+#define VTIME 5
+#define VSWTCH 7
+#define VSWTC VSWTCH
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VDSUSP 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+#define DOSMODE 0100000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY 0000400
+# define NL0 0000000
+# define NL1 0000400
+# define CRDLY 0003000
+# define CR0 0000000
+# define CR1 0001000
+# define CR2 0002000
+# define CR3 0003000
+# define TABDLY 0014000
+# define TAB0 0000000
+# define TAB1 0004000
+# define TAB2 0010000
+# define TAB3 0014000
+# define BSDLY 0020000
+# define BS0 0000000
+# define BS1 0020000
+# define FFDLY 0100000
+# define FF0 0000000
+# define FF1 0100000
+#endif
+
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+
+#ifdef __USE_MISC
+# define XTABS 0014000
+#endif
+
+#ifdef __USE_MISC
+# define PAGEOUT 0200000
+# define WRAP 0400000
+#endif
+
+/* c_cflag bit meaning */
+#if defined(__USE_MISC)
+# define CBAUD 0000017
+#endif
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define B57600 0000020
+#define B76800 0000021
+#define B115200 0000022
+#define B153600 0000023
+#define B230400 0000024
+#define B307200 0000025
+#define B460800 0000026
+#define __MAX_BAUD B460800
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#ifdef __USE_MISC
+# define RCV1EN 0010000
+# define XMT1EN 0020000
+# define LOBLK 0040000
+# define XCLUDE 0100000
+# define CRTSXOFF 010000000000
+# define CRTSCTS 020000000000
+# define CRTSCTS 020000000000
+# define CIBAUD 03600000
+# define PAREXT 04000000
+# define CBAUDEXT 010000000
+# define CIBAUDEXT 020000000
+# define CRTS_IFLOW 010000000000
+# define CCTS_OFLOW 020000000000
+#endif
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE 0000004
+#endif
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#ifdef __USE_MISC
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE 0004000
+# define DEFECHO 0010000
+# define FLUSHO 0020000
+# define PENDIN 0040000
+#endif
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#ifndef _TIOC
+# define _TIOC ('T'<<8)
+#endif
+#define TCSANOW (_TIOC|14)
+#define TCSADRAIN (_TIOC|15)
+#define TCSAFLUSH (_TIOC|16)
+
+
+#define _IOT_termios /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
+
+#define LDIOC ('D'<<8)
+#define LDOPEN (LDIOC|0)
+#define LDCLOSE (LDIOC|1)
+#define LDCHG (LDIOC|2)
+#define LDGETT (LDIOC|8)
+#define LDSETT (LDIOC|9)
+#define LDSMAP (LDIOC|110)
+#define LDGMAP (LDIOC|111)
+#define LDNMAP (LDIOC|112)
+#define LDEMAP (LDIOC|113)
+#define LDDMAP (LDIOC|114)
+
+#define DIOC ('d'<<8)
+#define DIOCGETP (DIOC|8)
+#define DIOCSETP (DIOC|9)
+
+#define FIORDCHK (('f'<<8)|3)
+
+#define CESC '\\'
+#define CNUL 0
+#define CDEL 0377
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/time.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/time.h
new file mode 100644
index 0000000000..fd39a74b69
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/time.h
@@ -0,0 +1,207 @@
+/* System-dependent timing definitions. OpenSolaris version.
+ Copyright (C) 1996,1997,1999-2002,2003,2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+# define _BITS_TIME_H 1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+ The macro `CLOCKS_PER_SEC' is the number per second of the value
+ returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+ The value of CLOCKS_PER_SEC is required to be 1 million on all
+ XSI-conformant systems. */
+# define CLOCKS_PER_SEC 1000000l
+
+# if !defined __STRICT_ANSI__ && !defined __USE_XOPEN2K
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+ presents the real value for clock ticks per second for the system. */
+# include <bits/types.h>
+extern long int __sysconf (int);
+# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
+# endif
+
+# ifdef __USE_POSIX199309
+
+/* Thread-specific userland-only CPU-time clock. */
+# define CLOCK_VIRTUAL 1
+/* Thread-specific CPU-time clock. */
+# define CLOCK_THREAD_CPUTIME_ID 2
+/* Identifier for system-wide realtime clock. */
+# define CLOCK_REALTIME 3
+/* Monotonic system-wide clock. */
+# define CLOCK_MONOTONIC 4
+/* High-resolution timer from the CPU. */
+# define CLOCK_PROCESS_CPUTIME_ID 5
+/* OpenSolaris defines these. */
+# define __CLOCK_REALTIME0 0
+# define CLOCK_HIGHRES CLOCK_MONOTONIC
+# define CLOCK_PROF CLOCK_THREAD_CPUTIME_ID
+
+/* Flag to indicate time is relative. */
+# define TIMER_RELTIME 0
+/* Flag to indicate time is absolute. */
+# define TIMER_ABSTIME 1
+
+# endif
+
+# endif /* bits/time.h */
+#endif
+
+#if defined (__need_itimerval) && !defined (__need_timeval)
+# define __need_timeval
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+ {
+ __time_t tv_sec; /* Seconds. */
+ __suseconds_t tv_usec; /* Microseconds. */
+ };
+
+
+
+# endif /* struct timeval */
+#endif /* need timeval */
+
+# if defined (__need_itimerval) && !defined (__itimerval_defined)
+struct itimerval
+ {
+ /* Value to put into `it_value' when the timer expires. */
+ struct timeval it_interval;
+ /* Time to the next timer expiration. */
+ struct timeval it_value;
+ };
+# define __itimerval_defined
+# undef __need_itimerval
+# endif
+
+#if !defined (__time_misc_defined) && defined (__USE_MISC)
+
+typedef struct timespec timespec_t;
+typedef struct timespec timestruc_t;
+typedef struct itimerspec itimerspec_t;
+typedef struct tm tm_t;
+
+# define SEC 1
+# define MILLISEC 1000
+# define MICROSEC 1000000
+# define NANOSEC 1000000000
+
+# include <bits/types.h>
+
+__BEGIN_DECLS
+
+extern int cftime (char *, const char *, const __time_t *) __THROW;
+extern int ascftime (char *, const char *, const struct tm *) __THROW;
+
+__END_DECLS
+
+# define __time_misc_defined
+
+#endif /* __time_misc_defined */
+
+#ifdef _SYSCALL32
+
+# include <sys/types32.h>
+
+# ifndef __time32_misc_defined
+
+# define TIMEVAL32_TO_TIMEVAL(tv, tv32) \
+{ \
+ (tv)->tv_sec = (time_t)(tv32)->tv_sec; \
+ (tv)->tv_usec = (tv32)->tv_usec; \
+}
+
+# define TIMEVAL_TO_TIMEVAL32(tv32, tv) \
+{ \
+ (tv32)->tv_sec = (time32_t)(tv)->tv_sec; \
+ (tv32)->tv_usec = (tv)->tv_usec; \
+}
+
+# define TIMESPEC32_TO_TIMESPEC(ts, ts32) \
+ { \
+ (ts)->tv_sec = (time_t)(ts32)->tv_sec; \
+ (ts)->tv_nsec = (ts32)->tv_nsec; \
+ }
+
+# define TIMESPEC_TO_TIMESPEC32(ts32, ts) \
+ { \
+ (ts32)->tv_sec = (time32_t)(ts)->tv_sec; \
+ (ts32)->tv_nsec = (ts)->tv_nsec; \
+ }
+
+# define TIME32_MAX INT32_MAX
+# define TIME32_MIN INT32_MIN
+
+# define TIMESPEC_OVERFLOW(ts) \
+ ((ts)->tv_sec < TIME32_MIN || (ts)->tv_sec > TIME32_MAX)
+
+# define __time32_misc_defined
+# endif /* __time32_misc_defined */
+
+# if defined (_SYS_TIME_H) && !defined (__itimerval32_defined)
+struct itimerval32
+ {
+ struct timeval32 it_interval;
+ struct timeval32 it_value;
+ };
+
+# define ITIMERVAL32_TO_ITIMERVAL(itv, itv32) \
+{ \
+ TIMEVAL32_TO_TIMEVAL(&(itv)->it_interval, &(itv32)->it_interval); \
+ TIMEVAL32_TO_TIMEVAL(&(itv)->it_value, &(itv32)->it_value); \
+}
+
+# define ITIMERVAL_TO_ITIMERVAL32(itv32, itv) \
+{ \
+ TIMEVAL_TO_TIMEVAL32(&(itv32)->it_interval, &(itv)->it_interval); \
+ TIMEVAL_TO_TIMEVAL32(&(itv32)->it_value, &(itv)->it_value); \
+}
+
+# define ITIMERVAL_OVERFLOW(itv) \
+ (TIMEVAL_OVERFLOW(&(itv)->it_interval) || \
+ TIMEVAL_OVERFLOW(&(itv)->it_value))
+
+# define __itimerval32_defined
+# endif
+
+# if defined (_TIME_H) && !defined (__tms32_defined)
+struct tms32
+ {
+ clock32_t tms_utime;
+ clock32_t tms_stime;
+ clock32_t tms_cutime;
+ clock32_t tms_cstime;
+ };
+# define __tms32_defined
+# endif
+
+#endif /* _SYSCALL32 */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/types.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/types.h
new file mode 100644
index 0000000000..f2dec909f3
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/types.h
@@ -0,0 +1,350 @@
+/* bits/types.h -- definitions of __*_t types underlying *_t types.
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef _BITS_TYPES_H
+#define _BITS_TYPES_H 1
+
+#include <bits/wordsize.h>
+
+/* Convenience types. */
+typedef unsigned char __u_char;
+typedef unsigned short int __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long int __u_long;
+
+/* Fixed-size types, underlying types depend on word size and compiler. */
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#if __WORDSIZE == 64
+typedef signed long int __int64_t;
+typedef unsigned long int __uint64_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+
+/* quad_t is also 64 bits. */
+#if __WORDSIZE == 64
+typedef long int __quad_t;
+typedef unsigned long int __u_quad_t;
+#elif defined __GLIBC_HAVE_LONG_LONG
+__extension__ typedef long long int __quad_t;
+__extension__ typedef unsigned long long int __u_quad_t;
+#else
+typedef struct
+{
+ long __val[2];
+} __quad_t;
+typedef struct
+{
+ __u_long __val[2];
+} __u_quad_t;
+#endif
+
+
+/* The machine-dependent file <bits/typesizes.h> defines __*_T_TYPE
+ macros for each of the OS types we define below. The definitions
+ of those macros must use the following macros for underlying types.
+ We define __S<SIZE>_TYPE and __U<SIZE>_TYPE for the signed and unsigned
+ variants of each of the following integer types on this machine.
+
+ 16 -- "natural" 16-bit type (always short)
+ 32 -- "natural" 32-bit type (always int)
+ 64 -- "natural" 64-bit type (long or long long)
+ LONG32 -- 32-bit type, traditionally long
+ QUAD -- 64-bit type, always long long
+ WORD -- natural type of __WORDSIZE bits (int or long)
+ LONGWORD -- type of __WORDSIZE bits, traditionally long
+
+ We distinguish WORD/LONGWORD, 32/LONG32, and 64/QUAD so that the
+ conventional uses of `long' or `long long' type modifiers match the
+ types we define, even when a less-adorned type would be the same size.
+ This matters for (somewhat) portably writing printf/scanf formats for
+ these types, where using the appropriate l or ll format modifiers can
+ make the typedefs and the formats match up across all GNU platforms. If
+ we used `long' when it's 64 bits where `long long' is expected, then the
+ compiler would warn about the formats not matching the argument types,
+ and the programmer changing them to shut up the compiler would break the
+ program's portability.
+
+ Here we assume what is presently the case in all the GCC configurations
+ we support: long long is always 64 bits, long is always word/address size,
+ and int is always 32 bits. */
+
+#define __S16_TYPE short int
+#define __U16_TYPE unsigned short int
+#define __S32_TYPE int
+#define __U32_TYPE unsigned int
+#define __SLONGWORD_TYPE long int
+#define __ULONGWORD_TYPE unsigned long int
+#if __WORDSIZE == 32
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
+# define __SWORD_TYPE int
+# define __UWORD_TYPE unsigned int
+# define __SLONG32_TYPE long int
+# define __ULONG32_TYPE unsigned long int
+# define __S64_TYPE __quad_t
+# define __U64_TYPE __u_quad_t
+/* We want __extension__ before typedef's that use nonstandard base types
+ such as `long long' in C89 mode. */
+# define __STD_TYPE __extension__ typedef
+#elif __WORDSIZE == 64
+# define __SQUAD_TYPE long int
+# define __UQUAD_TYPE unsigned long int
+# define __SWORD_TYPE long int
+# define __UWORD_TYPE unsigned long int
+# define __SLONG32_TYPE int
+# define __ULONG32_TYPE unsigned int
+# define __S64_TYPE long int
+# define __U64_TYPE unsigned long int
+/* No need to mark the typedef with __extension__. */
+# define __STD_TYPE typedef
+#else
+# error
+#endif
+#include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
+
+
+__STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
+__STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
+__STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
+__STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
+__STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
+__STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
+__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
+__STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
+__STD_TYPE __OFF64_T_TYPE __off64_t; /* Type of file sizes and offsets (LFS). */
+__STD_TYPE __PID_T_TYPE __pid_t; /* Type of process identifications. */
+__STD_TYPE __FSID_T_TYPE __fsid_t; /* Type of file system IDs. */
+__STD_TYPE __CLOCK_T_TYPE __clock_t; /* Type of CPU usage counts. */
+__STD_TYPE __RLIM_T_TYPE __rlim_t; /* Type for resource measurement. */
+__STD_TYPE __RLIM64_T_TYPE __rlim64_t; /* Type for resource measurement (LFS). */
+__STD_TYPE __ID_T_TYPE __id_t; /* General type for IDs. */
+__STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
+__STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */
+__STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */
+
+__STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */
+__STD_TYPE __SWBLK_T_TYPE __swblk_t; /* Type of a swap block maybe? */
+__STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */
+
+/* Clock ID used in clock and timer functions. */
+__STD_TYPE __CLOCKID_T_TYPE __clockid_t;
+
+/* Timer ID returned by `timer_create'. */
+__STD_TYPE __TIMER_T_TYPE __timer_t;
+
+/* Type to represent block size. */
+__STD_TYPE __BLKSIZE_T_TYPE __blksize_t;
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number of disk blocks. */
+__STD_TYPE __BLKCNT_T_TYPE __blkcnt_t;
+__STD_TYPE __BLKCNT64_T_TYPE __blkcnt64_t;
+
+/* Type to count file system blocks. */
+__STD_TYPE __FSBLKCNT_T_TYPE __fsblkcnt_t;
+__STD_TYPE __FSBLKCNT64_T_TYPE __fsblkcnt64_t;
+
+/* Type to count file system nodes. */
+__STD_TYPE __FSFILCNT_T_TYPE __fsfilcnt_t;
+__STD_TYPE __FSFILCNT64_T_TYPE __fsfilcnt64_t;
+
+__STD_TYPE __SSIZE_T_TYPE __ssize_t; /* Type of a byte count, or error. */
+
+/* These few don't really vary by system, they always correspond
+ to one of the other defined types. */
+typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS). */
+typedef __quad_t *__qaddr_t;
+typedef char *__caddr_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h. */
+__STD_TYPE __SWORD_TYPE __intptr_t;
+
+/* Duplicate info from sys/socket.h. */
+__STD_TYPE __U32_TYPE __socklen_t;
+
+
+#undef __STD_TYPE
+
+/* OpenSolaris extension types. */
+typedef __id_t taskid_t;
+typedef __id_t projid_t;
+typedef __id_t poolid_t;
+typedef __id_t zoneid_t;
+typedef __id_t ctid_t;
+typedef __id_t lgrp_id_t;
+typedef short pri_t;
+typedef long long offset_t;
+typedef long long longlong_t;
+typedef unsigned char uchar_t;
+typedef unsigned int uint_t;
+typedef unsigned short ushort_t;
+typedef unsigned long ulong_t;
+typedef unsigned long long u_longlong_t;
+typedef unsigned long long diskaddr_t;
+typedef unsigned long psaddr_t;
+typedef unsigned int lwpid_t;
+typedef long long hrtime_t;
+typedef unsigned int major_t;
+typedef unsigned int minor_t;
+typedef unsigned short cpu_flag_t;
+typedef unsigned long pgcnt_t;
+typedef long spgcnt_t;
+typedef unsigned long long u_offset_t;
+typedef unsigned long pfn_t;
+typedef unsigned int k_fltset_t;
+typedef void *timeout_id_t;
+typedef void *bufcall_id_t;
+typedef long long len_t;
+typedef __SLONG32_TYPE __t_scalar_t;
+typedef __ULONG32_TYPE __t_uscalar_t;
+#ifndef __t_uscalar_t_defined
+typedef __t_uscalar_t t_uscalar_t;
+# define __t_uscalar_t_defined
+#endif
+typedef __t_scalar_t t_scalar_t;
+
+#if defined(__USE_XOPEN_OR_POSIX)
+typedef enum
+ {
+ _B_FALSE,
+ _B_TRUE
+ } boolean_t;
+#else
+typedef enum
+ {
+ B_FALSE,
+ B_TRUE
+ } boolean_t;
+#endif
+
+typedef union
+ {
+ long double _q;
+ __int32_t _l[4];
+ } pad128_t;
+
+typedef union
+ {
+ long double _q;
+ __uint32_t _l[4];
+ } upad128_t;
+
+#include <endian.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+
+typedef union
+ {
+ offset_t _f;
+ struct
+ {
+ __int32_t _u;
+ __int32_t _l;
+ } _p;
+ } lloff_t;
+
+typedef union
+ {
+ long long _f;
+ struct
+ {
+ __int32_t _u;
+ __int32_t _l;
+ } _p;
+ } lldaddr_t;
+
+#else
+
+typedef union
+ {
+ offset_t _f;
+ struct
+ {
+ __int32_t _l;
+ __int32_t _u;
+ } _p;
+ } lloff_t;
+
+typedef union
+ {
+ long long _f;
+ struct
+ {
+ __int32_t _l;
+ __int32_t _u;
+ } _p;
+ } lldaddr_t;
+
+#endif /* __BYTE_ORDER == __BIG_ENDIAN */
+
+#define _INT64_TYPE
+
+#include <bits/machtypes.h>
+
+/* OpenSolaris compatibility types. */
+typedef unsigned short o_mode_t;
+typedef short o_dev_t;
+typedef unsigned short o_uid_t;
+typedef unsigned short o_gid_t;
+typedef short o_nlink_t;
+typedef short o_pid_t;
+typedef unsigned short o_ino_t;
+
+/* OpenSolaris needs clock_t in sys/types.h. */
+#if !defined __clock_t_defined
+# define __clock_t_defined 1
+
+__BEGIN_NAMESPACE_STD
+/* Returned by `clock'. */
+typedef __clock_t clock_t;
+__END_NAMESPACE_STD
+#if defined __USE_XOPEN || defined __USE_POSIX || defined __USE_MISC
+__USING_NAMESPACE_STD(clock_t)
+#endif
+
+#endif /* clock_t not defined and <time.h> or need clock_t. */
+
+#if defined(__USE_MISC)
+/* A value representing the current process/task. */
+# define P_MYID (-1)
+#endif
+
+/* OpenSolaris needs this for source compatibility. */
+#ifdef __USE_MISC
+# include <stdint.h>
+#endif
+
+#ifdef _SYSCALL32
+# include <sys/types32.h>
+#endif
+
+#endif /* bits/types.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/typesizes.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/typesizes.h
new file mode 100644
index 0000000000..02c03b0df3
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/typesizes.h
@@ -0,0 +1,67 @@
+/* bits/typesizes.h -- underlying types for *_t. OpenSolaris version.
+ Copyright (C) 2002, 2003, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+#ifndef _BITS_TYPESIZES_H
+#define _BITS_TYPESIZES_H 1
+
+/* See <bits/types.h> for the meaning of these macros. This file exists so
+ that <bits/types.h> need not vary across different GNU platforms. */
+
+#define __DEV_T_TYPE __ULONGWORD_TYPE
+#define __UID_T_TYPE __U32_TYPE
+#define __GID_T_TYPE __U32_TYPE
+#define __INO_T_TYPE __ULONGWORD_TYPE
+#define __INO64_T_TYPE __UQUAD_TYPE
+#define __MODE_T_TYPE __U32_TYPE
+#define __NLINK_T_TYPE __U32_TYPE
+#define __OFF_T_TYPE __SLONGWORD_TYPE
+#define __OFF64_T_TYPE __SQUAD_TYPE
+#define __PID_T_TYPE __S32_TYPE
+#define __RLIM_T_TYPE __ULONGWORD_TYPE
+#define __RLIM64_T_TYPE __UQUAD_TYPE
+#define __BLKCNT_T_TYPE __SLONGWORD_TYPE
+#define __BLKCNT64_T_TYPE __SQUAD_TYPE
+#define __FSBLKCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSBLKCNT64_T_TYPE __UQUAD_TYPE
+#define __FSFILCNT_T_TYPE __ULONGWORD_TYPE
+#define __FSFILCNT64_T_TYPE __UQUAD_TYPE
+#define __ID_T_TYPE __SLONG32_TYPE
+#define __CLOCK_T_TYPE __SLONGWORD_TYPE
+#define __TIME_T_TYPE __SLONGWORD_TYPE
+#define __USECONDS_T_TYPE __U32_TYPE
+#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
+#define __DADDR_T_TYPE __SLONGWORD_TYPE
+#define __SWBLK_T_TYPE __SLONGWORD_TYPE
+#define __KEY_T_TYPE __S32_TYPE
+#define __CLOCKID_T_TYPE __S32_TYPE
+#define __TIMER_T_TYPE __S32_TYPE
+#define __BLKSIZE_T_TYPE __S32_TYPE
+#define __FSID_T_TYPE struct { int __val[2]; }
+#define __SSIZE_T_TYPE __SWORD_TYPE
+
+/* Number of descriptors that can fit in an `fd_set'. */
+/* TODO: for 64-bit (_LP64) machines this should be 65536 */
+#define __FD_SETSIZE 1024
+
+
+#endif /* bits/typesizes.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/uio.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/uio.h
new file mode 100644
index 0000000000..0855d4e177
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/uio.h
@@ -0,0 +1,93 @@
+/* Copyright (C) 1996, 1997, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+
+#if !defined _SYS_UIO_H && !defined _FCNTL_H
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
+#endif
+
+#ifndef _BITS_UIO_H
+#define _BITS_UIO_H 1
+
+#include <bits/types.h>
+
+/* Maximum number of iovec's that can be processed in a single call. */
+#define UIO_MAXIOV 16
+
+/* `struct iovec' -- Structure describing a section of memory. */
+
+struct iovec {
+ /* Starting address. */
+ __ptr_t iov_base;
+ /* Length in bytes. */
+ size_t iov_len;
+};
+
+typedef struct iovec iovec_t;
+
+#ifdef __USE_MISC
+
+typedef enum uio_seg
+ {
+ UIO_USERSPACE,
+ UIO_SYSSPACE,
+ UIO_USERISPACE
+ } uio_seg_t;
+
+typedef struct uio
+ {
+ iovec_t *uio_iov;
+ int uio_iovcnt;
+ lloff_t _uio_offset;
+ uio_seg_t uio_segflg;
+ __uint16_t uio_fmode;
+ __uint16_t uio_extflg;
+ lloff_t _uio_limit;
+ ssize_t uio_resid;
+ } uio_t;
+
+typedef struct uioa_page_s
+ {
+ int uioa_pfncnt;
+ void **uioa_ppp;
+ caddr_t uioa_base;
+ size_t uioa_len;
+ } uioa_page_t;
+
+#define UIOA_IOV_MAX 16
+
+typedef struct uioa_s
+ {
+ iovec_t *uio_iov;
+ int uio_iovcnt;
+ lloff_t _uio_offset;
+ uio_seg_t uio_segflg;
+ uint16_t uio_fmode;
+ uint16_t uio_extflg;
+ lloff_t _uio_limit;
+ ssize_t uio_resid;
+ uint32_t uioa_state;
+ uioa_page_t *uioa_lcur;
+ void **uioa_lppp;
+ void *uioa_hwst[4];
+ uioa_page_t uioa_locked[UIOA_IOV_MAX];
+ } uioa_t;
+
+#endif
+
+#endif /* _SYS_UIO_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmp.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmp.h
new file mode 100644
index 0000000000..e855ad73f8
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmp.h
@@ -0,0 +1,125 @@
+/* The `struct utmp' type, describing entries in the utmp file. GNU version.
+ Copyright (C) 1993, 1996, 1997, 1998, 1999, 2002
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMP_H
+# error "Never include <bits/utmp.h> directly; use <utmp.h> instead."
+#endif
+
+#include <paths.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <bits/wordsize.h>
+
+
+#define UT_LINESIZE 32
+#define UT_NAMESIZE 32
+#define UT_HOSTSIZE 256
+
+
+/* The structure describing an entry in the database of
+ previous logins. */
+struct lastlog
+ {
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ int32_t ll_time;
+#else
+ __time_t ll_time;
+#endif
+ char ll_line[UT_LINESIZE];
+ char ll_host[UT_HOSTSIZE];
+ };
+
+
+/* The structure describing the status of a terminated process. This
+ type is used in `struct utmp' below. */
+struct exit_status
+ {
+ short int e_termination; /* Process termination status. */
+ short int e_exit; /* Process exit status. */
+ };
+
+
+/* The structure describing an entry in the user accounting database. */
+struct utmp
+{
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+ char ut_line[UT_LINESIZE]; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+ char ut_user[UT_NAMESIZE]; /* Username. */
+ char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+/* The ut_session and ut_tv fields must be the same size when compiled
+ 32- and 64-bit. This allows data files and shared memory to be
+ shared between 32- and 64-bit applications. */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ int32_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ int32_t tv_sec; /* Seconds. */
+ int32_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
+#else
+ long int ut_session; /* Session ID, used for windowing. */
+ struct timeval ut_tv; /* Time entry was made. */
+#endif
+
+ int32_t ut_addr_v6[4]; /* Internet address of remote host. */
+ char __unused[20]; /* Reserved for future use. */
+};
+
+/* Backwards compatibility hacks. */
+#define ut_name ut_user
+#ifndef _NO_UT_TIME
+/* We have a problem here: `ut_time' is also used otherwise. Define
+ _NO_UT_TIME if the compiler complains. */
+# define ut_time ut_tv.tv_sec
+#endif
+#define ut_xtime ut_tv.tv_sec
+#define ut_addr ut_addr_v6[0]
+
+
+/* Values for the `ut_type' field of a `struct utmp'. */
+#define EMPTY 0 /* No valid user accounting information. */
+
+#define RUN_LVL 1 /* The system's runlevel. */
+#define BOOT_TIME 2 /* Time of system boot. */
+#define NEW_TIME 3 /* Time after system clock changed. */
+#define OLD_TIME 4 /* Time when system clock changed. */
+
+#define INIT_PROCESS 5 /* Process spawned by the init process. */
+#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
+#define USER_PROCESS 7 /* Normal process. */
+#define DEAD_PROCESS 8 /* Terminated process. */
+
+#define ACCOUNTING 9
+
+/* Old Linux name for the EMPTY type. */
+#define UT_UNKNOWN EMPTY
+
+
+/* Tell the user that we have a modern system with UT_HOST, UT_PID,
+ UT_TYPE, UT_ID and UT_TV fields. */
+#define _HAVE_UT_TYPE 1
+#define _HAVE_UT_PID 1
+#define _HAVE_UT_ID 1
+#define _HAVE_UT_TV 1
+#define _HAVE_UT_HOST 1
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmpx.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmpx.h
new file mode 100644
index 0000000000..8ddd42973e
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utmpx.h
@@ -0,0 +1,126 @@
+/* Structures and definitions for the user accounting database. GNU version.
+ Copyright (C) 1997, 1998, 2000, 2001, 2002 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _UTMPX_H
+# error "Never include <bits/utmpx.h> directly; use <utmpx.h> instead."
+#endif
+
+#include <bits/types.h>
+#include <sys/time.h>
+#include <bits/wordsize.h>
+
+
+#define _UTMPX_FILE "/var/run/utmp"
+#define _WTMPX_FILE "/var/log/wtmp"
+#ifdef __USE_MISC
+# include <paths.h>
+# define _PATH_UTMPX _PATH_UTMP
+# define _PATH_WTMPX _PATH_WTMP
+#endif
+
+
+#define __UT_LINESIZE 32
+#define __UT_NAMESIZE 32
+#define __UT_HOSTSIZE 256
+
+
+/* The structure describing the status of a terminated process. This
+ type is used in `struct utmpx' below. */
+struct __exit_status
+ {
+#ifdef __USE_MISC
+ short int e_termination; /* Process termination status. */
+ short int e_exit; /* Process exit status. */
+#else
+ short int __e_termination; /* Process termination status. */
+ short int __e_exit; /* Process exit status. */
+#endif
+ };
+
+
+/* The structure describing an entry in the user accounting database. */
+struct utmpx
+{
+ short int ut_type; /* Type of login. */
+ __pid_t ut_pid; /* Process ID of login process. */
+ char ut_line[__UT_LINESIZE]; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+ char ut_user[__UT_NAMESIZE]; /* Username. */
+ char ut_host[__UT_HOSTSIZE]; /* Hostname for remote login. */
+ struct __exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+
+/* The fields ut_session and ut_tv must be the same size when compiled
+ 32- and 64-bit. This allows files and shared memory to be shared
+ between 32- and 64-bit applications. */
+#if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
+ __int32_t ut_session; /* Session ID, used for windowing. */
+ struct
+ {
+ __int32_t tv_sec; /* Seconds. */
+ __int32_t tv_usec; /* Microseconds. */
+ } ut_tv; /* Time entry was made. */
+#else
+ long int ut_session; /* Session ID, used for windowing. */
+ struct timeval ut_tv; /* Time entry was made. */
+#endif
+ __int32_t ut_addr_v6[4]; /* Internet address of remote host. */
+ char __unused[20]; /* Reserved for future use. */
+};
+
+/* Backwards compatibility hacks. */
+#define ut_name ut_user
+#ifndef _NO_UT_TIME
+/* We have a problem here: `ut_time' is also used otherwise. Define
+ _NO_UT_TIME if the compiler complains. */
+# define ut_time ut_tv.tv_sec
+#endif
+#define ut_xtime ut_tv.tv_sec
+#define ut_addr ut_addr_v6[0]
+
+
+/* Values for the `ut_type' field of a `struct utmpx'. */
+#define EMPTY 0 /* No valid user accounting information. */
+
+#ifdef __USE_MISC
+# define RUN_LVL 1 /* The system's runlevel. */
+#endif
+#define BOOT_TIME 2 /* Time of system boot. */
+#define NEW_TIME 3 /* Time after system clock changed. */
+#define OLD_TIME 4 /* Time when system clock changed. */
+
+#define INIT_PROCESS 5 /* Process spawned by the init process. */
+#define LOGIN_PROCESS 6 /* Session leader of a logged in user. */
+#define USER_PROCESS 7 /* Normal process. */
+#define DEAD_PROCESS 8 /* Terminated process. */
+
+#ifdef __USE_MISC
+# define ACCOUNTING 9 /* System accounting. */
+# define DOWN_TIME 10
+# define UTMAXTYPE DOWN_TIME
+#endif
+
+#ifdef __USE_MISC
+# define RUNLVL_MSG "run-level %c"
+# define BOOT_MSG "system boot"
+# define OTIME_MSG "old time"
+# define NTIME_MSG "new time"
+# define PSRADM_MSG "%03d %s"
+# define DOWN_MSG "system down"
+#endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utsname.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utsname.h
new file mode 100644
index 0000000000..8ed5155416
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/utsname.h
@@ -0,0 +1,26 @@
+/* Copyright (C) 1997, 2008 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UTSNAME_H
+# error "Never include <bits/utsname.h> directly; use <sys/utsname.h> instead."
+#endif
+
+/* The size of the character arrays used to hold the information
+ in a `struct utsname'. Enlarge this as necessary. */
+#define _UTSNAME_LENGTH 257
+#define _SYS_NMLN _UTSNAME_LENGTH
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitflags.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitflags.h
new file mode 100644
index 0000000000..0106e129d6
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitflags.h
@@ -0,0 +1,35 @@
+/* Definitions of flag bits for `waitpid' et al.
+ Copyright (C) 1992, 1996-1997, 2000, 2002, 2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Bits in the third argument to `waitpid'. */
+#define WNOHANG 0x40 /* Don't block waiting. */
+#define WUNTRACED 0x04 /* Report status of stopped children. */
+
+/* Bits in the fourth argument to `waitid'. */
+#define WSTOPPED WUNTRACED /* Report stopped child (same as WUNTRACED). */
+#define WCONTINUED 0x08 /* Report continued child. */
+#define WNOWAIT 0x80 /* Don't reap, just poll status. */
+#define WEXITED 0x01 /* Report dead child. */
+#define WTRAPPED 0x02 /* Report processes stopped while tracing */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitstatus.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitstatus.h
new file mode 100644
index 0000000000..237b0ba3be
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/waitstatus.h
@@ -0,0 +1,116 @@
+/* Definitions of status bits for `wait' et al.
+ Copyright (C) 1992,1994,1996,1997,2000,2004,2008
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if !defined _SYS_WAIT_H && !defined _STDLIB_H
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Everything extant so far uses these same bits. */
+
+
+/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */
+#define __WEXITSTATUS(status) (((status) >> 8) & 0xff)
+
+/* If WIFSIGNALED(STATUS), the terminating signal. */
+#define __WTERMSIG(status) ((status) & 0x7f)
+
+/* If WIFSTOPPED(STATUS), the signal that stopped the child. */
+#define __WSTOPSIG(status) __WEXITSTATUS(status)
+
+/* Nonzero if STATUS indicates normal termination. */
+#define __WIFEXITED(status) (((status) & 0xff) == 0)
+
+/* Nonzero if STATUS indicates termination by a signal. */
+#define __WIFSIGNALED(status) \
+ (((int)((status) & 0xff) > 0) && (((status) & 0xff00) == 0))
+
+/* Nonzero if STATUS indicates the child is stopped. */
+#define __WIFSTOPPED(status) \
+ ((((status) & 0xff) == 0x7f) && (((status) & 0xff00) != 0))
+
+/* Nonzero if STATUS indicates the child continued after a stop. We only
+ define this if <bits/waitflags.h> provides the WCONTINUED flag bit. */
+#ifdef WCONTINUED
+# define __WIFCONTINUED(status) (((status) & __W_CONTINUED) == __W_CONTINUED)
+#endif
+
+/* Nonzero if STATUS indicates the child dumped core. */
+#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
+
+/* Macros for constructing status values. */
+#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#define __W_CONTINUED 0xffff
+#define __WCOREFLAG 0x80
+
+#ifdef __USE_BSD
+
+#define WSTOPFLG 0x7f
+#define WCONTFLG __W_CONTINUED
+#define WCOREFLG __WCOREFLAG
+#define WSIGMASK 0x7f
+
+#define WLOBYTE(stat) (((status) & 0xff))
+#define WHIBYTE(stat) ((((status) >> 8) & 0xff))
+#define WWORD(stat) (((status)) & 0xffff)
+
+# include <endian.h>
+
+union wait
+ {
+ int w_status;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_termsig:7; /* Terminating signal. */
+ unsigned int __w_coredump:1; /* Set if dumped core. */
+ unsigned int __w_retcode:8; /* Return code if exited normally. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_retcode:8;
+ unsigned int __w_coredump:1;
+ unsigned int __w_termsig:7;
+# endif /* Big endian. */
+ } __wait_terminated;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+# endif /* Big endian. */
+ } __wait_stopped;
+ };
+
+# define w_termsig __wait_terminated.__w_termsig
+# define w_coredump __wait_terminated.__w_coredump
+# define w_retcode __wait_terminated.__w_retcode
+# define w_stopsig __wait_stopped.__w_stopsig
+# define w_stopval __wait_stopped.__w_stopval
+
+#endif /* Use BSD. */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/xtitypes.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/xtitypes.h
new file mode 100644
index 0000000000..4d0ce1de3a
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/xtitypes.h
@@ -0,0 +1 @@
+#include <bits/types.h>