分类: LINUX
2006-08-10 10:32:51
#include #include #include #include static int __init test_init(void) { char *argv[] = { "/bin/sh", "-c", "uname > /tmp/uname", NULL}; char *env[] = { "ROOT=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL}; int ret; printk("Begin the program!\n"); ret = call_usermodehelper_keys(argv[0], argv, env, NULL, 1); printk("End with %d\n", ret); return 0; } static void __exit test_exit(void) { } module_init(test_init); module_exit(test_exit); |