summaryrefslogtreecommitdiff
path: root/test/misc/sem.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/misc/sem.c')
-rw-r--r--test/misc/sem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/misc/sem.c b/test/misc/sem.c
index 029386d73..62a59b1e9 100644
--- a/test/misc/sem.c
+++ b/test/misc/sem.c
@@ -1,4 +1,6 @@
#include <stdio.h>
+#include <string.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
@@ -18,7 +20,7 @@ int main(void)
printf("semget(IPC_CREAT) = %d\n", k);
if (k < 0) {
- fprintf(stderr, "semget failed: %m\n");
+ fprintf(stderr, "semget failed: %s\n", strerror(errno));
return 1;
}