0
我需要在execlp calls()
中使用多个显示器。我想这样的:将指示路径前的显示设置为(execlp)
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("calling to execlp:\n\n");
execlp("DISPLAY=:0 /usr/bin/qtdisplay","qtdisplay", "-r", NULL);
execlp("DISPLAY=:1 /usr/bin/qtdisplay","qtdisplay", "-r", NULL);
printf("fail!");
exit(0);
}
但这种失败,并显示以下消息:execlp: No such file or directory
有什么办法与显示器的工作?
你可以做两个'execlp ()总是像这样,如果第一个成功,你的原始程序将会消失。你可以使用'setenv()'来设置环境变量。 – 2014-10-07 02:15:39