aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lsmod.c20
-rw-r--r--modutils/lsmod.c20
2 files changed, 40 insertions, 0 deletions
diff --git a/lsmod.c b/lsmod.c
index 2a238cd23..945f420e0 100644
--- a/lsmod.c
+++ b/lsmod.c
@@ -54,6 +54,13 @@ int query_module(const char *name, int which, void *buf, size_t bufsize,
54#define QM_SYMBOLS 4 54#define QM_SYMBOLS 4
55#define QM_INFO 5 55#define QM_INFO 5
56 56
57/* Bits of module.flags. */
58#define NEW_MOD_RUNNING 1
59#define NEW_MOD_DELETED 2
60#define NEW_MOD_AUTOCLEAN 4
61#define NEW_MOD_VISITED 8
62#define NEW_MOD_USED_ONCE 16
63#define NEW_MOD_INITIALIZING 64
57 64
58 65
59extern int lsmod_main(int argc, char **argv) 66extern int lsmod_main(int argc, char **argv)
@@ -95,6 +102,19 @@ extern int lsmod_main(int argc, char **argv)
95 } 102 }
96 if (count) printf("]"); 103 if (count) printf("]");
97 printf("\n"); 104 printf("\n");
105
106 if (info.flags & NEW_MOD_DELETED)
107 printf(" (deleted)");
108 else if (info.flags & NEW_MOD_INITIALIZING)
109 printf(" (initializing)");
110 else if (!(info.flags & NEW_MOD_RUNNING))
111 printf(" (uninitialized)");
112 else {
113 if (info.flags & NEW_MOD_AUTOCLEAN)
114 printf(" (autoclean)");
115 if (!(info.flags & NEW_MOD_USED_ONCE))
116 printf(" (unused)");
117 }
98 } 118 }
99 119
100 120
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 2a238cd23..945f420e0 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -54,6 +54,13 @@ int query_module(const char *name, int which, void *buf, size_t bufsize,
54#define QM_SYMBOLS 4 54#define QM_SYMBOLS 4
55#define QM_INFO 5 55#define QM_INFO 5
56 56
57/* Bits of module.flags. */
58#define NEW_MOD_RUNNING 1
59#define NEW_MOD_DELETED 2
60#define NEW_MOD_AUTOCLEAN 4
61#define NEW_MOD_VISITED 8
62#define NEW_MOD_USED_ONCE 16
63#define NEW_MOD_INITIALIZING 64
57 64
58 65
59extern int lsmod_main(int argc, char **argv) 66extern int lsmod_main(int argc, char **argv)
@@ -95,6 +102,19 @@ extern int lsmod_main(int argc, char **argv)
95 } 102 }
96 if (count) printf("]"); 103 if (count) printf("]");
97 printf("\n"); 104 printf("\n");
105
106 if (info.flags & NEW_MOD_DELETED)
107 printf(" (deleted)");
108 else if (info.flags & NEW_MOD_INITIALIZING)
109 printf(" (initializing)");
110 else if (!(info.flags & NEW_MOD_RUNNING))
111 printf(" (uninitialized)");
112 else {
113 if (info.flags & NEW_MOD_AUTOCLEAN)
114 printf(" (autoclean)");
115 if (!(info.flags & NEW_MOD_USED_ONCE))
116 printf(" (unused)");
117 }
98 } 118 }
99 119
100 120