diff options
author | Dan McDonald <danmcd@mnx.io> | 2022-10-17 17:45:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 17:45:31 -0400 |
commit | 0304e418633be64468218263192782a12da919a2 (patch) | |
tree | a305a88a3fb813163a34c393e4ec6742c519c038 /usr/src/cmd/bhyve/sockstream.c | |
parent | a41cec58980057a54ffdf464a2b2d381d819b975 (diff) | |
parent | 4012c8b05c5f0ba3a55d5f171a8906ec60b60076 (diff) | |
download | illumos-joyent-OS-8418.tar.gz |
Merge branch 'master' into OS-8418OS-8418
Diffstat (limited to 'usr/src/cmd/bhyve/sockstream.c')
-rw-r--r-- | usr/src/cmd/bhyve/sockstream.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr/src/cmd/bhyve/sockstream.c b/usr/src/cmd/bhyve/sockstream.c index b592bce9aa..d8d9966cfb 100644 --- a/usr/src/cmd/bhyve/sockstream.c +++ b/usr/src/cmd/bhyve/sockstream.c @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <unistd.h> +#ifndef __FreeBSD__ +#include <sys/socket.h> +#endif + #include <errno.h> #include "sockstream.h" @@ -72,7 +76,11 @@ stream_write(int fd, const void *buf, ssize_t nbytes) p = buf; while (len < nbytes) { +#ifdef __FreeBSD__ n = write(fd, p + len, nbytes - len); +#else + n = send(fd, p + len, nbytes - len, MSG_NOSIGNAL); +#endif if (n == 0) break; if (n < 0) { |