busybox/modutils/insmod.c

34 lines
710 B
C
Raw Normal View History

/* vi: set sw=4 ts=4: */
/*
* Mini insmod implementation for busybox
2001-07-25 22:28:58 +05:30
*
* Copyright (C) 2008 Timo Teras <timo.teras@iki.fi>
2001-07-25 22:28:58 +05:30
*
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
#include "libbb.h"
#include "modutils.h"
int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
2008-07-05 14:48:54 +05:30
int insmod_main(int argc UNUSED_PARAM, char **argv)
{
char *filename;
int rc;
USE_FEATURE_2_4_MODULES(
getopt32(argv, INSMOD_OPTS INSMOD_ARGS);
argv += optind-1;
);
2003-12-25 02:00:45 +05:30
filename = *++argv;
if (!filename)
bb_show_usage();
rc = bb_init_module(filename, parse_cmdline_module_options(argv));
if (rc)
bb_error_msg("cannot insert '%s': %s", filename, moderror(rc));
return rc;
}