Skip to content

Make sigar build with musl libc #75

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ int main()

ENDMACRO (CHECK_STRUCT_MEMBER)

FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(TIRPC libtirpc)
INCLUDE_DIRECTORIES(${TIRPC_INCLUDE_DIRS})


## linux
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
Expand Down Expand Up @@ -104,6 +108,7 @@ ENDIF(WIN32)
IF(SIGAR_LINK_FLAGS)
SET_TARGET_PROPERTIES(sigar PROPERTIES LINK_FLAGS "${SIGAR_LINK_FLAGS}")
ENDIF(SIGAR_LINK_FLAGS)
TARGET_LINK_LIBRARIES(sigar ${TIRPC_LIBRARIES})

INSTALL(TARGETS sigar
RUNTIME DESTINATION bin
Expand Down
4 changes: 4 additions & 0 deletions src/os/linux/linux_sigar.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#define PROC_PARTITIONS PROC_FS_ROOT "partitions"
#define PROC_DISKSTATS PROC_FS_ROOT "diskstats"

#ifndef HZ
#define HZ 100
#endif

/*
* /proc/self/stat fields:
* 1 - pid
Expand Down
2 changes: 1 addition & 1 deletion src/os/linux/sigar_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct sigar_t {
};

#define HAVE_STRERROR_R
#ifndef __USE_XOPEN2K
#if !defined(__USE_XOPEN2K) && defined(__GLIBC__)
/* use gnu version of strerror_r */
#define HAVE_STRERROR_R_GLIBC
#endif
Expand Down