mirror of
https://github.com/apple/swift-system
synced 2026-11-27 05:04:27 +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
@@ -0,0 +1,19 @@
|
||||
#[[
|
||||
This source file is part of the Swift System open source project
|
||||
|
||||
Copyright (c) 2026 Apple Inc. and the Swift System project authors
|
||||
Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
|
||||
See https://swift.org/LICENSE.txt for license information
|
||||
#]]
|
||||
|
||||
add_library(CSystemStatFS INTERFACE)
|
||||
target_include_directories(CSystemStatFS INTERFACE
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
$<INSTALL_INTERFACE:include/CSystemStatFS>)
|
||||
|
||||
install(FILES
|
||||
CSystemStatFS.h
|
||||
module.modulemap
|
||||
DESTINATION include/CSystemStatFS)
|
||||
set_property(GLOBAL APPEND PROPERTY SWIFT_SYSTEM_EXPORTS CSystemStatFS)
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
This source file is part of the Swift System open source project
|
||||
|
||||
Copyright (c) 2026 Apple Inc. and the Swift System project authors
|
||||
Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
|
||||
See https://swift.org/LICENSE.txt for license information
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Unlike the Musl and Android modules, Glibc doesn't export <sys/vfs.h>,
|
||||
// which declares `struct statfs` and `statfs()`/`fstatfs()`. SystemPackage
|
||||
// re-exports this module on glibc platforms so that clients can use the
|
||||
// raw `CInterop.StatFS` value under MemberImportVisibility.
|
||||
#if defined(__linux__) && !defined(__ANDROID__)
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
@@ -0,0 +1,4 @@
|
||||
module CSystemStatFS [system] {
|
||||
header "CSystemStatFS.h"
|
||||
export *
|
||||
}
|
||||
Reference in new issue
Block a user