[TOTALLY AND UTTERLY OFF TOPIC] Re: execl!

David Luyer (luyer@ucs.uwa.edu.au)
Wed, 24 Mar 1999 12:33:58 +0800


Definitely not a kernel issue, it's a libc issue, and not even a bug anyway.

G Jalaja Devi scrawled:

> Have a look at this piece of code.

Yuck.

> if (pid == 0)
> {
> printf("Tr -module");
> getchar();
> execl("/sbin/insmod", "insmod", "trc", NULL);
[...]

Your problem was that you needed the getchar() to make the printf() work.
This is probably because your output is in buffered mode, there is no '\n'
and you don't fflush(stdout) before the execl(), so the printf() just buffers
and the write is never actually done.

David.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/