我使用MinGW的:使用MinGW POSIX問題(sem_timedwait)
GNU讓4.1
專爲x86_64的-W64-mingw32的
我注意到,sem_timedwait不功能(它返回-1)。 我對sem_wait或sem_signal沒有任何問題。
代碼例如:
struct timespec timeSpec;
int rc = 0;
timeSpec.tv_sec = 1000;
timeSpec.tv_nsec = 0;
rc = sem_timedwait(pSemId,&timeSpec);
CC = x86_64的-W64-的mingw32-GCC
什麼是'errno'設置? – Dummy00001
printf(「%s」,strerror(errno)) - >「未知錯誤」 「未知錯誤」是errno的結果 – Sharon
errno的實際數值會更有幫助,因爲strerror )'不保證每一個可能的描述。有些描述完全是令人困惑的。用'errno'武裝你可以檢查Mingw標題來查看代碼對應的錯誤。這應該有助於縮小您對問題的搜索範圍。 – Dummy00001