- printf("Module Size Used by\n");
- for (i = 0, mn = module_names; i < nmod; mn += strlen(mn) + 1, i++) {
- if (query_module(mn, QM_INFO, &info, sizeof(info), &count)) {
- if (errno == ENOENT) {
- /* The module was removed out from underneath us. */
- continue;
- }
- /* else choke */
- fatalError("module %s: QM_INFO: %s\n", mn, strerror(errno));
- }
- while (query_module(mn, QM_REFS, deps, bufsize, &count)) {
- if (errno == ENOENT) {
- /* The module was removed out from underneath us. */
- continue;
- }
- if (errno != ENOSPC) {
- fatalError("module %s: QM_REFS: %s", mn, strerror(errno));
- }
- deps = xrealloc(deps, bufsize = count);
- }
- printf("%-20s%8lu%4ld ", mn, info.size, info.usecount);
- if (count) printf("[");
- for (j = 0, dn = deps; j < count; dn += strlen(dn) + 1, j++) {
- printf("%s%s", dn, (j==count-1)? "":" ");
- }
- if (count) printf("] ");
+int lsmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int lsmod_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
+{
+#if ENABLE_FEATURE_LSMOD_PRETTY_2_6_OUTPUT
+ char *token[4];
+ parser_t *parser = config_open("/proc/modules");
+ printf("Module Size Used by"); //vda!
+ check_tainted();