[1610] in linux-net channel archive
Network w/o PROC_FS (fix)
daemon@ATHENA.MIT.EDU (Paul Gortmaker)
Sat Jan 13 17:43:51 1996
From: Paul Gortmaker <gpg109@rsphy1.anu.edu.au>
To: iialan@www.linux.org.uk (Alan Cox)
Date: Sat, 13 Jan 1996 17:06:12 +1100 (EST)
Cc: linux-net@vger.rutgers.edu
Hi Alan,
These implicit dependencies on the /proc fs have crept in since the
last time somebody weeded them out. They usually go unnoticed until
some fool like me tries to build a stripped kernel for a 2MB box.
[FWIW, a stripped 1.3.56, + my lightweight disk driver will still
actually run a 1024x768x256 X server (X -bs -query foo) on a 1664kB 386-40.
Quite amusing. 1.0.9 is still a better choice for 2MB boxes tho...]
Paul.
diff -ur /mnt/linux/net/core/dev.c linux/net/core/dev.c
--- /mnt/linux/net/core/dev.c Mon Jan 8 13:42:00 1996
+++ linux/net/core/dev.c Sat Jan 13 16:30:46 1996
@@ -898,6 +898,7 @@
* in detail.
*/
+#ifdef CONFIG_PROC_FS
static int sprintf_stats(char *buffer, struct device *dev)
{
struct enet_statistics *stats = (dev->get_stats ? dev->get_stats(dev): NULL);
@@ -964,6 +965,7 @@
len=length; /* Ending slop */
return len;
}
+#endif /* CONFIG_PROC_FS */
/*
@@ -1422,12 +1424,14 @@
}
}
+#ifdef CONFIG_PROC_FS
proc_net_register(&(struct proc_dir_entry) {
PROC_NET_DEV, 3, "dev",
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_net_inode_operations,
dev_get_info
});
+#endif
/*
* Initialise net_alias engine
diff -ur /mnt/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- /mnt/linux/net/ipv4/af_inet.c Mon Jan 8 13:42:00 1996
+++ linux/net/ipv4/af_inet.c Sat Jan 13 16:21:33 1996
@@ -1540,10 +1540,16 @@
#if defined(CONFIG_IP_ALIAS)
ip_alias_init();
#endif
+
+#ifdef CONFIG_INET_RARP
+ rarp_ioctl_hook = rarp_ioctl;
+#endif
/*
* Create all the /proc entries.
*/
+#ifdef CONFIG_PROC_FS
+
#ifdef CONFIG_INET_RARP
proc_net_register(&(struct proc_dir_entry) {
PROC_NET_RARP, 4, "rarp",
@@ -1551,8 +1557,8 @@
0, &proc_net_inode_operations,
rarp_get_info
});
- rarp_ioctl_hook = rarp_ioctl;
-#endif
+#endif /* RARP */
+
proc_net_register(&(struct proc_dir_entry) {
PROC_NET_RAW, 3, "raw",
S_IFREG | S_IRUGO, 1, 0, 0,
@@ -1595,4 +1601,5 @@
0, &proc_net_inode_operations,
rt_cache_get_info
});
+#endif /* CONFIG_PROC_FS */
}
diff -ur /mnt/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
--- /mnt/linux/net/ipv4/arp.c Mon Jan 8 13:42:00 1996
+++ linux/net/ipv4/arp.c Sat Jan 13 16:22:09 1996
@@ -1997,11 +1997,13 @@
/* Register for device down reports */
register_netdevice_notifier(&arp_dev_notifier);
+#ifdef CONFIG_PROC_FS
proc_net_register(&(struct proc_dir_entry) {
PROC_NET_ARP, 3, "arp",
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_net_inode_operations,
arp_get_info
});
+#endif
}
diff -ur /mnt/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
--- /mnt/linux/net/unix/af_unix.c Mon Jan 8 13:42:01 1996
+++ linux/net/unix/af_unix.c Sat Jan 13 16:25:01 1996
@@ -38,6 +38,7 @@
* socketpair(...SOCK_RAW..) doesnt panic the kernel.
*/
+#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/major.h>
#include <linux/signal.h>
@@ -971,6 +972,7 @@
return(0);
}
+#ifdef CONFIG_PROC_FS
static int unix_get_info(char *buffer, char **start, off_t offset, int length, int dummy)
{
off_t pos=0;
@@ -1010,6 +1012,7 @@
len=length;
return len;
}
+#endif
static struct proto_ops unix_proto_ops = {
AF_UNIX,
@@ -1038,12 +1041,14 @@
{
printk("NET3: Unix domain sockets 0.10 BETA for Linux NET3.033.\n");
sock_register(unix_proto_ops.family, &unix_proto_ops);
+#ifdef CONFIG_PROC_FS
proc_net_register(&(struct proc_dir_entry) {
PROC_NET_UNIX, 4, "unix",
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_net_inode_operations,
unix_get_info
});
+#endif
}
/*
* Local variables: