@@ -74,7 +74,8 @@ extern char **environ;
74
74
75
75
#include < sys/types.h>
76
76
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
77
- !defined (__linux__) && !defined (__FreeBSD_kernel__) && !defined (_AIX)
77
+ !defined (__linux__) && !defined (__FreeBSD_kernel__) && !defined (_AIX) && \
78
+ !defined (__managarm__)
78
79
#include < sys/statvfs.h>
79
80
#define STATVFS statvfs
80
81
#define FSTATVFS fstatvfs
@@ -83,7 +84,7 @@ extern char **environ;
83
84
#if defined(__OpenBSD__) || defined(__FreeBSD__)
84
85
#include < sys/mount.h>
85
86
#include < sys/param.h>
86
- #elif defined(__linux__)
87
+ #elif defined(__linux__) || defined(__managarm__)
87
88
#if defined(HAVE_LINUX_MAGIC_H)
88
89
#include < linux/magic.h>
89
90
#else
@@ -129,7 +130,8 @@ const file_t kInvalidFile = -1;
129
130
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
130
131
defined (__FreeBSD_kernel__) || defined(__linux__) || defined(__CYGWIN__) || \
131
132
defined(__DragonFly__) || defined(_AIX) || defined(__GNU__) || \
132
- (defined (__sun__) && defined(__svr4__) || defined(__HAIKU__))
133
+ (defined (__sun__) && defined(__svr4__) || defined(__HAIKU__)) || \
134
+ defined(__managarm__)
133
135
static int test_dir(char ret[PATH_MAX], const char *dir, const char *bin) {
134
136
struct stat sb;
135
137
char fullpath[PATH_MAX];
@@ -250,7 +252,8 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) {
250
252
// If we don't have procfs mounted, fall back to argv[0]
251
253
if (getprogpath (exe_path, argv0) != NULL )
252
254
return exe_path;
253
- #elif defined(__linux__) || defined(__CYGWIN__) || defined(__gnu_hurd__)
255
+ #elif defined(__linux__) || defined(__CYGWIN__) || defined(__gnu_hurd__) || \
256
+ defined (__managarm__)
254
257
char exe_path[PATH_MAX];
255
258
const char *aPath = " /proc/self/exe" ;
256
259
if (sys::fs::exists (aPath)) {
@@ -477,7 +480,7 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) {
477
480
}
478
481
479
482
static bool is_local_impl (struct STATVFS &Vfs) {
480
- #if defined(__linux__) || defined(__GNU__)
483
+ #if defined(__linux__) || defined(__GNU__) || defined(__managarm__)
481
484
#ifndef NFS_SUPER_MAGIC
482
485
#define NFS_SUPER_MAGIC 0x6969
483
486
#endif
0 commit comments