- 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("]");
-
- printf("\n");
- }
-
-#ifdef CONFIG_FEATURE_CLEAN_UP
- free(module_names);
-#endif
-
- return( 0);
-}
-
-#else /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */
-
-int lsmod_main(int argc, char **argv)
-{
- FILE *file = xfopen("/proc/modules", "r");
-
- printf("Module Size Used by");
- check_tainted();
-#if defined(CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT)
- {
- char line[4096];
-
- while (fgets(line, sizeof(line), file)) {
- char *tok;
-
- tok = strtok(line, " \t");
- printf("%-19s", tok);
- tok = strtok(NULL, " \t\n");
- printf(" %8s", tok);
- tok = strtok(NULL, " \t\n");
- /* Null if no module unloading support. */
- if (tok) {
- printf(" %s", tok);
- tok = strtok(NULL, "\n");
- if (!tok)
- tok = "";
- /* New-style has commas, or -. If so,
- truncate (other fields might follow). */
- else if (strchr(tok, ',')) {
- tok = strtok(tok, "\t ");
- /* Strip trailing comma. */
- if (tok[strlen(tok)-1] == ',')
- tok[strlen(tok)-1] = '\0';
- } else if (tok[0] == '-'
- && (tok[1] == '\0' || isspace(tok[1])))
- tok = "";
- printf(" %s", tok);
- }
- printf("\n");
- }
- fclose(file);