On 02/11/2017 03:12, Ed Schouten wrote:
2017-02-11 8:35 GMT+01:00 Ngie Cooper <n...@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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to