NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/48560: kevent.udata and void *

>Number:         48560
>Category:       kern
>Synopsis:       kevent.udata and invalid conversion
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 29 13:45:00 +0000 2014
>Release:        NetBSD 6
Architecture: x86_64
Machine: amd64

For src/sys/sys/event.h

I am told that kevent.udata should maybe be void * since C++ doesn't 
allow the naive conversion from a pointer type to integer. Apparently 
some other systems have that has void *

error: invalid conversion from 'char*' to '__intptr_t'

I am not sure what prompted the change.

for an example of __NetBSD__ workaround.

#include <sys/types.h>
#include <sys/param.h>
#include <sys/event.h>
#include <sys/time.h>
int main ()
  struct kevent ev;
  char* udata;
  EV_SET(&ev, 0, 0, 0, 0, 0, udata);
  return 0;
I don't know if ours is correct or not, but it behaves different than
MacOS and others.


Home | Main Index | Thread Index | Old Index