0

I'm using C++11 to write a network program on OS X. When I try to call kevent function, I find it conflict with the kevent struct. What should I do?

I want to call kevent function to wait for event instead of calling kevent struct's constructor.

update


I read the answer from Constructor of class with conflicting name

After add parentheses to kevent,it become type cast expression.

I do want to call function

this is my code

kevent(event_loop_fd_, change_list.data(), 1, event_list.data(), 1, NULL, &timeout_struct)
Community
  • 1
  • 1
Neo Ko
  • 1,365
  • 15
  • 25

1 Answers1

0

It appears you're using the wrong signature. In your call above you pass 7 parameters, but the kevent function takes 6. There is a function called kevent64 which takes 7 parameters, the last of which is a const struct timespec* - maybe this is the function you intended to call?

Smeeheey
  • 9,906
  • 23
  • 39