오류 메시지의 텍스트를 스트림에서 변수로 가져 오는 방법은 무엇입니까? 예를오류 메시지 받기
void * thread_func(void) {
char args[]={"firefox","ax",NULL};
pid_t child_pid = fork();
if(child_pid!=0) {
cout<<"error";
} else {
execvp("firefox",args); /*something should be done here to get the message*/
}
return 0;
}
어떤 오류입니까? 무슨 메시지 야? 어떤 물줄기? 어떤 변수? – ereOn
당신이 원했던 것을 보여줘야한다는 코드를 게시하십시오. – Mat
예 : void * thread_func (void) { char args [] = { "firefox", "ax", NULL}; pid_t child_pid = fork(); if (child_pid! = 0) { cout << "error"; } else { execvp ("firefox", args); /* 메시지를 얻으려면 여기에서해야합니다 */ } return 0; } – Hayk