Using sys/types.h types in sys/socket.h

Warner Losh imp at bsdimp.com
Thu Dec 19 03:07:18 UTC 2013


Hmmm, not quite. These need to be inside a __BSD_VISIBLE block, which you can leverage from the immediately previous block.

Warner

On Dec 18, 2013, at 4:58 PM, Adrian Chadd wrote:

> Ok, how about this:
> 
> Index: sys/sys/socket.h
> ===================================================================
> --- sys/sys/socket.h    (revision 259475)
> +++ sys/sys/socket.h    (working copy)
> @@ -84,6 +84,16 @@
> #endif
> #endif
> 
> +#ifndef _UINT32_T_DECLARED
> +#define        _UINT32_T_DECLARED
> +typedef __uint32_t     uint32_t;
> +#endif
> +
> +#ifndef _UINTPTR_T_DECLARED
> +#define _UINTPTR_T_DECLARED
> +typedef __uintptr_t    uintptr_t;
> +#endif
> +
> /*
>  * Types
>  */
> @@ -577,11 +587,27 @@
> };
> 
> /*
> + * sendfile(2) kqueue information
> + */
> +struct sf_hdtr_kq {
> +       int kq_fd;              /* kq fd to post completion events on */
> +       uint32_t kq_flags;      /* extra flags to pass in */
> +       void *kq_udata;         /* user data pointer */
> +       uintptr_t kq_ident;     /* ident (from userland?) */
> +};
> +
> +struct sf_hdtr_all {
> +       struct sf_hdtr hdtr;
> +       struct sf_hdtr_kq kq;
> +};
> +
> +/*
>  * Sendfile-specific flag(s)
>  */
> #define        SF_NODISKIO     0x00000001
> #define        SF_MNOWAIT      0x00000002
> #define        SF_SYNC         0x00000004
> +#define        SF_KQUEUE       0x00000008
> 
> #ifdef _KERNEL
> #define        SFK_COMPAT      0x00000001



More information about the freebsd-arch mailing list