LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-01-2005, 12:21 AM   #1
shashishankar_h
LQ Newbie
 
Registered: Sep 2005
Posts: 1

Rep: Reputation: 0
making sys call ex:insmod,rmmod from function in user module


Hi,
I want to do insmod and rmmod from a function. This is because, i want to load a different driver version for some of the conditions i have. To do this, i need to invoke rmmod and insmod from the function, how can i do this?I am using linux kernel 2.6.
thanks in advance,
-Shashi
 
Old 09-01-2005, 12:36 AM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
a common way is to fork() then use then use something in the exec() family
like
execvp(program, args);

since modprobe and freinds only run as root depending on what you are doing if you are regular user you can use sudo..
in a production environment this would be a bad thing because funky kernel modules are a way for people to compromise your system
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a kernel module call the function of another kernel module sceadu Programming 3 05-02-2011 02:22 AM
Write sys call failing ppy Programming 1 11-05-2004 08:57 AM
rmmod - making the change permanent? DiBosco Linux - General 0 06-20-2004 05:32 AM
Kill sys call eshwar_ind Programming 4 05-07-2004 11:41 AM
can interrupt handler call user space function? pot_po Programming 0 11-07-2002 09:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration