Skip to content

Commit

Permalink
Fix cgroups
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Nov 24, 2020
1 parent dfa1945 commit de84734
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/coreclr/src/gc/unix/cgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Module Name:
#include <errno.h>
#include <limits>

#include "config.gc.h"

#include "cgroup.h"

#ifndef SIZE_T_MAX
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/gc/unix/config.gc.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
#cmakedefine01 HAVE_SYSINFO_WITH_MEM_UNIT
#cmakedefine01 HAVE_XSW_USAGE
#cmakedefine01 HAVE_XSWDEV

#cmakedefine01 HAVE_NON_LEGACY_STATFS

#endif // __CONFIG_H__
26 changes: 26 additions & 0 deletions src/coreclr/src/gc/unix/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,30 @@ int main(int argc, char **argv)
return 0;
}" HAVE_XSW_USAGE)

check_struct_has_member(
"struct statfs"
f_fstypename
"sys/mount.h"
HAVE_STATFS_FSTYPENAME)

check_struct_has_member(
"struct statvfs"
f_fstypename
"sys/mount.h"
HAVE_STATVFS_FSTYPENAME)

# statfs: Find whether this struct exists
if (HAVE_STATFS_FSTYPENAME OR HAVE_STATVFS_FSTYPENAME)
set (STATFS_INCLUDES sys/mount.h)
else ()
set (STATFS_INCLUDES sys/statfs.h)
endif ()

check_prototype_definition(
statfs
"int statfs(const char *path, struct statfs *buf)"
0
${STATFS_INCLUDES}
HAVE_NON_LEGACY_STATFS)

configure_file(${CMAKE_CURRENT_LIST_DIR}/config.gc.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.gc.h)

0 comments on commit de84734

Please sign in to comment.