mirror of
https://github.com/apple/swift-system
synced 2026-11-30 05:28:49 +00:00
v2: Use statfs on Linux and Android, make StatFS unavailable on WASI, omit Linux flags the kernel never reports, add descriptions for MountFlags and FileSystemID, and back-deploy CInterop.StatFS with CInterop.statfs(_:_:) for migration
This commit is contained in:
16 files changed
+958
-627
No files matched your search
@@ -21,9 +21,8 @@
|
||||
#include <unistd.h>
|
||||
#include "io_uring.h"
|
||||
|
||||
// The `ST_*` mount-flag constants in <sys/statvfs.h> require _GNU_SOURCE.
|
||||
// Rather than define _GNU_SOURCE module-wide, which clashes with SwiftGlibc,
|
||||
// expose them through these getters, defined in shims.c under _GNU_SOURCE.
|
||||
// Test-only: libc's `ST_*` values, which glibc gates on _GNU_SOURCE. Defining
|
||||
// that here would clash with SwiftGlibc, so shims.c defines it instead.
|
||||
#include <stdint.h>
|
||||
uint64_t _system_get_ST_RDONLY(void);
|
||||
uint64_t _system_get_ST_NOSUID(void);
|
||||
@@ -35,10 +34,5 @@ uint64_t _system_get_ST_NOATIME(void);
|
||||
uint64_t _system_get_ST_NODIRATIME(void);
|
||||
uint64_t _system_get_ST_RELATIME(void);
|
||||
uint64_t _system_get_ST_NOSYMFOLLOW(void);
|
||||
#if !defined(__ANDROID__)
|
||||
uint64_t _system_get_ST_WRITE(void);
|
||||
uint64_t _system_get_ST_APPEND(void);
|
||||
uint64_t _system_get_ST_IMMUTABLE(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <limits.h> // For NAME_MAX
|
||||
|
||||
// wasi-libc ships <sys/statvfs.h>, but the Swift WASILibc module does not
|
||||
// surface it. Re-export them through CSystem here.
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
// wasi-libc defines the following constants in a way that Clang Importer can't
|
||||
// understand, so we need to expose them manually.
|
||||
static inline int32_t _getConst_O_ACCMODE(void) { return O_ACCMODE; }
|
||||
|
||||
Reference in new issue
Block a user