I wrote this code:


void main()
{
execl("/usr/X11R6/bin/xclock","-display :0",NULL);
sleep(10);
}


Now I 'xhost +' ! (To disable the access control)
Now compile it and then run it!
If you run it from a xterm window... The clock runs ...
But if I run it from a tty.. ie the text terminal... it says
"Error: Can't open Display"
What is the problem ???
I want a simple program .. which must be able to exec a xclock on desktop ':0' ... when I run the program from text terminal (tty) logged in as root !
Thanks in advance !!!!
--
**********************************************************
* Never say die unless you are dead ! *
* .oooO *
* ( ) Oooo. Only those who will risk going too far *
* \ ( ( ) Can possibly find out how far one can go!*
* \_) ) / *
* (_/ http://www.it.iitb.ac.in/~akhilesh/ *
**********************************************************




_______________________________________________
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to