Skip to content

Commit 8d8315d

Browse files
MichaelRabekigaw
authored andcommitted
build: fix musl build
Signed-off-by: Michal Rábek <[email protected]>
1 parent 0210381 commit 8d8315d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

libnvme/src/nvme/linux.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#include <string.h>
1313
#include <errno.h>
1414

15+
#ifndef _GNU_SOURCE
16+
#include <libgen.h>
17+
#endif
18+
1519
#include <sys/param.h>
1620
#include <sys/stat.h>
1721
#include <fcntl.h>

libnvme/test/ioctl/mock.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,12 @@ int ioctl(int fd, int request, ...)
157157
real_ioctl = dlsym(RTLD_NEXT, "ioctl");
158158
if (!real_ioctl)
159159
fail("Error: dlsym failed to find original ioctl\n");
160-
#else
160+
#elif defined(HAVE_GLIBC_IOCTL) && HAVE_GLIBC_IOCTL == 1
161161
fprintf(stderr, "Warning: unhandled ioctl %lx\n", request);
162162
return -ENOTTY;
163+
#else
164+
fprintf(stderr, "Warning: unhandled ioctl %x\n", request);
165+
return -ENOTTY;
163166
#endif
164167
}
165168

0 commit comments

Comments
 (0)