Index: stable/10/cddl/contrib/opensolaris/head/libintl.h =================================================================== --- stable/10/cddl/contrib/opensolaris/head/libintl.h (revision 297541) +++ stable/10/cddl/contrib/opensolaris/head/libintl.h (revision 297542) @@ -1,125 +1,97 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* + * Copyright 2014 Garrett D'Amore + * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _LIBINTL_H #define _LIBINTL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus extern "C" { #endif /* * wchar_t is a built-in type in standard C++ and as such is not * defined here when using standard C++. However, the GNU compiler * fixincludes utility nonetheless creates its own version of this * header for use by gcc and g++. In that version it adds a redundant * guard for __cplusplus. To avoid the creation of a gcc/g++ specific * header we need to include the following magic comment: * * we must use the C++ compiler's type * * The above comment should not be removed or changed until GNU * gcc/fixinc/inclhack.def is updated to bypass this header. */ #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__)) #ifndef _WCHAR_T #define _WCHAR_T #if defined(_LP64) typedef int wchar_t; #else typedef long wchar_t; #endif #endif /* !_WCHAR_T */ #endif /* !defined(__cplusplus) ... */ #define TEXTDOMAINMAX 256 #define __GNU_GETTEXT_SUPPORTED_REVISION(m) \ ((((m) == 0) || ((m) == 1)) ? 1 : -1) -#ifdef __STDC__ extern char *dcgettext(const char *, const char *, const int); extern char *dgettext(const char *, const char *); extern char *gettext(const char *); extern char *textdomain(const char *); extern char *bindtextdomain(const char *, const char *); /* * LI18NUX 2000 Globalization Specification Version 1.0 * with Amendment 2 */ extern char *dcngettext(const char *, const char *, const char *, unsigned long int, int); extern char *dngettext(const char *, const char *, const char *, unsigned long int); extern char *ngettext(const char *, const char *, unsigned long int); extern char *bind_textdomain_codeset(const char *, const char *); /* Word handling functions --- requires dynamic linking */ /* Warning: these are experimental and subject to change. */ extern int wdinit(void); extern int wdchkind(wchar_t); extern int wdbindf(wchar_t, wchar_t, int); extern wchar_t *wddelim(wchar_t, wchar_t, int); extern wchar_t mcfiller(void); extern int mcwrap(void); - -#else -extern char *dcgettext(); -extern char *dgettext(); -extern char *gettext(); -extern char *textdomain(); -extern char *bindtextdomain(); - -/* - * LI18NUX 2000 Globalization Specification Version 1.0 - * with Amendment 2 - */ -extern char *dcngettext(); -extern char *dngettext(); -extern char *ngettext(); -extern char *bind_textdomain_codeset(); - -/* Word handling functions --- requires dynamic linking */ -/* Warning: these are experimental and subject to change. */ -extern int wdinit(); -extern int wdchkind(); -extern int wdbindf(); -extern wchar_t *wddelim(); -extern wchar_t mcfiller(); -extern int mcwrap(); - -#endif #ifdef __cplusplus } #endif #endif /* _LIBINTL_H */ Index: stable/10/cddl/contrib/opensolaris/head/nlist.h =================================================================== --- stable/10/cddl/contrib/opensolaris/head/nlist.h (revision 297541) +++ stable/10/cddl/contrib/opensolaris/head/nlist.h (revision 297542) @@ -1,54 +1,51 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ +/* + * Copyright 2014 Garrett D'Amore + */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ #ifndef _NLIST_H #define _NLIST_H -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.8.2.4 */ - #ifdef __cplusplus extern "C" { #endif struct nlist { char *n_name; /* symbol name */ long n_value; /* value of symbol */ short n_scnum; /* section number */ unsigned short n_type; /* type and derived type */ char n_sclass; /* storage class */ char n_numaux; /* number of aux. entries */ }; -#if defined(__STDC__) extern int nlist(const char *, struct nlist *); -#else /* __STDC__ */ -extern int nlist(); -#endif /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* _NLIST_H */ Index: stable/10/cddl/contrib/opensolaris/head/synch.h =================================================================== --- stable/10/cddl/contrib/opensolaris/head/synch.h (revision 297541) +++ stable/10/cddl/contrib/opensolaris/head/synch.h (revision 297542) @@ -1,277 +1,218 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* + * Copyright 2014 Garrett D'Amore * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. */ #ifndef _SYNCH_H #define _SYNCH_H /* * synch.h: * definitions needed to use the thread synchronization interface */ #ifndef _ASM #include #include #include #endif /* _ASM */ #ifdef __cplusplus extern "C" { #endif #ifndef _ASM /* * Semaphores */ typedef struct _sema { /* this structure must be the same as sem_t in */ uint32_t count; /* semaphore count */ uint16_t type; uint16_t magic; upad64_t pad1[3]; /* reserved for a mutex_t */ upad64_t pad2[2]; /* reserved for a cond_t */ } sema_t; /* * POSIX.1c Note: * POSIX.1c requires that define the structures pthread_mutex_t * and pthread_cond_t. These structures are identical to mutex_t (lwp_mutex_t) * and cond_t (lwp_cond_t) which are defined in . A nested included * of (to allow a "#typedef mutex_t pthread_mutex_t") would pull in * non-posix symbols/constants violating the namespace restrictions. Hence, * pthread_mutex_t/pthread_cond_t have been redefined in (actually * in ). Any modifications done to mutex_t/lwp_mutex_t or * cond_t/lwp_cond_t should also be done to pthread_mutex_t/pthread_cond_t. */ typedef lwp_mutex_t mutex_t; typedef lwp_cond_t cond_t; /* * Readers/writer locks * * NOTE: The layout of this structure should be kept in sync with the layout * of the correponding structure of pthread_rwlock_t in sys/types.h. * Also, there is an identical structure for lwp_rwlock_t in . * Because we have to deal with C++, we cannot redefine this one as that one. */ typedef struct _rwlock { int32_t readers; /* rwstate word */ uint16_t type; uint16_t magic; mutex_t mutex; /* used with process-shared rwlocks */ cond_t readercv; /* used only to indicate ownership */ cond_t writercv; /* used only to indicate ownership */ } rwlock_t; -#ifdef __STDC__ int _lwp_mutex_lock(lwp_mutex_t *); int _lwp_mutex_unlock(lwp_mutex_t *); int _lwp_mutex_trylock(lwp_mutex_t *); int _lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *); int _lwp_cond_timedwait(lwp_cond_t *, lwp_mutex_t *, timespec_t *); int _lwp_cond_reltimedwait(lwp_cond_t *, lwp_mutex_t *, timespec_t *); int _lwp_cond_signal(lwp_cond_t *); int _lwp_cond_broadcast(lwp_cond_t *); int _lwp_sema_init(lwp_sema_t *, int); int _lwp_sema_wait(lwp_sema_t *); int _lwp_sema_trywait(lwp_sema_t *); int _lwp_sema_post(lwp_sema_t *); int cond_init(cond_t *, int, void *); int cond_destroy(cond_t *); int cond_wait(cond_t *, mutex_t *); int cond_timedwait(cond_t *, mutex_t *, const timespec_t *); int cond_reltimedwait(cond_t *, mutex_t *, const timespec_t *); int cond_signal(cond_t *); int cond_broadcast(cond_t *); int mutex_init(mutex_t *, int, void *); int mutex_destroy(mutex_t *); int mutex_consistent(mutex_t *); int mutex_lock(mutex_t *); int mutex_trylock(mutex_t *); int mutex_unlock(mutex_t *); int rwlock_init(rwlock_t *, int, void *); int rwlock_destroy(rwlock_t *); int rw_rdlock(rwlock_t *); int rw_wrlock(rwlock_t *); int rw_unlock(rwlock_t *); int rw_tryrdlock(rwlock_t *); int rw_trywrlock(rwlock_t *); int sema_init(sema_t *, unsigned int, int, void *); int sema_destroy(sema_t *); int sema_wait(sema_t *); int sema_timedwait(sema_t *, const timespec_t *); int sema_reltimedwait(sema_t *, const timespec_t *); int sema_post(sema_t *); int sema_trywait(sema_t *); -#else /* __STDC__ */ - -int _lwp_mutex_lock(); -int _lwp_mutex_unlock(); -int _lwp_mutex_trylock(); -int _lwp_cond_wait(); -int _lwp_cond_timedwait(); -int _lwp_cond_reltimedwait(); -int _lwp_cond_signal(); -int _lwp_cond_broadcast(); -int _lwp_sema_init(); -int _lwp_sema_wait(); -int _lwp_sema_trywait(); -int _lwp_sema_post(); -int cond_init(); -int cond_destroy(); -int cond_wait(); -int cond_timedwait(); -int cond_reltimedwait(); -int cond_signal(); -int cond_broadcast(); -int mutex_init(); -int mutex_destroy(); -int mutex_consistent(); -int mutex_lock(); -int mutex_trylock(); -int mutex_unlock(); -int rwlock_init(); -int rwlock_destroy(); -int rw_rdlock(); -int rw_wrlock(); -int rw_unlock(); -int rw_tryrdlock(); -int rw_trywrlock(); -int sema_init(); -int sema_destroy(); -int sema_wait(); -int sema_timedwait(); -int sema_reltimedwait(); -int sema_post(); -int sema_trywait(); - -#endif /* __STDC__ */ - #endif /* _ASM */ /* "Magic numbers" tagging synchronization object types */ #define MUTEX_MAGIC _MUTEX_MAGIC #define SEMA_MAGIC _SEMA_MAGIC #define COND_MAGIC _COND_MAGIC #define RWL_MAGIC _RWL_MAGIC /* * POSIX.1c Note: * DEFAULTMUTEX is defined same as PTHREAD_MUTEX_INITIALIZER in . * DEFAULTCV is defined same as PTHREAD_COND_INITIALIZER in . * DEFAULTRWLOCK is defined same as PTHREAD_RWLOCK_INITIALIZER in . * Any changes to these macros should be reflected in */ #define DEFAULTMUTEX \ {{0, 0, 0, {USYNC_THREAD}, MUTEX_MAGIC}, \ {{{0, 0, 0, 0, 0, 0, 0, 0}}}, 0} #define SHAREDMUTEX \ {{0, 0, 0, {USYNC_PROCESS}, MUTEX_MAGIC}, \ {{{0, 0, 0, 0, 0, 0, 0, 0}}}, 0} #define RECURSIVEMUTEX \ {{0, 0, 0, {USYNC_THREAD|LOCK_RECURSIVE}, MUTEX_MAGIC}, \ {{{0, 0, 0, 0, 0, 0, 0, 0}}}, 0} #define ERRORCHECKMUTEX \ {{0, 0, 0, {USYNC_THREAD|LOCK_ERRORCHECK}, MUTEX_MAGIC}, \ {{{0, 0, 0, 0, 0, 0, 0, 0}}}, 0} #define RECURSIVE_ERRORCHECKMUTEX \ {{0, 0, 0, {USYNC_THREAD|LOCK_RECURSIVE|LOCK_ERRORCHECK}, \ MUTEX_MAGIC}, {{{0, 0, 0, 0, 0, 0, 0, 0}}}, 0} #define DEFAULTCV \ {{{0, 0, 0, 0}, USYNC_THREAD, COND_MAGIC}, 0} #define SHAREDCV \ {{{0, 0, 0, 0}, USYNC_PROCESS, COND_MAGIC}, 0} #define DEFAULTSEMA \ {0, USYNC_THREAD, SEMA_MAGIC, {0, 0, 0}, {0, 0}} #define SHAREDSEMA \ {0, USYNC_PROCESS, SEMA_MAGIC, {0, 0, 0}, {0, 0}} #define DEFAULTRWLOCK \ {0, USYNC_THREAD, RWL_MAGIC, DEFAULTMUTEX, DEFAULTCV, DEFAULTCV} #define SHAREDRWLOCK \ {0, USYNC_PROCESS, RWL_MAGIC, SHAREDMUTEX, SHAREDCV, SHAREDCV} /* * Tests on lock states. */ #define SEMA_HELD(x) _sema_held(x) #define RW_READ_HELD(x) _rw_read_held(x) #define RW_WRITE_HELD(x) _rw_write_held(x) #define RW_LOCK_HELD(x) (RW_READ_HELD(x) || RW_WRITE_HELD(x)) #define MUTEX_HELD(x) _mutex_held(x) /* * The following definitions are for assertions which can be checked * statically by tools like lock_lint. You can also define your own * run-time test for each. If you don't, we define them to 1 so that * such assertions simply pass. */ #ifndef NO_LOCKS_HELD #define NO_LOCKS_HELD 1 #endif #ifndef NO_COMPETING_THREADS #define NO_COMPETING_THREADS 1 #endif #ifndef _ASM -#ifdef __STDC__ - /* * The *_held() functions apply equally well to Solaris threads * and to Posix threads synchronization objects, but the formal * type declarations are different, so we just declare the argument * to each *_held() function to be a void *, expecting that they will * be called with the proper type of argument in each case. */ int _sema_held(void *); /* sema_t or sem_t */ int _rw_read_held(void *); /* rwlock_t or pthread_rwlock_t */ int _rw_write_held(void *); /* rwlock_t or pthread_rwlock_t */ int _mutex_held(void *); /* mutex_t or pthread_mutex_t */ -#else /* __STDC__ */ - -int _sema_held(); -int _rw_read_held(); -int _rw_write_held(); -int _mutex_held(); - -#endif /* __STDC__ */ - /* Pause API */ -#ifdef __STDC__ void smt_pause(void); -#else /* __STDC__ */ -void smt_pause(); -#endif /* __STDC__ */ #endif /* _ASM */ #ifdef __cplusplus } #endif #endif /* _SYNCH_H */ Index: stable/10/cddl/contrib/opensolaris/head/thread.h =================================================================== --- stable/10/cddl/contrib/opensolaris/head/thread.h (revision 297541) +++ stable/10/cddl/contrib/opensolaris/head/thread.h (revision 297542) @@ -1,104 +1,104 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* + * Copyright 2014 Garrett D'Amore + * * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _THREAD_H #define _THREAD_H - -#pragma ident "%Z%%M% %I% %E% SMI" #include #include #include /* * Compatibility thread stuff needed for Solaris -> Linux port */ typedef pthread_t thread_t; typedef pthread_mutex_t mutex_t; typedef pthread_cond_t cond_t; typedef pthread_rwlock_t rwlock_t; #define USYNC_THREAD 0 #define thr_self() (unsigned long)pthread_self() #define thr_equal(a,b) pthread_equal(a,b) #define thr_join(t,d,s) pthread_join(t,s) #define thr_exit(r) pthread_exit(r) #define _mutex_init(l,f,a) pthread_mutex_init(l,NULL) #define _mutex_destroy(l) pthread_mutex_destroy(l) #define mutex_lock(l) pthread_mutex_lock(l) #define mutex_trylock(l) pthread_mutex_trylock(l) #define mutex_unlock(l) pthread_mutex_unlock(l) #define rwlock_init(l,f,a) pthread_rwlock_init(l,NULL) #define rwlock_destroy(l) pthread_rwlock_destroy(l) #define rw_rdlock(l) pthread_rwlock_rdlock(l) #define rw_wrlock(l) pthread_rwlock_wrlock(l) #define rw_tryrdlock(l) pthread_rwlock_tryrdlock(l) #define rw_trywrlock(l) pthread_rwlock_trywrlock(l) #define rw_unlock(l) pthread_rwlock_unlock(l) #define cond_init(l,f,a) pthread_cond_init(l,NULL) #define cond_destroy(l) pthread_cond_destroy(l) #define cond_wait(l,m) pthread_cond_wait(l,m) #define cond_signal(l) pthread_cond_signal(l) #define cond_broadcast(l) pthread_cond_broadcast(l) #define THR_BOUND 0x00000001 /* = PTHREAD_SCOPE_SYSTEM */ #define THR_NEW_LWP 0x00000002 #define THR_DETACHED 0x00000040 /* = PTHREAD_CREATE_DETACHED */ #define THR_SUSPENDED 0x00000080 #define THR_DAEMON 0x00000100 static __inline int thr_create(void *stack_base, size_t stack_size, void *(*start_func) (void*), void *arg, long flags, thread_t *new_thread_ID) { pthread_t dummy; int ret; assert(stack_base == NULL); assert(stack_size == 0); assert((flags & ~THR_BOUND & ~THR_DETACHED) == 0); pthread_attr_t attr; pthread_attr_init(&attr); if (flags & THR_DETACHED) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if (new_thread_ID == NULL) new_thread_ID = &dummy; /* This function ignores the THR_BOUND flag, since NPTL doesn't seem to support PTHREAD_SCOPE_PROCESS */ ret = pthread_create(new_thread_ID, &attr, start_func, arg); pthread_attr_destroy(&attr); return (ret); } #endif /* _THREAD_H */ Index: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h =================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h (revision 297541) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h (revision 297542) @@ -1,315 +1,312 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* + * Copyright 2014 Garrett D'Amore + * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_ACL_H #define _SYS_ACL_H #include #include #if defined(_KERNEL) /* * When compiling OpenSolaris kernel code, this file is getting * included instead of FreeBSD one. Pull the original sys/acl.h as well. */ #undef _SYS_ACL_H #include_next #define _SYS_ACL_H #endif /* _KERNEL */ #ifdef __cplusplus extern "C" { #endif #define MAX_ACL_ENTRIES (1024) /* max entries of each type */ typedef struct { int a_type; /* the type of ACL entry */ uid_t a_id; /* the entry in -uid or gid */ o_mode_t a_perm; /* the permission field */ } aclent_t; typedef struct ace { uid_t a_who; /* uid or gid */ uint32_t a_access_mask; /* read,write,... */ uint16_t a_flags; /* see below */ uint16_t a_type; /* allow or deny */ } ace_t; #ifndef _KERNEL typedef struct acl_info acl_t; #endif /* * The following are Defined types for an aclent_t. */ #define USER_OBJ (0x01) /* object owner */ #define USER (0x02) /* additional users */ #define GROUP_OBJ (0x04) /* owning group of the object */ #define GROUP (0x08) /* additional groups */ #define CLASS_OBJ (0x10) /* file group class and mask entry */ #define OTHER_OBJ (0x20) /* other entry for the object */ #define ACL_DEFAULT (0x1000) /* default flag */ /* default object owner */ #define DEF_USER_OBJ (ACL_DEFAULT | USER_OBJ) /* default additional users */ #define DEF_USER (ACL_DEFAULT | USER) /* default owning group */ #define DEF_GROUP_OBJ (ACL_DEFAULT | GROUP_OBJ) /* default additional groups */ #define DEF_GROUP (ACL_DEFAULT | GROUP) /* default mask entry */ #define DEF_CLASS_OBJ (ACL_DEFAULT | CLASS_OBJ) /* default other entry */ #define DEF_OTHER_OBJ (ACL_DEFAULT | OTHER_OBJ) /* * The following are defined for ace_t. */ #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_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_ACCESS_ALLOWED_ACE_TYPE 0x0000 #define ACE_ACCESS_DENIED_ACE_TYPE 0x0001 #define ACE_SYSTEM_AUDIT_ACE_TYPE 0x0002 #define ACE_SYSTEM_ALARM_ACE_TYPE 0x0003 #define ACL_AUTO_INHERIT 0x0001 #define ACL_PROTECTED 0x0002 #define ACL_DEFAULTED 0x0004 #define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED| \ ACL_DEFAULTED) #ifdef _KERNEL /* * These are only applicable in a CIFS context. */ #define ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE 0x04 #define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE 0x05 #define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE 0x06 #define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE 0x07 #define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE 0x08 #define ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE 0x09 #define ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE 0x0A #define ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE 0x0B #define ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE 0x0C #define ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE 0x0D #define ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE 0x0E #define ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE 0x0F #define ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE 0x10 #define ACE_ALL_TYPES 0x001F typedef struct ace_object { uid_t a_who; /* uid or gid */ uint32_t a_access_mask; /* read,write,... */ uint16_t a_flags; /* see below */ uint16_t a_type; /* allow or deny */ uint8_t a_obj_type[16]; /* obj type */ uint8_t a_inherit_obj_type[16]; /* inherit obj */ } ace_object_t; #endif #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_ALL_WRITE_PERMS (ACE_WRITE_DATA|ACE_APPEND_DATA| \ ACE_WRITE_ATTRIBUTES|ACE_WRITE_NAMED_ATTRS|ACE_WRITE_ACL| \ ACE_WRITE_OWNER|ACE_DELETE|ACE_DELETE_CHILD) #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) /* * The following flags are supported by both NFSv4 ACLs and ace_t. */ #define ACE_NFSV4_SUP_FLAGS (ACE_FILE_INHERIT_ACE | \ ACE_DIRECTORY_INHERIT_ACE | \ ACE_NO_PROPAGATE_INHERIT_ACE | \ ACE_INHERIT_ONLY_ACE | \ ACE_INHERITED_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| ACL_INHERITED_ACE| \ ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE|ACE_INHERIT_ONLY_ACE) /* cmd args to acl(2) for aclent_t */ #define GETACL 1 #define SETACL 2 #define GETACLCNT 3 /* cmd's to manipulate ace acls. */ #define ACE_GETACL 4 #define ACE_SETACL 5 #define ACE_GETACLCNT 6 /* minimal acl entries from GETACLCNT */ #define MIN_ACL_ENTRIES 4 #if !defined(_KERNEL) /* acl check errors */ #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 /* * similar to ufs_acl.h: changed to char type for user commands (tar, cpio) * Attribute types */ #define UFSD_FREE ('0') /* Free entry */ #define UFSD_ACL ('1') /* Access Control Lists */ #define UFSD_DFACL ('2') /* reserved for future use */ #define ACE_ACL ('3') /* ace_t style acls */ /* * flag to [f]acl_get() * controls whether a trivial acl should be returned. */ #define ACL_NO_TRIVIAL 0x2 /* * Flags to control acl_totext() */ #define ACL_APPEND_ID 0x1 /* append uid/gid to user/group entries */ #define ACL_COMPACT_FMT 0x2 /* build ACL in ls -V format */ #define ACL_NORESOLVE 0x4 /* don't do name service lookups */ #define ACL_SID_FMT 0x8 /* use usersid/groupsid when appropriate */ /* * Legacy aclcheck errors for aclent_t ACLs */ #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 /* invalid inherit flags */ #define EACL_FLAGS_ERROR 10 /* unknown flag value */ #define EACL_PERM_MASK_ERROR 11 /* unknown permission */ #define EACL_COUNT_ERROR 12 /* invalid acl count */ #define EACL_INVALID_SLOT 13 /* invalid acl slot */ #define EACL_NO_ACL_ENTRY 14 /* Entry doesn't exist */ #define EACL_DIFF_TYPE 15 /* acls aren't same type */ #define EACL_INVALID_USER_GROUP 16 /* need user/group name */ #define EACL_INVALID_STR 17 /* invalid acl string */ #define EACL_FIELD_NOT_BLANK 18 /* can't have blank field */ #define EACL_INVALID_ACCESS_TYPE 19 /* invalid access type */ #define EACL_UNKNOWN_DATA 20 /* Unrecognized data in ACL */ #define EACL_MISSING_FIELDS 21 /* missing fields in acl */ #define EACL_INHERIT_NOTDIR 22 /* Need dir for inheritance */ extern int aclcheck(aclent_t *, int, int *); extern int acltomode(aclent_t *, int, mode_t *); extern int aclfrommode(aclent_t *, int, mode_t *); extern int aclsort(int, int, aclent_t *); extern char *acltotext(aclent_t *, int); extern aclent_t *aclfromtext(char *, int *); extern void acl_free(acl_t *); extern int acl_get(const char *, int, acl_t **); extern int facl_get(int, int, acl_t **); extern int acl_set(const char *, acl_t *acl); extern int facl_set(int, acl_t *acl); extern int acl_strip(const char *, uid_t, gid_t, mode_t); extern int acl_trivial(const char *); extern char *acl_totext(acl_t *, int); extern int acl_fromtext(const char *, acl_t **); extern int acl_check(acl_t *, int); #else /* !defined(_KERNEL) */ extern void ksort(caddr_t, int, int, int (*)(void *, void *)); extern int cmp2acls(void *, void *); #endif /* !defined(_KERNEL) */ -#if defined(__STDC__) extern int acl(const char *path, int cmd, int cnt, void *buf); extern int facl(int fd, int cmd, int cnt, void *buf); -#else /* !__STDC__ */ -extern int acl(); -extern int facl(); -#endif /* defined(__STDC__) */ #ifdef __cplusplus } #endif #endif /* _SYS_ACL_H */ Index: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h =================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h (revision 297541) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h (revision 297542) @@ -1,164 +1,156 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* + * Copyright 2014 Garrett D'Amore + * * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ #ifndef _SYS_DEBUG_H #define _SYS_DEBUG_H #include #include #ifdef __cplusplus extern "C" { #endif /* * ASSERT(ex) causes a panic or debugger entry if expression ex is not * true. ASSERT() is included only for debugging, and is a no-op in * production kernels. VERIFY(ex), on the other hand, behaves like * ASSERT and is evaluated on both debug and non-debug kernels. */ -#if defined(__STDC__) extern int assfail(const char *, const char *, int); #define VERIFY(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__))) #ifdef DEBUG #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__))) #else #define ASSERT(x) ((void)0) #endif -#else /* defined(__STDC__) */ -extern int assfail(); -#define VERIFY(EX) ((void)((EX) || assfail("EX", __FILE__, __LINE__))) -#ifdef DEBUG -#define ASSERT(EX) ((void)((EX) || assfail("EX", __FILE__, __LINE__))) -#else -#define ASSERT(x) ((void)0) -#endif -#endif /* defined(__STDC__) */ /* * Assertion variants sensitive to the compilation data model */ #if defined(_LP64) #define ASSERT64(x) ASSERT(x) #define ASSERT32(x) #else #define ASSERT64(x) #define ASSERT32(x) ASSERT(x) #endif /* * IMPLY and EQUIV are assertions of the form: * * if (a) then (b) * and * if (a) then (b) *AND* if (b) then (a) */ #ifdef DEBUG #define IMPLY(A, B) \ ((void)(((!(A)) || (B)) || \ assfail("(" #A ") implies (" #B ")", __FILE__, __LINE__))) #define EQUIV(A, B) \ ((void)((!!(A) == !!(B)) || \ assfail("(" #A ") is equivalent to (" #B ")", __FILE__, __LINE__))) #else #define IMPLY(A, B) ((void)0) #define EQUIV(A, B) ((void)0) #endif /* * ASSERT3() behaves like ASSERT() except that it is an explicit conditional, * and prints out the values of the left and right hand expressions as part of * the panic message to ease debugging. The three variants imply the type * of their arguments. ASSERT3S() is for signed data types, ASSERT3U() is * for unsigned, and ASSERT3P() is for pointers. The VERIFY3*() macros * have the same relationship as above. */ extern void assfail3(const char *, uintmax_t, const char *, uintmax_t, const char *, int); #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \ const TYPE __left = (TYPE)(LEFT); \ const TYPE __right = (TYPE)(RIGHT); \ if (!(__left OP __right)) \ assfail3(#LEFT " " #OP " " #RIGHT, \ (uintmax_t)__left, #OP, (uintmax_t)__right, \ __FILE__, __LINE__); \ _NOTE(CONSTCOND) } while (0) #define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t) #define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t) #define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t) #define VERIFY0(x) VERIFY3_IMPL(x, ==, 0, uintmax_t) #ifdef DEBUG #define ASSERT3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t) #define ASSERT3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t) #define ASSERT3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t) #define ASSERT0(x) VERIFY3_IMPL(x, ==, 0, uintmax_t) #else #define ASSERT3S(x, y, z) ((void)0) #define ASSERT3U(x, y, z) ((void)0) #define ASSERT3P(x, y, z) ((void)0) #define ASSERT0(x) ((void)0) #endif /* * Compile-time assertion. The condition 'x' must be constant. */ #ifndef CTASSERT #define CTASSERT(x) _CTASSERT(x, __LINE__) #define _CTASSERT(x, y) __CTASSERT(x, y) #define __CTASSERT(x, y) \ typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1] #endif #ifdef _KERNEL extern void abort_sequence_enter(char *); extern void debug_enter(char *); #endif /* _KERNEL */ #if defined(DEBUG) && !defined(__sun) /* CSTYLED */ #define STATIC #else /* CSTYLED */ #define STATIC static #endif #ifdef __cplusplus } #endif #endif /* _SYS_DEBUG_H */ Index: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/feature_tests.h =================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/feature_tests.h (revision 297541) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/feature_tests.h (revision 297542) @@ -1,395 +1,431 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* + * Copyright 2013 Garrett D'Amore + * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_FEATURE_TESTS_H #define _SYS_FEATURE_TESTS_H #include #ifdef __cplusplus extern "C" { #endif /* * Values of _POSIX_C_SOURCE * * undefined not a POSIX compilation * 1 POSIX.1-1990 compilation * 2 POSIX.2-1992 compilation * 199309L POSIX.1b-1993 compilation (Real Time) * 199506L POSIX.1c-1995 compilation (POSIX Threads) * 200112L POSIX.1-2001 compilation (Austin Group Revision) + * 200809L POSIX.1-2008 compilation */ #if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 1 #endif /* - * The feature test macros __XOPEN_OR_POSIX, _STRICT_STDC, and _STDC_C99 - * are Sun implementation specific macros created in order to compress - * common standards specified feature test macros for easier reading. + * The feature test macros __XOPEN_OR_POSIX, _STRICT_STDC, _STRICT_SYMBOLS, + * and _STDC_C99 are Sun implementation specific macros created in order to + * compress common standards specified feature test macros for easier reading. * These macros should not be used by the application developer as * unexpected results may occur. Instead, the user should reference * standards(5) for correct usage of the standards feature test macros. * * __XOPEN_OR_POSIX Used in cases where a symbol is defined by both * X/Open or POSIX or in the negative, when neither * X/Open or POSIX defines a symbol. * * _STRICT_STDC __STDC__ is specified by the C Standards and defined * by the compiler. For Sun compilers the value of * __STDC__ is either 1, 0, or not defined based on the * compilation mode (see cc(1)). When the value of * __STDC__ is 1 and in the absence of any other feature * test macros, the namespace available to the application * is limited to only those symbols defined by the C * Standard. _STRICT_STDC provides a more readable means * of identifying symbols defined by the standard, or in * the negative, symbols that are extensions to the C * Standard. See additional comments for GNU C differences. * * _STDC_C99 __STDC_VERSION__ is specified by the C standards and * defined by the compiler and indicates the version of * the C standard. A value of 199901L indicates a * compiler that complies with ISO/IEC 9899:1999, other- * wise known as the C99 standard. + * + * _STRICT_SYMBOLS Used in cases where symbol visibility is restricted + * by the standards, and the user has not explicitly + * relaxed the strictness via __EXTENSIONS__. */ #if defined(_XOPEN_SOURCE) || defined(_POSIX_C_SOURCE) #define __XOPEN_OR_POSIX #endif /* * ISO/IEC 9899:1990 and it's revision, ISO/IEC 9899:1999 specify the * following predefined macro name: * * __STDC__ The integer constant 1, intended to indicate a conforming * implementation. * * Furthermore, a strictly conforming program shall use only those features * of the language and library specified in these standards. A conforming * implementation shall accept any strictly conforming program. * * Based on these requirements, Sun's C compiler defines __STDC__ to 1 for * strictly conforming environments and __STDC__ to 0 for environments that * use ANSI C semantics but allow extensions to the C standard. For non-ANSI * C semantics, Sun's C compiler does not define __STDC__. * * The GNU C project interpretation is that __STDC__ should always be defined * to 1 for compilation modes that accept ANSI C syntax regardless of whether * or not extensions to the C standard are used. Violations of conforming * behavior are conditionally flagged as warnings via the use of the * -pedantic option. In addition to defining __STDC__ to 1, the GNU C * compiler also defines __STRICT_ANSI__ as a means of specifying strictly * conforming environments using the -ansi or -std= options. * * In the absence of any other compiler options, Sun and GNU set the value * of __STDC__ as follows when using the following options: * * Value of __STDC__ __STRICT_ANSI__ * * cc -Xa (default) 0 undefined * cc -Xt (transitional) 0 undefined * cc -Xc (strictly conforming) 1 undefined * cc -Xs (K&R C) undefined undefined * * gcc (default) 1 undefined * gcc -ansi, -std={c89, c99,...) 1 defined * gcc -traditional (K&R) undefined undefined * * The default compilation modes for Sun C compilers versus GNU C compilers * results in a differing value for __STDC__ which results in a more * restricted namespace when using Sun compilers. To allow both GNU and Sun * interpretations to peacefully co-exist, we use the following Sun * implementation _STRICT_STDC_ macro: */ #if (__STDC__ - 0 == 1 && !defined(__GNUC__)) || \ (defined(__GNUC__) && defined(__STRICT_ANSI__)) #define _STRICT_STDC #else #undef _STRICT_STDC #endif /* * Compiler complies with ISO/IEC 9899:1999 */ #if __STDC_VERSION__ - 0 >= 199901L #ifndef _STDC_C99 #define _STDC_C99 #endif #endif /* + * Use strict symbol visibility. + */ +#if (defined(_STRICT_STDC) || defined(__XOPEN_OR_POSIX)) && \ + !defined(__EXTENSIONS__) +#define _STRICT_SYMBOLS +#endif + +/* * Large file interfaces: * * _LARGEFILE_SOURCE * 1 large file-related additions to POSIX * interfaces requested (fseeko, etc.) * _LARGEFILE64_SOURCE * 1 transitional large-file-related interfaces * requested (seek64, stat64, etc.) * * The corresponding announcement macros are respectively: * _LFS_LARGEFILE * _LFS64_LARGEFILE * (These are set in .) * * Requesting _LARGEFILE64_SOURCE implies requesting _LARGEFILE_SOURCE as * well. * * The large file interfaces are made visible regardless of the initial values * of the feature test macros under certain circumstances: * - If no explicit standards-conforming environment is requested (neither * of _POSIX_SOURCE nor _XOPEN_SOURCE is defined and the value of * __STDC__ does not imply standards conformance). * - Extended system interfaces are explicitly requested (__EXTENSIONS__ * is defined). * - Access to in-kernel interfaces is requested (_KERNEL or _KMEMUSER is * defined). (Note that this dependency is an artifact of the current * kernel implementation and may change in future releases.) */ #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \ defined(_KERNEL) || defined(_KMEMUSER) || \ defined(__EXTENSIONS__) #undef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE 1 #endif #if _LARGEFILE64_SOURCE - 0 == 1 #undef _LARGEFILE_SOURCE #define _LARGEFILE_SOURCE 1 #endif /* * Large file compilation environment control: * * The setting of _FILE_OFFSET_BITS controls the size of various file-related * types and governs the mapping between file-related source function symbol * names and the corresponding binary entry points. * * In the 32-bit environment, the default value is 32; if not set, set it to * the default here, to simplify tests in other headers. * * In the 64-bit compilation environment, the only value allowed is 64. */ #if defined(_LP64) #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif #if _FILE_OFFSET_BITS - 0 != 64 #error "invalid _FILE_OFFSET_BITS value specified" #endif #else /* _LP64 */ #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 32 #endif #if _FILE_OFFSET_BITS - 0 != 32 && _FILE_OFFSET_BITS - 0 != 64 #error "invalid _FILE_OFFSET_BITS value specified" #endif #endif /* _LP64 */ /* * Use of _XOPEN_SOURCE * * The following X/Open specifications are supported: * * X/Open Portability Guide, Issue 3 (XPG3) * X/Open CAE Specification, Issue 4 (XPG4) * X/Open CAE Specification, Issue 4, Version 2 (XPG4v2) * X/Open CAE Specification, Issue 5 (XPG5) * Open Group Technical Standard, Issue 6 (XPG6), also referred to as * IEEE Std. 1003.1-2001 and ISO/IEC 9945:2002. + * Open Group Technical Standard, Issue 7 (XPG7), also referred to as + * IEEE Std. 1003.1-2008 and ISO/IEC 9945:2009. * * XPG4v2 is also referred to as UNIX 95 (SUS or SUSv1). * XPG5 is also referred to as UNIX 98 or the Single Unix Specification, * Version 2 (SUSv2) * XPG6 is the result of a merge of the X/Open and POSIX specifications * and as such is also referred to as IEEE Std. 1003.1-2001 in * addition to UNIX 03 and SUSv3. + * XPG7 is also referred to as UNIX 08 and SUSv4. * * When writing a conforming X/Open application, as per the specification * requirements, the appropriate feature test macros must be defined at * compile time. These are as follows. For more info, see standards(5). * * Feature Test Macro Specification * ------------------------------------------------ ------------- * _XOPEN_SOURCE XPG3 * _XOPEN_SOURCE && _XOPEN_VERSION = 4 XPG4 * _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1 XPG4v2 * _XOPEN_SOURCE = 500 XPG5 * _XOPEN_SOURCE = 600 (or POSIX_C_SOURCE=200112L) XPG6 + * _XOPEN_SOURCE = 700 (or POSIX_C_SOURCE=200809L) XPG7 * * In order to simplify the guards within the headers, the following * implementation private test macros have been created. Applications * must NOT use these private test macros as unexpected results will * occur. * * Note that in general, the use of these private macros is cumulative. * For example, the use of _XPG3 with no other restrictions on the X/Open * namespace will make the symbols visible for XPG3 through XPG6 * compilation environments. The use of _XPG4_2 with no other X/Open * namespace restrictions indicates that the symbols were introduced in * XPG4v2 and are therefore visible for XPG4v2 through XPG6 compilation * environments, but not for XPG3 or XPG4 compilation environments. * * _XPG3 X/Open Portability Guide, Issue 3 (XPG3) * _XPG4 X/Open CAE Specification, Issue 4 (XPG4) * _XPG4_2 X/Open CAE Specification, Issue 4, Version 2 (XPG4v2/UNIX 95/SUS) * _XPG5 X/Open CAE Specification, Issue 5 (XPG5/UNIX 98/SUSv2) * _XPG6 Open Group Technical Standard, Issue 6 (XPG6/UNIX 03/SUSv3) + * _XPG7 Open Group Technical Standard, Issue 7 (XPG7/UNIX 08/SUSv4) */ /* X/Open Portability Guide, Issue 3 */ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 < 500) && \ (_XOPEN_VERSION - 0 < 4) && !defined(_XOPEN_SOURCE_EXTENDED) #define _XPG3 /* X/Open CAE Specification, Issue 4 */ #elif (defined(_XOPEN_SOURCE) && _XOPEN_VERSION - 0 == 4) #define _XPG4 #define _XPG3 /* X/Open CAE Specification, Issue 4, Version 2 */ #elif (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE_EXTENDED - 0 == 1) #define _XPG4_2 #define _XPG4 #define _XPG3 /* X/Open CAE Specification, Issue 5 */ #elif (_XOPEN_SOURCE - 0 == 500) #define _XPG5 #define _XPG4_2 #define _XPG4 #define _XPG3 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 199506L /* Open Group Technical Standard , Issue 6 */ #elif (_XOPEN_SOURCE - 0 == 600) || (_POSIX_C_SOURCE - 0 == 200112L) #define _XPG6 #define _XPG5 #define _XPG4_2 #define _XPG4 #define _XPG3 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200112L #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 + +/* Open Group Technical Standard, Issue 7 */ +#elif (_XOPEN_SOURCE - 0 == 700) || (_POSIX_C_SOURCE - 0 == 200809L) +#define _XPG7 +#define _XPG6 +#define _XPG5 +#define _XPG4_2 +#define _XPG4 +#define _XPG3 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#undef _XOPEN_SOURCE +#define _XOPEN_SOURCE 700 #endif /* * _XOPEN_VERSION is defined by the X/Open specifications and is not * normally defined by the application, except in the case of an XPG4 * application. On the implementation side, _XOPEN_VERSION defined with * the value of 3 indicates an XPG3 application. _XOPEN_VERSION defined * with the value of 4 indicates an XPG4 or XPG4v2 (UNIX 95) application. * _XOPEN_VERSION defined with a value of 500 indicates an XPG5 (UNIX 98) * application and with a value of 600 indicates an XPG6 (UNIX 03) - * application. The appropriate version is determined by the use of the + * application and with a value of 700 indicates an XPG7 (UNIX 08). + * The appropriate version is determined by the use of the * feature test macros described earlier. The value of _XOPEN_VERSION * defaults to 3 otherwise indicating support for XPG3 applications. */ #ifndef _XOPEN_VERSION -#ifdef _XPG6 +#if defined(_XPG7) +#define _XOPEN_VERSION 700 +#elif defined(_XPG6) #define _XOPEN_VERSION 600 #elif defined(_XPG5) #define _XOPEN_VERSION 500 #elif defined(_XPG4_2) #define _XOPEN_VERSION 4 #else #define _XOPEN_VERSION 3 #endif #endif /* * ANSI C and ISO 9899:1990 say the type long long doesn't exist in strictly * conforming environments. ISO 9899:1999 says it does. * * The presence of _LONGLONG_TYPE says "long long exists" which is therefore * defined in all but strictly conforming environments that disallow it. */ #if !defined(_STDC_C99) && defined(_STRICT_STDC) && !defined(__GNUC__) /* * Resist attempts to force the definition of long long in this case. */ #if defined(_LONGLONG_TYPE) #error "No long long in strictly conforming ANSI C & 1990 ISO C environments" #endif #else #if !defined(_LONGLONG_TYPE) #define _LONGLONG_TYPE #endif #endif /* * It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application * using c99. The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b, * and POSIX.1c applications. Likewise, it is invalid to compile an XPG6 * or a POSIX.1-2001 application with anything other than a c99 or later * compiler. Therefore, we force an error in both cases. */ #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6)) #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \ and pre-2001 POSIX applications" #elif !defined(_STDC_C99) && \ (defined(__XOPEN_OR_POSIX) && defined(_XPG6)) #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \ require the use of c99" #endif /* * The following macro defines a value for the ISO C99 restrict * keyword so that _RESTRICT_KYWD resolves to "restrict" if * an ISO C99 compiler is used and "" (null string) if any other * compiler is used. This allows for the use of single prototype * declarations regardless of compiler version. */ #if (defined(__STDC__) && defined(_STDC_C99)) && !defined(__cplusplus) #define _RESTRICT_KYWD restrict #else #define _RESTRICT_KYWD #endif /* * The following macro indicates header support for the ANSI C++ * standard. The ISO/IEC designation for this is ISO/IEC FDIS 14882. */ #define _ISO_CPP_14882_1998 /* * The following macro indicates header support for the C99 standard, * ISO/IEC 9899:1999, Programming Languages - C. */ #define _ISO_C_9899_1999 /* * The following macro indicates header support for DTrace. The value is an * integer that corresponds to the major version number for DTrace. */ #define _DTRACE_VERSION 1 #ifdef __cplusplus } #endif #endif /* _SYS_FEATURE_TESTS_H */ Index: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h =================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h (revision 297541) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h (revision 297542) @@ -1,149 +1,140 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T * All Rights Reserved * */ /* + * Copyright 2014 Garrett D'Amore + * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_PROCESSOR_H #define _SYS_PROCESSOR_H #include #include #ifdef __cplusplus extern "C" { #endif /* * Definitions for p_online, processor_info & lgrp system calls. */ /* * Type for an lgrpid */ typedef uint16_t lgrpid_t; /* * Type for processor name (CPU number). */ typedef int processorid_t; typedef int chipid_t; /* * Flags and return values for p_online(2), and pi_state for processor_info(2). * These flags are *not* for in-kernel examination of CPU states. * See for appropriate informational functions. */ #define P_OFFLINE 0x0001 /* processor is offline, as quiet as possible */ #define P_ONLINE 0x0002 /* processor is online */ #define P_STATUS 0x0003 /* value passed to p_online to request status */ #define P_FAULTED 0x0004 /* processor is offline, in faulted state */ #define P_POWEROFF 0x0005 /* processor is powered off */ #define P_NOINTR 0x0006 /* processor is online, but no I/O interrupts */ #define P_SPARE 0x0007 /* processor is offline, can be reactivated */ #define P_BAD P_FAULTED /* unused but defined by USL */ #define P_FORCED 0x10000000 /* force processor offline */ /* * String names for processor states defined above. */ #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" /* * Structure filled in by processor_info(2). This structure * SHOULD NOT BE MODIFIED. Changes to the structure would * negate ABI compatibility. * * The string fields are guaranteed to contain a NULL. * * The pi_fputypes field contains a (possibly empty) comma-separated * list of floating point identifier strings. */ #define PI_TYPELEN 16 /* max size of CPU type string */ #define PI_FPUTYPE 32 /* max size of FPU types string */ typedef struct { int pi_state; /* processor state, see above */ char pi_processor_type[PI_TYPELEN]; /* ASCII CPU type */ char pi_fputypes[PI_FPUTYPE]; /* ASCII FPU types */ int pi_clock; /* CPU clock freq in MHz */ } processor_info_t; /* * Binding values for processor_bind(2) */ #define PBIND_NONE -1 /* LWP/thread is not bound */ #define PBIND_QUERY -2 /* don't set, just return the binding */ #define PBIND_HARD -3 /* prevents offlining CPU (default) */ #define PBIND_SOFT -4 /* allows offlining CPU */ #define PBIND_QUERY_TYPE -5 /* Return binding type */ /* * User-level system call interface prototypes */ #ifndef _KERNEL -#ifdef __STDC__ extern int p_online(processorid_t processorid, int flag); 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 processorid_t getcpuid(void); extern lgrpid_t gethomelgroup(void); - -#else - -extern int p_online(); -extern int processor_info(); -extern int processor_bind(); -extern processorid_t getcpuid(); -extern lgrpid_t gethomelgroup(); - -#endif /* __STDC__ */ #else /* _KERNEL */ /* * Internal interface prototypes */ extern int p_online_internal(processorid_t, int, int *); extern int p_online_internal_locked(processorid_t, int, int *); #endif /* !_KERNEL */ #ifdef __cplusplus } #endif #endif /* _SYS_PROCESSOR_H */ Index: stable/10 =================================================================== --- stable/10 (revision 297541) +++ stable/10 (revision 297542) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r270382