mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@novell.com>
To: Andrew Morton <akpm@osdl.org>,
	Marcelo Tosatti <marcelo.tosatti@cyclades.com.br>
Cc: linux-kernel@vger.kernel.org
Subject: accept should return ENFILE if it runs out of inodes
Date: Thu, 21 Oct 2004 02:41:27 +0200	[thread overview]
Message-ID: <20041021004127.GO24619@dualathlon.random> (raw)

EMFILE is only for the per-process fds limit, all other cases where
sock_alloc fails already returns -ENFILE too, must have been a typo.

patch for 2.4:

--- 2.4.23aa3/net/socket.c.~1~	2004-07-04 02:09:33.000000000 +0200
+++ 2.4.23aa3/net/socket.c	2004-10-21 02:36:45.704715960 +0200
@@ -1068,7 +1068,7 @@ asmlinkage long sys_accept(int fd, struc
 	if (!sock)
 		goto out;
 
-	err = -EMFILE;
+	err = -ENFILE;
 	if (!(newsock = sock_alloc())) 
 		goto out_put;
 

patch for 2.6:

Index: linux-2.5/net/socket.c
===================================================================
RCS file: /home/andrea/crypto/cvs/linux-2.5/net/socket.c,v
retrieving revision 1.90
diff -u -p -r1.90 socket.c
--- linux-2.5/net/socket.c	8 Aug 2004 02:05:19 -0000	1.90
+++ linux-2.5/net/socket.c	21 Oct 2004 00:37:12 -0000
@@ -1354,7 +1354,7 @@ asmlinkage long sys_accept(int fd, struc
 	if (!sock)
 		goto out;
 
-	err = -EMFILE;
+	err = -ENFILE;
 	if (!(newsock = sock_alloc())) 
 		goto out_put;
 

             reply	other threads:[~2004-10-21  0:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-21  0:41 Andrea Arcangeli [this message]
2004-10-25 23:36 ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041021004127.GO24619@dualathlon.random \
    --to=andrea@novell.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®