Hi, I am getting an error while unloading modules via modprobe. Here is the description of issue. I have a module 'A' that depends on Module 'C' and 'D'. And another module 'B' that depends on Module 'C' and 'E' I loaded these modules from code via 'system' function as error = system("modprobe -v A"); error = system("modprobe -v B"); After this all my modules A, B, C, D, and E are loaded properly. Now when i tried to unload module A via error = system("modprobe -rv A"); This returns an error = 256. But my module A and D is unloaded successfully. 'C' is not unloaded as it is still in used by 'B'. Is the error returned by system function is caused due to not unloading of module 'C'? This is a valid scenario and error should not have returned in this case. I am still trying to find the reason for an error. If anyone has some information on this then please help to share. Thanks, Chetan Nanda
error = system("modprobe -rv A");
This returns an error = 256.
What does 'perror' show (if anything) ? Also, if you try the same via a shel, whats the return value ('echo $?') printed? BTW, why are you using the '-v' option when invoking modprobe programatically? -mandeep
On Tue, Dec 3, 2013 at 2:17 PM, Mandeep Sandhu <mandeepsandhu.chd@gmail.com>wrote:
error = system("modprobe -rv A");
This returns an error = 256.
Hi Mandeep,
thanks for your mail What does 'perror' show (if anything) ?
Also, if you try the same via a shel, whats the return value ('echo $?') printed?
echo $? show 1 (EPERM? most probably, operation not permitted for common
module).
BTW, why are you using the '-v' option when invoking modprobe programatically?
yes, -v option can be removed (behaviour is same even after removing -v option)
-mandeep
Thanks, Chetan Nanda
participants (2)
-
Chetan Nanda -
Mandeep Sandhu