خرید بک لینک

Vote count: 0

everyone!

I want to get the retu value of the shell command "ls" in a keel module. the following is the source code of my keel module.

#include <linux/init.h>
#include <linux/module.h>
#include <linux/keel.h>
#include <linux/kmod.h>


MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("yuuyuu");
MODULE_DESCRIPTION("keel module hello");
MODULE_VERSION("1.0");

static int hello_init(void)
{

    char * envp[] = { "HOME=/", NULL };
    char * argv[] = { "/bin/ls","/home", NULL };

    call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);

    printk(KERN_ALERT "hello_init() startn");
    retu 0;
}


static void hello_exit(void)
{
printk(KERN_ALERT "hello_exit() startn");
}


module_init(hello_init);
module_exit(hello_exit);

Is there anyone know how to get the output of "ls /home"?

Thanks!

asked 41 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 8 تير 1395 ساعت: 11:18

صفحه بندی