Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Feb 2017 08:28:21 -0600
From:      Eric van Gyzen <eric@vangyzen.net>
To:        Ed Schouten <ed@nuxi.nl>, Ngie Cooper <ngie@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   Re: svn commit: r313632 - in stable/10/contrib/netbsd-tests/lib/libc/gen: . posix_spawn
Message-ID:  <65538136-4b19-bc06-f3e0-302ef2fc2359@vangyzen.net>
In-Reply-To: <CABh_MKmYuP-Yb3VLJ3EOb1dODtHmN8uoSuytTrjTQm=C9iwuMw@mail.gmail.com>
References:  <201702110735.v1B7ZROH028648@repo.freebsd.org> <CABh_MKmYuP-Yb3VLJ3EOb1dODtHmN8uoSuytTrjTQm=C9iwuMw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02/11/2017 03:12, Ed Schouten wrote:
> 2017-02-11 8:35 GMT+01:00 Ngie Cooper <ngie@freebsd.org>:
>>   Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD
>
> Which is a bug on its own in my opinion. What do you think of this patch?
>
> Index: sys/sys/event.h
> ===================================================================
> --- sys/sys/event.h (revision 313335)
> +++ sys/sys/event.h (working copy)
> @@ -29,7 +29,8 @@
>  #ifndef _SYS_EVENT_H_
>  #define _SYS_EVENT_H_
>
> -#include <sys/queue.h>
> +#include <sys/_types.h>
> +#include <sys/queue.h>
>
>  #define EVFILT_READ (-1)
>  #define EVFILT_WRITE (-2)
> @@ -57,11 +58,11 @@
>  } while(0)
>
>  struct kevent {
> - uintptr_t ident; /* identifier for this event */
> + __uintptr_t ident; /* identifier for this event */
>   short filter; /* filter for event */
> - u_short flags;
> - u_int fflags;
> - intptr_t data;
> + unsigned short flags;
> + unsigned int fflags;
> + __intptr_t data;
>   void *udata; /* opaque user data identifier */
>  };

I would be concerned that app developers would read this definition, ignore the 
one in the man page, and use the __-prefixed types in their apps.  Maybe 
<stdint.h> could be included instead?  Otherwise, I think a comment about the __ 
prefix would be wise.

Eric



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65538136-4b19-bc06-f3e0-302ef2fc2359>