protocols/unix: Return EOPNOTSUPP when unhandled flags are specified.

Fixes the "bug" part of #18653 (however the flags still need to
actually be implemented.)

Change-Id: Icd296af8b409416317ba3d02735504729949fd08
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7109
Reviewed-by: Niels Sascha Reedijk <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2023-11-15 16:33:38 +00:00
committed by waddlesplash
parent 1b8870852e
commit 74a44f5aed
2 changed files with 12 additions and 0 deletions
@@ -215,6 +215,9 @@ UnixDatagramEndpoint::Send(const iovec* vecs, size_t vecCount,
TRACE("[%" B_PRId32 "] %p->UnixDatagramEndpoint::Send()\n",
find_thread(NULL), this);
if ((flags & ~(MSG_DONTWAIT)) != 0)
return EOPNOTSUPP;
bigtime_t timeout = 0;
if ((flags & MSG_DONTWAIT) == 0) {
timeout = absolute_timeout(socket->send.timeout);
@@ -325,6 +328,9 @@ UnixDatagramEndpoint::Receive(const iovec* vecs, size_t vecCount,
TRACE("[%" B_PRId32 "] %p->UnixDatagramEndpoint::Receive()\n",
find_thread(NULL), this);
if ((flags & ~(MSG_DONTWAIT)) != 0)
return EOPNOTSUPP;
bigtime_t timeout = 0;
if ((flags & MSG_DONTWAIT) == 0) {
timeout = absolute_timeout(socket->receive.timeout);
@@ -379,6 +379,9 @@ UnixStreamEndpoint::Send(const iovec* vecs, size_t vecCount,
TRACE("[%" B_PRId32 "] %p->UnixStreamEndpoint::Send(%p, %ld, %p)\n",
find_thread(NULL), this, vecs, vecCount, ancillaryData);
if ((flags & ~(MSG_DONTWAIT)) != 0)
return EOPNOTSUPP;
bigtime_t timeout = 0;
if ((flags & MSG_DONTWAIT) == 0) {
timeout = absolute_timeout(socket->send.timeout);
@@ -473,6 +476,9 @@ UnixStreamEndpoint::Receive(const iovec* vecs, size_t vecCount,
TRACE("[%" B_PRId32 "] %p->UnixStreamEndpoint::Receive(%p, %ld)\n",
find_thread(NULL), this, vecs, vecCount);
if ((flags & ~(MSG_DONTWAIT)) != 0)
return EOPNOTSUPP;
bigtime_t timeout = 0;
if ((flags & MSG_DONTWAIT) == 0) {
timeout = absolute_timeout(socket->receive.timeout);