Skip to content

Commit

Permalink
Merge pull request #57 from koct9i/workflows
Browse files Browse the repository at this point in the history
Fix musl build
  • Loading branch information
koct9i authored Jan 18, 2025
2 parents ee5d311 + 3f06548 commit fcc62bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
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

0 comments on commit fcc62bd

Please sign in to comment.