3 ms·
Linux kernel APIs are interesting. Couple days ago I was writing code which needs sendmsg/recvmsg. The manual page says this: Ancillary data should only be acc
by Const-me 5y ago
Linux kernel APIs are interesting. Couple days ago I was writing code which needs sendmsg/recvmsg. The manual page says this:
Ancillary data should only be accessed by the macros defined in cmsg(3).
The problem being, the code I was writing was in C# which can't consume C headers or evaluate these macros.
- kragen 5y agoCan't you write C functions that invoke the cmsg macros and call them from C#?
- Const-me 5y agoSure, but that complicates things. I have reverse-engineered the macros instead. They aren't terribly complicated, they simply rounding up some of the pointers by sizeof(void*).
- kragen 5y agoThat's probably reasonable. The Linux kernel has historically been very good about not breaking existing compiled code by changing ABIs like this.