Skip to content

socket: Fix get_available_bytes on systems other than Linux and Windows

Ting-Wei Lan requested to merge lantw/glib:wip/lantw/freebsd-socket-tests into master

Moved from !57 (merged).

FIONREAD ioctl on Linux reports the size of payload on UDP sockets. However, other systems usually add internal header size to the reported size, which vary between different operating systems and socket types. To make it work on more systems, we should follow what we do on Windows instead of using this unreliable FIONREAD ioctl.

This fixes socket test on FreeBSD.

Merge request reports