Re: Does FreeBSD have sendmmsg or recvmmsg system calls?

2016-01-19 Thread Jilles Tjoelker
sendmmsg). Note that implementing this in a Linux-compatible manner has low overhead, since Linux only checks it between packets and never interrupts a wait because of this timeout (source: http://man7.org/linux/man-pages/man2/recvmmsg.2.html ). > [snip] -- Jilles Tjoelker ___

Re: Does FreeBSD have sendmmsg or recvmmsg system calls?

2016-01-17 Thread Jilles Tjoelker
On Sun, Jan 17, 2016 at 10:18:53PM +0100, Jilles Tjoelker wrote: > On Sat, Jan 16, 2016 at 10:25:34PM +0200, Konstantin Belousov wrote: > > On Sat, Jan 16, 2016 at 09:56:57PM +0200, Konstantin Belousov wrote: > > > After thinking some more, I believe I managed to construct a pos

Re: Does FreeBSD have sendmmsg or recvmmsg system calls?

2016-01-17 Thread Jilles Tjoelker
e leaving cancellation pending. This seems conceptually possible but adds some code to the common path for cancellation points. A new version of pthread_testcancel() with a return value would be needed. -- Jilles Tjoelker ___ freebsd-net@freebsd.or

Re: close(2) while accept(2) is blocked

2013-04-05 Thread Jilles Tjoelker
return (0); } A blocking accept (and some other operations) is waiting on &so->so_timeo. Once it wakes up, it will detect the SBS_CANTRCVMORE bit. A spurious wakeup on so->so_timeo appears harmless (sleep retried) except when lingering on close (SO_LINGER) so this should be fairly safe.

Re: close(2) while accept(2) is blocked

2013-03-28 Thread Jilles Tjoelker
ead out of accept(2) (at least without resorting to > signals). Pthread cancellation works better than raw signals for this use case. In a proper implementation such as in FreeBSD 9.0 or newer and used properly, it allows avoiding the resource leak that may happen

Re: possible array out of bounds access in sys/netinet/sctp_output.c

2011-11-27 Thread Jilles Tjoelker
tations. C99 recognized this need and created a way to do it, which looks like uint16_t addr_type[];. This adds any necessary padding and allows access to however many elements have been allocated. Also, if it is not at the end of a struct it is an error. Using this new construct requires cod

Re: POLLHUP on never connected socket

2011-09-02 Thread Jilles Tjoelker
; and "connection closed after poll() returned something" are useful in reasoning about this. Ports people have complained about poll() behaviour before, are there configure scripts that attempt to check if we ever return POLLHUP alone and only check for POLLIN if not? -- Jilles T