[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/LWIP PATCH 3/5] sockets: Add recvmsg() function


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Wed, 4 Sep 2019 22:09:10 +0300
  • Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, vlad_andrei.badoiu@xxxxxxxxxxxxxxx
  • Delivery-date: Wed, 04 Sep 2019 19:09:42 +0000
  • Ironport-phdr: 9a23:OV8PJhfGHtpi668HFP0JduWClGMj4u6mDksu8pMizoh2WeGdxcW8YR7h7PlgxGXEQZ/co6odzbaP6ea5BjFLuMzQ+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe7x/IAiooQnLq8Ubg4tvJqksxhfXpnZDZvhby35vKV+PhRj3+92+/IRk8yReuvIh89BPXKDndKkmTrJWESorPXkt6MLkqRfMQw2P5mABUmoNiRpHHxLF7BDhUZjvtCbxq/dw1zObPc3ySrA0RCii4qJ2QxLmlCsLKzg0+3zRh8dtjqxUvQihqgR/zYDKfY+bOvlwcKTfctMUXmdNQtpdWjZdDo6mc4cDE+wMNvtYoYnnoFsOqAOzCBerBOP01j9Ih3n21rA83eQ8CQHGwRErEtUSv3TTt9X1KKYSUeavwKnM0DXDd+5W1Czh54jTaBwhueyMUqlqfcrLzkkiDgXIhUiTp4z9Jz6Zy+sAv3WB4+djVe+jkXArpx9zrzS1yMogkpTFi40Ixlze9ih0wJw5KcO2RUN1e9KoDZRduz+cOoBrWM0tWXtotzw/yrAevJ67ezUFx4o/yh7EbvyHb5CI4hX+VOaNOTt4hGxqeLa4hxuq70igz/fzVsiw0FpQsiVFicPAtmgQ1xPI8MSHUPx98l+g2TaJyQ/T9vlJLV07mKbGMZIswb49moANvUjdHCL6gkv7gLeTdko+++io7+rnYq/hpp+ZL4J7lgb+Mr8ymsy+B+Q0KAwOX3WD+eShz7Ds4Vb5TK9Sjv0riabVqoraJcMDqq6jHwBVypoj6wq4Dzq+1dQYnH8HLFNCeBKcloTmJk/BIO7mAve7mFmslDZrx+vaPr36GJnMIWbMkLH7cbZ68U5cxxI5zcpD6JJMFrEBPPXzV1f/tNPGCh85MhS0zPj9BNV9y4MeWH6AAq6CPaPUr1CH+uYvLPOXa4MPpjn9NuAv5+Tygn8hhV8dYa6p0IMMaHC5G/RmJEOZbWDvgtccD2gKuAs/Q/LwiFCZVz5ceWq9X6Ym6T4gEo6pE5rDTJi3gLOdxCe7AoFWZmdeB1CSFXfnbZiLVO8WZyKUP8BhiCILVbm7R4A6zx6hqQj6y7t6LufP4S0YqY/j28Vv6+LJiR4y7iZ4D9mF026WVW10hGQIFHcK2/V6oEp8zUzG3aVmjvhwEd1I++gPQgo8c5nGwL9UEdf3DynGZcuITh6CX827SWU6ScktwtlIZ1tlBv2plVbbwiDsGbhDxO/DP4A97q+Jhyu5HM160XuTjKQ=
  • Ironport-sdr: 28S/9qW1ZqlWuwlXgivqcuSXG7W1mRlCQ4b6wtUWiaoiO6lazAs0Byy3FknYjzVV/LQNrtI50e zOUKXHMoxCCQ==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 exportsyms.uk        |  1 +
 include/sys/socket.h |  1 +
 sockets.c            | 19 +++++++++++++++++++
 3 files changed, 21 insertions(+)

diff --git a/exportsyms.uk b/exportsyms.uk
index 1ca43f8..2f9f4f6 100644
--- a/exportsyms.uk
+++ b/exportsyms.uk
@@ -38,6 +38,7 @@ pbuf_ref
 poll
 recv
 recvfrom
+recvmsg
 select
 send
 sendmsg
diff --git a/include/sys/socket.h b/include/sys/socket.h
index aff064e..7e027b9 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -70,6 +70,7 @@ int listen(int s, int backlog);
 int recv(int s, void *mem, size_t len, int flags);
 int recvfrom(int s, void *mem, size_t len, int flags,
             struct sockaddr *from, socklen_t *fromlen);
+int recvmsg(int s, struct msghdr *msg, int flags);
 int send(int s, const void *dataptr, size_t size, int flags);
 int sendmsg(int s, const struct msghdr *message, int flags);
 int sendto(int s, const void *dataptr, size_t size, int flags,
diff --git a/sockets.c b/sockets.c
index aa772da..1806846 100644
--- a/sockets.c
+++ b/sockets.c
@@ -755,6 +755,25 @@ EXIT:
        return ret;
 }
 
+int recvmsg(int s, struct msghdr *msg, int flags)
+{
+       int ret = 0;
+       struct sock_net_file *file = NULL;
+
+       file = sock_net_file_get(s);
+       if (PTRISERR(file)) {
+               LWIP_DEBUGF(SOCKETS_DEBUG,
+                           ("failed to identify socket descriptor\n"));
+               ret = -1;
+               SOCK_NET_SET_ERRNO(PTR2ERR(file));
+               goto EXIT;
+       }
+       ret = lwip_recvmsg(file->sock_fd, msg, flags);
+       vfscore_put_file(file->vfscore_file); /* release refcount */
+EXIT:
+       return ret;
+}
+
 int send(int s, const void *dataptr, size_t size, int flags)
 {
        int ret = 0;
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.