Harry Sintonen on Nostr: DId you know that some BSDs would return 0 if called recvmsg() for non-blocking UDP ...
Published at
2025-04-21 20:26:04Event JSON
{
"id": "f23c685c585cec42e85ab9af51c36f4f7cb90fc062ad311c89faffc7272b4093",
"pubkey": "029bf35c63e8b20564400c0ab35fe3f14bc6c64ff6e3ba1c115271bd053b7e8c",
"created_at": 1745267164,
"kind": 1,
"tags": [
[
"t",
"netbsd"
],
[
"t",
"linux"
],
[
"proxy",
"https://infosec.exchange/users/harrysintonen/statuses/114377828891859904",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.mostr.pub"
]
],
"content": "DId you know that some BSDs would return 0 if called recvmsg() for non-blocking UDP socket with all iov_len totalling to 0? No-one says this is incorrect return value, but Linux does return -1 EAGAIN in this case. It's a subtle difference but it can cause trouble if your code assumes certain behaviour.\n\nnetbsd kernel code responsible for returning 0 in this case: https://github.com/NetBSD/src/blob/68fd9ef50c0ab993c10e4f19cfa2a1f4dbb10802/sys/kern/uipc_socket.c#L578\n\n#netbsd #linux",
"sig": "56447cca313dd4623812bd079ffebb2bd983b228c85e2a87ce787e797d134fae6a27f41c2f23191cf9d1c00fb9141913493305f22cfc1f796bed1cf00a8ec906"
}