Portál AbcLinuxu, 8. prosince 2025 02:17
int pid;
if ( (pid = fork()) < 0)
cerr << "fork error !!!!!!!!!!!!!!!" << endl;
else
if (pid == 0) { /* child */
cerr << "executing Twister...";
if (execve("PROGRAM", NULL, NULL))
cerr << "ERROR!!!";
else
cerr << "done" << endl;
} // if pid
else
sleep(2); /* parent */
ALE:
executing PROGRAM... QSettings: error creating /.qt: cannot connect to X serverTakze se program size spusti, ale zarve, ze se nemuze nakonektit na X server a ukonci se. Diky moc za pomoc
int pid;
if ( (pid = fork()) < 0)
cerr << "fork error !!!!!!!!!!!!!!!" << endl;
else
if (pid == 0) { /* child */
cerr << "executing program...";
char *arg[]={"program", NULL};
if (execve("program", arg, environ))
cerr << "ERROR!!!";
else
cerr << "done" << endl;
} // if pid
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.