aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>1999-12-15 22:14:12 +0000
committerErik Andersen <andersen@codepoet.org>1999-12-15 22:14:12 +0000
commit6f23cec5d081fac63a7a0c493d6caff77e55dfb1 (patch)
tree237dbf5039738e52cd7f6a3ada0ee9c03eccc01c
parent935fb3886fc9bb91266275236da1edd5b2b6c2d9 (diff)
downloadbusybox-w32-6f23cec5d081fac63a7a0c493d6caff77e55dfb1.tar.gz
busybox-w32-6f23cec5d081fac63a7a0c493d6caff77e55dfb1.tar.bz2
busybox-w32-6f23cec5d081fac63a7a0c493d6caff77e55dfb1.zip
Added lsmod
-Erik
-rw-r--r--Changelog3
-rw-r--r--applets/busybox.c3
-rw-r--r--busybox.c3
-rw-r--r--busybox.def.h1
-rw-r--r--internal.h5
-rw-r--r--lsmod.c35
-rw-r--r--modutils/lsmod.c35
7 files changed, 83 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index a1469c631..9ccc21160 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,9 @@
10.40 10.40
2 * Added the -s option to du -beppu 2 * Added the -s option to du -beppu
3 * Fixed an embarrasing segfault in head -beppu 3 * Fixed an embarrasing segfault in head -beppu
4 * New App: lsmod -erik
5
6 -Erik Andersen
4 7
50.39 80.39
6 * New Apps: ping, hostname, and mkfifo contributed by Randolph Chung 9 * New Apps: ping, hostname, and mkfifo contributed by Randolph Chung
diff --git a/applets/busybox.c b/applets/busybox.c
index 4d676e7c0..4967e5fa3 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -105,6 +105,9 @@ static const struct Applet applets[] = {
105#ifdef BB_LS //bin 105#ifdef BB_LS //bin
106 {"ls", ls_main}, 106 {"ls", ls_main},
107#endif 107#endif
108#ifdef BB_LSMOD //sbin
109 {"lsmod", lsmod_main},
110#endif
108#ifdef BB_MAKEDEVS //sbin 111#ifdef BB_MAKEDEVS //sbin
109 {"makedevs", makedevs_main}, 112 {"makedevs", makedevs_main},
110#endif 113#endif
diff --git a/busybox.c b/busybox.c
index 4d676e7c0..4967e5fa3 100644
--- a/busybox.c
+++ b/busybox.c
@@ -105,6 +105,9 @@ static const struct Applet applets[] = {
105#ifdef BB_LS //bin 105#ifdef BB_LS //bin
106 {"ls", ls_main}, 106 {"ls", ls_main},
107#endif 107#endif
108#ifdef BB_LSMOD //sbin
109 {"lsmod", lsmod_main},
110#endif
108#ifdef BB_MAKEDEVS //sbin 111#ifdef BB_MAKEDEVS //sbin
109 {"makedevs", makedevs_main}, 112 {"makedevs", makedevs_main},
110#endif 113#endif
diff --git a/busybox.def.h b/busybox.def.h
index cbee4f651..fcd185aa7 100644
--- a/busybox.def.h
+++ b/busybox.def.h
@@ -35,6 +35,7 @@
35//#define BB_LOADKMAP 35//#define BB_LOADKMAP
36#define BB_LOGGER 36#define BB_LOGGER
37#define BB_LS 37#define BB_LS
38#define BB_LSMOD
38//#define BB_MAKEDEVS 39//#define BB_MAKEDEVS
39//#define BB_MATH 40//#define BB_MATH
40#define BB_MKDIR 41#define BB_MKDIR
diff --git a/internal.h b/internal.h
index 3cf777418..371728dd7 100644
--- a/internal.h
+++ b/internal.h
@@ -58,9 +58,11 @@ extern int more_main(int argc, char** argv);
58extern int cp_main(int argc, char** argv); 58extern int cp_main(int argc, char** argv);
59extern int chmod_chown_chgrp_main(int argc, char** argv); 59extern int chmod_chown_chgrp_main(int argc, char** argv);
60extern int chroot_main(int argc, char** argv); 60extern int chroot_main(int argc, char** argv);
61extern int chvt_main(int argc, char** argv);
61extern int clear_main(int argc, char** argv); 62extern int clear_main(int argc, char** argv);
62extern int date_main(int argc, char** argv); 63extern int date_main(int argc, char** argv);
63extern int dd_main(int argc, char** argv); 64extern int dd_main(int argc, char** argv);
65extern int deallocvt_main(int argc, char** argv);
64extern int df_main(int argc, char** argv); 66extern int df_main(int argc, char** argv);
65extern int dmesg_main(int argc, char** argv); 67extern int dmesg_main(int argc, char** argv);
66extern int du_main(int argc, char** argv); 68extern int du_main(int argc, char** argv);
@@ -83,8 +85,7 @@ extern int loadfont_main(int argc, char** argv);
83extern int loadkmap_main(int argc, char** argv); 85extern int loadkmap_main(int argc, char** argv);
84extern int losetup_main(int argc, char** argv); 86extern int losetup_main(int argc, char** argv);
85extern int ls_main(int argc, char** argv); 87extern int ls_main(int argc, char** argv);
86extern int chvt_main(int argc, char** argv); 88extern int lsmod_main(int argc, char** argv);
87extern int deallocvt_main(int argc, char** argv);
88extern int makedevs_main(int argc, char** argv); 89extern int makedevs_main(int argc, char** argv);
89extern int math_main(int argc, char** argv); 90extern int math_main(int argc, char** argv);
90extern int mkdir_main(int argc, char** argv); 91extern int mkdir_main(int argc, char** argv);
diff --git a/lsmod.c b/lsmod.c
new file mode 100644
index 000000000..1696f756e
--- /dev/null
+++ b/lsmod.c
@@ -0,0 +1,35 @@
1/*
2 * Mini lsmod implementation for busybox
3 *
4 * Copyright (C) 1999 by Lineo, inc.
5 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23#include "internal.h"
24#include <stdio.h>
25
26
27#if ! defined BB_FEATURE_USE_PROCFS
28#error Sorry, I depend on the /proc filesystem right now.
29#endif
30
31extern int lsmod_main(int argc, char **argv)
32{
33 char* cmd[] = { "cat", "/proc/modules", "\0" };
34 exit(cat_main( 3, cmd));
35}
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
new file mode 100644
index 000000000..1696f756e
--- /dev/null
+++ b/modutils/lsmod.c
@@ -0,0 +1,35 @@
1/*
2 * Mini lsmod implementation for busybox
3 *
4 * Copyright (C) 1999 by Lineo, inc.
5 * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23#include "internal.h"
24#include <stdio.h>
25
26
27#if ! defined BB_FEATURE_USE_PROCFS
28#error Sorry, I depend on the /proc filesystem right now.
29#endif
30
31extern int lsmod_main(int argc, char **argv)
32{
33 char* cmd[] = { "cat", "/proc/modules", "\0" };
34 exit(cat_main( 3, cmd));
35}