:맥 OS X - sem_open retuns 0 errno를, 정의되지 않은 오류
const char *semaphore_open_path = "/tmp/sem_handle_open";
errno = 0;
sem_t *semaphore_handle_open = sem_open(semaphore_open_path, O_CREAT, S_IRUSR | S_IWUSR, 0);
if(semaphore_handle_open == SEM_FAILED || !semaphore_handle_open)
{
printf("ERROR sem_open init: %s , %d\n", strerror(errno), errno);
exit(EXIT_FAILURE);
}
내가 오류를 얻을 : 내가 잘못을 ERROR sem_open init: Undefined error: 0 , 0
를하고있는 중이 야 무엇을? 감사합니다. .
sem_open을 호출하기 전에 errno = 0을 설정 했으므로 그 이유 때문에 정의되지 않은 오류가 발생합니다 : 0,하지만 호출이 성공하면 if 문에 입력되는 이유는 무엇입니까? – user7685985
나는 이것을 다음과 같이 풀어 봤다. http://stackoverflow.com/questions/28167419/mac-os-x-sem-open-fail – user7685985