On Mon, Jan 15, 2018 at 09:12:09PM -0300, Philippe Mathieu-Daudé wrote: > On 01/15/2018 06:29 PM, Pavel Pisa wrote: > >>> + /* open socket */ > >>> + s = socket(PF_CAN, SOCK_RAW, CAN_RAW); > >> > >> I never used it, but I think QEMU uses his socket API: "qemu/sockets.h" > > > > The SocketCAN host connection code is Linux specific, > > but I can switch to qemu_socket() if it is preferred. > > But address family has to be from Linux header file anyway. > > qemu_socket() sockets are heavily tested and already solve many things, > like async I/O and error handling.
NB that's just the low level system call wrapper. All it really does is ensure O_CLOSEXEC is set for all sockets. It should defintely be used just for that reason alone though. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|