Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix musl build #57

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- os: ubuntu-latest
image: debian:12

- os: ubuntu-latest
image: alpine:3

- os: ubuntu-24.04-arm

# - os: ubuntu-24.04-arm
Expand All @@ -46,6 +49,9 @@ jobs:
- os: ubuntu-24.04-arm
image: fedora:42

# - os: ubuntu-24.04-arm
# image: alpine:3

- os: macos-13
- os: macos-14
- os: macos-15
Expand All @@ -63,6 +69,11 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Dependencies (alpine)
if: ${{ startsWith(matrix.build.image, 'alpine') }}
run: |
apk --no-cache add make gcc musl-dev linux-headers

- name: Dependencies (ubuntu, debian)
if: ${{ startsWith(matrix.build.image, 'ubuntu') || startsWith(matrix.build.image, 'debian') }}
run: |
Expand Down
17 changes: 11 additions & 6 deletions ioping.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
# include <sys/syscall.h>
# define HAVE_CLOCK_GETTIME
# define HAVE_POSIX_FADVICE
# define HAVE_POSIX_FDATASYNC
# define HAVE_POSIX_MEMALIGN
# define HAVE_MKOSTEMP
# define HAVE_DIRECT_IO
Expand All @@ -74,9 +75,11 @@
# define aio_rw_flags aio_reserved1
# endif

#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 32)
# define HAVE_ERR_NAME
#endif
# ifdef __GLIBC_PREREQ
# if __GLIBC_PREREQ(2, 32)
# define HAVE_ERR_NAME
# endif
# endif

# undef RWF_NOWAIT
# include <sys/uio.h>
Expand Down Expand Up @@ -174,8 +177,10 @@
# define HAVE_MKOSTEMP /* not required */
#endif

#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
# define HAVE_POSIX_FDATASYNC
#ifndef HAVE_POSIX_FDATASYNC
# if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
# define HAVE_POSIX_FDATASYNC
# endif
#endif

#ifdef O_SYNC
Expand Down Expand Up @@ -1011,7 +1016,7 @@ int get_device_size(int fd, struct stat *st)

#if defined(BLKGETSIZE64)
/* linux */
ret = ioctl(fd, BLKGETSIZE64, &blksize);
ret = ioctl(fd, (unsigned int)BLKGETSIZE64, &blksize);
#elif defined(DIOCGMEDIASIZE)
/* freebsd */
ret = ioctl(fd, DIOCGMEDIASIZE, &blksize);
Expand Down
Loading