sarah tonin :wlfBlep: on Nostr: ok so when i am trying to insert into a buffer that is already full (or to remove ...
ok so when i am trying to insert into a buffer that is already full (or to remove from one that is already empty), should set errno to ENOSPC, ENOMEM or ENOBUFS ? i have seen all three being used and i'm unsure which one is the most correct
i mean ENOSPC explicitly states "No space left on device", but i'm unsure what device means here, and ENOMEM just says "Not enough space" which ? may you be a little more descriptive ?
i'm tempted to go with ENOBUFS ("No buffer space available"), but i wonder if there is a consensus here
Published at
2026-05-21 18:18:55 UTCEvent JSON
{
"id": "7e9dfa6de882a10b7125da0bc8138d9e8dd5bce110fe2847d2cfa80d678e20f5",
"pubkey": "d8784e1235e59d8a0faf020c35dac3c5e80cede84b6c500992ee2b7062aabeeb",
"created_at": 1779387535,
"kind": 1,
"tags": [
[
"proxy",
"https://tech.lgbt/@SRAZKVT/116613941551286743",
"web"
],
[
"proxy",
"https://tech.lgbt/users/SRAZKVT/statuses/116613941551286743",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://tech.lgbt/users/SRAZKVT/statuses/116613941551286743",
"pink.momostr"
],
[
"-"
]
],
"content": "ok so when i am trying to insert into a buffer that is already full (or to remove from one that is already empty), should set errno to ENOSPC, ENOMEM or ENOBUFS ? i have seen all three being used and i'm unsure which one is the most correct\n\ni mean ENOSPC explicitly states \"No space left on device\", but i'm unsure what device means here, and ENOMEM just says \"Not enough space\" which ? may you be a little more descriptive ?\n\ni'm tempted to go with ENOBUFS (\"No buffer space available\"), but i wonder if there is a consensus here",
"sig": "d62276704ad184441fe2702857a7ccf5849752eb040e3b59336b80ef92c471de4baad8c51c131ee2a234669e0c5ba954b6b7240a143e0b449b0146ca86ca2698"
}