netdev
[Top] [All Lists]

[PATCH] make {send|recv}msg return code 1003.1 compatible

To: davem@xxxxxxxxxx
Subject: [PATCH] make {send|recv}msg return code 1003.1 compatible
From: Thomas Graf <tgraf@xxxxxxx>
Date: Wed, 9 Jul 2003 21:36:28 +0200
Cc: netdev@xxxxxxxxxxx, tgraf@xxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
Hello

1003.1 says:

[EMSGSIZE]
    The msg_iovlen member of the msghdr structure pointed to by
    message is less than or equal to 0, or is greater than
    {IOV_MAX}.

The patch changes the return code of {send|recv}msg from EINVAL
to EMSGSIZE.

 -- thomas


Index: net/socket.c
===================================================================
RCS file: /cvs/tgr/linux-25/net/socket.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 socket.c
--- net/socket.c        9 Jul 2003 18:42:29 -0000       1.1.1.1
+++ net/socket.c        9 Jul 2003 19:17:29 -0000
@@ -1614,7 +1614,7 @@
                goto out;
 
        /* do not move before msg_sys is valid */
-       err = -EINVAL;
+       err = -EMSGSIZE;
        if (msg_sys.msg_iovlen > UIO_MAXIOV)
                goto out_put;
 
@@ -1713,7 +1713,7 @@
        if (!sock)
                goto out;
 
-       err = -EINVAL;
+       err = -EMSGSIZE;
        if (msg_sys.msg_iovlen > UIO_MAXIOV)
                goto out_put;
        

<Prev in Thread] Current Thread [Next in Thread>