mirror of
https://github.com/apple/swift-system
synced 2026-11-22 04:30:46 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
666fba77fc | ||
|
|
360e6f70f0 |
No files matched your search
@@ -16,6 +16,7 @@ install(FILES
|
||||
include/CSystemLinux.h
|
||||
include/CSystemShared.h
|
||||
include/CSystemWindows.h
|
||||
include/CSystemFreeBSD.h
|
||||
include/module.modulemap
|
||||
DESTINATION include/CSystem)
|
||||
set_property(GLOBAL APPEND PROPERTY SWIFT_SYSTEM_EXPORTS CSystem)
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef O_CLOFORK
|
||||
#define FREEBSD_O_CLOFORK O_CLOFORK
|
||||
#else
|
||||
#define FREEBSD_O_CLOFORK 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,5 +3,6 @@ module CSystem {
|
||||
header "CSystemLinux.h"
|
||||
header "CSystemWASI.h"
|
||||
header "CSystemWindows.h"
|
||||
header "CSystemFreeBSD.h"
|
||||
export *
|
||||
}
|
||||
@@ -12,6 +12,10 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#include <CSystemFreeBSD.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#define _GNU_SOURCE
|
||||
#include <CSystemLinux.h>
|
||||
|
||||
@@ -631,8 +631,10 @@ internal var _O_CLOEXEC: CInt {
|
||||
#if !os(Windows)
|
||||
@_alwaysEmitIntoClient
|
||||
internal var _O_CLOFORK: CInt {
|
||||
#if !os(WASI) && !os(Linux) && !os(Android) && !canImport(Darwin)
|
||||
#if !os(WASI) && !os(Linux) && !os(Android) && !canImport(Darwin) && !os(FreeBSD)
|
||||
O_CLOFORK
|
||||
#elseif os(FreeBSD)
|
||||
FREEBSD_O_CLOFORK
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user