summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys')
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acct.h62
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acctctl.h155
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acl.h207
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/atomic.h74
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/auxv.h53
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/byteorder.h47
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/corectl.h76
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/dirent.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/door.h143
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/elf.h77
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/exacct.h134
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fault.h42
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/feature_tests.h79
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fork.h36
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fsid.h29
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fstyp.h36
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/instance.h34
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/int_types.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/inttypes.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ioccom.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/klog.h34
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/link.h45
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/loadavg.h31
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machelf.h88
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machtypes.h25
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mkdev.h47
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mntio.h52
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mnttab.h82
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mount.h69
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/old_procfs.h339
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/param.h139
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port.h77
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port_impl.h40
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priocntl.h119
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv.h115
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv_names.h101
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/processor.h83
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procfs.h487
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procset.h79
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/pset.h67
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ptms.h37
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl.h93
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl_impl.h52
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reboot.h52
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reg.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sendfile.h91
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sid.h28
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/siginfo.h25
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sockio.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/swap.h78
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/syscall.h301
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysconfig.h66
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysmacros.h107
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/systeminfo.h53
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/task.h44
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/termio.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/time_impl.h1
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/timex.h155
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tsol/label.h44
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttold.h35
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tty.h25
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttydefaults.h101
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/types32.h66
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/uadmin.h65
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ucontext.h65
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utime.h37
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utssys.h81
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/vfstab.h58
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/wait.h172
-rw-r--r--sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/zone.h166
70 files changed, 5508 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acct.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acct.h
new file mode 100644
index 0000000000..32fef42905
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acct.h
@@ -0,0 +1,62 @@
+/* Declarations of privilege functions and types.
+ 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_ACCT_H
+#define _SYS_ACCT_H
+
+#include <features.h>
+#include <sys/types.h>
+#include <sys/types32.h>
+
+#define AFORK 0001
+#define ASU 0002
+#ifdef SUN_SRC_COMPAT
+# define ACOMPAT 0004
+# define ACORE 0010
+# define AXSIG 0020
+#endif
+#define AEXPND 0040
+#define ACCTF 0300
+
+typedef unsigned short comp_t;
+
+struct acct
+ {
+ char ac_flag;
+ char ac_stat;
+ uid32_t ac_uid;
+ gid32_t ac_gid;
+ dev32_t ac_tty;
+ time32_t ac_btime;
+ comp_t ac_utime;
+ comp_t ac_stime;
+ comp_t ac_etime;
+ comp_t ac_mem;
+ comp_t ac_io;
+ comp_t ac_rw;
+ char ac_comm[8];
+};
+
+__BEGIN_DECLS
+
+extern int acct (const char *);
+
+__END_DECLS
+
+#endif /* _SYS_ACCT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acctctl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acctctl.h
new file mode 100644
index 0000000000..f3664c156d
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acctctl.h
@@ -0,0 +1,155 @@
+/* Declarations of acctlctl function and types.
+ 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_ACCTCTL_H
+#define _SYS_ACCTCTL_H
+
+#include <sys/types.h>
+#include <features.h>
+
+#define AC_PROC (0x1 << 28)
+#define AC_TASK (0x2 << 28)
+#define AC_FLOW (0x4 << 28)
+#define AC_MODE(x) ((x) & 0xf0000000)
+
+#define AC_FILE_SET 0x01
+#define AC_FILE_GET 0x02
+#define AC_RES_SET 0x04
+#define AC_RES_GET 0x08
+#define AC_STATE_SET 0x10
+#define AC_STATE_GET 0x20
+#define AC_OPTION(x) ((x) & 0x0fffffff)
+
+enum
+ {
+ AC_NONE = 0,
+#define AC_NONE AC_NONE
+ AC_PROC_PID = 1,
+#define AC_PROC_PID AC_PROC_PID
+ AC_PROC_UID = 2,
+#define AC_PROC_UID AC_PROC_UID
+ AC_PROC_GID = 3,
+#define AC_PROC_GID AC_PROC_GID
+ AC_PROC_PROJID = 4,
+#define AC_PROC_PROJID AC_PROC_PROJID
+ AC_PROC_TASKID = 5,
+#define AC_PROC_TASKID AC_PROC_TASKID
+ AC_PROC_CPU = 6,
+#define AC_PROC_CPU AC_PROC_CPU
+ AC_PROC_TIME = 7,
+#define AC_PROC_TIME AC_PROC_TIME
+ AC_PROC_COMMAND = 8,
+#define AC_PROC_COMMAND AC_PROC_COMMAND
+ AC_PROC_TTY = 9,
+#define AC_PROC_TTY AC_PROC_TTY
+ AC_PROC_HOSTNAME = 10,
+#define AC_PROC_HOSTNAME AC_PROC_HOSTNAME
+ AC_PROC_MICROSTATE = 11,
+#define AC_PROC_MICROSTATE AC_PROC_MICROSTATE
+ AC_PROC_FLAG = 12,
+#define AC_PROC_FLAG AC_PROC_FLAG
+ AC_PROC_ANCPID = 13,
+#define AC_PROC_ANCPID AC_PROC_ANCPID
+ AC_PROC_WAIT_STATUS = 14,
+#define AC_PROC_WAIT_STATUS AC_PROC_WAIT_STATUS
+ AC_PROC_ZONENAME = 15,
+#define AC_PROC_ZONENAME AC_PROC_ZONENAME
+ AC_PROC_MEM = 16,
+#define AC_PROC_MEM AC_PROC_MEM
+ AC_PROC_MAX_RES = 17
+#define AC_PROC_MAX_RES AC_PROC_MAX_RES
+ };
+
+enum
+ {
+ AC_TASK_TASKID = 1,
+#define AC_TASK_TASKID AC_TASK_TASKID
+ AC_TASK_PROJID = 2,
+#define AC_TASK_PROJID AC_TASK_PROJID
+ AC_TASK_CPU = 3,
+#define AC_TASK_CPU AC_TASK_CPU
+ AC_TASK_TIME = 4,
+#define AC_TASK_TIME AC_TASK_TIME
+ AC_TASK_HOSTNAME = 5,
+#define AC_TASK_HOSTNAME AC_TASK_HOSTNAME
+ AC_TASK_MICROSTATE = 6,
+#define AC_TASK_MICROSTATE AC_TASK_MICROSTATE
+ AC_TASK_ANCTASKID = 7,
+#define AC_TASK_ANCTASKID AC_TASK_ANCTASKID
+ AC_TASK_ZONENAME = 8
+#define AC_TASK_ZONENAME AC_TASK_ZONENAME
+#define A_TASK_MAX_RES AC_TASK_ZONENAME
+ };
+
+enum
+ {
+ AC_FLOW_SADDR = 1,
+#define AC_FLOW_SADDR AC_FLOW_SADDR
+ AC_FLOW_DADDR = 2,
+#define AC_FLOW_DADDR AC_FLOW_DADDR
+ AC_FLOW_SPORT = 3,
+#define AC_FLOW_SPORT AC_FLOW_DPORT
+ AC_FLOW_DPORT = 4,
+#define AC_FLOW_DPORT AC_FLOW_DPORT
+ AC_FLOW_PROTOCOL = 5,
+#define AC_FLOW_PROTOCOL AC_FLOW_PROTOCOL
+ AC_FLOW_DSFIELD = 6,
+#define AC_FLOW_DSFIELD AC_FLOW_DSFIELD
+ AC_FLOW_CTIME = 7,
+#define AC_FLOW_CTIME AC_FLOW_CTIME
+ AC_FLOW_LSEEN = 8,
+#define AC_FLOW_LSEEN AC_FLOW_LSEEN
+ AC_FLOW_NBYTES = 9,
+#define AC_FLOW_NBYTES AC_FLOW_NBYTES
+ AC_FLOW_NPKTS = 10,
+#define AC_FLOW_NPKTS AC_FLOW_NPKTS
+ AC_FLOW_PROJID = 11,
+#define AC_FLOW_PROJID AC_FLOW_PROJID
+ AC_FLOW_UID = 12,
+#define AC_FLOW_UID AC_FLOW_UID
+ AC_FLOW_ANAME = 13
+#define AC_FLOW_ANAME AC_FLOW_ANAME
+#define AC_FLOW_MAX_RES AC_FLOW_ANAME
+ };
+
+#define AC_MAX_RES_TMP MAX (AC_PROC_MAX_RES, AC_TASK_MAX_RES)
+#define AC_MAX_RES MAX (AC_MAX_RES_TMP, AC_FLOW_MAX_RES)
+#define AC_MASK_SZ BT_BITOUL (AC_MAX_RES + 1)
+
+enum
+ {
+ AC_OFF = 0,
+#define AC_OFF AC_OFF
+ AC_ON = 1
+#define AC_ON AC_ON
+ };
+
+typedef struct ac_res
+ {
+ int ar_id;
+ int ar_state;
+ } ac_res_t;
+
+__BEGIN_DECLS
+
+extern int acctctl (int, void *, size_t);
+
+__END_DECLS
+
+#endif /* _SYS_ACCTCTL_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acl.h
new file mode 100644
index 0000000000..5087dece60
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/acl.h
@@ -0,0 +1,207 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_ACL_H
+#define _SYS_ACL_H
+
+#include <features.h>
+#include <sys/types.h>
+
+#define ACL_IS_TRIVIAL 0x10000
+#define ACL_IS_DIR 0x20000
+
+typedef enum acl_type
+ {
+ ACLENT_T = 0,
+ ACE_T = 1
+ } acl_type_t;
+
+struct acl_info
+ {
+ acl_type_t acl_type;
+ int acl_cnt;
+ int acl_entry_size;
+ int acl_flags;
+ void *acl_aclp;
+ };
+
+/* cmd values. */
+#define GETACL 1
+#define SETACL 2
+#define GETACLCNT 3
+#define ACE_GETACL 4
+#define ACE_SETACL 5
+#define ACE_GETACLCNT 6
+
+/* Used by UFS. */
+typedef struct acl
+{
+ int a_type;
+ unsigned int a_id;
+ o_mode_t a_perm;
+} aclent_t;
+
+/* Used by ZFS and NFSv4. */
+typedef struct ace {
+ unsigned int a_who;
+ uint32_t a_access_mask;
+ uint16_t a_flags;
+ uint16_t a_type;
+} ace_t;
+
+typedef struct acl_info acl_t;
+
+#define MIN_ACL_ENTRIES 4
+#define MAX_ACL_ENTRIES 1024
+
+/* aclent_t a_type values. */
+#define USER_OBJ 0x01
+#define USER 0x02
+#define GROUP_OBJ 0x04
+#define GROUP 0x08
+#define CLASS_OBJ 0x10
+#define OTHER_OBJ 0x20
+#define ACL_DEFAULT 0x1000
+#define DEF_USER_OBJ (ACL_DEFAULT | USER_OBJ)
+#define DEF_USER (ACL_DEFAULT | USER)
+#define DEF_GROUP_OBJ (ACL_DEFAULT | GROUP_OBJ)
+#define DEF_GROUP (ACL_DEFAULT | GROUP)
+#define DEF_CLASS_OBJ (ACL_DEFAULT | CLASS_OBJ)
+#define DEF_OTHER_OBJ (ACL_DEFAULT | OTHER_OBJ)
+
+/* ace_t a_access_mask values. */
+#define ACE_READ_DATA 0x00000001
+#define ACE_LIST_DIRECTORY 0x00000001
+#define ACE_WRITE_DATA 0x00000002
+#define ACE_ADD_FILE 0x00000002
+#define ACE_APPEND_DATA 0x00000004
+#define ACE_ADD_SUBDIRECTORY 0x00000004
+#define ACE_READ_NAMED_ATTRS 0x00000008
+#define ACE_WRITE_NAMED_ATTRS 0x00000010
+#define ACE_EXECUTE 0x00000020
+#define ACE_DELETE_CHILD 0x00000040
+#define ACE_READ_ATTRIBUTES 0x00000080
+#define ACE_WRITE_ATTRIBUTES 0x00000100
+#define ACE_DELETE 0x00010000
+#define ACE_READ_ACL 0x00020000
+#define ACE_WRITE_ACL 0x00040000
+#define ACE_WRITE_OWNER 0x00080000
+#define ACE_SYNCHRONIZE 0x00100000
+#define ACE_ALL_PERMS (ACE_READ_DATA | ACE_LIST_DIRECTORY | \
+ ACE_WRITE_DATA | ACE_ADD_FILE | ACE_APPEND_DATA | \
+ ACE_ADD_SUBDIRECTORY | ACE_READ_NAMED_ATTRS | ACE_WRITE_NAMED_ATTRS | \
+ ACE_EXECUTE | ACE_DELETE_CHILD | ACE_READ_ATTRIBUTES | \
+ ACE_WRITE_ATTRIBUTES | ACE_DELETE | ACE_READ_ACL | ACE_WRITE_ACL | \
+ ACE_WRITE_OWNER | ACE_SYNCHRONIZE)
+#define ACE_READ_PERMS (ACE_READ_DATA | ACE_READ_ACL | ACE_READ_ATTRIBUTES | \
+ ACE_READ_NAMED_ATTRS)
+#define ACE_WRITE_PERMS (ACE_WRITE_DATA | ACE_APPEND_DATA | \
+ ACE_WRITE_ATTRIBUTES | ACE_WRITE_NAMED_ATTRS)
+#define ACE_MODIFY_PERMS (ACE_READ_DATA | ACE_LIST_DIRECTORY | \
+ ACE_WRITE_DATA | ACE_ADD_FILE | ACE_APPEND_DATA | \
+ ACE_ADD_SUBDIRECTORY | ACE_READ_NAMED_ATTRS | ACE_WRITE_NAMED_ATTRS | \
+ ACE_EXECUTE | ACE_DELETE_CHILD | ACE_READ_ATTRIBUTES | \
+ ACE_WRITE_ATTRIBUTES | ACE_DELETE | ACE_READ_ACL | ACE_SYNCHRONIZE)
+
+/* ace_t a_flags values. */
+#define ACE_FILE_INHERIT_ACE 0x0001
+#define ACE_DIRECTORY_INHERIT_ACE 0x0002
+#define ACE_NO_PROPAGATE_INHERIT_ACE 0x0004
+#define ACE_INHERIT_ONLY_ACE 0x0008
+#define ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x0010
+#define ACE_FAILED_ACCESS_ACE_FLAG 0x0020
+#define ACE_IDENTIFIER_GROUP 0x0040
+#define ACE_INHERITED_ACE 0x0080
+#define ACE_OWNER 0x1000
+#define ACE_GROUP 0x2000
+#define ACE_EVERYONE 0x4000
+#define ACE_NFSV4_SUP_FLAGS (ACE_FILE_INHERIT_ACE | \
+ ACE_DIRECTORY_INHERIT_ACE | ACE_NO_PROPAGATE_INHERIT_ACE | \
+ ACE_INHERIT_ONLY_ACE | ACE_IDENTIFIER_GROUP)
+#define ACE_TYPE_FLAGS (ACE_OWNER | ACE_GROUP | ACE_EVERYONE | \
+ ACE_IDENTIFIER_GROUP)
+#define ACE_INHERIT_FLAGS (ACE_FILE_INHERIT_ACE | \
+ ACE_DIRECTORY_INHERIT_ACE | ACE_NO_PROPAGATE_INHERIT_ACE | \
+ ACE_INHERIT_ONLY_ACE)
+
+/* ace_t a_type values. */
+#define ACE_ACCESS_ALLOWED_ACE_TYPE 0
+#define ACE_ACCESS_DENIED_ACE_TYPE 1
+#define ACE_SYSTEM_AUDIT_ACE_TYPE 2
+#define ACE_SYSTEM_ALARM_ACE_TYPE 3
+
+#define ACL_AUTO_INHERIT 0x0001
+#define ACL_PROTECTED 0x0002
+#define ACL_DEFAULTED 0x0004
+#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT | ACL_PROTECTED | \
+ ACL_DEFAULTED)
+
+#define UFSD_FREE '0'
+#define UFSD_ACL '1'
+#define UFSD_DFACL '2'
+#define ACE_ACL '3'
+
+#define ACL_NO_TRIVIAL 0x2
+
+#define ACL_APPEND_ID 0x01
+#define ACL_COMPACT_FMT 0x02
+#define ACL_NORESOLVE 0x04
+#define ACL_SID_FMT 0x08
+
+#define GRP_ERROR 1
+#define USER_ERROR 2
+#define OTHER_ERROR 3
+#define CLASS_ERROR 4
+#define DUPLICATE_ERROR 5
+#define MISS_ERROR 6
+#define MEM_ERROR 7
+#define ENTRY_ERROR 8
+
+#define EACL_GRP_ERROR GRP_ERROR
+#define EACL_USER_ERROR USER_ERROR
+#define EACL_OTHER_ERROR OTHER_ERROR
+#define EACL_CLASS_ERROR CLASS_ERROR
+#define EACL_DUPLICATE_ERROR DUPLICATE_ERROR
+#define EACL_MISS_ERROR MISS_ERROR
+#define EACL_MEM_ERROR MEM_ERROR
+#define EACL_ENTRY_ERROR ENTRY_ERROR
+#define EACL_INHERIT_ERROR 9
+#define EACL_FLAGS_ERROR 10
+#define EACL_PERM_MASK_ERROR 11
+#define EACL_COUNT_ERROR 12
+#define EACL_INVALID_SLOT 13
+#define EACL_NO_ACL_ENTRY 14
+#define EACL_DIFF_TYPE 15
+#define EACL_INVALID_USER_GROUP 16
+#define EACL_INVALID_STR 17
+#define EACL_FIELD_NOT_BLANK 18
+#define EACL_INVALID_ACCESS_TYPE 19
+#define EACL_UNKNOWN_DATA 20
+#define EACL_MISSING_FIELDS 21
+#define EACL_INHERIT_NOTDIR 22
+
+__BEGIN_DECLS
+
+extern int acl(char *__pathp, int __cmd, int __nentries, void *__aclbufp);
+
+extern int facl(int __fildes, int __cmd, int __nentries, void *__aclbufp);
+
+__END_DECLS
+
+#endif /* _SYS_ACL_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/atomic.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/atomic.h
new file mode 100644
index 0000000000..86ca630192
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/atomic.h
@@ -0,0 +1,74 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_ATOMIC_H
+#define _SYS_ATOMIC_H
+
+#include <features.h>
+#include <sys/types.h>
+#include <stdint.h>
+
+__BEGIN_DECLS
+
+extern void membar_enter (void);
+extern void membar_exit (void);
+extern void membar_producer (void);
+extern void membar_consumer (void);
+
+extern void atomic_add_8 (volatile uint8_t *, int8_t);
+extern void atomic_add_char (volatile unsigned char *, signed char);
+extern void atomic_add_16 (volatile uint16_t *, int16_t);
+extern void atomic_add_short (volatile unsigned short *, short);
+extern void atomic_add_32 (volatile uint32_t *, int32_t);
+extern void atomic_add_int (volatile unsigned int *, int);
+extern void atomic_add_long (volatile unsigned long *, long);
+extern void atomic_add_64 (volatile uint64_t *, int64_t);
+extern void atomic_add_ptr (volatile void *, ssize_t);
+
+extern uint8_t atomic_add_8_nv (volatile uint8_t *, int8_t);
+extern unsigned char atomic_add_char_nv (volatile unsigned char *, signed char);
+extern uint16_t atomic_add_16_nv (volatile uint16_t *, int16_t);
+extern unsigned short atomic_add_short_nv (volatile unsigned short *, short);
+extern uint32_t atomic_add_32_nv (volatile uint32_t *, int32_t);
+extern unsigned int atomic_add_int_nv (volatile unsigned int *, int);
+extern unsigned long atomic_add_long_nv (volatile unsigned long *, long);
+extern uint64_t atomic_add_64_nv (volatile uint64_t *, int64_t);
+extern void * atomic_add_ptr_nv (volatile void *, ssize_t);
+
+extern void atomic_dec_8 (volatile uint8_t *target);
+extern void atomic_dec_uchar (volatile unsigned char *target);
+extern void atomic_dec_16 (volatile uint16_t *target);
+extern void atomic_dec_ushort (volatile unsigned short *target);
+extern void atomic_dec_32 (volatile uint32_t *target);
+extern void atomic_dec_uint (volatile unsigned int *target);
+extern void atomic_dec_ulong (volatile unsigned long *target);
+extern void atomic_dec_64 (volatile uint64_t *target);
+
+extern uint8_t atomic_dec_8_nv (volatile uint8_t *target);
+extern unsigned char atomic_dec_uchar_nv (volatile unsigned char *target);
+extern uint16_t atomic_dec_16_nv (volatile uint16_t *target);
+extern unsigned short atomic_dec_ushort_nv (volatile unsigned short *target);
+extern uint32_t atomic_dec_32_nv (volatile uint32_t *target);
+extern unsigned int atomic_dec_uint_nv (volatile unsigned int *target);
+extern unsigned long atomic_dec_ulong_nv (volatile unsigned long *target);
+extern uint64_t atomic_dec_64_nv (volatile uint64_t *target);
+
+__END_DECLS
+
+#endif /* _SYS_ATOMIC_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/auxv.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/auxv.h
new file mode 100644
index 0000000000..6d3b7fa3c0
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/auxv.h
@@ -0,0 +1,53 @@
+/* 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_AUXV_H
+#define _SYS_AUXV_H
+
+#ifndef __ASSEMBLER__
+typedef struct
+ {
+ int a_type;
+ union
+ {
+ long a_val;
+ void *a_ptr;
+ void (*a_fcn)(void);
+ } a_un;
+ } auxv_t;
+#endif
+
+#define AT_SUN_IFLUSH 2010
+#define AT_SUN_CPU 2011
+
+#define AT_SUN_EXECNAME 2014
+#define AT_SUN_MMU 2015
+#define AT_SUN_LDDATA 2016
+#define AT_SUN_AUXFLAGS 2017
+#define AT_SUN_EMULATOR 2018
+#define AT_SUN_BRANDNAME 2019
+#define AT_SUN_BRAND_AUX1 2020
+#define AT_SUN_BRAND_AUX2 2021
+#define AT_SUN_BRAND_AUX3 2022
+
+/* Passed in AT_SUN_AUXFLAGS. */
+#define AF_SUN_SETUGID 0x01
+#define AF_SUN_HWCAPVERIFY 0x02
+#define AF_SUN_NOPLM 0x04
+
+#endif /* _SYS_AUXV_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/byteorder.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/byteorder.h
new file mode 100644
index 0000000000..9db7b75806
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/byteorder.h
@@ -0,0 +1,47 @@
+/* Declarations of zone functions and types.
+ Copyright (C) 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_BYTEORDER_H
+#define _SYS_BYTEORDER_H
+
+#include <byteswap.h>
+#include <features.h>
+#include <sys/types.h>
+
+#define BSWAP_8(x) __bswap_8(x)
+#define BSWAP_16(x) __bswap_16(x)
+#define BSWAP_32(x) __bswap_32(x)
+#define BSWAP_64(x) __bswap_64(x)
+
+extern uint64_t htonll (uint64_t __hostlonglong)
+ __THROW __attribute__ ((__const__));
+extern uint64_t ntohll (uint64_t __netlonglong)
+ __THROW __attribute__ ((__const__));
+
+#ifdef __OPTIMIZE__
+# if __BYTE_ORDER == __BIG_ENDIAN
+# define ntohll(x) (x)
+# else
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define ntohll(x) __bswap_64 (x)
+# endif
+# endif
+#endif
+
+#endif /* _SYS_BYTEORDER_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/corectl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/corectl.h
new file mode 100644
index 0000000000..0b00da4070
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/corectl.h
@@ -0,0 +1,76 @@
+/* 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_CORECTL_H
+#define _SYS_CORECTL_H
+
+#include <sys/types.h>
+#include <features.h>
+
+typedef unsigned long long core_content_t;
+
+/* Options. */
+#define CC_GLOBAL_PATH 0x01
+#define CC_PROCESS_PATH 0x02
+#define CC_GLOBAL_SETID 0x04
+#define CC_PROCESS_SETID 0x08
+#define CC_GLOBAL_LOG 0x10
+
+/* core_content_t values. */
+#define CC_CONTENT_STACK 0x0001ULL
+#define CC_CONTENT_HEAP 0x0002ULL
+#define CC_CONTENT_SHFILE 0x0004ULL
+#define CC_CONTENT_SHANON 0x0008ULL
+#define CC_CONTENT_TEXT 0x0010ULL
+#define CC_CONTENT_DATA 0x0020ULL
+#define CC_CONTENT_RODATA 0x0040ULL
+#define CC_CONTENT_ANON 0x0080ULL
+#define CC_CONTENT_SHM 0x0100ULL
+#define CC_CONTENT_ISM 0x0200ULL
+#define CC_CONTENT_DISM 0x0400ULL
+#define CC_CONTENT_CTF 0x0800ULL
+#define CC_CONTENT_SYMTAB 0x1000ULL
+#define CC_CONTENT_ALL 0x1FFFULL
+#define CC_CONTENT_NONE 0x0000ULL
+#define CC_CONTENT_DEFAULT \
+ (CC_CONTENT_STACK | CC_CONTENT_HEAP | CC_CONTENT_ISM | \
+ CC_CONTENT_DISM | CC_CONTENT_SHM | CC_CONTENT_SHANON | \
+ CC_CONTENT_TEXT | CC_CONTENT_DATA | CC_CONTENT_RODATA | \
+ CC_CONTENT_ANON | CC_CONTENT_CTF)
+#define CC_CONTENT_INVALID (-1ULL)
+
+__BEGIN_DECLS
+
+extern int core_set_options (int);
+extern int core_get_options (void);
+extern int core_set_global_path (const char *, size_t);
+extern int core_get_global_path (char *, size_t);
+extern int core_set_default_path (const char *, size_t);
+extern int core_get_default_path (char *, size_t);
+extern int core_set_process_path (const char *, size_t, pid_t);
+extern int core_get_process_path (char *, size_t, pid_t);
+extern int core_set_global_content (const core_content_t *);
+extern int core_get_global_content (core_content_t *);
+extern int core_set_default_content (const core_content_t *);
+extern int core_get_default_content (core_content_t *);
+extern int core_set_process_content (const core_content_t *, pid_t);
+extern int core_get_process_content (core_content_t *, pid_t);
+
+__END_DECLS
+
+#endif /* _SYS_CORECTL_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/dirent.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/dirent.h
new file mode 100644
index 0000000000..d66bbdf7b6
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/dirent.h
@@ -0,0 +1 @@
+#include <dirent.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/door.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/door.h
new file mode 100644
index 0000000000..7673293bc7
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/door.h
@@ -0,0 +1,143 @@
+/* Declarations of privilege functions and types.
+ 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_DOOR_H
+#define _SYS_DOOR_H
+
+#include <sys/types.h>
+#include <sys/isa_defs.h>
+
+#define DOOR_CREATE 0
+#define DOOR_REVOKE 1
+#define DOOR_INFO 2
+#define DOOR_CALL 3
+#define DOOR_BIND 6
+#define DOOR_UNBIND 7
+#define DOOR_UNREFSYS 8
+#define DOOR_UCRED 9
+#define DOOR_RETURN 10
+#define DOOR_GETPARAM 11
+#define DOOR_SETPARAM 12
+
+#define DOOR_INVAL -1
+#define DOOR_UNREF_DATA ((void *)1)
+
+#define DOOR_QUERY -2
+
+#define DOOR_UNREF 0x01
+#define DOOR_PRIVATE 0x02
+#define DOOR_UNREF_MULTI 0x10
+#define DOOR_REFUSE_DESC 0x40
+#define DOOR_NO_CANCEL 0x80
+
+#define DOOR_LOCAL 0x04
+#define DOOR_REVOKED 0x08
+#define DOOR_IS_UNREF 0x20
+
+#define DOOR_CREATE_MASK (DOOR_UNREF | DOOR_PRIVATE | \
+ DOOR_UNREF_MULTI | DOOR_REFUSE_DESC | DOOR_NO_CANCEL)
+#define DOOR_KI_CREATE_MASK (DOOR_UNREF | DOOR_UNREF_MULTI)
+
+#define DOOR_ATTR_MASK (DOOR_CREATE_MASK | DOOR_LOCAL | DOOR_REVOKED | \
+ DOOR_IS_UNREF)
+
+#define DOOR_DESCRIPTOR 0x10000
+#define DOOR_RELEASE 0x40000
+#define DOOR_DELAY 0x80000
+#define DOOR_UNREF_ACTIVE 0x100000
+
+#define DOOR_PARAM_DESC_MAX 1
+#define DOOR_PARAM_DATA_MAX 2
+#define DOOR_PARAM_DATA_MIN 3
+
+typedef unsigned long long door_ptr_t;
+typedef unsigned int door_attr_t;
+typedef unsigned long long door_id_t;
+
+#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
+# pragma pack(4)
+#endif
+
+typedef struct door_info
+ {
+ pid_t di_target;
+ door_ptr_t di_proc;
+ door_ptr_t di_data;
+ door_attr_t di_attributes;
+ door_id_t di_uniquifier;
+ int di_resv[4];
+ } door_info_t;
+
+typedef struct door_desc
+ {
+ door_attr_t d_attributes;
+ union
+ {
+ struct
+ {
+ int d_descriptor;
+ door_id_t d_id;
+ } d_desc;
+ int d_resv[5];
+ } d_data;
+} door_desc_t;
+
+#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
+# pragma pack()
+#endif
+
+typedef struct door_cred
+ {
+ uid_t dc_euid;
+ gid_t dc_egid;
+ uid_t dc_ruid;
+ gid_t dc_rgid;
+ pid_t dc_pid;
+ int dc_resv[4];
+ } door_cred_t;
+
+typedef struct door_arg
+ {
+ char *data_ptr;
+ size_t data_size;
+ door_desc_t *desc_ptr;
+ unsigned int desc_num;
+ char *rbuf;
+ size_t rsize;
+ } door_arg_t;
+
+struct door_results
+ {
+ void *cookie;
+ char *data_ptr;
+ size_t data_size;
+ door_desc_t *desc_ptr;
+ size_t desc_num;
+ void (*pc)(void);
+ int nservers;
+ door_info_t *door_info;
+ };
+
+typedef struct door_return_desc
+ {
+ door_desc_t *desc_ptr;
+ unsigned int desc_num;
+ } door_return_desc_t;
+
+#endif /* _SYS_DOOR_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/elf.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/elf.h
new file mode 100644
index 0000000000..d6b6fc9b63
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/elf.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_ELF_H
+#define _SYS_ELF_H
+
+#include <elf.h>
+
+#define PF_SUNW_FAILURE 0x00100000
+
+#define PN_XNUM 0xFFFF
+
+#define SHT_SUNW_symsort 0x6FFFFFF1
+#define SHT_SUNW_tlssort 0x6FFFFFF2
+#define SHT_SUNW_LDYNSYM 0x6FFFFFF3
+#define SHT_SUNW_dof 0x6FFFFFF4
+#define SHT_SUNW_cap 0x6FFFFFF5
+
+/* TODO: these collide with GNU definitions. */
+#if 0
+#define SHT_SUNW_SIGNATURE 0x6FFFFFF6
+#define SHT_SUNW_ANNOTATE 0x6FFFFFF7
+#define SHT_SUNW_DEBUGSTR 0x6FFFFFF8
+#define SHT_SUNW_DEBUG 0x6FFFFFF9
+#endif
+
+#define SHT_SUNW_verdef SHT_GNU_verdef
+#define SHT_SUNW_verneed SHT_GNU_verneed
+#define SHT_SUNW_versym SHT_GNU_versym
+
+typedef struct
+ {
+ Elf32_Word c_tag;
+ union
+ {
+ Elf32_Word c_val;
+ Elf32_Addr c_ptr;
+ } c_un;
+ } Elf32_Cap;
+
+typedef struct
+ {
+ Elf64_Xword c_tag;
+ union
+ {
+ Elf64_Xword c_val;
+ Elf64_Addr c_ptr;
+ } c_un;
+ } Elf64_Cap;
+
+#define EM_AMD64 EM_X86_64
+
+#define STV_EXPORTED 4
+#define STV_SINGLETON 5
+#define STV_ELIMINATE 6
+
+#define SHN_LOSUNW 0xff3f
+#define SHN_SUNW_IGNORE 0xff3f
+#define SHN_HISUNW 0xff3f
+
+#endif /* _SYS_ELF_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/exacct.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/exacct.h
new file mode 100644
index 0000000000..0c1481fd7a
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/exacct.h
@@ -0,0 +1,134 @@
+/* Declarations of privilege functions and types.
+ 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_EXACCT_H
+#define _SYS_EXACCT_H
+
+#include <sys/types.h>
+#include <sys/procset.h>
+#include <sys/task.h>
+#include <sys/proc.h>
+#include <features.h>
+
+#define EXACCT_VERSION 1
+
+#define EUP_ALLOC 0x00
+#define EUP_NOALLOC 0x01
+#define EUP_ALLOC_MASK 0x02
+
+#define EW_PARTIAL 0x01
+#define EW_INTERVAL 0x02
+#define EW_FINAL 0x04
+
+enum
+ {
+ EP_RAW = 0,
+#define EP_RAW EP_RAW
+ EP_EXACCT_OBJECT = 1
+#define EP_EXACCT_OBJECT EP_EXACCT_OBJECT
+ };
+
+enum
+ {
+ EXR_OK = 0,
+#define EXR_OK EXR_OK
+ EXR_SYSCALL_FAIL = 1,
+#define EXR_SYSCALL_FAIL EXR_SYSCALL_FAIL
+ EXR_CORRUPT_FILE = 2,
+#define EXR_CORRUPT_FILE EXR_CORRUPT_FILE
+ EXR_EOF = 3,
+#define EXR_EOF EXR_EOF
+ EXR_NO_CREATOR = 4,
+#define EXR_NO_CREATOR EXR_NO_CREATOR
+ EXR_INVALID_BUF = 5,
+#define EXR_INVALID_BUF EXR_INVALID_BUF
+ EXR_NOTSUPP = 6,
+#define EXR_NOTSUPP EXR_NOTSUPP
+ EXR_UNKN_VERSION = 7,
+#define EXR_UNKN_VERSION EXR_UNKN_VERSION
+ EXR_INVALID_OBJ = 8
+#define EXR_INVALID_OBJ EXR_INVALID_OBJ
+ };
+
+typedef enum
+ {
+ EO_ERROR = -1,
+ EO_NONE = 0,
+ EO_GROUP = 1,
+ EO_ITEM = 2
+ } ea_object_type_t;
+
+#define EXACCT_MAX_BUFSIZE (64 * 1024) /* 64 kb */
+
+typedef uint64_t ea_size_t;
+typedef uint32_t ea_catalog_t;
+
+typedef struct ea_item
+ {
+ union
+ {
+ uint8_t ei_u_uint8;
+ uint16_t ei_u_uint16;
+ uint32_t ei_u_uint32;
+ uint64_t ei_u_uint64;
+ double ei_u_double;
+ char *ei_u_string;
+ void *ei_u_object;
+ void *ei_u_raw;
+ } ei_u;
+ ea_size_t ei_size;
+ } ea_item_t;
+#define ei_uint8 ei_u.ei_u_uint8
+#define ei_uint16 ei_u.ei_u_uint16
+#define ei_uint32 ei_u.ei_u_uint32
+#define ei_uint64 ei_u.ei_u_uint64
+#define ei_double ei_u.ei_u_double
+#define ei_string ei_u.ei_u_string
+#define ei_object ei_u.ei_u_object
+#define ei_raw ei_u.ei_u_raw
+
+typedef struct ea_group
+ {
+ uint32_t eg_nobjs;
+ struct ea_object *eg_objs;
+ } ea_group_t;
+
+typedef struct ea_object
+ {
+ ea_object_type_t eo_type;
+ union
+ {
+ ea_group_t eo_u_group;
+ ea_item_t eo_u_item;
+ } eo_u;
+ struct ea_object *eo_next;
+ ea_catalog_t eo_catalog;
+ } ea_object_t;
+#define eo_group eo_u.eo_u_group
+#define eo_item eo_u.eo_u_item
+
+__BEGIN_DECLS
+
+size_t getacct (idtype_t, id_t, void *, size_t);
+int putacct (idtype_t, id_t, void *, size_t, int);
+int wracct (idtype_t, id_t, int);
+
+__END_DECLS
+
+#endif /* _SYS_EXACCT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fault.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fault.h
new file mode 100644
index 0000000000..8a1f9e00ff
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fault.h
@@ -0,0 +1,42 @@
+/* Declarations of fltset_t.
+ 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_FAULT_H
+#define _SYS_FAULT_H
+
+typedef struct
+{
+ unsigned int word[4];
+} fltset_t;
+
+#define FLTILL 1
+#define FLTPRIV 2
+#define FLTBPT 3
+#define FLTTRACE 4
+#define FLTACCESS 5
+#define FLTBOUNDS 6
+#define FLTIOVF 7
+#define FLTIZDIV 8
+#define FLTFPE 9
+#define FLTSTACK 10
+#define FLTPAGE 11
+#define FLTWATCH 12
+#define FLTCPCOVF 13
+
+#endif /* _SYS_FAULT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/feature_tests.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/feature_tests.h
new file mode 100644
index 0000000000..afaba66a7c
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/feature_tests.h
@@ -0,0 +1,79 @@
+/* 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_FEATURE_TESTS
+#define _SYS_FEATURE_TESTS
+
+/* Let glibc do the rest of most of the work. */
+#include <features.h>
+#include <sys/isa_defs.h>
+
+#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
+# define _POSIX_C_SOURCE 1
+#endif
+
+#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 < 500) && \
+ (_XOPEN_VERSION - 0 < 4) && !defined(_XOPEN_SOURCE_EXTENDED)
+# define _XPG3
+# elif (defined(_XOPEN_SOURCE) && _XOPEN_VERSION - 0 == 4)
+# define _XPG4
+# define _XPG3
+#elif (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 == 1)
+# define _XPG4_2
+# define _XPG4
+# define _XPG3
+#elif (_XOPEN_SOURCE - 0 == 500)
+# define _XPG5
+# define _XPG4_2
+# define _XPG4
+# define _XPG3
+#elif (_XOPEN_SOURCE - 0 == 600)
+# define _XPG6
+# define _XPG5
+# define _XPG4_2
+# define _XPG4
+# define _XPG3
+#endif
+
+/* By default the large-file interfaces are available. */
+#if !defined(_XOPEN_SOURCE) && !defined(__USE_LARGEFILE64)
+# define __USE_LARGEFILE64 1
+#endif
+
+/* Sun doesn't leave _FILE_OFFSET_BITS undefined. */
+#ifdef _LP64
+# ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+# endif
+#else
+# ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 32
+# endif
+#endif
+
+/* UNIX98 stuff is always available. */
+#ifndef __USE_UNIX98
+# define __USE_UNIX98 1
+#endif
+
+/* __EXTENSIONS__ corresponds to __USE_MISC. */
+#if defined(__USE_MISC) && !defined(__EXTENSIONS__)
+# define __EXTENSIONS__
+#endif
+
+#endif /* _SYS_FEATURE_TESTS */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fork.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fork.h
new file mode 100644
index 0000000000..26703e08ad
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fork.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_FORK_H
+#define _SYS_FORK_H
+
+#include <features.h>
+
+#define FORK_NOSIGCHLD 0x01
+#define FORK_WAITPID 0x02
+
+__BEGIN_DECLS
+
+extern pid_t forkx (int);
+extern pid_t forkallx (int);
+extern pid_t vforkx (int);
+
+__END_DECLS
+
+#endif /* _SYS_FORK_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fsid.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fsid.h
new file mode 100644
index 0000000000..76229ce040
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fsid.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_FSID_H
+#define _SYS_FSID_H
+
+#define S51K "S51K"
+#define PROC "PROC"
+#define DUFST "DUFST"
+#define NFS "NFS"
+#define S52K "S52K"
+
+#endif /* _SYS_FSID_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fstyp.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fstyp.h
new file mode 100644
index 0000000000..b03165a988
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/fstyp.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_FSTYP_H
+#define _SYS_FSTYP_H
+
+#include <features.h>
+#include <sys/statvfs.h>
+
+#define GETFSIND 1
+#define GETFSTYP 2
+#define GETNFSTYP 3
+
+__BEGIN_DECLS
+
+int sysfs (int, ...);
+
+__END_DECLS
+
+#endif /* _SYS_FSTYP_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/instance.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/instance.h
new file mode 100644
index 0000000000..df7781850d
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/instance.h
@@ -0,0 +1,34 @@
+/* Declarations of zone functions and types.
+ 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_INSTANCE_H
+#define _SYS_INSTANCE_H
+
+#include <features.h>
+
+#define INSTANCE_FILE "/etc/path_to_inst"
+#define INSTANCE_FILE_SUFFIX ".old"
+
+__BEGIN_DECLS
+
+extern int inst_sync (char *pathname, int flags);
+
+__END_DECLS
+
+#endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/int_types.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/int_types.h
new file mode 100644
index 0000000000..9a6118bd85
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/int_types.h
@@ -0,0 +1 @@
+#include <stdint.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/inttypes.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/inttypes.h
new file mode 100644
index 0000000000..8049f02f15
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/inttypes.h
@@ -0,0 +1 @@
+#include <inttypes.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ioccom.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ioccom.h
new file mode 100644
index 0000000000..6ec92cf732
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ioccom.h
@@ -0,0 +1 @@
+#include <sys/ioctl.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/klog.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/klog.h
new file mode 100644
index 0000000000..35f5fe40e0
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/klog.h
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996, 1999 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_KLOG_H
+
+#define _SYS_KLOG_H 1
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Control the kernel's logging facility. This corresponds exactly to
+ the kernel's syslog system call, but that name is easily confused
+ with the user-level syslog facility, which is something completely
+ different. */
+extern int klogctl (int __type, char *__bufp, int __len) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_KLOG_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/link.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/link.h
new file mode 100644
index 0000000000..dd55fc0e1e
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/link.h
@@ -0,0 +1,45 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_LINK_H
+#define _SYS_LINK_H
+
+#include <link.h>
+
+/* XXX: These are different from OpenSolaris. */
+#define LM_ID_BRAND -3
+#define LM_ID_NONE -2
+#define LM_ID_NEWLM -1
+
+typedef enum
+ {
+ RD_NONE = 0,
+ RD_PREINIT,
+ RD_POSTINIT,
+ RD_DLACTIVITY
+ } rd_event_e;
+
+typedef enum
+ {
+ RD_FL_NONE = 0,
+ RD_FL_ODBG = 1,
+ RD_FL_DBG = 2
+ } rd_flags_e;
+
+#endif /* _SYS_LINK_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/loadavg.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/loadavg.h
new file mode 100644
index 0000000000..8b5b0ae8f3
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/loadavg.h
@@ -0,0 +1,31 @@
+/* Declarations of loadavg types.
+ Copyright (C) 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_LOADAVG
+#define _SYS_LOADAVG
+
+#include <stdlib.h>
+
+#define LOADAVG_1MIN 0
+#define LOADAVG_5MIN 1
+#define LOADAVG_15MIN 2
+
+#define LOADAVG_NSTATS 3
+
+#endif /* _SYS_LOADAVG */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machelf.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machelf.h
new file mode 100644
index 0000000000..fe0d47492d
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machelf.h
@@ -0,0 +1,88 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_MACHELF_H
+#define _SYS_MACHELF_H
+
+#include <sys/isa_defs.h>
+#include <sys/elf.h>
+#include <link.h>
+
+#if defined (_ELF64) && !defined (_ELF32_COMPAT)
+
+typedef Elf64_Xword Xword;
+typedef Elf64_Lword Lword;
+typedef Elf64_Sxword Sxword;
+typedef Elf64_Word Word;
+typedef Elf64_Sword Sword;
+typedef Elf64_Half Half;
+typedef Elf64_Addr Addr;
+typedef Elf64_Off Off;
+typedef uchar_t Byte;
+
+typedef Elf64_Ehdr Ehdr;
+typedef Elf64_Shdr Shdr;
+typedef Elf64_Sym Sym;
+typedef Elf64_Syminfo Syminfo;
+typedef Elf64_Rela Rela;
+typedef Elf64_Rel Rel;
+typedef Elf64_Nhdr Nhdr;
+typedef Elf64_Phdr Phdr;
+typedef Elf64_Dyn Dyn;
+typedef Elf64_Boot Boot;
+typedef Elf64_Verdef Verdef;
+typedef Elf64_Verdaux Verdaux;
+typedef Elf64_Verneed Verneed;
+typedef Elf64_Vernaux Vernaux;
+typedef Elf64_Versym Versym;
+typedef Elf64_Move Move;
+typedef Elf64_Cap Cap;
+
+#else
+
+typedef Elf32_Word Xword;
+typedef Elf32_Lword Lword;
+typedef Elf32_Sword Sxword;
+typedef Elf32_Word Word;
+typedef Elf32_Sword Sword;
+typedef Elf32_Half Half;
+typedef Elf32_Addr Addr;
+typedef Elf32_Off Off;
+
+typedef Elf32_Ehdr Ehdr;
+typedef Elf32_Shdr Shdr;
+typedef Elf32_Sym Sym;
+typedef Elf32_Syminfo Syminfo;
+typedef Elf32_Rela Rela;
+typedef Elf32_Rel Rel;
+typedef Elf32_Nhdr Nhdr;
+typedef Elf32_Phdr Phdr;
+typedef Elf32_Dyn Dyn;
+typedef Elf32_Boot Boot;
+typedef Elf32_Verdef Verdef;
+typedef Elf32_Verdaux Verdaux;
+typedef Elf32_Verneed Verneed;
+typedef Elf32_Vernaux Vernaux;
+typedef Elf32_Versym Versym;
+typedef Elf32_Move Move;
+typedef Elf32_Cap Cap;
+
+#endif /* _ELF64 */
+
+#endif /* _SYS_MACHELF_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machtypes.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machtypes.h
new file mode 100644
index 0000000000..99b84d608b
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machtypes.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_MACHTYPES_H
+#define _SYS_MACHTYPES_H
+
+#include <bits/machtypes.h>
+
+#endif /* _SYS_MACHTYPES_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mkdev.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mkdev.h
new file mode 100644
index 0000000000..903017ba86
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mkdev.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_MKDEV_H
+#define _SYS_MKDEV_H
+
+#include <sys/sysmacros.h>
+
+#define ONBITSMAJOR O_BITSMAJOR
+#define ONBITSMINOR O_BITSMINOR
+#define OMAXMAJ O_MAXMAJ
+#define OMAXMIN O_MAXMIN
+
+#define NBITSMAJOR32 L_BITSMAJOR32
+#define NBITSMINOR32 L_BITSMINOR32
+#define MAXMAJ32 L_MAXMAJ32
+#define MAXMIN32 L_MAXMIN32
+
+#ifdef _LP64
+# define NBITSMAJOR64 L_BITSMAJOR
+# define NBITSMINOR64 L_BITSMINOR
+# define MAXMAJ64 L_MAXMAJ
+# define MAXMIN64 L_MAXMIN
+#endif
+
+#define NBITSMAJOR L_BITSMAJOR
+#define NBITSMINOR L_BITSMINOR
+#define MAXMAJ L_MAXMAJ
+#define MAXMIN L_MAXMIN
+
+#endif /* _SYS_MKDEV_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mntio.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mntio.h
new file mode 100644
index 0000000000..f8a6c97a47
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mntio.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2009 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2009.
+
+ 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_MNTIO_H
+#define _SYS_MNTIO_H
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#define MNTIOC ('m' << 8)
+#define MNTIOC_NMNTS (MNTIOC|1)
+#define MNTIOC_GETDEVLIST (MNTIOC|2)
+#define MNTIOC_SETTAG (MNTIOC|3)
+#define MNTIOC_CLRTAG (MNTIOC|4)
+#define MNTIOC_SHOWHIDDEN (MNTIOC|6)
+#define MNTIOC_GETMNTENT (MNTIOC|7)
+
+struct mnttagdesc
+ {
+ unsigned int mtd_major;
+ unsigned int mtd_minor;
+ char *mtd_mntpt;
+ char *mtd_tag;
+ };
+
+struct mntlookup
+ {
+ size_t mtl_mntpt_off;
+ char *mtl_mntpt;
+ major_t mtl_major;
+ minor_t mtl_minor;
+ __ino64_t mtl_ino;
+ char mtl_fstype[_ST_FSTYPSZ];
+ };
+
+#endif /* _SYS_MNTIO_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mnttab.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mnttab.h
new file mode 100644
index 0000000000..be5ae5930d
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mnttab.h
@@ -0,0 +1,82 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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 _MNTENT_H
+#ifndef _SYS_MNTTAB_H
+#define _SYS_MNTTAB_H
+
+#include <features.h>
+#include <paths.h>
+
+#define MNTTAB _PATH_MOUNTED
+#define MNT_LINE_MAX 1024
+
+#define MNT_TOOLONG 1
+#define MNT_TOOMANY 2
+#define MNT_TOOFEW 3
+
+#define mntnull(mp) ((mp)->mnt_special = (mp)->mnt_mountp = \
+ (mp)->mnt_fstype = (mp)->mnt_mntopts = (mp)->mnt_time = NULL)
+#define putmntent(fd, mp) (-1)
+
+struct mnttab
+ {
+ char *mnt_special;
+ char *mnt_mountp;
+ char *mnt_fstype;
+ char *mnt_mntopts;
+ char *mnt_time;
+ };
+
+struct extmnttab
+ {
+ char *mnt_special;
+ char *mnt_mountp;
+ char *mnt_fstype;
+ char *mnt_mntopts;
+ char *mnt_time;
+ unsigned int mnt_major;
+ unsigned int mnt_minor;
+ };
+
+__BEGIN_DECLS
+
+extern void resetmnttab (FILE *);
+# ifdef __REDIRECT_NTH
+extern int __getmntent_sun (FILE *, struct mnttab *);
+extern int __REDIRECT_NTH (getmntent, (FILE *, struct mnttab *),
+ __getmntent_sun);
+# else
+# define getmntent __getmntent_sun
+# endif
+extern int getextmntent (FILE *, struct extmnttab *, size_t);
+extern int getmntany (FILE *, struct mnttab *, struct mnttab *);
+# ifdef __REDIRECT_NTH
+extern char * __hasmntopt_sun (struct mnttab *, char *);
+extern char * __REDIRECT_NTH (hasmntopt, (struct mnttab *, char *),
+ __hasmntopt_sun);
+# else
+# define hasmntopt __hasmntopt_sun
+# endif
+extern char *mntopt (char **);
+
+__END_DECLS
+
+#endif /* _SYS_MNTTAB_H */
+#endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mount.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mount.h
new file mode 100644
index 0000000000..36e239fc83
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/mount.h
@@ -0,0 +1,69 @@
+/* Header file for mounting/unmount OpenSolaris filesystems.
+ Copyright (C) 1996,1997,1998,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. */
+
+/* This is taken from /usr/include/linux/fs.h. */
+
+#ifndef _SYS_MOUNT_H
+#define _SYS_MOUNT_H 1
+
+#include <features.h>
+#include <sys/ioctl.h>
+
+
+/* These are the fs-independent mount-flags: up to 16 flags are
+ supported */
+#define MS_RDONLY 0x0001 /* Mount read-only. */
+#define MS_FSS 0x0002 /* Old mount. */
+#define MS_DATA 0x0004 /* 6-argument mount. */
+#define MS_SYSSPACE 0x0008 /* In kernel space. */
+#define MS_NOSUID 0x0010 /* Ignore suid and sgid bits. */
+#define MS_REMOUNT 0x0020 /* Alter flags of a mounted FS. */
+#define MS_NOTRUNC 0x0040 /* Return ENAMETOOLONG for long filenames. */
+#define MS_OVERLAY 0x0080 /* Allow overlay mounts. */
+#define MS_OPTIONSTR 0x0100 /* Data is a an in/out option string. */
+#define MS_GLOBAL 0x0200 /* Clustering: Mount into global name space. */
+#define MS_FORCE 0x0400 /* Forced unmount. */
+#define MS_NOMNTTAB 0x0800 /* Don't show mount in mnttab. */
+#define MS_NOSPLICE 0x1000
+#define MS_NOCHECK 0x2000
+
+#define MS_MASK (MS_RDONLY | MS_FSS | MS_DATA | MS_NOSUID | \
+ MS_REMOUNT | MS_NOTRUNC | MS_OVERLAY | MS_OPTIONSTR | \
+ MS_GLOBAL | MS_NOMNTTAB)
+#define MS_UMOUNT_MASK (MS_FORCE)
+
+#define MAX_MNTOPT_STR 1024
+
+__BEGIN_DECLS
+
+/* Mount a filesystem. */
+extern int mount (__const char *__spec, __const char *__dir,
+ int __mflag_, __const char *__fstype, __const void *__dataptr,
+ int __datalen, char *__optptr, int __optlen) __THROW;
+
+/* Unmount a filesystem. */
+extern int umount (__const char *__file) __THROW;
+
+/* Unmount a filesystem. Force unmounting if FLAG is set to MS_FORCE. */
+extern int umount2 (__const char *__file, int __flag) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_MOUNT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/old_procfs.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/old_procfs.h
new file mode 100644
index 0000000000..33e7354f09
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/old_procfs.h
@@ -0,0 +1,339 @@
+/* Declarations of old procfs structures.
+ 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_OLD_PROCFS_H
+#define _SYS_OLD_PROCFS_H 1
+
+#if _STRUCTURED_PROC == 0
+
+#include <sys/types.h>
+#include <sys/procset.h>
+#include <sys/ucontext.h>
+#include <sys/signal.h>
+#include <sys/fault.h>
+#include <sys/procfs_isa.h>
+
+#define PIOC ('q'<<8)
+#define PIOCSTATUS (PIOC|1)
+#define PIOCSTOP (PIOC|2)
+#define PIOCWSTOP (PIOC|3)
+#define PIOCRUN (PIOC|4)
+#define PIOCGTRACE (PIOC|5)
+#define PIOCSTRACE (PIOC|6)
+#define PIOCSSIG (PIOC|7)
+#define PIOCKILL (PIOC|8)
+#define PIOCUNKILL (PIOC|9)
+#define PIOCGHOLD (PIOC|10)
+#define PIOCSHOLD (PIOC|11)
+#define PIOCMAXSIG (PIOC|12)
+#define PIOCACTION (PIOC|13)
+#define PIOCGFAULT (PIOC|14)
+#define PIOCSFAULT (PIOC|15)
+#define PIOCCFAULT (PIOC|16)
+#define PIOCGENTRY (PIOC|17)
+#define PIOCSENTRY (PIOC|18)
+#define PIOCGEXIT (PIOC|19)
+#define PIOCSEXIT (PIOC|20)
+#define PIOCSFORK (PIOC|21)
+#define PIOCRFORK (PIOC|22)
+#define PIOCSRLC (PIOC|23)
+#define PIOCRRLC (PIOC|24)
+#define PIOCGREG (PIOC|25)
+#define PIOCSREG (PIOC|26)
+#define PIOCGFPREG (PIOC|27)
+#define PIOCSFPREG (PIOC|28)
+#define PIOCNICE (PIOC|29)
+#define PIOCPSINFO (PIOC|30)
+#define PIOCNMAP (PIOC|31)
+#define PIOCMAP (PIOC|32)
+#define PIOCOPENM (PIOC|33)
+#define PIOCCRED (PIOC|34)
+#define PIOCGROUPS (PIOC|35)
+#define PIOCGETPR (PIOC|36)
+#define PIOCGETU (PIOC|37)
+#define PIOCSET (PIOC|38)
+#define PIOCRESET (PIOC|39)
+#define PIOCUSAGE (PIOC|43)
+#define PIOCOPENPD (PIOC|44)
+#define PIOCLWPIDS (PIOC|45)
+#define PIOCOPENLWP (PIOC|46)
+#define PIOCLSTATUS (PIOC|47)
+#define PIOCLUSAGE (PIOC|48)
+#define PIOCNAUXV (PIOC|49)
+#define PIOCAUXV (PIOC|50)
+#define PIOCGXREGSIZE (PIOC|51)
+#define PIOCGXREG (PIOC|52)
+#define PIOCSXREG (PIOC|53)
+
+#define PIOCNLDT (PIOC|103)
+#define PIOCLDT (PIOC|104)
+
+#define PRCLSZ 8
+#define PRSYSARGS 8
+
+#endif /* _STRUCTURED_PROC == 0 */
+
+typedef struct prstatus
+ {
+ int pr_flags;
+ short pr_why;
+ short pr_what;
+ siginfo_t pr_info;
+ short pr_cursig;
+ unsigned short pr_nlwp;
+ sigset_t pr_sigpend;
+ sigset_t pr_sighold;
+ struct sigaltstack pr_altstack;
+ struct sigaction pr_action;
+ pid_t pr_pid;
+ pid_t pr_ppid;
+ pid_t pr_pgrp;
+ pid_t pr_sid;
+ struct timespec pr_utime;
+ struct timespec pr_stime;
+ struct timespec pr_cutime;
+ struct timespec pr_cstime;
+ char pr_clname[PRCLSZ];
+ short pr_syscall;
+ short pr_nsysarg;
+ long pr_sysarg[PRSYSARGS];
+ id_t pr_who;
+ sigset_t pr_lwppend;
+ struct ucontext *pr_oldcontext;
+ caddr_t pr_brkbase;
+ size_t pr_brksize;
+ caddr_t pr_stkbase;
+ size_t pr_stksize;
+ short pr_processor;
+ short pr_bind;
+ long pr_instr;
+ prgregset_t pr_reg;
+ } prstatus_t;
+
+#if _STRUCTURED_PROC == 0
+
+#define PR_STOPPED 0x0001
+#define PR_ISTOP 0x0002
+#define PR_DSTOP 0x0004
+#define PR_ASLEEP 0x0008
+#define PR_FORK 0x0010
+#define PR_RLC 0x0020
+#define PR_PTRACE 0x0040
+#define PR_PCINVAL 0x0080
+#define PR_ISSYS 0x0100
+#define PR_STEP 0x0200
+#define PR_KLC 0x0400
+#define PR_ASYNC 0x0800
+#define PR_PCOMPAT 0x1000
+#define PR_MSACCT 0x2000
+#define PR_BPTADJ 0x4000
+#define PR_ASLWP 0x8000
+
+#define PR_REQUESTED 1
+#define PR_SIGNALLED 2
+#define PR_SYSENTRY 3
+#define PR_SYSEXIT 4
+#define PR_JOBCONTROL 5
+#define PR_FAULTED 6
+#define PR_SUSPENDED 7
+#define PR_CHECKPOINT 8
+
+#define PRFNSZ 16
+#define PRARGSZ 80
+
+#endif /* _STRUCTURED_PROC == 0 */
+
+typedef struct prpsinfo
+ {
+ char pr_state;
+ char pr_sname;
+ char pr_zomb;
+ char pr_nice;
+ unsigned int pr_flag;
+ uid_t pr_uid;
+ gid_t pr_gid;
+ pid_t pr_pid;
+ pid_t pr_ppid;
+ pid_t pr_pgrp;
+ pid_t pr_sid;
+ caddr_t pr_addr;
+ size_t pr_size;
+ size_t pr_rssize;
+ caddr_t pr_wchan;
+ struct timespec pr_start;
+ struct timespec pr_time;
+ int pr_pri;
+ char pr_oldpri;
+ char pr_cpu;
+ o_dev_t pr_ottydev;
+ dev_t pr_lttydev;
+ char pr_clname[PRCLSZ];
+ char pr_fname[PRFNSZ];
+ char pr_psargs[PRARGSZ];
+ short pr_syscall;
+ short pr_fill;
+ struct timespec pr_ctime;
+ size_t pr_bysize;
+ size_t pr_byrssize;
+ int pr_argc;
+ char **pr_argv;
+ char **pr_envp;
+ int pr_wstat;
+ unsigned short pr_pctcpu;
+ unsigned short pr_pctmem;
+ uid_t pr_euid;
+ gid_t pr_egid;
+ id_t pr_aslwpid;
+ char pr_dmodel;
+ char pr_pad[3];
+ int pr_filler[6];
+ } prpsinfo_t;
+
+#if _STRUCTURED_PROC == 0
+
+typedef struct prrun
+ {
+ int pr_flags;
+ sigset_t pr_trace;
+ sigset_t pr_sighold;
+ fltset_t pr_fault;
+ caddr_t pr_vaddr;
+ int pr_filler[8];
+ } prrun_t;
+
+#define PRCSIG 0x001
+#define PRCFAULT 0x002
+#define PRSTRACE 0x004
+#define PRSHOLD 0x008
+#define PRSFAULT 0x010
+#define PRSVADDR 0x020
+#define PRSTEP 0x040
+#define PRSABORT 0x080
+#define PRSTOP 0x100
+
+typedef struct prmap
+ {
+ caddr_t pr_vaddr;
+ size_t pr_size;
+ off_t pr_off;
+ unsigned int pr_mflags;
+ unsigned int pr_pagesize;
+ long pr_filler[3];
+ } prmap_t;
+
+#define MA_READ 0x04
+#define MA_WRITE 0x02
+#define MA_EXEC 0x01
+#define MA_SHARED 0x08
+#define MA_BREAK 0x10
+#define MA_STACK 0x20
+
+typedef struct prcred
+ {
+ uid_t pr_euid;
+ uid_t pr_ruid;
+ uid_t pr_suid;
+ gid_t pr_egid;
+ gid_t pr_rgid;
+ gid_t pr_sgid;
+ unsigned int pr_ngroups;
+ } prcred_t;
+
+typedef struct prusage
+ {
+ id_t pr_lwpid;
+ int pr_count;
+ struct timespec pr_tstamp;
+ struct timespec pr_create;
+ struct timespec pr_term;
+ struct timespec pr_rtime;
+ struct timespec pr_utime;
+ struct timespec pr_stime;
+ struct timespec pr_ttime;
+ struct timespec pr_tftime;
+ struct timespec pr_dftime;
+ struct timespec pr_kftime;
+ struct timespec pr_ltime;
+ struct timespec pr_slptime;
+ struct timespec pr_wtime;
+ struct timespec pr_stoptime;
+ struct timespec filltime[6];
+ unsigned long pr_minf;
+ unsigned long pr_majf;
+ unsigned long pr_nswap;
+ unsigned long pr_inblk;
+ unsigned long pr_oublk;
+ unsigned long pr_msnd;
+ unsigned long pr_mrcv;
+ unsigned long pr_sigs;
+ unsigned long pr_vctx;
+ unsigned long pr_ictx;
+ unsigned long pr_sysc;
+ unsigned long pr_ioch;
+ unsigned long filler[10];
+ } prusage_t;
+
+typedef struct prpageheader
+ {
+ struct timespec pr_tstamp;
+ unsigned long pr_nmap;
+ unsigned long pr_npage;
+ } prpageheader_t;
+
+typedef struct prasmap
+ {
+ caddr_t pr_vaddr;
+ size_t pr_npage;
+ off_t pr_off;
+ unsigned int pr_mflags;
+ unsigned int pr_pagesize;
+ long pr_filler[3];
+ } prasmap_t;
+
+#define PG_REFERENCED 0x02
+#define PG_MODIFIED 0x01
+#define PG_HWMAPPED 0x04
+
+/* based on sig*set */
+
+#define prfillset(set) \
+ { int __cnt = sizeof (*set) / sizeof (uint32_t); \
+ while (--__cnt >= 0) ((uint32_t *)(set))[__cnt] = 0xFFFFFFFF; }
+
+#define premptyset(set) \
+ { int __cnt = sizeof (*set) / sizeof (uint32_t); \
+ while (--__cnt >= 0) ((uint32_t *)(set))[__cnt] = 0; }
+
+#define __prmask(flag) \
+ (((uint32_t) 1) << (((flag) - 1) % (8 * (int)sizeof (uint32_t))))
+
+# define __prword(flag) (((flag) - 1) / (8 * (int)sizeof (uint32_t)))
+
+#define praddset(set, flag) \
+ (((uint32_t *)(set))[__prword (flag)] |= __prmask (flag))
+
+#define prdelset(set, flag) \
+ (((uint32_t *)(set))[__prword (flag)] &= ~__prmask (flag))
+
+#define prismember(set, flag) \
+ ((((uint32_t *)(set))[__prword (flag)] & __prmask (flag)) ? 1 : 0)
+
+#endif /* _STRUCTURED_PROC == 0 */
+
+#endif /* _SYS_OLD_PROCFS_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/param.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/param.h
new file mode 100644
index 0000000000..a17a0405d9
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/param.h
@@ -0,0 +1,139 @@
+/* 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_PARAM_H
+#define _SYS_PARAM_H 1
+
+#include <limits.h>
+#include <bits/local_lim.h>
+#include <features.h>
+#include <sys/isa_defs.h>
+
+#ifndef MIN
+# define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+#ifndef MAX
+# define MAX(a,b) (((a)>(b))?(a):(b))
+#endif
+
+/* BSD names for some <limits.h> values. */
+
+#define NBBY CHAR_BIT
+#ifndef NGROUPS
+# define NGROUPS NGROUPS_MAX
+#endif
+#define MAXSYMLINKS 20
+#define CANBSIZ MAX_CANON
+#define NCARGS ARG_MAX
+#define MAXPATHLEN PATH_MAX
+#define NOFILE OPEN_MAX
+
+
+#include <sys/types.h>
+
+/* Bit map related macros. */
+#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
+#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
+#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
+#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
+
+/* Macros for counting and rounding. */
+#ifndef howmany
+# define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
+#define powerof2(x) ((((x)-1)&(x))==0)
+
+#define NODEV (dev_t)(-1l)
+
+/* Unit of `st_blocks'. */
+#define DEV_BSIZE 512
+
+/* Maximum hostname length. */
+#define MAXHOSTNAMELEN 256
+
+#define PAGESIZE sysconf(_SC_PAGESIZE)
+#define MAXPID (pid_t)sysconf(_SC_MAXPID)
+#define MAXEPHUID (uid_t)sysconf(_SC_EPHID_MAX)
+#define MAXNAMELEN 256
+#define TYPICALMAXPATHLEN 64
+#define MAXLINKNAMELEN 32
+
+#define UID_NOBODY 60001
+#define GID_NOBODY UID_NOBODY
+#define GID_SYS 3
+#define UID_DLADM 15
+#define MAXUID 2147483647
+#define MAXPROJID MAXUID
+
+#define NS_PACKETSZ 512
+#define NS_MAXDNAME 1025
+#define NS_MAXMSG 65535
+#define NS_MAXCDNAME 255
+#define NS_MAXLABEL 63
+#define NS_HFIXEDSZ 12
+#define NS_QFIXEDSZ 4
+#define NS_RRFIXEDSZ 10
+#define NS_INT32SZ 4
+#define NS_INT16SZ 2
+#define NS_INT8SZ 1
+#define NS_INADDRSZ 4
+#define NS_IN6ADDRSZ 16
+#define NS_CMPRSFLGS 0xc0
+#define NS_DEFAULTPORT 53
+
+#define NGROUPS_UMIN 0
+#define NGROUPS_UMAX 32
+#define NGROUPS_MAX_DEFAULT 16
+
+#define MAXBSIZE 8192
+#define DEV_BSIZE 512
+#define DEV_BSHIFT 9
+#define MAXFRAG 8
+#ifdef _LP64
+# define MAXOFF_T 0x7fffffffffffffffl
+# define MAXOFFSET_T 0x7fffffffffffffffl
+#else
+# define MAXOFF_T 0x7fffffffl
+# define MAXOFFSET_T 0x7fffffffffffffffLL
+#endif
+
+#ifdef _LITTLE_ENDIAN
+# define lobyte(X) (((unsigned char *)&(X))[0])
+# define hibyte(X) (((unsigned char *)&(X))[1])
+# define loword(X) (((ushort_t *)&(X))[0])
+# define hiword(X) (((ushort_t *)&(X))[1])
+#endif
+#ifdef _BIG_ENDIAN
+# define lobyte(X) (((unsigned char *)&(X))[1])
+# define hibyte(X) (((unsigned char *)&(X))[0])
+# define loword(X) (((ushort_t *)&(X))[1])
+# define hiword(X) (((ushort_t *)&(X))[0])
+#endif
+
+#ifndef __USE_XOPEN
+# define NZERO 20
+#endif
+
+__BEGIN_DECLS
+
+extern long int sysconf (int __name) __THROW;
+
+__END_DECLS
+
+#endif /* sys/param.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port.h
new file mode 100644
index 0000000000..a96ff627a6
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port.h
@@ -0,0 +1,77 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_PORT_H
+#define _SYS_PORT_H
+
+#include <sys/types.h>
+
+#define PORT_SOURCE_AIO 1
+#define PORT_SOURCE_TIMER 2
+#define PORT_SOURCE_USER 3
+#define PORT_SOURCE_FD 4
+#define PORT_SOURCE_ALERT 5
+#define PORT_SOURCE_MQ 6
+#define PORT_SOURCE_FILE 7
+
+typedef struct port_event
+ {
+ int portev_events;
+ unsigned short portev_source;
+ unsigned short portev_pad;
+ uintptr_t portev_object;
+ void *portev_user;
+ } port_event_t;
+
+typedef struct port_notify
+ {
+ int portnfy_port;
+ void *portnfy_user;
+ } port_notify_t;
+
+typedef struct file_obj
+ {
+ struct timespec fo_atime;
+ struct timespec fo_mtime;
+ struct timespec fo_ctime;
+ uintptr_t fo_pad[3];
+ char *fo_name;
+ } file_obj_t;
+
+#define PORT_ALERT_SET 0x01
+#define PORT_ALERT_UPDATE 0x02
+#define PORT_ALERT_INVALID (PORT_ALERT_SET | PORT_ALERT_UPDATE)
+
+#define FILE_ACCESS 0x00000001
+#define FILE_MODIFIED 0x00000002
+#define FILE_ATTRIB 0x00000004
+#define FILE_NOFOLLOW 0x10000000
+
+#define FILE_DELETE 0x00000010
+#define FILE_RENAME_TO 0x00000020
+#define FILE_RENAME_FROM 0x00000040
+
+#define UNMOUNTED 0x20000000
+
+#define MOUNTEDOVER 0x40000000
+
+#define FILE_EXCEPTION (UNMOUNTED | FILE_DELETE | FILE_RENAME_TO | \
+ FILE_RENAME_FROM | MOUNTEDOVER)
+
+#endif /* _SYS_PORT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port_impl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port_impl.h
new file mode 100644
index 0000000000..2968aeccbd
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/port_impl.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 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_PORT_IMPL_H
+#define _SYS_PORT_IMPL_H
+
+#include <sys/port.h>
+
+#define PORT_CREATE 0
+#define PORT_ASSOCIATE 1
+#define PORT_DISSOCIATE 2
+#define PORT_SEND 3
+#define PORT_SENDN 4
+#define PORT_GET 5
+#define PORT_GETN 6
+#define PORT_ALERT 7
+#define PORT_DISPATCH 8
+
+#define PORT_SYS_NOPORT 0x0100
+#define PORT_SYS_NOSHARE 0x0200
+#define PORT_CODE_MASK 0xFF
+#define PORT_SHARE_EVENT 0x01
+#define PORT_MAX_LIST 8192
+
+#endif /* _SYS_PORT_IMPL_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priocntl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priocntl.h
new file mode 100644
index 0000000000..741b036638
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priocntl.h
@@ -0,0 +1,119 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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 _PRIOCNTLP_H
+#define _PRIOCNTLP_H
+
+#include <features.h>
+#include <sys/types.h>
+#include <sys/procset.h>
+
+#define PC_VERSION 1
+
+#define PC_GETCID 0
+#define PC_GETCLINFO 1
+#define PC_SETPARMS 2
+#define PC_GETPARMS 3
+#define PC_ADMIN 4
+#define PC_GETPRIRANGE 5
+#define PC_DONICE 6
+#define PC_SETXPARMS 7
+#define PC_GETXPARMS 8
+#define PC_SETDFLCL 9
+#define PC_GETDFLCL 10
+#define PC_DOPRIO 11
+
+#define PC_CLNULL -1
+
+typedef struct pcinfo
+ {
+ id_t pc_cid;
+#define PC_CLNMSZ 16
+ char pc_clname[PC_CLNMSZ];
+#define PC_CLINFOSZ (32 / sizeof (int))
+ int pc_clinfo[PC_CLINFOSZ];
+ } pcinfo_t;
+
+typedef struct pcparms
+ {
+ id_t pc_cid;
+#define PC_CLPARMSZ (32 / sizeof (int))
+ int pc_clparms[PC_CLPARMSZ];
+ } pcparms_t;
+
+typedef struct pcnice
+ {
+ int pc_val;
+ int pc_op;
+ } pcnice_t;
+
+/* pc_op values. */
+#define PC_GETNICE 0
+#define PC_SETNICE 1
+
+typedef struct pcprio
+ {
+ int pc_op;
+ id_t pc_cid;
+ int pc_val;
+ } pcprio_t;
+
+/* pc_op values. */
+#define PC_GETPRIO 0
+#define PC_SETPRIO 1
+
+typedef struct pc_vaparm
+ {
+ int pc_key;
+ unsigned long long pc_parm;
+ } pc_vaparm_t;
+
+/* pc_key values. */
+#define PC_KY_NULL 0
+#define PC_KY_CLNAME 1
+
+typedef struct pc_vaparms
+ {
+ unsigned int pc_vaparmscnt;
+#define PC_VAPARMCNT 8
+ pc_vaparm_t pc_parms[PC_VAPARMCNT];
+ } pc_vaparms_t;
+
+typedef struct pcpri
+ {
+ id_t pc_cid;
+ pri_t pc_clpmax;
+ pri_t pc_clpmin;
+ } pcpri_t;
+
+typedef struct pcadmin
+ {
+ id_t pc_cid;
+ __caddr_t pc_cladmin;
+ } pcadmin_t;
+
+__BEGIN_DECLS
+
+long priocntl (idtype_t idtype, id_t id, int cmd, ...);
+
+long priocntlset (procset_t *ps, int cmd, ...);
+
+__END_DECLS
+
+#endif /* _PRIOCNTLP_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv.h
new file mode 100644
index 0000000000..1da00b647f
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv.h
@@ -0,0 +1,115 @@
+/* Declarations of privilege functions and types.
+ 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_PRIV_H
+#define _SYS_PRIV_H
+
+#include <sys/types.h>
+#include <sys/priv_names.h>
+
+/* privsys codes */
+#define PRIVSYS_SETPPRIV 0
+#define PRIVSYS_GETPPRIV 1
+#define PRIVSYS_GETIMPLINFO 2
+#define PRIVSYS_SETPFLAGS 3
+#define PRIVSYS_GETPFLAGS 4
+#define PRIVSYS_ISSETUGID 5
+#define PRIVSYS_KLPD_REG 6
+#define PRIVSYS_KLPD_UNREG 7
+
+typedef enum priv_op
+{
+ PRIV_ON,
+ PRIV_OFF,
+ PRIV_SET
+} priv_op_t;
+
+typedef uint32_t priv_chunk_t;
+typedef struct priv_set priv_set_t;
+typedef const char *priv_ptype_t;
+typedef const char *priv_t;
+
+typedef struct priv_impl_info
+{
+ uint32_t priv_headersize;
+ uint32_t priv_flags;
+ uint32_t priv_nsets;
+ uint32_t priv_setsize;
+ uint32_t priv_max;
+ uint32_t priv_infosize;
+ uint32_t priv_globalinfosize;
+} priv_impl_info_t;
+
+#define PRIV_DEBUG 0x0001
+#define PRIV_AWARE 0x0002
+#define PRIV_AWARE_INHERIT 0x0004
+#define __PROC_PROTECT 0x0008
+#define NET_MAC_AWARE 0x0010
+#define NET_MAC_AWARE_INHERIT 0x0020
+#define PRIV_XPOLICY 0x0080
+#define PRIV_USER (PRIV_DEBUG | NET_MAC_AWARE | \
+ NET_MAC_AWARE_INHERIT | PRIV_XPOLICY)
+
+#define PRIV_IMPL_INFO_SIZE(p) \
+ ((p)->priv_headersize + (p)->priv_globalinfosize)
+
+typedef struct priv_info
+{
+ uint32_t priv_info_type;
+ uint32_t priv_info_size;
+} priv_info_t;
+
+typedef struct priv_info_uint
+{
+ priv_info_t info;
+ uint_t val;
+} priv_info_uint_t;
+
+typedef struct priv_info_set
+{
+ priv_info_t info;
+ priv_chunk_t set[1];
+} priv_info_set_t;
+
+typedef struct priv_info_names
+{
+ priv_info_t info;
+ int cnt;
+ char names[1];
+} priv_info_names_t;
+
+#define PRIV_PRPRIV_INFO_OFFSET(p) \
+ (sizeof (prpriv_t) + sizeof (priv_chunk_t)) * \
+ ((p)->pr_nsets * (p)->pr_setsize - 1)
+
+#define PRIV_PRPRIV_SIZE(p) \
+ (PRIV_PRPRIV_INFO_OFFSET(p) + (p)->pr_infosize)
+
+#define PRIV_ALL (-1)
+#define PRIV_MULTIPLE (-2)
+#define PRIV_NONE (-3)
+#define PRIV_ALLZONE (-4)
+#define PRIV_GLOBAL (-5)
+
+#define PRIV_INFO_SETNAMES 1
+#define PRIV_INFO_PRIVNAMES 2
+#define PRIV_INFO_BASICPRIVS 3
+#define PRIV_INFO_FLAGS 4
+
+#endif /* _SYS_PRIV_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv_names.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv_names.h
new file mode 100644
index 0000000000..70c4f07db8
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/priv_names.h
@@ -0,0 +1,101 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_PRIV_NAMES_H
+#define _SYS_PRIV_NAMES_H
+
+#define PRIV_CONTRACT_EVENT ((const char *)"contract_event")
+#define PRIV_CONTRACT_IDENTITY ((const char *)"contract_identity")
+#define PRIV_CONTRACT_OBSERVER ((const char *)"contract_observer")
+#define PRIV_CPC_CPU ((const char *)"cpc_cpu")
+#define PRIV_DTRACE_KERNEL ((const char *)"dtrace_kernel")
+#define PRIV_DTRACE_PROC ((const char *)"dtrace_proc")
+#define PRIV_DTRACE_USER ((const char *)"dtrace_user")
+#define PRIV_FILE_CHOWN ((const char *)"file_chown")
+#define PRIV_FILE_CHOWN_SELF ((const char *)"file_chown_self")
+#define PRIV_FILE_DAC_EXECUTE ((const char *)"file_dac_execute")
+#define PRIV_FILE_DAC_READ ((const char *)"file_dac_read")
+#define PRIV_FILE_DAC_SEARCH ((const char *)"file_dac_search")
+#define PRIV_FILE_DAC_WRITE ((const char *)"file_dac_write")
+#define PRIV_FILE_DOWNGRADE_SL ((const char *)"file_downgrade_sl")
+#define PRIV_FILE_LINK_ANY ((const char *)"file_link_any")
+#define PRIV_FILE_OWNER ((const char *)"file_owner")
+#define PRIV_FILE_SETID ((const char *)"file_setid")
+#define PRIV_FILE_UPGRADE_SL ((const char *)"file_upgrade_sl")
+#define PRIV_FILE_FLAG_SET ((const char *)"file_flag_set")
+#define PRIV_GRAPHICS_ACCESS ((const char *)"graphics_access")
+#define PRIV_GRAPHICS_MAP ((const char *)"graphics_map")
+#define PRIV_IPC_DAC_READ ((const char *)"ipc_dac_read")
+#define PRIV_IPC_DAC_WRITE ((const char *)"ipc_dac_write")
+#define PRIV_IPC_OWNER ((const char *)"ipc_owner")
+#define PRIV_NET_BINDMLP ((const char *)"net_bindmlp")
+#define PRIV_NET_ICMPACCESS ((const char *)"net_icmpaccess")
+#define PRIV_NET_MAC_AWARE ((const char *)"net_mac_aware")
+#define PRIV_NET_PRIVADDR ((const char *)"net_privaddr")
+#define PRIV_NET_RAWACCESS ((const char *)"net_rawaccess")
+#define PRIV_PROC_AUDIT ((const char *)"proc_audit")
+#define PRIV_PROC_CHROOT ((const char *)"proc_chroot")
+#define PRIV_PROC_CLOCK_HIGHRES ((const char *)"proc_clock_highres")
+#define PRIV_PROC_EXEC ((const char *)"proc_exec")
+#define PRIV_PROC_FORK ((const char *)"proc_fork")
+#define PRIV_PROC_INFO ((const char *)"proc_info")
+#define PRIV_PROC_LOCK_MEMORY ((const char *)"proc_lock_memory")
+#define PRIV_PROC_OWNER ((const char *)"proc_owner")
+#define PRIV_PROC_PRIOCNTL ((const char *)"proc_priocntl")
+#define PRIV_PROC_SESSION ((const char *)"proc_session")
+#define PRIV_PROC_SETID ((const char *)"proc_setid")
+#define PRIV_PROC_TASKID ((const char *)"proc_taskid")
+#define PRIV_PROC_ZONE ((const char *)"proc_zone")
+#define PRIV_SYS_ACCT ((const char *)"sys_acct")
+#define PRIV_SYS_ADMIN ((const char *)"sys_admin")
+#define PRIV_SYS_AUDIT ((const char *)"sys_audit")
+#define PRIV_SYS_CONFIG ((const char *)"sys_config")
+#define PRIV_SYS_DEVICES ((const char *)"sys_devices")
+#define PRIV_SYS_IPC_CONFIG ((const char *)"sys_ipc_config")
+#define PRIV_SYS_LINKDIR ((const char *)"sys_linkdir")
+#define PRIV_SYS_MOUNT ((const char *)"sys_mount")
+#define PRIV_SYS_IP_CONFIG ((const char *)"sys_ip_config")
+#define PRIV_SYS_NET_CONFIG ((const char *)"sys_net_config")
+#define PRIV_SYS_NFS ((const char *)"sys_nfs")
+#define PRIV_SYS_RES_CONFIG ((const char *)"sys_res_config")
+#define PRIV_SYS_RESOURCE ((const char *)"sys_resource")
+#define PRIV_SYS_SMB ((const char *)"sys_smb")
+#define PRIV_SYS_SUSER_COMPAT ((const char *)"sys_suser_compat")
+#define PRIV_SYS_TIME ((const char *)"sys_time")
+#define PRIV_SYS_TRANS_LABEL ((const char *)"sys_trans_label")
+#define PRIV_VIRT_MANAGE ((const char *)"virt_manage")
+#define PRIV_WIN_COLORMAP ((const char *)"win_colormap")
+#define PRIV_WIN_CONFIG ((const char *)"win_config")
+#define PRIV_WIN_DAC_READ ((const char *)"win_dac_read")
+#define PRIV_WIN_DAC_WRITE ((const char *)"win_dac_write")
+#define PRIV_WIN_DEVICES ((const char *)"win_devices")
+#define PRIV_WIN_DGA ((const char *)"win_dga")
+#define PRIV_WIN_DOWNGRADE_SL ((const char *)"win_downgrade_sl")
+#define PRIV_WIN_FONTPATH ((const char *)"win_fontpath")
+#define PRIV_WIN_MAC_READ ((const char *)"win_mac_read")
+#define PRIV_WIN_MAC_WRITE ((const char *)"win_mac_write")
+#define PRIV_WIN_SELECTION ((const char *)"win_selection")
+#define PRIV_WIN_UPGRADE_SL ((const char *)"win_upgrade_sl")
+#define PRIV_XVM_CONTROL ((const char *)"xvm_control")
+#define PRIV_EFFECTIVE ((const char *)"Effective")
+#define PRIV_INHERITABLE ((const char *)"Inheritable")
+#define PRIV_PERMITTED ((const char *)"Permitted")
+#define PRIV_LIMIT ((const char *)"Limit")
+
+#endif /* _SYS_PRIV_NAMES_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/processor.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/processor.h
new file mode 100644
index 0000000000..b8f941e776
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/processor.h
@@ -0,0 +1,83 @@
+/* Declarations of processor-related types/macros.
+ 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_PROCESSOR_H
+#define _SYS_PROCESSOR_H
+
+#include <features.h>
+#include <sys/procset.h>
+
+typedef int processorid_t;
+
+typedef struct
+{
+ int pi_state;
+#define PI_TYPELEN 16
+ char pi_processor_type[PI_TYPELEN];
+#define PI_FPUTYPE 32
+ char pi_fputypes[PI_FPUTYPE];
+ int pi_clock;
+} processor_info_t;
+
+/* p_online flag values */
+enum
+{
+ P_OFFLINE = 1,
+#define P_OFFLINE P_OFFLINE
+ P_ONLINE = 2,
+#define P_ONLINE P_ONLINE
+ P_STATUS = 3,
+#define P_STATUS P_STATUS
+ P_FAULTED = 4,
+#define P_FAULTED P_FAULTED
+#define P_BAD P_FAULTED
+ P_POWEROFF = 5,
+#define P_POWEROFF P_POWEROFF
+ P_NOINTR = 6,
+#define P_NOINTR P_NOINTR
+ P_SPARE = 7,
+#define P_SPARE P_SPARE
+ P_FORCED = 0x10000000
+#define P_FORCED P_FORCED
+};
+
+#define PS_OFFLINE "off-line"
+#define PS_ONLINE "on-line"
+#define PS_FAULTED "faulted"
+#define PS_POWEROFF "powered-off"
+#define PS_NOINTR "no-intr"
+#define PS_SPARE "spare"
+
+#define PBIND_NONE -1
+#define PBIND_QUERY -2
+#define PBIND_HARD -3
+#define PBIND_SOFT -4
+#define PBIND_QUERY_TYPE -5
+
+__BEGIN_DECLS
+
+extern int processor_info (processorid_t processorid, processor_info_t *infop);
+extern int processor_bind (idtype_t idtype, id_t id, processorid_t processorid,
+ processorid_t *obind);
+extern int p_online (processorid_t processorid, int flag);
+extern processorid_t getcpuid (void);
+
+__END_DECLS
+
+#endif /* _SYS_PROCESSOR_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procfs.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procfs.h
new file mode 100644
index 0000000000..7344015938
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procfs.h
@@ -0,0 +1,487 @@
+/* Declarations of procfs structures.
+ 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_PROCFS_H
+#define _SYS_PROCFS_H 1
+
+#ifndef _STRUCTURED_PROC
+# define _STRUCTURED_PROC 0
+#endif
+
+#if _STRUCTURED_PROC == 0
+
+# include <sys/old_procfs.h>
+
+#else
+
+#include <sys/types.h>
+#include <sys/signal.h>
+#include <sys/fault.h>
+#include <sys/syscall.h>
+#include <sys/processor.h>
+#include <sys/pset.h>
+#include <sys/priv.h>
+#include <bits/regset.h>
+#include <time.h>
+#include <bits/wordsize.h>
+#include <sys/procfs_isa.h>
+
+/* control codes for ctl and lwpctl */
+#define PCNULL 0
+#define PCSTOP 1
+#define PCDSTOP 2
+#define PCWSTOP 3
+#define PCTWSTOP 4
+#define PCRUN 5
+#define PCCSIG 6
+#define PCCFAULT 7
+#define PCSSIG 8
+#define PCKILL 9
+#define PCUNKILL 10
+#define PCSHOLD 11
+#define PCSTRACE 12
+#define PCSFAULT 13
+#define PCSENTRY 14
+#define PCSEXIT 15
+#define PCSET 16
+#define PCUNSET 17
+#define PCSREG 18
+#define PCSFPREG 19
+#define PCSXREG 20
+#define PCNICE 21
+#define PCSVADDR 22
+#define PCWATCH 23
+#define PCAGENT 24
+#define PCREAD 25
+#define PCWRITE 26
+#define PCSCRED 27
+#define PCSASRS 28
+#define PCSPRIV 29
+#define PCSZONE 30
+#define PCSCREDX 31
+
+/* PCRUN codes */
+#define PRCSIG 0x01
+#define PRCFAULT 0x02
+#define PRSTEP 0x04
+#define PRSABORT 0x08
+#define PRSTOP 0x10
+
+/* /proc/<pid>/lwp/<lwpid>/lwpstatus */
+typedef struct lwpstatus
+{
+ int pr_flags;
+ id_t pr_lwpid;
+ short pr_why;
+ short pr_what;
+ short pr_cursig;
+ short pr_pad1;
+ siginfo_t pr_info;
+ sigset_t pr_lwppend;
+ sigset_t pr_lwphold;
+ struct sigaction pr_action;
+ stack_t pr_altstack;
+ uintptr_t pr_oldcontext;
+ short pr_syscall;
+ short pr_nsysarg;
+ int pr_errno;
+#define PRSYSARGS 8
+ long pr_sysarg[PRSYSARGS];
+ long pr_rval1;
+ long pr_rval2;
+#define PRCLSZ 8
+ char pr_clname[PRCLSZ];
+ struct timespec pr_tstamp;
+ struct timespec pr_utime;
+ struct timespec pr_stime;
+ int pr_filler[11 - 2 * sizeof (struct timespec) / sizeof (int)];
+ int pr_errpriv;
+ uintptr_t pr_ustack;
+ unsigned long pr_instr;
+ prgregset_t pr_reg;
+ prfpregset_t pr_fpreg;
+} lwpstatus_t;
+
+/* /proc/<pid>/status */
+typedef struct pstatus
+{
+ int pr_flags;
+ int pr_nlwp;
+ pid_t pr_pid;
+ pid_t pr_ppid;
+ pid_t pr_pgid;
+ pid_t pr_sid;
+ id_t pr_aslwpid;
+ id_t pr_agentid;
+ sigset_t pr_sigpend;
+ uintptr_t pr_brkbase;
+ size_t pr_brksize;
+ uintptr_t pr_stkbase;
+ size_t pr_stksize;
+ struct timespec pr_utime;
+ struct timespec pr_stime;
+ struct timespec pr_cutime;
+ struct timespec pr_cstime;
+ sigset_t pr_sigtrace;
+ fltset_t pr_flttrace;
+ sysset_t pr_sysentry;
+ sysset_t pr_sysexit;
+ char pr_dmodel;
+ char pr_pad[3];
+ taskid_t pr_taskid;
+ projid_t pr_projid;
+ int pr_nzomb;
+ zoneid_t pr_zoneid;
+ int pr_filler[15];
+ lwpstatus_t pr_lwp;
+} pstatus_t;
+
+/* pr_flags */
+#define PR_STOPPED 0x00000001
+#define PR_ISTOP 0x00000002
+#define PR_DSTOP 0x00000004
+#define PR_STEP 0x00000008
+#define PR_ASLEEP 0x00000010
+#define PR_PCINVAL 0x00000020
+#define PR_ASLWP 0x00000040
+#define PR_AGENT 0x00000080
+#define PR_DETACH 0x00000100
+#define PR_DAEMON 0x00000200
+#define PR_IDLE 0x00000400
+#define PR_ISSYS 0x00001000
+#define PR_VFORKP 0x00002000
+#define PR_ORPHAN 0x00004000
+#define PR_NOSIGCHLD 0x00008000
+#define PR_WAITPID 0x00010000
+#define PR_FORK 0x00100000
+#define PR_RLC 0x00200000
+#define PR_KLC 0x00400000
+#define PR_ASYNC 0x00800000
+#define PR_MSACCT 0x01000000
+#define PR_BPTADJ 0x02000000
+#define PR_PTRACE 0x04000000
+#define PR_MSFORK 0x08000000
+
+/* pr_why */
+enum
+{
+ PR_REQUESTED = 1,
+#define PR_REQUESTED PR_REQUESTED
+ PR_SIGNALLED = 2,
+#define PR_SIGNALLED PR_SIGNALLED
+ PR_SYSENTRY = 3,
+#define PR_SYSENTRY PR_SYSENTRY
+ PR_SYSEXIT = 4,
+#define PR_SYSEXIT PR_SYSEXIT
+ PR_JOBCONTROL = 5,
+#define PR_JOBCONTROL PR_JOBCONTROL
+ PR_FAULTED = 6,
+#define PR_FAULTED PR_FAULTED
+ PR_SUSPENDED = 7,
+#define PR_SUSPENDED PR_SUSPENDED
+ PR_CHECKPOINT = 8
+#define PR_CHECKPOINT PR_CHECKPOINT
+};
+
+/* /proc/<pid>/lwp/<lwpid>/lwpsinfo */
+typedef struct lwpsinfo
+{
+ int pr_flag;
+ id_t pr_lwpid;
+ uintptr_t pr_addr;
+ uintptr_t pr_wchan;
+ char pr_stype;
+ char pr_state;
+ char pr_sname;
+ char pr_nice;
+ short pr_syscall;
+ char pr_oldpri;
+ char pr_cpu;
+ int pr_pri;
+ unsigned short pr_pctcpu;
+ unsigned short pr_pad;
+ struct timespec pr_start;
+ struct timespec pr_time;
+#define PRFNSZ 16
+ char pr_clname[PRCLSZ];
+ char pr_name[PRFNSZ];
+ processorid_t pr_onpro;
+ processorid_t pr_bindpro;
+ psetid_t pr_bindpset;
+ int pr_lgrp;
+ int pr_filler[4];
+} lwpsinfo_t;
+
+/* pr_ttydev: non-existent device */
+#define PRNODEV (dev_t)(-1)
+
+/* /proc/<pid>/psinfo */
+typedef struct psinfo
+{
+ int pr_flag;
+ int pr_nlwp;
+ pid_t pr_pid;
+ pid_t pr_ppid;
+ pid_t pr_pgid;
+ pid_t pr_sid;
+ uid_t pr_uid;
+ uid_t pr_euid;
+ gid_t pr_gid;
+ gid_t pr_egid;
+ uintptr_t pr_addr;
+ size_t pr_size;
+ size_t pr_rssize;
+ size_t pr_pad1;
+ dev_t pr_ttydev;
+ unsigned short pr_pctcpu;
+ unsigned short pr_pctmem;
+ struct timespec pr_start;
+ struct timespec pr_time;
+ struct timespec pr_ctime;
+ char pr_fname[PRFNSZ];
+#define PRARGSZ 80
+ char pr_psargs[PRARGSZ];
+ int pr_wstat;
+ int pr_argc;
+ uintptr_t pr_argv;
+ uintptr_t pr_envp;
+ char pr_dmodel;
+ char pr_pad2[3];
+ taskid_t pr_taskid;
+ projid_t pr_projid;
+ int pr_nzomb;
+ poolid_t pr_poolid;
+ zoneid_t pr_zoneid;
+ id_t pr_contract;
+ int pr_filler[1];
+ lwpsinfo_t pr_lwp;
+} psinfo_t;
+
+/* /proc/<pid>/map, /proc/<pid>/rmap */
+typedef struct prmap
+{
+ uintptr_t pr_vaddr;
+ size_t pr_size;
+#define PRMAPSZ 64
+ char pr_mapname[PRMAPSZ];
+ offset_t pr_offset;
+ int pr_mflags;
+ int pr_pagesize;
+ int pr_shmid;
+ int pr_filler[1];
+} prmap_t;
+
+/* pr_mflags values */
+#define MA_EXEC 0x0001
+#define MA_WRITE 0x0002
+#define MA_READ 0x0004
+#define MA_SHARED 0x0008
+#define MA_BREAK 0x0010
+#define MA_STACK 0x0020
+#define MA_ANON 0x0040
+#define MA_ISM 0x0080
+#define MA_NORESERVE 0x0100
+#define MA_SHM 0x0200
+#define MA_RESERVED1 0x0400
+
+/* /proc/<pid>/xmap */
+typedef struct prxmap
+{
+ uintptr_t pr_vaddr;
+ size_t pr_size;
+ char pr_mapname[PRMAPSZ];
+ offset_t pr_offset;
+ int pr_mflags;
+ int pr_pagesize;
+ int pr_shmid;
+ dev_t pr_dev;
+ uint64_t pr_ino;
+ size_t pr_rss;
+ size_t pr_anon;
+ size_t pr_locked;
+ size_t pr_pad;
+ uint64_t pr_hatpagesize;
+#if __WORDSIZE == 32
+ unsigned long pr_filler[6];
+#else
+ unsigned long pr_filler[7];
+#endif
+} prxmap_t;
+
+/* pr_mflags */
+#define MA_EXEC 0x0001
+#define MA_WRITE 0x0002
+#define MA_READ 0x0004
+#define MA_SHARED 0x0008
+#define MA_ANON 0x0040
+#define MA_ISM 0x0080
+#define MA_NORESERVE 0x0100
+#define MA_SHM 0x0200
+#define MA_RESERVED1 0x0400
+
+/* /proc/<pid>/cred */
+typedef struct prcred
+{
+ uid_t pr_euid;
+ uid_t pr_ruid;
+ uid_t pr_suid;
+ gid_t pr_egid;
+ gid_t pr_rgid;
+ gid_t pr_sgid;
+ int pr_ngroups;
+ gid_t pr_groups[1];
+} prcred_t;
+
+/* /proc/<pid>/priv */
+typedef struct prpriv
+{
+ uint32_t pr_nsets;
+ uint32_t pr_setsize;
+ uint32_t pr_infosize;
+ priv_chunk_t pr_sets[1];
+} prpriv_t;
+
+/* /proc/<pid>/watch */
+typedef struct prwatch
+{
+ uintptr_t pr_vaddr;
+ size_t pr_size;
+ int pr_wflags;
+ int pr_pad;
+} prwatch_t;
+
+/* pr_wflags */
+#define WA_EXEC 0x01
+#define WA_WRITE 0x02
+#define WA_READ 0x04
+#define WA_TRAPAFTER 0x08
+
+typedef struct priovec {
+ void *pio_base;
+ size_t pio_len;
+ off_t pio_offset;
+} priovec_t;
+
+/* /proc/<pid>/usage, /proc/<pid>/lwp/<lwpid>/lwpusage */
+typedef struct prusage
+{
+ id_t pr_lwpid;
+ int pr_count;
+ struct timespec pr_tstamp;
+ struct timespec pr_create;
+ struct timespec pr_term;
+ struct timespec pr_rtime;
+ struct timespec pr_utime;
+ struct timespec pr_stime;
+ struct timespec pr_ttime;
+ struct timespec pr_tftime;
+ struct timespec pr_dftime;
+ struct timespec pr_kftime;
+ struct timespec pr_ltime;
+ struct timespec pr_slptime;
+ struct timespec pr_wtime;
+ struct timespec pr_stoptime;
+ struct timespec filltime[6];
+ unsigned long pr_minf;
+ unsigned long pr_majf;
+ unsigned long pr_nswap;
+ unsigned long pr_inblk;
+ unsigned long pr_oublk;
+ unsigned long pr_msnd;
+ unsigned long pr_mrcv;
+ unsigned long pr_sigs;
+ unsigned long pr_vctx;
+ unsigned long pr_ictx;
+ unsigned long pr_sysc;
+ unsigned long pr_ioch;
+ unsigned long filler[10];
+} prusage_t;
+
+/* /proc/<pid>/pagedata file header */
+typedef struct prpageheader
+{
+ struct timespec pr_tstamp;
+ long pr_nmap;
+ long pr_npage;
+} prpageheader_t;
+
+/* /proc/<pid>/pagedata mapping header */
+typedef struct prasmap
+{
+ uintptr_t pr_vaddr;
+ size_t pr_npage;
+ char pr_mapname[PRMAPSZ];
+ offset_t pr_offset;
+ int pr_mflags;
+ int pr_pagesize;
+ int pr_shmid;
+ int pr_filler[1];
+} prasmap_t;
+
+/* pr_npage-long byte array (plus 8-byte alignment) of the following flags */
+#define PG_REFERENCED 0x02
+#define PG_MODIFIED 0x01
+#define PG_HWMAPPED 0x04
+
+/* /proc/<pid>/lstatus, /proc/<pid>/lpsinfo, /proc/<pid>/lusage header */
+typedef struct prheader
+{
+ long pr_nent;
+ long pr_entsize;
+} prheader_t;
+
+/* based on sig*set */
+
+#define prfillset(set) \
+ { int __cnt = sizeof (*set) / sizeof (uint32_t); \
+ while (--__cnt >= 0) ((uint32_t *)(set))[__cnt] = 0xFFFFFFFF; }
+
+#define premptyset(set) \
+ { int __cnt = sizeof (*set) / sizeof (uint32_t); \
+ while (--__cnt >= 0) ((uint32_t *)(set))[__cnt] = 0; }
+
+#define __prmask(flag) \
+ (((uint32_t) 1) << (((flag) - 1) % (8 * (int)sizeof (uint32_t))))
+
+# define __prword(flag) (((flag) - 1) / (8 * (int)sizeof (uint32_t)))
+
+#define praddset(set, flag) \
+ (((uint32_t *)(set))[__prword (flag)] |= __prmask (flag))
+
+#define prdelset(set, flag) \
+ (((uint32_t *)(set))[__prword (flag)] &= ~__prmask (flag))
+
+#define prismember(set, flag) \
+ ((((uint32_t *)(set))[__prword (flag)] & __prmask (flag)) ? 1 : 0)
+
+/* Data models. */
+#define PR_MODEL_UNKNOWN 0
+#define PR_MODEL_ILP32 1
+#define PR_MODEL_LP64 2
+#if defined(_LP64)
+# define PR_MODEL_NATIVE PR_MODEL_LP64
+#elif defined(_ILP32)
+# define PR_MODEL_NATIVE PR_MODEL_ILP32
+#else
+# error Unknown data model
+#endif
+
+#endif /* _STRUCTURED_PROC == 0 */
+
+#endif /* _SYS_PROCFS_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procset.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procset.h
new file mode 100644
index 0000000000..9104e9ccf8
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/procset.h
@@ -0,0 +1,79 @@
+/* Declarations of procset structures.
+ 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_PROCSET_H
+#define _SYS_PROCSET_H
+
+#include <sys/types.h>
+#include <features.h>
+
+#if defined __USE_MISC || defined __USE_XOPEN
+typedef enum
+{
+ P_PID,
+ P_PPID,
+ P_PGID,
+ P_SID,
+ P_CID,
+ P_UID,
+ P_GID,
+ P_ALL,
+ P_LWPID,
+ P_TASKID,
+ P_PROJID,
+ P_POOLID,
+ P_ZONEID,
+ P_CTID,
+ P_CPUID,
+ P_PSETID
+} idtype_t;
+#endif
+
+#define P_INITPID 1
+#define P_INITUID 0
+#define P_INITPGID 0
+
+#ifdef __USE_MISC
+typedef enum idop
+{
+ POP_DIFF,
+ POP_AND,
+ POP_OR,
+ POP_XOR
+} idop_t;
+
+typedef struct procset
+{
+ idop_t p_op;
+ idtype_t p_lidtype;
+ id_t p_lid;
+ idtype_t p_ridtype;
+ id_t p_rid;
+} procset_t;
+
+#endif /* __USE_MISC */
+
+#define setprocset(psp, op, lidtype, lid, ridtype, rid) \
+ (psp)->p_op = (op); \
+ (psp)->p_lidtype = (lidtype); \
+ (psp)->p_lid = (lid); \
+ (psp)->p_ridtype = (ridtype); \
+ (psp)->p_rid = (rid);
+
+#endif /* _SYS_PROCSET_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/pset.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/pset.h
new file mode 100644
index 0000000000..b5d326f767
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/pset.h
@@ -0,0 +1,67 @@
+/* Declarations of processor sets.
+ 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_PSET_H
+#define _SYS_PSET_H
+
+#include <sys/processor.h>
+#include <features.h>
+
+typedef int psetid_t;
+
+/* Syscall sub-call numbers. */
+#define PSET_CREATE 0
+#define PSET_DESTROY 1
+#define PSET_ASSIGN 2
+#define PSET_INFO 3
+#define PSET_BIND 4
+#define PSET_GETLOADAVG 5
+#define PSET_LIST 6
+#define PSET_SETATTR 7
+#define PSET_GETATTR 8
+#define PSET_ASSIGN_FORCED 9
+
+#define PS_NONE -1
+#define PS_QUERY -2
+#define PS_MYID -3
+#define PS_SOFT -4
+#define PS_HARD -5
+#define PS_QUERY_TYPE -6
+
+/* types of processor sets */
+#define PS_SYSTEM 1
+#define PS_PRIVATE 2
+
+__BEGIN_DECLS
+
+extern int pset_create (psetid_t *newpset);
+extern int pset_destroy (psetid_t pset);
+extern int pset_assign (psetid_t pset, processorid_t cpu, psetid_t *opset);
+extern int pset_info (psetid_t pset, int *type, unsigned int *numcpus,
+ processorid_t *cpulist);
+extern int pset_bind (psetid_t pset, idtype_t idtype, id_t id,
+ psetid_t *opset);
+extern int pset_getloadavg (psetid_t pset, double loadavg[], int nelem);
+extern int pset_list (psetid_t *psetlist, unsigned int *numpsets);
+extern int pset_setattr (psetid_t pset, unsigned int attr);
+extern int pset_getattr (psetid_t pset, unsigned int *attr);
+
+__END_DECLS
+
+#endif /* _SYS_PSET_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ptms.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ptms.h
new file mode 100644
index 0000000000..2f22e2f5bc
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ptms.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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 _PTMS_SYS_H
+#define _PTMS_SYS_H
+
+#include <sys/types.h>
+
+typedef struct pt_own
+ {
+ uid_t pto_ruid;
+ gid_t pto_rgid;
+ } pt_own_t;
+
+#define ISPTM (('P'<<8)|1)
+#define UNLKPT (('P'<<8)|2)
+#define PTSSTTY (('P'<<8)|3)
+#define ZONEPT (('P'<<8)|4)
+#define OWNERPT (('P'<<8)|5)
+
+#endif /* _PTMS_SYS_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl.h
new file mode 100644
index 0000000000..c9b4c3eb85
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl.h
@@ -0,0 +1,93 @@
+/* Declarations of rctl functions and types.
+ 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_RCTL_H
+#define _SYS_RCTL_H
+
+#include <features.h>
+
+#define RCTL_LOCAL_NOACTION 0x00000000
+#define RCTL_LOCAL_SIGNAL 0x00000001
+#define RCTL_LOCAL_DENY 0x00000002
+#define RCTL_LOCAL_MAXIMAL 0x80000000
+#define RCTL_LOCAL_PROJDB 0x40000000
+#define RCTL_LOCAL_ACTION_MASK 0xFFFF0000
+#define RCTL_LOCAL_MASK 0xC0000003
+
+#define RCTL_GLOBAL_NOACTION 0x00000000
+#define RCTL_GLOBAL_SYSLOG 0x00000001
+#define RCTL_GLOBAL_NOBASIC 0x80000000
+#define RCTL_GLOBAL_LOWERABLE 0x40000000
+#define RCTL_GLOBAL_DENY_ALWAYS 0x20000000
+#define RCTL_GLOBAL_DENY_NEVER 0x10000000
+#define RCTL_GLOBAL_FILE_SIZE 0x08000000
+#define RCTL_GLOBAL_CPU_TIME 0x04000000
+#define RCTL_GLOBAL_SIGNAL_NEVER 0x02000000
+#define RCTL_GLOBAL_NOLOCALACTION RCTL_GLOBAL_SIGNAL_NEVER
+#define RCTL_GLOBAL_INFINITE 0x01000000
+#define RCTL_GLOBAL_UNOBSERVABLE 0x00800000
+#define RCTL_GLOBAL_SYSLOG_NEVER 0x00080000
+#define RCTL_GLOBAL_BYTES 0x00400000
+#define RCTL_GLOBAL_SECONDS 0x00200000
+#define RCTL_GLOBAL_COUNT 0x00100000
+#define RCTL_GLOBAL_ACTION_MASK 0xFFFF0000
+#define RCTL_GLOBAL_MASK 0xFFF80001
+
+#define RCTL_FIRST 0x00000000
+#define RCTL_NEXT 0x00000001
+#define RCTL_USAGE 0x00000002
+
+#define RCTL_INSERT 0x00000000
+#define RCTL_DELETE 0x00000001
+#define RCTL_REPLACE 0x00000002
+
+#define RCTL_USE_RECIPIENT_PID 0x10000000
+
+#define RCTLSYS_ACTION_MASK 0xFFFF0000
+#define RCTLSYS_MASK 0x10000003
+
+#define RCPRIV_BASIC 0x01000000
+#define RCPRIV_PRIVILEGED 0x04000000
+#define RCPRIV_SYSTEM 0x07000000
+
+typedef enum
+ {
+ RCENTITY_PROCESS,
+ RCENTITY_TASK,
+ RCENTITY_PROJECT,
+ RCENTITY_ZONE
+ } rctl_entity_t;
+#define RC_MAX_ENTITY RCENTITY_ZONE
+
+typedef unsigned long long rctl_qty_t;
+typedef int rctl_priv_t;
+typedef struct rctlblk rctlblk_t;
+typedef struct rctl_set rctl_set_t;
+
+__BEGIN_DECLS
+
+int setrctl (const char *controlname, rctlblk_t *old_blk, rctlblk_t *new_blk,
+ unsigned int flags);
+
+int getrctl (const char *controlname, rctlblk_t *old_blk, rctlblk_t *new_blk,
+ unsigned int flags);
+
+__END_DECLS
+
+#endif /* _SYS_RCTL_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl_impl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl_impl.h
new file mode 100644
index 0000000000..3dfc594b19
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/rctl_impl.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 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_RCTL_IMPL_H
+#define _SYS_RCTL_IMPL_H
+
+#include <sys/rctl.h>
+#include <sys/types.h>
+#include <features.h>
+
+#define RCTLCTL_GET 0
+#define RCTLCTL_SET 1
+
+typedef struct rctl_opaque
+ {
+ rctl_qty_t rcq_value;
+ rctl_qty_t rcq_enforced_value;
+ rctl_priv_t rcq_privilege;
+ int rcq_global_flagaction;
+ int rcq_global_syslog_level;
+ int rcq_local_flagaction;
+ int rcq_local_signal;
+ id_t rcq_local_recipient_pid;
+ hrtime_t rcq_firing_time;
+ } rctl_opaque_t;
+
+#define RCTLBLK_INC(b, n) (rctlblk_t *)(((char *)b) + (n * rctlblk_size ()))
+
+__BEGIN_DECLS
+
+extern int rctlctl (const char *, rctlblk_t *, int);
+extern size_t rctllist (char *, size_t);
+extern int setprojrctl (const char *, rctlblk_t *, size_t, int);
+
+__END_DECLS
+
+#endif /* _SYS_RCTL_IMPL_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reboot.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reboot.h
new file mode 100644
index 0000000000..4f0ff0e161
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reboot.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_REBOOT_H
+#define _SYS_REBOOT_H
+
+#include <features.h>
+
+#define RB_AUTOBOOT 0
+#define RB_ASKNAME 0x00000001
+#define RB_SINGLE 0x00000002
+#define RB_NOSYNC 0x00000004
+#define RB_HALT 0x00000008
+#define RB_INITNAME 0x00000010
+#define RB_NOBOOTRC 0x00000020
+#define RB_DEBUG 0x00000040
+#define RB_DUMP 0x00000080
+#define RB_WRITABLE 0x00000100
+#define RB_STRING 0x00000200
+#define RB_CONFIG 0x00000800
+#define RB_RECONFIG 0x00001000
+#define RB_VERBOSE 0x00002000
+#define RB_FORTHDEBUG 0x00004000
+#define RB_FORTHDEBUGDBP 0x00008000
+#define RB_KMDB 0x00020000
+#define RB_NOBOOTCLUSTER 0x00040000
+#define RB_DEBUGENTER 0x00080000
+
+__BEGIN_DECLS
+
+/* Reboot or halt the system. */
+extern int reboot (int __howto, char *bootargs) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_REBOOT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reg.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reg.h
new file mode 100644
index 0000000000..edcd34fee2
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/reg.h
@@ -0,0 +1 @@
+#include <sys/regset.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sendfile.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sendfile.h
new file mode 100644
index 0000000000..bb29d07511
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sendfile.h
@@ -0,0 +1,91 @@
+/* sendfile -- copy data directly from one file descriptor to another
+ Copyright (C) 1998,99,01,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_SENDFILE_H
+#define _SYS_SENDFILE_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+#define SENDFILEV 0
+#define SENDFILEV64 1
+
+#define SFV_FD_SELF (-2)
+
+typedef struct sendfilevec
+{
+ int sfv_fd;
+ unsigned int sfv_flag;
+ off_t sfv_off;
+ size_t sfv_len;
+} sendfilevec_t;
+
+#ifdef __USE_LARGEFILE64
+typedef struct sendfilevec64
+{
+ int sfv_fd;
+ unsigned int sfv_flag;
+ off64_t sfv_off;
+ size_t sfv_len;
+} sendfilevec64_t;
+#endif
+
+__BEGIN_DECLS
+
+/* Send up to COUNT bytes from file associated with IN_FD starting at
+ *OFFSET to descriptor OUT_FD. Set *OFFSET to the IN_FD's file position
+ following the read bytes. If OFFSET is a null pointer, use the normal
+ file position instead. Return the number of written bytes, or -1 in
+ case of error. */
+#ifndef __USE_FILE_OFFSET64
+extern ssize_t sendfile (int __out_fd, int __in_fd, off_t *__offset,
+ size_t __count) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern ssize_t __REDIRECT_NTH (sendfile,
+ (int __out_fd, int __in_fd, __off64_t *__offset,
+ size_t __count), sendfile64);
+# else
+# define sendfile sendfile64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern ssize_t sendfile64 (int __out_fd, int __in_fd, __off64_t *__offset,
+ size_t __count) __THROW;
+#endif
+
+#ifndef __USE_FILE_OFFSET64
+extern ssize_t sendfilev (int, const sendfilevec_t *,
+ int, size_t *) __THROW;
+#else
+# ifdef __REDIRECT_NTH
+extern ssize_t __REDIRECT_NTH (sendfilev,
+ (int, const sendfilevec64_t *, int, size_t *), sendfilev64);
+# else
+# define sendfilev sendfilev64
+# endif
+#endif
+#ifdef __USE_LARGEFILE64
+extern ssize_t sendfilev64 (int, const sendfilevec64_t *,
+ int, size_t *) __THROW;
+#endif
+
+__END_DECLS
+
+#endif /* sys/sendfile.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sid.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sid.h
new file mode 100644
index 0000000000..ebb481dfc4
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sid.h
@@ -0,0 +1,28 @@
+/* Copyright (C) 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_SID_H
+#define _SYS_SID_H
+
+#include <sys/types.h>
+
+int allocids (int, int, uid_t *, int, gid_t *);
+int idmap_reg (int);
+int idmap_unreg (int);
+
+#endif /* _SYS_SID_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/siginfo.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/siginfo.h
new file mode 100644
index 0000000000..b1ddf1ffee
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/siginfo.h
@@ -0,0 +1,25 @@
+/* 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_SIGINFO_H
+#define _SYS_SIGINFO_H
+
+#define __need_siginfo_t
+#include <bits/siginfo.h>
+
+#endif /* _SYS_SIGINFO_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sockio.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sockio.h
new file mode 100644
index 0000000000..6ec92cf732
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sockio.h
@@ -0,0 +1 @@
+#include <sys/ioctl.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/swap.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/swap.h
new file mode 100644
index 0000000000..2e8476695f
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/swap.h
@@ -0,0 +1,78 @@
+/* Calls to enable and disable swapping on specified locations.
+ OpenSolaris version.
+ Copyright (C) 1996, 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_SWAP_H
+#define __SYS_SWAP_H
+
+/* Docs: http://docs.sun.com/app/docs/doc/816-5167/swapctl-2?a=view */
+
+#include <features.h>
+#include <bits/types.h>
+
+/* swapctl cmd values. */
+#define SC_ADD 1
+#define SC_LIST 2
+#define SC_REMOVE 3
+#define SC_GETNSWP 4
+#define SC_AINFO 5
+
+/* swapctl arg for SC_ADD and SC_REMOVE. */
+typedef struct swapres
+ {
+ char *sr_name;
+ __off_t sr_start;
+ __off_t sr_length;
+ } swapres_t;
+
+typedef struct swapent
+ {
+ char *ste_path;
+ __off_t ste_start;
+ __off_t ste_length;
+ long ste_pages;
+ long ste_free;
+ int ste_flags;
+ } swapent_t;
+
+/* ste_flags values. */
+#define ST_INDEL 1
+#define ST_DOINGDEL 2
+
+/* swapctl arg for SC_LIST. */
+typedef struct swaptable
+ {
+ int swt_n;
+ swapent_t swt_ent[1];
+ } swaptbl_t;
+
+__BEGIN_DECLS
+
+/* Make the block special device PATH available to the system for swapping.
+ This call is restricted to the super-user. */
+extern int swapon (__const char *__path) __THROW;
+
+/* Stop using block special device PATH for swapping. */
+extern int swapoff (__const char *__path) __THROW;
+
+extern int swapctl (int cmd, void *arg);
+
+__END_DECLS
+
+#endif /* sys/swap.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/syscall.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/syscall.h
new file mode 100644
index 0000000000..4ff347c272
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/syscall.h
@@ -0,0 +1,301 @@
+/* Copyright (C) 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 _SYSCALL_H
+#define _SYSCALL_H 1
+
+/* OpenSolaris syscall numbers */
+
+#define SYS_syscall 0
+#define SYS_exit 1
+#define SYS_forkall 2
+#define SYS_read 3
+#define SYS_write 4
+#define SYS_open 5
+#define SYS_close 6
+#define SYS_wait 7
+#define SYS_creat 8
+#define SYS_link 9
+#define SYS_unlink 10
+#define SYS_exec 11
+#define SYS_chdir 12
+#define SYS_time 13
+#define SYS_mknod 14
+#define SYS_chmod 15
+#define SYS_chown 16
+#define SYS_brk 17
+#define SYS_stat 18
+#define SYS_lseek 19
+#define SYS_getpid 20
+#define SYS_mount 21
+#define SYS_umount 22
+#define SYS_setuid 23
+#define SYS_getuid 24
+#define SYS_stime 25
+#define SYS_pcsample 26
+#define SYS_alarm 27
+#define SYS_fstat 28
+#define SYS_pause 29
+#define SYS_utime 30
+#define SYS_stty 31
+#define SYS_gtty 32
+#define SYS_access 33
+#define SYS_nice 34
+#define SYS_statfs 35
+#define SYS_sync 36
+#define SYS_kill 37
+#define SYS_fstatfs 38
+#define SYS_pgrpsys 39
+#define SYS_uucopystr 40
+#define SYS_dup 41
+#define SYS_pipe 42
+#define SYS_times 43
+#define SYS_profil 44
+#define SYS_plock 45
+#define SYS_setgid 46
+#define SYS_getgid 47
+#define SYS_signal 48
+#define SYS_msgsys 49
+#define SYS_syssun 50
+#define SYS_sysi86 50
+#define SYS_sysppc 50
+#define SYS_acct 51
+#define SYS_shmsys 52
+#define SYS_semsys 53
+#define SYS_ioctl 54
+#define SYS_uadmin 55
+#define SYS_utssys 57
+#define SYS_fdsync 58
+#define SYS_execve 59
+#define SYS_umask 60
+#define SYS_chroot 61
+#define SYS_fcntl 62
+#define SYS_ulimit 63
+/* 64 - 69 are reserved */
+#define SYS_tasksys 70
+#define SYS_acctctl 71
+#define SYS_exacctsys 72
+#define SYS_getpagesizes 73
+#define SYS_rctlsys 74
+#define SYS_sidsys 75
+#define SYS_fsat 76
+#define SYS_lwp_park 77
+#define SYS_sendfilev 78
+#define SYS_rmdir 79
+#define SYS_mkdir 80
+#define SYS_getdents 81
+#define SYS_privsys 82
+#define SYS_ucredsys 83
+#define SYS_sysfs 84
+#define SYS_getmsg 85
+#define SYS_putmsg 86
+#define SYS_poll 87
+#define SYS_lstat 88
+#define SYS_symlink 89
+#define SYS_readlink 90
+#define SYS_setgroups 91
+#define SYS_getgroups 92
+#define SYS_fchmod 93
+#define SYS_fchown 94
+#define SYS_sigprocmask 95
+#define SYS_sigsuspend 96
+#define SYS_sigaltstack 97
+#define SYS_sigaction 98
+#define SYS_sigpending 99
+#define SYS_context 100
+#define SYS_evsys 101
+#define SYS_evtrapret 102
+#define SYS_statvfs 103
+#define SYS_fstatvfs 104
+#define SYS_getloadavg 105
+#define SYS_nfssys 106
+#define SYS_waitid 107
+#define SYS_waitsys SYS_waitid
+#define SYS_sigsendsys 108
+#define SYS_hrtsys 109
+/* 110 unused */
+#define SYS_sigresend 111
+#define SYS_priocntlsys 112
+#define SYS_pathconf 113
+#define SYS_mincore 114
+#define SYS_mmap 115
+#define SYS_mprotect 116
+#define SYS_munmap 117
+#define SYS_fpathconf 118
+#define SYS_vfork 119
+#define SYS_fchdir 120
+#define SYS_readv 121
+#define SYS_writev 122
+#define SYS_xstat 123
+#define SYS_lxstat 124
+#define SYS_fxstat 125
+#define SYS_xmknod 126
+/* 127 unused */
+#define SYS_setrlimit 128
+#define SYS_getrlimit 129
+#define SYS_lchown 130
+#define SYS_memcntl 131
+#define SYS_getpmsg 132
+#define SYS_putpmsg 133
+#define SYS_rename 134
+#define SYS_uname 135
+#define SYS_setegid 136
+#define SYS_sysconfig 137
+#define SYS_adjtime 138
+#define SYS_systeminfo 139
+#define SYS_sharefs 140
+#define SYS_seteuid 141
+#define SYS_forksys 142
+#define SYS_fork1 143
+#define SYS_sigtimedwait 144
+#define SYS_lwp_info 145
+#define SYS_yield 146
+#define SYS_lwp_sema_wait 147
+#define SYS_lwp_sema_post 148
+#define SYS_lwp_sema_trywait 149
+#define SYS_lwp_detach 150
+#define SYS_corectl 151
+#define SYS_modctl 152
+#define SYS_fchroot 153
+#define SYS_utimes 154
+#define SYS_vhangup 155
+#define SYS_gettimeofday 156
+#define SYS_getitimer 157
+#define SYS_setitimer 158
+#define SYS_lwp_create 159
+#define SYS_lwp_exit 160
+#define SYS_lwp_suspend 161
+#define SYS_lwp_continue 162
+#define SYS_lwp_kill 163
+#define SYS_lwp_self 164
+#define SYS_lwp_sigmask 165
+#define SYS_lwp_private 166
+#define SYS_lwp_wait 167
+#define SYS_lwp_mutex_wakeup 168
+#define SYS_lwp_mutex_lock 169
+#define SYS_lwp_cond_wait 170
+#define SYS_lwp_cond_signal 171
+#define SYS_lwp_cond_broadcast 172
+#define SYS_pread 173
+#define SYS_pwrite 174
+#define SYS_llseek 175
+#define SYS_inst_sync 176
+#define SYS_brand 177
+#define SYS_kaio 178
+#define SYS_cpc 179
+#define SYS_lgrpsys 180
+#define SYS_meminfosys SYS_lgrpsys
+#define SYS_rusagesys 181
+#define SYS_port 182
+#define SYS_pollsys 183
+#define SYS_labelsys 184
+#define SYS_acl 185
+#define SYS_auditsys 186
+#define SYS_processor_bind 187
+#define SYS_processor_info 188
+#define SYS_p_online 189
+#define SYS_sigqueue 190
+#define SYS_clock_gettime 191
+#define SYS_clock_settime 192
+#define SYS_clock_getres 193
+#define SYS_timer_create 194
+#define SYS_timer_delete 195
+#define SYS_timer_settime 196
+#define SYS_timer_gettime 197
+#define SYS_timer_getoverrun 198
+#define SYS_nanosleep 199
+#define SYS_facl 200
+#define SYS_door 201
+#define SYS_setreuid 202
+#define SYS_setregid 203
+#define SYS_install_utrap 204
+#define SYS_signotify 205
+#define SYS_schedctl 206
+#define SYS_pset 207
+#define SYS_sparc_utrap_install 208
+#define SYS_resolvepath 209
+#define SYS_lwp_mutex_timedlock 210
+#define SYS_lwp_sema_timedwait 211
+#define SYS_lwp_rwlock_sys 212
+#define SYS_getdents64 213
+#define SYS_mmap64 214
+#define SYS_stat64 215
+#define SYS_lstat64 216
+#define SYS_fstat64 217
+#define SYS_statvfs64 218
+#define SYS_fstatvfs64 219
+#define SYS_setrlimit64 220
+#define SYS_getrlimit64 221
+#define SYS_pread64 222
+#define SYS_pwrite64 223
+#define SYS_creat64 224
+#define SYS_open64 225
+#define SYS_rpcsys 226
+#define SYS_zone 227
+#define SYS_autofssys 228
+#define SYS_getcwd 229
+#define SYS_so_socket 230
+#define SYS_so_socketpair 231
+#define SYS_bind 232
+#define SYS_listen 233
+#define SYS_accept 234
+#define SYS_connect 235
+#define SYS_shutdown 236
+#define SYS_recv 237
+#define SYS_recvfrom 238
+#define SYS_recvmsg 239
+#define SYS_send 240
+#define SYS_sendmsg 241
+#define SYS_sendto 242
+#define SYS_getpeername 243
+#define SYS_getsockname 244
+#define SYS_getsockopt 245
+#define SYS_setsockopt 246
+#define SYS_sockconfig 247
+#define SYS_ntp_gettime 248
+#define SYS_ntp_adjtime 249
+#define SYS_lwp_mutex_unlock 250
+#define SYS_lwp_mutex_trylock 251
+#define SYS_lwp_mutex_register 252
+#define SYS_cladm 253
+#define SYS_uucopy 254
+#define SYS_umount2 255
+
+#ifndef __ASSEMBLER__
+typedef struct
+ {
+ unsigned int word[16];
+ } sysset_t;
+
+typedef struct
+ {
+ long sys_rval1;
+ long sys_rval2;
+ } sysret_t;
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+extern int __systemcall (sysret_t *, int, ...);
+
+__END_DECLS
+
+#endif
+
+#endif /* sys/syscall.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysconfig.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysconfig.h
new file mode 100644
index 0000000000..c93c572f00
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysconfig.h
@@ -0,0 +1,66 @@
+/* Definitions for sysconfig found on Solaris systems.
+ 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 _BITS_SYSCONFIG_H
+#define _BITS_SYSCONFIG_H
+
+#define _CONFIG_NGROUPS 2
+#define _CONFIG_CHILD_MAX 3
+#define _CONFIG_OPEN_FILES 4
+#define _CONFIG_POSIX_VER 5
+#define _CONFIG_PAGESIZE 6
+#define _CONFIG_CLK_TCK 7
+#define _CONFIG_XOPEN_VER 8
+#define _CONFIG_PROF_TCK 10
+#define _CONFIG_NPROC_CONF 11
+#define _CONFIG_NPROC_ONLN 12
+#define _CONFIG_AIO_LISTIO_MAX 13
+#define _CONFIG_AIO_MAX 14
+#define _CONFIG_AIO_PRIO_DELTA_MAX 15
+#define _CONFIG_DELAYTIMER_MAX 16
+#define _CONFIG_MQ_OPEN_MAX 17
+#define _CONFIG_MQ_PRIO_MAX 18
+#define _CONFIG_RTSIG_MAX 19
+#define _CONFIG_SEM_NSEMS_MAX 20
+#define _CONFIG_SEM_VALUE_MAX 21
+#define _CONFIG_SIGQUEUE_MAX 22
+#define _CONFIG_SIGRT_MIN 23
+#define _CONFIG_SIGRT_MAX 24
+#define _CONFIG_TIMER_MAX 25
+#define _CONFIG_PHYS_PAGES 26
+#define _CONFIG_AVPHYS_PAGES 27
+#define _CONFIG_COHERENCY 28
+#define _CONFIG_SPLIT_CACHE 29
+#define _CONFIG_ICACHESZ 30
+#define _CONFIG_DCACHESZ 31
+#define _CONFIG_ICACHELINESZ 32
+#define _CONFIG_DCACHELINESZ 33
+#define _CONFIG_ICACHEBLKSZ 34
+#define _CONFIG_DCACHEBLKSZ 35
+#define _CONFIG_DCACHETBLKSZ 36
+#define _CONFIG_ICACHE_ASSOC 37
+#define _CONFIG_DCACHE_ASSOC 38
+#define _CONFIG_MAXPID 42
+#define _CONFIG_STACK_PROT 43
+#define _CONFIG_NPROC_MAX 44
+#define _CONFIG_CPUID_MAX 45
+#define _CONFIG_SYMLOOP_MAX 46
+#define _CONFIG_EPHID_MAX 47
+
+#endif /* _BITS_SYSCONFIG_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysmacros.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysmacros.h
new file mode 100644
index 0000000000..74095a247c
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/sysmacros.h
@@ -0,0 +1,107 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_SYSMACROS_H
+#define _SYS_SYSMACROS_H
+
+#include <features.h>
+#include <sys/isa_defs.h>
+
+#ifdef __USE_MISC
+
+# define dtob(DD) ((DD) << DEV_BSHIFT)
+# define btod(BB) (((BB) + DEV_BSIZE - 1) >> DEV_BSHIFT)
+# define btodt(BB) ((BB) >> DEV_BSHIFT)
+# define lbtod(BB) (((offset_t)(BB) + DEV_BSIZE - 1) >> DEV_BSHIFT)
+
+# define O_BITSMAJOR 7
+# define O_BITSMINOR 8
+# define O_MAXMAJ 0x7f
+# define O_MAXMIN 0xff
+# define L_BITSMAJOR32 14
+# define L_BITSMINOR32 18
+# define L_MAXMAJ32 0x3fff
+# define L_MAXMIN32 0x3ffff
+
+# ifdef _LP64
+# define L_BITSMAJOR 32
+# define L_BITSMINOR 32
+# define L_MAXMAJ 0xfffffffful
+# define L_MAXMIN 0xfffffffful
+# else
+# define L_BITSMAJOR L_BITSMAJOR32
+# define L_BITSMINOR L_BITSMINOR32
+# define L_MAXMAJ L_MAXMAJ32
+# define L_MAXMIN L_MAXMIN32
+# endif
+
+# define major(x) (major_t)(((dev_t)(x)) >> L_BITSMINOR)
+# define getmajor(x) major(x)
+# define minor(x) (minor_t)((x) & L_MAXMIN)
+# define getminor(x) minor(x)
+
+# define makedev(x, y) (dev_t)(((dev_t)(x) << L_BITSMINOR) | \
+ ((y) & L_MAXMIN))
+# define makedevice(x, y) makedev(x, y)
+
+# define emajor(x) (major_t)(((unsigned int)(x) >> O_BITSMINOR) > \
+ O_MAXMAJ) ? NODEV : (((unsigned int)(x) >> O_BITSMINOR) & O_MAXMAJ)
+# define eminor(x) (minor_t)((x) & O_MAXMIN)
+
+# define cmpdev(x) (o_dev_t)((((x) >> L_BITSMINOR) > O_MAXMAJ || \
+ ((x) & L_MAXMIN) > O_MAXMIN) ? NODEV : \
+ ((((x) >> L_BITSMINOR) << O_BITSMINOR) | ((x) & O_MAXMIN)))
+# define expdev(x) (dev_t)(((dev_t)(((x) >> O_BITSMINOR) & O_MAXMAJ) << \
+ L_BITSMINOR) | ((x) & O_MAXMIN))
+
+# define howmany(x, y) (((x)+((y)-1))/(y))
+# define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
+
+# define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
+# define ISP2(x) (((x) & ((x) - 1)) == 0)
+
+# define P2ALIGN(x, align) ((x) & -(align))
+# define P2PHASE(x, align) ((x) & ((align) - 1))
+# define P2NPHASE(x, align) (-(x) & ((align) - 1))
+# define P2ROUNDUP(x, align) (-(-(x) & -(align)))
+# define P2END(x, align) (-(~(x) & -(align)))
+# define P2PHASEUP(x, align, phase) ((phase) - (((phase) - (x)) & -(align)))
+# define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
+# define P2SAMEHIGHBIT(x, y) (((x) ^ (y)) < ((x) & (y)))
+
+# define P2ALIGN_TYPED(x, align, type) ((type)(x) & -(type)(align))
+# define P2PHASE_TYPED(x, align, type) ((type)(x) & ((type)(align) - 1))
+# define P2NPHASE_TYPED(x, align, type) (-(type)(x) & ((type)(align) - 1))
+# define P2ROUNDUP_TYPED(x, align, type) (-(-(type)(x) & -(type)(align)))
+# define P2END_TYPED(x, align, type) (-(~(type)(x) & -(type)(align)))
+# define P2PHASEUP_TYPED(x, align, phase, type) ((type)(phase) - \
+ (((type)(phase) - (type)(x)) & -(type)(align)))
+# define P2CROSS_TYPED(x, y, align, type) (((type)(x) ^ (type)(y)) > \
+ (type)(align) - 1)
+# define P2SAMEHIGHBIT_TYPED(x, y, type) (((type)(x) ^ (type)(y)) < \
+ ((type)(x) & (type)(y)))
+
+/* For compatibility with GNU/Linux. */
+# define gnu_dev_major(dev) major (dev)
+# define gnu_dev_minor(dev) minor (dev)
+# define gnu_dev_makedev(maj, min) makedev (maj, min)
+
+#endif /* __USE_MISC */
+
+#endif /* _SYS_SYSMACROS_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/systeminfo.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/systeminfo.h
new file mode 100644
index 0000000000..ac32b78811
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/systeminfo.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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 _SYSTEMINFO_H
+#define _SYSTEMINFO_H
+
+#include <features.h>
+
+#define SI_SYSNAME 1
+#define SI_HOSTNAME 2
+#define SI_RELEASE 3
+#define SI_VERSION 4
+#define SI_MACHINE 5
+#define SI_ARCHITECTURE 6
+#define SI_HW_SERIAL 7
+#define SI_HW_PROVIDER 8
+#define SI_SRPC_DOMAIN 9
+
+#define SI_SET_HOSTNAME 258
+
+#define SI_SET_SRPC_DOMAIN 265
+
+#define SI_PLATFORM 513
+#define SI_ISALIST 514
+#define SI_DHCP_CACHE 515
+#define SI_ARCHITECTURE_32 516
+#define SI_ARCHITECTURE_64 517
+#define SI_ARCHITECTURE_K 518
+#define SI_ARCHITECTURE_NATIVE 519
+
+__BEGIN_DECLS
+
+extern long sysinfo (int command, char *buf, long count);
+
+__END_DECLS
+
+#endif /* _SYSTEMINFO_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/task.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/task.h
new file mode 100644
index 0000000000..ab51c85b61
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/task.h
@@ -0,0 +1,44 @@
+/* Declarations of privilege functions and types.
+ 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_TASK_H
+#define _SYS_TASK_H
+
+#include <sys/types.h>
+#include <sys/rctl.h>
+#include <sys/param.h>
+#include <features.h>
+
+#define TASK_NORMAL 0x00
+#define TASK_FINAL 0x01
+#define TASK_MASK 0x01
+
+#define TASK_PROJ_PURGE 0x00100000
+#define TASK_PROJ_MASK 0x00100000
+
+struct task;
+
+__BEGIN_DECLS
+
+extern taskid_t settaskid (projid_t, unsigned int);
+extern taskid_t gettaskid (void);
+
+__END_DECLS
+
+#endif /* _SYS_TASK_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/termio.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/termio.h
new file mode 100644
index 0000000000..1da76d5058
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/termio.h
@@ -0,0 +1 @@
+#include <sys/termios.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/time_impl.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/time_impl.h
new file mode 100644
index 0000000000..18a03a58e7
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/time_impl.h
@@ -0,0 +1 @@
+#include <sys/time.h>
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/timex.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/timex.h
new file mode 100644
index 0000000000..8a59d5fe06
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/timex.h
@@ -0,0 +1,155 @@
+/* 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_TIMEX_H
+#define _SYS_TIMEX_H 1
+
+#include <features.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
+struct ntptimeval
+{
+ struct timeval time; /* current time (ro) */
+ int32_t maxerror; /* maximum error (us) (ro) */
+ int32_t esterror; /* estimated error (us) (ro) */
+};
+
+#ifdef _SYSCALL32
+# include <sys/types32.h>
+struct ntptimeval32
+{
+ struct timeval32 time;
+ int32_t maxerror;
+ int32_t esterror;
+};
+#endif
+
+struct timex
+{
+ uint32_t modes; /* mode selector */
+ int32_t offset; /* time offset (usec) */
+ int32_t freq; /* frequency offset (scaled ppm) */
+ int32_t maxerror; /* maximum error (usec) */
+ int32_t esterror; /* estimated error (usec) */
+ int32_t status; /* clock command/status */
+ int32_t constant; /* pll time constant */
+ int32_t precision; /* clock precision (usec) (read only) */
+ int32_t tolerance; /* clock frequency tolerance (ppm) (read only) */
+ int32_t ppsfreq; /* pps frequency (scaled ppm) (ro) */
+ int32_t jitter; /* pps jitter (us) (ro) */
+ int32_t shift; /* interval duration (s) (shift) (ro) */
+ int32_t stabil; /* pps stability (scaled ppm) (ro) */
+ int32_t jitcnt; /* jitter limit exceeded (ro) */
+ int32_t calcnt; /* calibration intervals (ro) */
+ int32_t errcnt; /* calibration errors (ro) */
+ int32_t stbcnt; /* stability limit exceeded (ro) */
+};
+
+/* Engineering parameters of the PLL. */
+#define SCALE_KG (1<<6)
+#define SCALE_KF (1<<16)
+#define SCALE_KH (1<<2)
+#define MAXTC (1<<6)
+
+
+/* PLL variables. */
+#define SCALE_PHASE (1<<22)
+#define SCALE_USEC (1<<16)
+#define SCALE_UPDATE (SCALE_KG * MAXTC)
+#define FINEUSEC (1<<22)
+
+/* Performance envelope of the PLL. */
+#define MAXPHASE 512000
+#define MAXFREQ (512 * SCALE_USEC)
+#define MAXTIME (200 << PPS_AVG)
+#define MINSEC 16
+#define MAXSEC 1200
+
+/* Used if pulse-per-second (PPS) is present. */
+#define PPS_AVG 2
+#define PPS_SHIFT 2
+#define PPS_SHIFTMAX 8
+#define PPS_VALID 120
+#define MAXGLITCH 30
+
+/* Mode codes (timex.mode) */
+#define ADJ_OFFSET 0x0001 /* time offset */
+#define ADJ_FREQUENCY 0x0002 /* frequency offset */
+#define ADJ_MAXERROR 0x0004 /* maximum time error */
+#define ADJ_ESTERROR 0x0008 /* estimated time error */
+#define ADJ_STATUS 0x0010 /* clock status */
+#define ADJ_TIMECONST 0x0020 /* pll time constant */
+#define ADJ_TICK 0x4000 /* tick value */
+#define ADJ_OFFSET_SINGLESHOT 0x8000 /* old-fashioned adjtime */
+
+/* xntp 3.4 compatibility names */
+#define MOD_OFFSET ADJ_OFFSET
+#define MOD_FREQUENCY ADJ_FREQUENCY
+#define MOD_MAXERROR ADJ_MAXERROR
+#define MOD_ESTERROR ADJ_ESTERROR
+#define MOD_STATUS ADJ_STATUS
+#define MOD_TIMECONST ADJ_TIMECONST
+#define MOD_CLKB ADJ_TICK
+#define MOD_CLKA ADJ_OFFSET_SINGLESHOT /* 0x8000 in original */
+
+
+/* Status codes (timex.status) */
+#define STA_PLL 0x0001 /* enable PLL updates (rw) */
+#define STA_PPSFREQ 0x0002 /* enable PPS freq discipline (rw) */
+#define STA_PPSTIME 0x0004 /* enable PPS time discipline (rw) */
+#define STA_FLL 0x0008 /* select frequency-lock mode (rw) */
+
+#define STA_INS 0x0010 /* insert leap (rw) */
+#define STA_DEL 0x0020 /* delete leap (rw) */
+#define STA_UNSYNC 0x0040 /* clock unsynchronized (rw) */
+#define STA_FREQHOLD 0x0080 /* hold frequency (rw) */
+
+#define STA_PPSSIGNAL 0x0100 /* PPS signal present (ro) */
+#define STA_PPSJITTER 0x0200 /* PPS signal jitter exceeded (ro) */
+#define STA_PPSWANDER 0x0400 /* PPS signal wander exceeded (ro) */
+#define STA_PPSERROR 0x0800 /* PPS signal calibration error (ro) */
+
+#define STA_CLOCKERR 0x1000 /* clock hardware fault (ro) */
+
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | \
+ STA_PPSERROR | STA_CLOCKERR) /* read-only bits */
+
+/* Clock states (time_state) */
+#define TIME_OK 0 /* clock synchronized, no leap second */
+#define TIME_INS 1 /* insert leap second */
+#define TIME_DEL 2 /* delete leap second */
+#define TIME_OOP 3 /* leap second in progress */
+#define TIME_WAIT 4 /* leap second has occurred */
+#define TIME_ERROR 5 /* clock not synchronized */
+#define TIME_BAD TIME_ERROR /* bw compat */
+
+/* Maximum time constant of the PLL. */
+#define MAXTC 6
+
+__BEGIN_DECLS
+
+extern int __adjtimex (struct timex *__ntx) __THROW;
+extern int adjtimex (struct timex *__ntx) __THROW;
+
+extern int ntp_gettime (struct ntptimeval *__ntv) __THROW;
+extern int ntp_adjtime (struct timex *__tntx) __THROW;
+
+__END_DECLS
+
+#endif /* sys/timex.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tsol/label.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tsol/label.h
new file mode 100644
index 0000000000..0feca36f97
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tsol/label.h
@@ -0,0 +1,44 @@
+/* Copyright (C) 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 _SYS_TSOL_LABEL_H
+#define _SYS_TSOL_LABEL_H
+
+#include <sys/types.h>
+
+typedef struct _mac_label_impl m_label_t;
+typedef m_label_t blevel_t;
+typedef m_label_t bslabel_t;
+typedef m_label_t bclear_t;
+
+typedef struct _tsol_binary_level_lrange
+ {
+ m_label_t *lower_bound;
+ m_label_t *upper_bound;
+ } m_range_t;
+
+typedef m_range_t blrange_t;
+
+typedef struct tsol_mlp_s
+ {
+ unsigned char mlp_ipp;
+ uint16_t mlp_port;
+ uint16_t mlp_port_upper;
+ } tsol_mlp_t;
+
+#endif /* _SYS_TSOL_LABEL_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttold.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttold.h
new file mode 100644
index 0000000000..755272bbf6
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttold.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_TTOLD_H
+#define _SYS_TTOLD_H
+
+#include <sys/ioctl.h>
+
+struct tc
+ {
+ char t_intrc;
+ char t_quitc;
+ char t_startc;
+ char t_stopc;
+ char t_eofc;
+ char t_brkc;
+ };
+
+#endif /* _SYS_TTOLD_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tty.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tty.h
new file mode 100644
index 0000000000..e2e0dac385
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/tty.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_TTY_H
+#define _SYS_TTY_H
+
+#include <sys/termios.h>
+
+#endif /* _SYS_TTY_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttydefaults.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttydefaults.h
new file mode 100644
index 0000000000..555ba51966
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ttydefaults.h
@@ -0,0 +1,101 @@
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)ttydefaults.h 8.4 (Berkeley) 1/21/94
+ */
+
+/*
+ * System wide defaults for terminal state. 4.4 BSD/generic GNU version.
+ */
+#ifndef _SYS_TTYDEFAULTS_H_
+#define _SYS_TTYDEFAULTS_H_
+
+/*
+ * Defaults on "first" open.
+ */
+#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
+#define TTYDEF_OFLAG (OPOST | ONLCR | OXTABS)
+#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
+#define TTYDEF_SPEED (B9600)
+
+/*
+ * Control Character Defaults
+ */
+#define CTRL(x) (x&037)
+#define CEOF CTRL('d')
+#ifdef _POSIX_VDISABLE
+# define CEOL _POSIX_VDISABLE
+#else
+# define CEOL ((unsigned char)'\377') /* XXX avoid _POSIX_VDISABLE */
+#endif
+#define CERASE 0177
+#define CINTR CTRL('c')
+#ifdef _POSIX_VDISABLE
+# define CSTATUS _POSIX_VDISABLE
+#else
+# define CSTATUS ((unsigned char)'\377') /* XXX avoid _POSIX_VDISABLE */
+#endif
+#define CKILL CTRL('u')
+#define CMIN 1
+#define CQUIT 034 /* FS, ^\ */
+#define CSUSP CTRL('z')
+#define CTIME 0
+#define CDSUSP CTRL('y')
+#define CSTART CTRL('q')
+#define CSTOP CTRL('s')
+#define CSWTCH CTRL('z')
+#define CLNEXT CTRL('v')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
+#define CEOT CEOF
+/* compat */
+#define CBRK CEOL
+#define CRPRNT CREPRINT
+#define CFLUSH CDISCARD
+
+/* PROTECTED INCLUSION ENDS HERE */
+#endif /* !_SYS_TTYDEFAULTS_H_ */
+
+/*
+ * #define TTYDEFCHARS to include an array of default control characters.
+ */
+#ifdef TTYDEFCHARS
+cc_t ttydefchars[NCCS] = {
+ CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
+ _POSIX_VDISABLE, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
+ CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
+};
+#undef TTYDEFCHARS
+#endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/types32.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/types32.h
new file mode 100644
index 0000000000..9d13a5e8ad
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/types32.h
@@ -0,0 +1,66 @@
+/* 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_TYPES32_H
+#define _SYS_TYPES32_H
+
+#include <bits/types.h>
+
+typedef __uint32_t caddr32_t;
+typedef __int32_t daddr32_t;
+typedef __int32_t off32_t;
+typedef __uint32_t ino32_t;
+typedef __int32_t blkcnt32_t;
+typedef __uint32_t fsblkcnt32_t;
+typedef __uint32_t fsfilcnt32_t;
+typedef __int32_t id32_t;
+typedef __uint32_t major32_t;
+typedef __uint32_t minor32_t;
+typedef __int32_t key32_t;
+typedef __uint32_t mode32_t;
+typedef __uint32_t uid32_t;
+typedef __uint32_t gid32_t;
+typedef __uint32_t nlink32_t;
+typedef __uint32_t dev32_t;
+typedef __int32_t pid32_t;
+typedef __uint32_t size32_t;
+typedef __int32_t ssize32_t;
+typedef __int32_t time32_t;
+typedef __int32_t clock32_t;
+
+struct timeval32
+ {
+ time32_t tv_sec;
+ __int32_t tv_usec;
+ };
+
+typedef struct timespec32
+ {
+ time32_t tv_sec;
+ __int32_t tv_nsec;
+ } timespec32_t;
+
+typedef struct timespec32 timestruc32_t;
+
+typedef struct itimerspec32
+ {
+ struct timespec32 it_interval;
+ struct timespec32 it_value;
+ } itimerspec32_t;
+
+#endif /* _SYS_TYPES32_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/uadmin.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/uadmin.h
new file mode 100644
index 0000000000..c495021132
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/uadmin.h
@@ -0,0 +1,65 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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 _UADMINP_H
+#define _UADMINP_H
+
+#include <sys/types.h>
+
+/* uadmin cmd's. */
+#define A_REBOOT 1
+#define A_SHUTDOWN 2
+#define A_FREEZE 3
+#define A_REMOUNT 4
+#define A_DUMP 5
+#define A_FTRACE 15
+#define A_SWAPCTL 16
+#define A_SDTTEST 22
+
+/* Shutdown-related fcn's. */
+#define AD_HALT 0
+#define AD_BOOT 1
+#define AD_IBOOT 2
+#define AD_SBOOT 3
+#define AD_SIBOOT 4
+#define AD_POWEROFF 6
+#define AD_NOSYNC 7
+#define AD_FASTREBOOT 8
+#define AD_FASTREBOOT_DRYRUN 9
+
+/* Freeze-related fcn's. */
+#define AD_COMPRESS 0
+#define AD_FORCE 1
+#define AD_CHECK 2
+#define AD_REUSEINIT 3
+#define AD_REUSABLE 4
+#define AD_REUSEFINI 5
+#define AD_SUSPEND_TO_DISK AD_COMPRESS
+#define AD_CHECK_SUSPEND_TO_DISK AD_CHECK
+#define AD_SUSPEND_TO_RAM 20
+#define AD_CHECK_SUSPEND_TO_RAM 21
+
+#define AD_FTRACE_START 1
+#define AD_FTRACE_STOP 2
+
+#define BOOTARGS_MAX 256
+
+extern int uadmin (int, int, uintptr_t);
+
+#endif /* _UADMINP_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ucontext.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ucontext.h
new file mode 100644
index 0000000000..e017381d4f
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/ucontext.h
@@ -0,0 +1,65 @@
+/* Declaration of ucontext_t.
+ 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_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#ifndef __stack_t_defined
+# define __need_stack_t
+# include <bits/sigstack.h>
+#endif
+#include <bits/sigset.h>
+#include <bits/regset.h>
+#include <features.h>
+
+typedef struct ucontext
+{
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ __sigset_t uc_sigmask;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ long uc_filler[5];
+} ucontext_t;
+
+/* uc_flags */
+#define UC_SIGMASK 0x01
+#define UC_STACK 0x02
+#define UC_CPU 0x04
+#define UC_MAU 0x08
+#define UC_FPU UC_MAU
+#define UC_MCONTEXT (UC_CPU | UC_FPU)
+#define UC_ALL (UC_SIGMASK | UC_STACK | UC_MCONTEXT)
+
+#define GETCONTEXT 0
+#define SETCONTEXT 1
+#define GETUSTACK 2
+#define SETUSTACK 3
+
+__BEGIN_DECLS
+
+int getustack (stack_t **);
+
+int setustack (stack_t *);
+
+int stack_getbounds (stack_t *);
+
+__END_DECLS
+
+#endif /* _SYS_UCONTEXT_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utime.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utime.h
new file mode 100644
index 0000000000..65633b84f3
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utime.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_UTIME_H
+#define _SYS_UTIME_H
+
+#include <utime.h>
+
+#ifdef _SYSCALL32
+
+# include <sys/types32.h>
+
+struct utimbuf32
+ {
+ time32_t actime;
+ time32_t modtime;
+ };
+
+#endif
+
+#endif /* _SYS_UTIME_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utssys.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utssys.h
new file mode 100644
index 0000000000..885b4774a3
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/utssys.h
@@ -0,0 +1,81 @@
+/* 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_UTSSYS_H
+#define _SYS_UTSSYS_H
+
+#include <sys/types.h>
+
+#define UTS_UNAME 0x00
+#define UTS_USTAT 0x02
+#define UTS_FUSERS 0x03
+
+/* UTS_FUSERS flags. */
+#define F_FILE_ONLY 0x01
+#define F_CONTAINED 0x02
+#define F_NBMANDLIST 0x04
+#define F_DEVINFO 0x08
+#define F_KINFO_COUNT 0x10
+
+typedef struct f_user
+ {
+ int fu_flags; /* see below */
+ union
+ {
+ struct
+ {
+ pid_t u_pid;
+ uid_t u_uid;
+ } u_info;
+ struct
+ {
+ int k_modid;
+ int k_instance;
+ int k_minor;
+ } k_info;
+ } fu_info;
+ } f_user_t;
+
+#define fu_pid fu_info.u_info.u_pid
+#define fu_uid fu_info.u_info.u_uid
+#define fu_modid fu_info.k_info.k_modid
+#define fu_instance fu_info.k_info.k_instance
+#define fu_minor fu_info.k_info.k_minor
+
+/* fu_flags values. */
+#define F_CDIR 0x01
+#define F_RDIR 0x02
+#define F_TEXT 0x04
+#define F_MAP 0x08
+#define F_OPEN 0x10
+#define F_TRACE 0x20
+#define F_TTY 0x40
+#define F_NBM 0x80
+#define F_KERNEL 0x80000000
+
+typedef struct fu_data
+ {
+ int fud_user_max;
+ int fud_user_count;
+ struct f_user fud_user[1];
+ } fu_data_t;
+
+#define fu_data_size(x) (sizeof(fu_data_t) - sizeof(f_user_t) + \
+ ((x) * sizeof(f_user_t)))
+
+#endif /* _SYS_UTSSYS_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/vfstab.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/vfstab.h
new file mode 100644
index 0000000000..53d4a0bb04
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/vfstab.h
@@ -0,0 +1,58 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+ 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_VFSTAB_H
+#define _SYS_VFSTAB_H
+
+#include <features.h>
+#include <stdio.h>
+#include <paths.h>
+
+#define VFSTAB _PATH_MNTTAB
+
+#define VFS_LINE_MAX 1024
+
+#define VFS_TOOLONG 1
+#define VFS_TOOMANY 2
+#define VFS_TOOFEW 3
+
+
+struct vfstab
+ {
+ char *vfs_special;
+ char *vfs_fsckdev;
+ char *vfs_mountp;
+ char *vfs_fstype;
+ char *vfs_fsckpass;
+ char *vfs_automnt;
+ char *vfs_mntopts;
+ };
+
+__BEGIN_DECLS
+
+extern int getvfsent (FILE *, struct vfstab *);
+extern int getvfsspec (FILE *, struct vfstab *, char *);
+extern int getvfsfile (FILE *, struct vfstab *, char *);
+extern int getvfsany (FILE *, struct vfstab *, struct vfstab *);
+extern void vfsnull (FILE *, struct vfstab *);
+extern void putvfsent (FILE *, struct vfstab *);
+
+__END_DECLS
+
+#endif /* _SYS_VFSTAB_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/wait.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/wait.h
new file mode 100644
index 0000000000..7c24bdffda
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/wait.h
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991-1994,1996-2001,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. */
+
+/*
+ * POSIX Standard: 3.2.1 Wait for Process Termination <sys/wait.h>
+ */
+
+#ifndef _SYS_WAIT_H
+#define _SYS_WAIT_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+#include <signal.h>
+#include <sys/resource.h>
+#include <sys/procset.h>
+
+/* These macros could also be defined in <stdlib.h>. */
+#if !defined _STDLIB_H || !defined __USE_XOPEN
+/* This will define the `W*' macros for the flag
+ bits to `waitpid', `wait3', and `wait4'. */
+# include <bits/waitflags.h>
+
+# ifdef __USE_BSD
+
+/* Lots of hair to allow traditional BSD use of `union wait'
+ as well as POSIX.1 use of `int' for the status word. */
+
+# if defined __GNUC__ && !defined __cplusplus
+# define __WAIT_INT(status) \
+ (__extension__ (((union { __typeof(status) __in; int __i; }) \
+ { .__in = (status) }).__i))
+# else
+# define __WAIT_INT(status) (*(__const int *) &(status))
+# endif
+
+/* This is the type of the argument to `wait'. The funky union
+ causes redeclarations with ether `int *' or `union wait *' to be
+ allowed without complaint. __WAIT_STATUS_DEFN is the type used in
+ the actual function definitions. */
+
+# if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
+# define __WAIT_STATUS void *
+# define __WAIT_STATUS_DEFN void *
+# else
+/* This works in GCC 2.6.1 and later. */
+typedef union
+ {
+ union wait *__uptr;
+ int *__iptr;
+ } __WAIT_STATUS __attribute__ ((__transparent_union__));
+# define __WAIT_STATUS_DEFN int *
+# endif
+
+# else /* Don't use BSD. */
+
+# define __WAIT_INT(status) (status)
+# define __WAIT_STATUS int *
+# define __WAIT_STATUS_DEFN int *
+
+# endif /* Use BSD. */
+
+/* This will define all the `__W*' macros. */
+# include <bits/waitstatus.h>
+
+# define WEXITSTATUS(status) __WEXITSTATUS(__WAIT_INT(status))
+# define WTERMSIG(status) __WTERMSIG(__WAIT_INT(status))
+# define WSTOPSIG(status) __WSTOPSIG(__WAIT_INT(status))
+# define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status))
+# define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status))
+# define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status))
+# ifdef __WIFCONTINUED
+# define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status))
+# endif
+#endif /* <stdlib.h> not included. */
+
+#ifdef __USE_BSD
+# define WCOREFLAG __WCOREFLAG
+# define WCOREDUMP(status) __WCOREDUMP(__WAIT_INT(status))
+# define W_EXITCODE(ret, sig) __W_EXITCODE(ret, sig)
+# define W_STOPCODE(sig) __W_STOPCODE(sig)
+#endif
+
+/* Wait for a child to die. When one does, put its status in *STAT_LOC
+ and return its process ID. For errors, return (pid_t) -1.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern __pid_t wait (__WAIT_STATUS __stat_loc);
+
+#ifdef __USE_BSD
+/* Special values for the PID argument to `waitpid' and `wait4'. */
+# define WAIT_ANY (-1) /* Any process. */
+# define WAIT_MYPGRP 0 /* Any process in my process group. */
+#endif
+
+/* Wait for a child matching PID to die.
+ If PID is greater than 0, match any process whose process ID is PID.
+ If PID is (pid_t) -1, match any process.
+ If PID is (pid_t) 0, match any process with the
+ same process group as the current process.
+ If PID is less than -1, match any process whose
+ process group is the absolute value of PID.
+ If the WNOHANG bit is set in OPTIONS, and that child
+ is not already dead, return (pid_t) 0. If successful,
+ return PID and store the dead child's status in STAT_LOC.
+ Return (pid_t) -1 for errors. If the WUNTRACED bit is
+ set in OPTIONS, return status for stopped children; otherwise don't.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
+
+#if defined __USE_SVID || defined __USE_XOPEN
+# define __need_siginfo_t
+# include <bits/siginfo.h>
+/* Wait for a childing matching IDTYPE and ID to change the status and
+ place appropriate information in *INFOP.
+ If IDTYPE is P_PID, match any process whose process ID is ID.
+ If IDTYPE is P_PGID, match any process whose process group is ID.
+ If IDTYPE is P_ALL, match any process.
+ If the WNOHANG bit is set in OPTIONS, and that child
+ is not already dead, clear *INFOP and return 0. If successful, store
+ exit code and status in *INFOP.
+
+ This function is a cancellation point and therefore not marked with
+ __THROW. */
+extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
+ int __options);
+#endif
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+/* This being here makes the prototypes valid whether or not
+ we have already included <sys/resource.h> to define `struct rusage'. */
+struct rusage;
+
+/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
+ return its process ID. For errors return (pid_t) -1. If USAGE is not
+ nil, store information about the child's resource usage there. If the
+ WUNTRACED bit is set in OPTIONS, return status for stopped children;
+ otherwise don't. */
+extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
+ struct rusage * __usage) __THROW;
+#endif
+
+#ifdef __USE_BSD
+/* PID is like waitpid. Other args are like wait3. */
+extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
+ struct rusage *__usage) __THROW;
+#endif /* Use BSD. */
+
+
+__END_DECLS
+
+#endif /* sys/wait.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/zone.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/zone.h
new file mode 100644
index 0000000000..37bf4d8f87
--- /dev/null
+++ b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/zone.h
@@ -0,0 +1,166 @@
+/* Declarations of zone functions and types.
+ 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_ZONE_H
+#define _SYS_ZONE_H
+
+#include <sys/types.h>
+#include <sys/priv.h>
+#include <sys/uadmin.h>
+#include <sys/param.h>
+#include <sys/tsol/label.h>
+
+/* Subcall numbers. */
+#define ZONE_CREATE 0
+#define ZONE_DESTROY 1
+#define ZONE_GETATTR 2
+#define ZONE_ENTER 3
+#define ZONE_LIST 4
+#define ZONE_SHUTDOWN 5
+#define ZONE_LOOKUP 6
+#define ZONE_BOOT 7
+#define ZONE_VERSION 8
+#define ZONE_SETATTR 9
+#define ZONE_ADD_DATALINK 10
+#define ZONE_DEL_DATALINK 11
+#define ZONE_CHECK_DATALINK 12
+#define ZONE_LIST_DATALINK 13
+
+/* Miscellaneous. */
+#define GLOBAL_ZONEID 0
+#define GLOBAL_ZONENAME "global"
+#define MIN_ZONEID 0
+#define MIN_USERZONEID 1
+#define MAX_ZONEID 9999
+#define ZONEID_WIDTH 4
+#define ALL_ZONES (-1)
+#define ZONENAME_MAX 64
+#define ZONENAME_REGEXP "[a-zA-Z0-9][-_.a-zA-Z0-9]{0,62}"
+#define ZONES_TMPDIR "/var/run/zones"
+#define ZONE_DOOR_PATH ZONES_TMPDIR "/%s.zoneadmd_door"
+
+/* Zone attributes. */
+#define ZONE_ATTR_ROOT 1
+#define ZONE_ATTR_NAME 2
+#define ZONE_ATTR_STATUS 3
+#define ZONE_ATTR_PRIVSET 4
+#define ZONE_ATTR_UNIQID 5
+#define ZONE_ATTR_POOLID 6
+#define ZONE_ATTR_INITPID 7
+#define ZONE_ATTR_SLBL 8
+#define ZONE_ATTR_INITNAME 9
+#define ZONE_ATTR_BOOTARGS 10
+#define ZONE_ATTR_BRAND 11
+#define ZONE_ATTR_PHYS_MCAP 12
+#define ZONE_ATTR_SCHED_CLASS 13
+#define ZONE_ATTR_FLAGS 14
+#define ZONE_ATTR_BRAND_ATTRS 32768
+
+/* Zone event strings. */
+#define ZONE_EVENT_CHANNEL "com.sun:zones:status"
+#define ZONE_EVENT_STATUS_CLASS "status"
+#define ZONE_EVENT_STATUS_SUBCLASS "change"
+#define ZONE_EVENT_UNINITIALIZED "uninitialized"
+#define ZONE_EVENT_INITIALIZED "initialized"
+#define ZONE_EVENT_READY "ready"
+#define ZONE_EVENT_RUNNING "running"
+#define ZONE_EVENT_SHUTTING_DOWN "shutting_down"
+
+#define ZONE_CB_NAME "zonename"
+#define ZONE_CB_NEWSTATE "newstate"
+#define ZONE_CB_OLDSTATE "oldstate"
+#define ZONE_CB_TIMESTAMP "when"
+#define ZONE_CB_ZONEID "zoneid"
+
+/* Zone flags. */
+#define ZF_HASHED_LABEL 0x2
+#define ZF_IS_SCRATCH 0x4
+#define ZF_NET_EXCL 0x8
+
+/* Zone create flags. */
+#define ZCF_NET_EXCL 0x1
+
+/* Exit values. */
+#define ZONE_SUBPROC_OK 0
+#define ZONE_SUBPROC_USAGE 253
+#define ZONE_SUBPROC_NOTCOMPLETE 254
+#define ZONE_SUBPROC_FATAL 255
+
+typedef enum
+ {
+ ZONE_IS_UNINITIALIZED = 0,
+ ZONE_IS_INITIALIZED,
+ ZONE_IS_READY,
+ ZONE_IS_BOOTING,
+ ZONE_IS_RUNNING,
+ ZONE_IS_SHUTTING_DOWN,
+ ZONE_IS_EMPTY,
+ ZONE_IS_DOWN,
+ ZONE_IS_DYING,
+ ZONE_IS_DEAD
+ } zone_status_t;
+#define ZONE_MIN_STATE ZONE_IS_UNINITIALIZED
+#define ZONE_MAX_STATE ZONE_IS_DEAD
+
+typedef struct
+ {
+ const char *zone_name;
+ const char *zone_root;
+ const struct priv_set *zone_privs;
+ size_t zone_privssz;
+ const char *rctlbuf;
+ size_t rctlbufsz;
+ int *extended_error;
+ const char *zfsbuf;
+ size_t zfsbufsz;
+ int match;
+ uint32_t doi;
+ const bslabel_t *label;
+ int flags;
+ } zone_def;
+
+typedef enum zone_cmd
+ {
+ Z_READY,
+ Z_BOOT,
+ Z_FORCEBOOT,
+ Z_REBOOT,
+ Z_HALT,
+ Z_NOTE_UNINSTALLING,
+ Z_MOUNT,
+ Z_FORCEMOUNT,
+ Z_UNMOUNT
+ } zone_cmd_t;
+
+typedef struct zone_cmd_arg
+ {
+ uint64_t uniqid;
+ zone_cmd_t cmd;
+ uint32_t _pad;
+ char locale[MAXPATHLEN];
+ char bootbuf[BOOTARGS_MAX];
+ } zone_cmd_arg_t;
+
+typedef struct zone_cmd_rval
+ {
+ int rval;
+ char errbuf[1];
+ } zone_cmd_rval_t;
+
+#endif /* _SYS_ZONE_H */