@@ -69,7 +69,8 @@ extern char **environ;
69
69
70
70
#include < sys/types.h>
71
71
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
72
- !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX)
72
+ !defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX) && \
73
+ !defined(__managarm__)
73
74
#include < sys/statvfs.h>
74
75
#define STATVFS statvfs
75
76
#define FSTATVFS fstatvfs
@@ -78,7 +79,7 @@ extern char **environ;
78
79
#if defined(__OpenBSD__) || defined(__FreeBSD__)
79
80
#include < sys/mount.h>
80
81
#include < sys/param.h>
81
- #elif defined(__linux__)
82
+ #elif defined(__linux__) || defined(__managarm__)
82
83
#if defined(HAVE_LINUX_MAGIC_H)
83
84
#include < linux/magic.h>
84
85
#else
@@ -121,10 +122,12 @@ namespace fs {
121
122
122
123
const file_t kInvalidFile = -1 ;
123
124
124
- #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
125
- defined (__FreeBSD_kernel__) || defined(__linux__) || defined(__CYGWIN__) || \
126
- defined(__DragonFly__) || defined(_AIX) || defined(__GNU__) || \
127
- (defined(__sun__) && defined(__svr4__) || defined(__HAIKU__))
125
+ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
126
+ defined (__FreeBSD_kernel__) || defined(__linux__) || \
127
+ defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX) || \
128
+ defined(__GNU__) || \
129
+ (defined(__sun__) && defined(__svr4__) || defined(__HAIKU__)) || \
130
+ defined(__managarm__)
128
131
static int test_dir(char ret[PATH_MAX], const char *dir, const char *bin) {
129
132
struct stat sb;
130
133
char fullpath[PATH_MAX];
@@ -245,7 +248,8 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) {
245
248
// If we don't have procfs mounted, fall back to argv[0]
246
249
if (getprogpath (exe_path, argv0) != NULL )
247
250
return exe_path;
248
- #elif defined(__linux__) || defined(__CYGWIN__) || defined(__gnu_hurd__)
251
+ #elif defined(__linux__) || defined(__CYGWIN__) || defined(__gnu_hurd__) || \
252
+ defined (__managarm__)
249
253
char exe_path[PATH_MAX];
250
254
const char *aPath = " /proc/self/exe" ;
251
255
if (sys::fs::exists (aPath)) {
@@ -472,7 +476,7 @@ std::error_code remove(const Twine &path, bool IgnoreNonExisting) {
472
476
}
473
477
474
478
static bool is_local_impl (struct STATVFS &Vfs) {
475
- #if defined(__linux__) || defined(__GNU__)
479
+ #if defined(__linux__) || defined(__GNU__) || defined(__managarm__)
476
480
#ifndef NFS_SUPER_MAGIC
477
481
#define NFS_SUPER_MAGIC 0x6969
478
482
#endif
0 commit comments