浏览代码

[LibOS] Explicitly return error if flags parameter set for recvmsg/recvmmsg/recvfrom

Thomas Knauth 6 年之前
父节点
当前提交
58bd20e8d3
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      LibOS/shim/src/sys/shim_socket.c

+ 6 - 0
LibOS/shim/src/sys/shim_socket.c

@@ -1192,6 +1192,12 @@ int shim_do_sendmmsg (int sockfd, struct mmsghdr * msg, int vlen, int flags)
 static ssize_t do_recvmsg (int fd, struct iovec * bufs, int nbufs, int flags,
                            struct sockaddr * addr, socklen_t * addrlen)
 {
+    /* TODO handle flags properly. For now, explicitly return an error. */
+    if (flags) {
+        debug("recvmsg()/recvmmsg()/recvfrom(): flags parameter unsupported.\n");
+        return -EOPNOTSUPP;
+    }
+
     struct shim_handle * hdl = get_fd_handle(fd, NULL, NULL);
     if (!hdl)
         return -EBADF;