1

I am Trying to use kqueue for doing an event oriented server in c when i compile my code it give me this error

fatal error: sys/event.h: No such file or directory

according to a tutorial that I am following to create the kqueue events that file have to be include I am new to events programming in C

user2948982
  • 61
  • 1
  • 2
  • 8

3 Answers3

4

kqueue is only present in BSD (FreeBSD / OpenBSD) and Darwin (Mac OS X / iOS) kernels. It does not exist in the Linux kernel.

The closest equivalents available on Linux are epoll for asynchronous I/O, and inotify for file system watches.

1

kqueue is a BSD feature. you cannot use it on Linux. the equivalent feature on Linux is epoll.

SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
1

If you want t try kqueue in any platform other than BSD, then https://github.com/mheily/libkqueue library is your way to go!! give this a try.

auvipy
  • 769
  • 10
  • 22