[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Fork with gtk+-2.0



On Mon, 5 Jan 2004 15:04:15 +0300
"Alphex K." <alphex@crew.org.ru> wrote:

> pid_t pid;
> pid = fork();
> 
> if ((pid=fork())==0)
> 	execlp("/bin/xvkbd", "-geometry 800x185-0-0", NULL);
> else
> 	g_print("Fork failed\n");
> }

You've left out a lot of details. You need to register a singal handler for
SIGCHLD. If you want to communitate with the child process, you have to setup
pipes etc.

It's better to use one of g_spawn_async or g_spawn_async_with_pipes or
g_spawn_command_line_async. They take care of a lot of the details for you.

Roland
-- 
R.F. Smith                           /"\    ASCII Ribbon Campaign
r s m i t h @ x s 4 a l l . n l      \ /    No HTML/RTF in email
http://www.xs4all.nl/~rsmith/         X     No Word docs in email
                                     / \    Respect for open standards

PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]