diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2012-11-04 02:52:03 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2012-11-04 02:52:03 +0000 |
| commit | 23090366f729c56cab62de74c7a51792357e98a9 (patch) | |
| tree | c511c885796e28ec571b5267e8f11f3b103d35e9 /include | |
| parent | 7750ad47a9a7dbc83f87158464170c8640723293 (diff) | |
| parent | 22ff74b2f44234d31540b1f7fd6c91489c37cad3 (diff) | |
Notes
Diffstat (limited to 'include')
| -rw-r--r-- | include/Makefile | 24 | ||||
| -rw-r--r-- | include/fmtmsg.h | 2 | ||||
| -rw-r--r-- | include/grp.h | 4 | ||||
| -rw-r--r-- | include/gssapi/gssapi.h | 18 | ||||
| -rw-r--r-- | include/mqueue.h | 2 | ||||
| -rw-r--r-- | include/paths.h | 1 | ||||
| -rw-r--r-- | include/printf.h | 2 | ||||
| -rw-r--r-- | include/pwd.h | 4 | ||||
| -rw-r--r-- | include/rpc/auth.h | 9 | ||||
| -rw-r--r-- | include/rpc/auth_unix.h | 6 | ||||
| -rw-r--r-- | include/rpc/xdr.h | 20 | ||||
| -rw-r--r-- | include/stdatomic.h | 73 | ||||
| -rw-r--r-- | include/time.h | 11 | ||||
| -rw-r--r-- | include/unistd.h | 1 | ||||
| -rw-r--r-- | include/wchar.h | 6 |
15 files changed, 89 insertions, 94 deletions
diff --git a/include/Makefile b/include/Makefile index c4ca316457d7..49e1cfc633f1 100644 --- a/include/Makefile +++ b/include/Makefile @@ -34,17 +34,17 @@ LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ - netipsec ${_netipx} netnatm ${_netncp} netsmb \ + netipsec ${_netipx} netnatm \ nfs nfsclient nfsserver \ sys vm LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/an dev/bktr dev/ciss dev/filemon dev/firewire dev/hwpmc \ - dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ - dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ + dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/nvme \ + dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ - fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \ - ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ + fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ + fs/procfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ @@ -76,16 +76,10 @@ INCS+= iconv.h LSUBSUBDIRS+= netgraph/bluetooth/include .endif -# XXX unconditionally needed by <netsmb/netbios.h> #.if ${MK_IPX} != "no" _netipx= netipx #.endif -.if ${MK_NCP} != "no" -_netncp= netncp -_fs_nwfs= fs/nwfs -.endif - # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is # probably only useful for developers and should be avoided if you do not @@ -216,9 +210,6 @@ copies: ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/netinet .endif - cd ${.CURDIR}/../sys/contrib/pf/net; \ - ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ - ${DESTDIR}${INCLUDEDIR}/net cd ${.CURDIR}/../sys/crypto; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ ${DESTDIR}${INCLUDEDIR}/crypto @@ -302,11 +293,6 @@ symlinks: ${DESTDIR}${INCLUDEDIR}/netinet; \ done .endif - cd ${.CURDIR}/../sys/contrib/pf/net; \ - for h in *.h; do \ - ln -fs ../../../sys/contrib/pf/net/$$h \ - ${DESTDIR}${INCLUDEDIR}/net; \ - done cd ${.CURDIR}/../sys/crypto; \ for h in rijndael/rijndael.h; do \ ln -fs ../../../sys/crypto/$$h \ diff --git a/include/fmtmsg.h b/include/fmtmsg.h index 32f0970fb94e..307c844c388b 100644 --- a/include/fmtmsg.h +++ b/include/fmtmsg.h @@ -32,7 +32,7 @@ /* Source of condition is... */ #define MM_HARD 0x0001 /* ...hardware. */ #define MM_SOFT 0x0002 /* ...software. */ -#define MM_FIRM 0x0004 /* ...fireware. */ +#define MM_FIRM 0x0004 /* ...firmware. */ /* Condition detected by... */ #define MM_APPL 0x0010 /* ...application. */ diff --git a/include/grp.h b/include/grp.h index 2b9f73f763cc..e7f65ecad636 100644 --- a/include/grp.h +++ b/include/grp.h @@ -69,6 +69,10 @@ struct group *getgrgid(gid_t); struct group *getgrnam(const char *); #if __BSD_VISIBLE const char *group_from_gid(gid_t, int); +int gid_from_group(const char *, gid_t *); +int pwcache_groupdb(int (*)(int), void (*)(void), + struct group * (*)(const char *), + struct group * (*)(gid_t)); #endif #if __BSD_VISIBLE || __XSI_VISIBLE /* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ diff --git a/include/gssapi/gssapi.h b/include/gssapi/gssapi.h index d5294de72c82..032e78495f9e 100644 --- a/include/gssapi/gssapi.h +++ b/include/gssapi/gssapi.h @@ -31,15 +31,13 @@ #ifndef _GSSAPI_GSSAPI_H_ #define _GSSAPI_GSSAPI_H_ -/* - * First, include stddef.h to get size_t defined. - */ -#include <stddef.h> +#include <sys/cdefs.h> +#include <sys/_types.h> -/* - * Include stdint.h to get explicitly sized data types. - */ -#include <stdint.h> +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif #ifndef _SSIZE_T_DECLARED typedef __ssize_t ssize_t; @@ -67,7 +65,7 @@ typedef struct _gss_name_t *gss_name_t; * unsigned integer supported by the platform that has at least * 32 bits of precision. */ -typedef uint32_t gss_uint32; +typedef __uint32_t gss_uint32; #ifdef OM_STRING @@ -89,7 +87,7 @@ typedef OM_object_identifier gss_OID_desc, *gss_OID; */ typedef gss_uint32 OM_uint32; -typedef uint64_t OM_uint64; +typedef __uint64_t OM_uint64; typedef struct gss_OID_desc_struct { OM_uint32 length; diff --git a/include/mqueue.h b/include/mqueue.h index 833274f04b89..788d0a1aa5cf 100644 --- a/include/mqueue.h +++ b/include/mqueue.h @@ -32,8 +32,8 @@ #include <sys/cdefs.h> #include <sys/types.h> #include <sys/mqueue.h> +#include <sys/signal.h> -struct sigevent; struct timespec; __BEGIN_DECLS diff --git a/include/paths.h b/include/paths.h index 650393446577..1e7402b4aa6f 100644 --- a/include/paths.h +++ b/include/paths.h @@ -42,7 +42,6 @@ /* Locate system binaries. */ #define _PATH_SYSPATH "/sbin:/usr/sbin" -#define _PATH_AUTHCONF "/etc/auth.conf" #define _PATH_BSHELL "/bin/sh" #define _PATH_CAPABILITY "/etc/capability" #define _PATH_CAPABILITY_DB "/etc/capability.db" diff --git a/include/printf.h b/include/printf.h index 1cb39c700926..c12c3ebf4ec3 100644 --- a/include/printf.h +++ b/include/printf.h @@ -123,7 +123,7 @@ int register_printf_function(int spec, printf_function *render, printf_arginfo_f /* FreeBSD */ int register_printf_render(int spec, printf_render *render, printf_arginfo_function *arginfo); -int register_printf_render_std(const unsigned char *specs); +int register_printf_render_std(const char *specs); /* vprintf_errno.c */ printf_arginfo_function __printf_arginfo_errno; diff --git a/include/pwd.h b/include/pwd.h index 0a6dba1d7b90..2099e33891a4 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -165,6 +165,10 @@ int getpwuid_r(uid_t, struct passwd *, char *, size_t, int getpwent_r(struct passwd *, char *, size_t, struct passwd **); int setpassent(int); const char *user_from_uid(uid_t, int); +int uid_from_user(const char *, uid_t *); +int pwcache_userdb(int (*)(int), void (*)(void), + struct passwd * (*)(const char *), + struct passwd * (*)(uid_t)); #endif __END_DECLS diff --git a/include/rpc/auth.h b/include/rpc/auth.h index d39ad1205379..b19addc87d63 100644 --- a/include/rpc/auth.h +++ b/include/rpc/auth.h @@ -243,14 +243,13 @@ __END_DECLS * System style authentication * AUTH *authunix_create(machname, uid, gid, len, aup_gids) * char *machname; - * int uid; - * int gid; + * u_int uid; + * u_int gid; * int len; - * int *aup_gids; + * u_int *aup_gids; */ __BEGIN_DECLS -extern AUTH *authunix_create(char *, int, int, int, - int *); +extern AUTH *authunix_create(char *, u_int, u_int, int, u_int *); extern AUTH *authunix_create_default(void); /* takes no parameters */ extern AUTH *authnone_create(void); /* takes no parameters */ __END_DECLS diff --git a/include/rpc/auth_unix.h b/include/rpc/auth_unix.h index 48373b2c24c7..b005bac8a51a 100644 --- a/include/rpc/auth_unix.h +++ b/include/rpc/auth_unix.h @@ -60,10 +60,10 @@ struct authunix_parms { u_long aup_time; char *aup_machname; - int aup_uid; - int aup_gid; + u_int aup_uid; + u_int aup_gid; u_int aup_len; - int *aup_gids; + u_int *aup_gids; }; #define authsys_parms authunix_parms diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index 92116c0eb62f..ada5c5bdb1b8 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -97,26 +97,26 @@ enum xdr_op { * an operations vector for the particular implementation (e.g. see xdr_mem.c), * and two private fields for the use of the particular implementation. */ -typedef struct __rpc_xdr { +typedef struct XDR { enum xdr_op x_op; /* operation; fast additional param */ const struct xdr_ops { /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); + bool_t (*x_getlong)(struct XDR *, long *); /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); + bool_t (*x_putlong)(struct XDR *, const long *); /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); + bool_t (*x_getbytes)(struct XDR *, char *, u_int); /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); + bool_t (*x_putbytes)(struct XDR *, const char *, u_int); /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); + u_int (*x_getpostn)(struct XDR *); /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); + bool_t (*x_setpostn)(struct XDR *, u_int); /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); + int32_t *(*x_inline)(struct XDR *, u_int); /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); + void (*x_destroy)(struct XDR *); + bool_t (*x_control)(struct XDR *, int, void *); } *x_ops; char * x_public; /* users' data */ void * x_private; /* pointer to private data */ diff --git a/include/stdatomic.h b/include/stdatomic.h index 35469e31456a..44f73b536a81 100644 --- a/include/stdatomic.h +++ b/include/stdatomic.h @@ -33,7 +33,7 @@ #include <sys/cdefs.h> #include <sys/_types.h> -#if __has_feature(cxx_atomic) +#if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS #elif __GNUC_PREREQ__(4, 7) #define __GNUC_ATOMICS @@ -54,9 +54,7 @@ #define atomic_init(obj, value) __c11_atomic_init(obj, value) #else #define ATOMIC_VAR_INIT(value) { .__val = (value) } -#define atomic_init(obj, value) do { \ - (obj)->__val = (value); \ -} while (0) +#define atomic_init(obj, value) ((void)((obj)->__val = (value))) #endif /* @@ -111,23 +109,24 @@ enum memory_order { #define atomic_thread_fence(order) __atomic_thread_fence(order) #define atomic_signal_fence(order) __atomic_signal_fence(order) #else -#define atomic_thread_fence(order) __sync_synchronize() -#define atomic_signal_fence(order) __asm volatile ("" : : : "memory") +#define atomic_thread_fence(order) ((void)(order), __sync_synchronize()) +#define atomic_signal_fence(order) __extension__ ({ \ + (void)(order); \ + __asm volatile ("" ::: "memory"); \ + (void)0; \ +}) #endif /* * 7.17.5 Lock-free property. */ -#if defined(__CLANG_ATOMICS) +#if defined(__CLANG_ATOMICS) || defined(__GNUC_ATOMICS) #define atomic_is_lock_free(obj) \ - __c11_atomic_is_lock_free(sizeof(obj)) -#elif defined(__GNUC_ATOMICS) -#define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val)) + __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->val) #else #define atomic_is_lock_free(obj) \ - (sizeof((obj)->__val) <= sizeof(void *)) + ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) #endif /* @@ -234,54 +233,50 @@ typedef _Atomic(__uintmax_t) atomic_uintmax_t; __atomic_store_n(&(object)->__val, desired, order) #else #define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) ({ \ - __typeof__((object)->__val) __v; \ - _Bool __r; \ - __v = __sync_val_compare_and_swap(&(object)->__val, \ - *(expected), desired); \ - __r = *(expected) == __v; \ - *(expected) = __v; \ - __r; \ + desired, success, failure) __extension__ ({ \ + __typeof__(expected) __ep = (expected); \ + __typeof__(*__ep) __e = *__ep; \ + (void)(success); (void)(failure); \ + (*__ep = __sync_val_compare_and_swap(&(object)->__val, \ + __e, desired)) == __e; \ }) - #define atomic_compare_exchange_weak_explicit(object, expected, \ desired, success, failure) \ atomic_compare_exchange_strong_explicit(object, expected, \ desired, success, failure) #if __has_builtin(__sync_swap) /* Clang provides a full-barrier atomic exchange - use it if available. */ -#define atomic_exchange_explicit(object, desired, order) \ - __sync_swap(&(object)->__val, desired) +#define atomic_exchange_explicit(object, desired, order) \ + ((void)(order), __sync_swap(&(object)->__val, desired)) #else /* * __sync_lock_test_and_set() is only an acquire barrier in theory (although in - * practice it is usually a full barrier) so we need an explicit barrier after + * practice it is usually a full barrier) so we need an explicit barrier before * it. */ -#define atomic_exchange_explicit(object, desired, order) ({ \ - __typeof__((object)->__val) __v; \ - __v = __sync_lock_test_and_set(&(object)->__val, desired); \ +#define atomic_exchange_explicit(object, desired, order) \ +__extension__ ({ \ + __typeof__(object) __o = (object); \ + __typeof__(desired) __d = (desired); \ + (void)(order); \ __sync_synchronize(); \ - __v; \ + __sync_lock_test_and_set(&(__o)->__val, __d); \ }) #endif #define atomic_fetch_add_explicit(object, operand, order) \ - __sync_fetch_and_add(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_add(&(object)->__val, operand)) #define atomic_fetch_and_explicit(object, operand, order) \ - __sync_fetch_and_and(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) #define atomic_fetch_or_explicit(object, operand, order) \ - __sync_fetch_and_or(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) #define atomic_fetch_sub_explicit(object, operand, order) \ - __sync_fetch_and_sub(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_sub(&(object)->__val, operand)) #define atomic_fetch_xor_explicit(object, operand, order) \ - __sync_fetch_and_xor(&(object)->__val, operand) + ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) #define atomic_load_explicit(object, order) \ - __sync_fetch_and_add(&(object)->__val, 0) -#define atomic_store_explicit(object, desired, order) do { \ - __sync_synchronize(); \ - (object)->__val = (desired); \ - __sync_synchronize(); \ -} while (0) + ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) +#define atomic_store_explicit(object, desired, order) \ + ((void)atomic_exchange_explicit(object, desired, order)) #endif /* diff --git a/include/time.h b/include/time.h index 19c948d646a7..6c9e7a92314e 100644 --- a/include/time.h +++ b/include/time.h @@ -88,6 +88,13 @@ typedef __timer_t timer_t; #include <sys/timespec.h> #endif /* __POSIX_VISIBLE >= 199309 */ +#if __POSIX_VISIBLE >= 200112 +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif +#endif + /* These macros are also in sys/time.h. */ #if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 #define CLOCK_REALTIME 0 @@ -165,6 +172,10 @@ int clock_settime(clockid_t, const struct timespec *); int nanosleep(const struct timespec *, struct timespec *); #endif /* __POSIX_VISIBLE >= 199309 */ +#if __POSIX_VISIBLE >= 200112 +int clock_getcpuclockid(pid_t, clockid_t *); +#endif + #if __POSIX_VISIBLE >= 199506 char *asctime_r(const struct tm *, char *); char *ctime_r(const time_t *, char *); diff --git a/include/unistd.h b/include/unistd.h index 9b2f2ecb997c..dabf1780c455 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -100,6 +100,7 @@ typedef __useconds_t useconds_t; * returns -1, the functions may be stubbed out. */ #define _POSIX_BARRIERS 200112L +#define _POSIX_CPUTIME 200112L #define _POSIX_READER_WRITER_LOCKS 200112L #define _POSIX_REGEXP 1 #define _POSIX_SHELL 1 diff --git a/include/wchar.h b/include/wchar.h index 1ebb72f58223..9e8d807c5f27 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -88,10 +88,8 @@ typedef __wint_t wint_t; #define _WINT_T_DECLARED #endif -#ifndef WCHAR_MIN -#define WCHAR_MIN __INT_MIN -#define WCHAR_MAX __INT_MAX -#endif +#define WCHAR_MIN __WCHAR_MIN +#define WCHAR_MAX __WCHAR_MAX #ifndef WEOF #define WEOF ((wint_t)-1) |
