libtock-c
libtock-c copied to clipboard
libtock/ipc: add custom IPC service callback type with buffer pointer
This changes the IPC service callback function type to provide the IPC buffer pointer as an actual pointer type. The fact that this is currently an integer is pretty weird, and appears to be an artifact of the implementation sharing the subscribe system call wrapper.
I'm not sure whether what I'm doing here works, or is legal. In fact, there's a chance that it's relying on undefined behavior. However, conveying pointers as int
is also not exactly elegant. A proper fix may be to duplicate the subscribe
system call wrapper implementation and declare it with a different type that accepts this upcall function signature.