Hello Josef,
On May 8, 2015 02:52, "Josef Söntgen" <josef.soentgen@...1...> wrote:
Hello Aditya,
- Aditya Kousik <adit267.kousik@...9...> [2015-05-07 17:08:00 -0700]:
- Compilation of ndn-cxx goes fine (after adding ndn-cxx-config.hpp).
The final set of errors are undefined references. I'm facing similar problems to the article written about porting SDL_net. undefined references to 'kqueue', 'kevent' and 'sendmsg'.
I've found a few implementations of kqueue(), kevent() in the original
libc
repository : they're defined in kern_event.c which is not present in the current libc port. Same for sendmsg. I've been trying to add kevent and kqueue by changing the libc port by adding sys/kern to the list of
exports
and adding a mk file for the libc-kern component. I'm wondering if I
should
go to the extent of doing this because just by looking at the code I can see that there will be a cascade of dependencies within sys/kern itself that I now have to deal with. Suggestions would help - I'm kind of lost with this exact decision that was mentioned in porting SDL_net.
That sounds doable. Can you point to where you've provided the syscall implementation expected to by done by the kernel? I can get an appreciation for the way it's implemented. Have you implemented select(2)/poll(2) already?
That is the kernel side of FreeBSD's kqueue(2) implementation and is not part of the libc. If you take a closer look at our libc you will see that we actually implement the system call functions, i.e., we provide the functionality normally expected from the kernel. Therefore, your job would be to write the implementation of the kernel side of kqueue(2) like it is done for, e.g., select(2) or rather emulate its behaviour.
The weirdest part in this, is that I can't seem to find the place in the ndn-cxx code that even makes a call or even includes sys/event.h. I
grepped
the words 'kqueue', 'kevent' and 'sendmsg' and they're present in the object files but nowhere to be found in the source files!
Yeah, I bet boost uses kqueue and the like in its asynchronous I/O backend because it thinks it is running on FreeBSD. Hence, you could try to configure boost in such a way that it uses poll(2) or select(2) (that would be the easy way) or you could extend the libc (the not so easy way). Since you would not gain much performance-wise (*), I would take the easy way.
Thanks, Aditya.