Hi there
This is what I am doing inside a "libmylib.so" which I am loading from
a java app. The problem is that the two lines "execl" and "system"
refuses to take effect. It correctly executes all the other parts
like the "fprintf" statements. Is there somekind of a limitation
that "system" calls and "exec" group of calls do not work when using
a java wrapper over a shared object C library ?
if ((pid = fork()) <0 ) {
fprintf(stdout,"fork() error\n");
} else if (pid == 0) {
fprintf(stdout,"Inside the forked process\n");
execl("/bin/sh","sh","-c","/sbin/ifconfig",(char *) 0);
_exit(127);
} else {
system("/bin/ls");
fprintf(stdout,"Reached the end\n");
return(errno);
}
I declare the above function as "public native" in the java wrapping
function which is called by the java app.
Any help is appreciated.
-amlan.
--
Amlan Saha [EMAIL PROTECTED]
[EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]