patch-2.1.101 linux/fs/proc/fd.c
Next file: linux/fs/proc/inode-alloc.txt
Previous file: linux/fs/open.c
Back to the patch index
Back to the overall index
- Lines: 48
- Date:
Fri May 8 18:10:30 1998
- Orig file:
v2.1.100/linux/fs/proc/fd.c
- Orig date:
Wed Apr 1 20:11:53 1998
diff -u --recursive --new-file v2.1.100/linux/fs/proc/fd.c linux/fs/proc/fd.c
@@ -4,6 +4,10 @@
* Copyright (C) 1991, 1992 Linus Torvalds
*
* proc fd directory handling functions
+ *
+ * 01-May-98 Edgar Toernig <froese@gmx.de>
+ * Added support for more than 256 fds.
+ * Limit raised to 32768.
*/
#include <linux/errno.h>
@@ -91,7 +95,7 @@
goto out;
fd *= 10;
fd += c;
- if (fd & 0xffff0000)
+ if (fd & 0xffff8000)
goto out;
}
@@ -111,8 +115,7 @@
if (!file || !file->f_dentry)
goto out;
- /* N.B. What happens if fd > 255?? */
- ino = (pid << 16) + (PROC_PID_FD_DIR << 8) + fd;
+ ino = (pid << 16) + PROC_PID_FD_DIR + fd;
inode = proc_get_inode(dir->i_sb, ino, NULL);
if (inode) {
d_add(dentry, inode);
@@ -144,7 +147,7 @@
goto out;
for (fd = filp->f_pos; fd < 2; fd++, filp->f_pos++) {
- unsigned long ino = inode->i_ino;
+ ino = inode->i_ino;
if (fd)
ino = (ino & 0xffff0000) | PROC_PID_INO;
if (filldir(dirent, "..", fd+1, fd, ino) < 0)
@@ -176,7 +179,7 @@
/* Drop the task lock, as the filldir function may block */
read_unlock(&tasklist_lock);
- ino = (pid << 16) + (PROC_PID_FD_DIR << 8) + fd;
+ ino = (pid << 16) + PROC_PID_FD_DIR + fd;
if (filldir(dirent, buf+j, NUMBUF-j, fd+2, ino) < 0)
goto out;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov