Re: call insmod in C program
- From: kartik saxena <kartik.sxn@xxxxxxxxx>
- Date: Fri, 25 Apr 2008 13:45:27 -0700 (PDT)
mbm wrote:
Hi
I need to insert kernel modules from a C application , is it possible
to do that without calling system("insmod ..")
Definitely. All you need to do is to take the insmod source code and
copy it into your application.
Simple as that. Open Source.
Hi, here goes the program.
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main()
{
setuid(0);
system("/sbin/insmod /.../yourmodule.ko");
system("/sbin/rmmod yourmodule");
return 0;
}
compile it with GCC, get back to me in case of any errors. i will be
more than glad to help.
.
- Follow-Ups:
- Re: call insmod in C program
- From: Tilman Schmidt
- Re: call insmod in C program
- References:
- call insmod in C program
- From: mbm
- Re: call insmod in C program
- From: Josef Moellers
- call insmod in C program
- Prev by Date: Re: Netlink sockets problem in Fedora Core 8 2.6.23.1-42 Kernel
- Next by Date: Re: call insmod in C program
- Previous by thread: Re: call insmod in C program
- Next by thread: Re: call insmod in C program
- Index(es):
Relevant Pages
|