Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
set(BSD true)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set(SOLARIS true)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "GNU")
set(LINUX true)
else()
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/dfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ disp(struct list *lst, const char *fstfilter, const char *fsnfilter,
if (iflag) {
ifitot += (double)p->files;
ifatot += (double)p->favail;
#if defined(__linux__)
#if defined(__linux__) || defined(__GLIBC__)
sdisp->print_inodes((uint64_t)(p->files),
(uint64_t)(p->favail));
#else
Expand Down
2 changes: 1 addition & 1 deletion src/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct fsmntinfo {
double used; /* fs used size */

/* infos to get from statvfs(3) */
#if defined(__linux__)
#if defined(__linux__) || defined(__GLIBC__)
int flags; /* XXX: does not exist on Linux */
unsigned long bsize; /* file system block size */
unsigned long frsize; /* fragment size */
Expand Down
3 changes: 2 additions & 1 deletion src/platform/services-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@
*
* Linux implemention of services.
*/
#ifdef __linux__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#if defined(__linux__) || defined(__GLIBC__)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to move the check down? I'd like it to be at the very top because this file is linux/glibc specific. But I'm being picky, I'll move it back at the top after merging.

@kilobyte kilobyte Jul 31, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The__GLIBC__ define comes from one of these headers, not from gcc, so the order does matter. I'm not sure what happens on Linux libcs other than glibc, like musl or dietlibc.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll fire up a VM with Alpine Linux and see how it behaves.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it builds fine in Alpine Linux which uses musl. I'll leave it as is then.


#ifdef NLS_ENABLED
#include <locale.h>
#include <libintl.h>
Expand Down