-
Notifications
You must be signed in to change notification settings - Fork 149
Expand file tree
/
Copy pathMountFlags.swift
More file actions
522 lines (453 loc) · 25.6 KB
/
Copy pathMountFlags.swift
File metadata and controls
522 lines (453 loc) · 25.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
// |-------------------------------------------------------------------------------------------------------------------------------------------|
// | Swift API to C Mapping |
// |-------------------------------------------------------------------------------------------------------------------------------------------|
// | MountFlags | Darwin | FreeBSD | OpenBSD | Linux | Android | WASI |
// |-----------------------------|----------------------|-----------------|-----------------|----------------|----------------|----------------|
// | readOnly | MNT_RDONLY | MNT_RDONLY | MNT_RDONLY | ST_RDONLY | ST_RDONLY | ST_RDONLY |
// | synchronous | MNT_SYNCHRONOUS | MNT_SYNCHRONOUS | MNT_SYNCHRONOUS | ST_SYNCHRONOUS | ST_SYNCHRONOUS | ST_SYNCHRONOUS |
// | noExecution | MNT_NOEXEC | MNT_NOEXEC | MNT_NOEXEC | ST_NOEXEC | ST_NOEXEC | ST_NOEXEC |
// | noSetUserID | MNT_NOSUID | MNT_NOSUID | MNT_NOSUID | ST_NOSUID | ST_NOSUID | ST_NOSUID |
// | noAccessTime | MNT_NOATIME | MNT_NOATIME | MNT_NOATIME | ST_NOATIME | ST_NOATIME | ST_NOATIME |
// | noDevices | MNT_NODEV | N/A | MNT_NODEV | ST_NODEV | ST_NODEV | ST_NODEV |
// | mandatoryLockingPermitted | N/A | N/A | N/A | ST_MANDLOCK | ST_MANDLOCK | ST_MANDLOCK |
// | noDirectoryAccessTime | N/A | N/A | N/A | ST_NODIRATIME | ST_NODIRATIME | ST_NODIRATIME |
// | relativeAccessTime | N/A | N/A | N/A | ST_RELATIME | ST_RELATIME | ST_RELATIME |
// | write | N/A | N/A | N/A | ST_WRITE | N/A | ST_WRITE |
// | appendOnly | N/A | N/A | N/A | ST_APPEND | N/A | ST_APPEND |
// | immutable | N/A | N/A | N/A | ST_IMMUTABLE | N/A | ST_IMMUTABLE |
// | noSymlinkFollow | N/A | MNT_NOSYMFOLLOW | N/A | ST_NOSYMFOLLOW | ST_NOSYMFOLLOW | N/A |
// | asynchronous | MNT_ASYNC | MNT_ASYNC | MNT_ASYNC | N/A | N/A | N/A |
// | exported | MNT_EXPORTED | MNT_EXPORTED | MNT_EXPORTED | N/A | N/A | N/A |
// | local | MNT_LOCAL | MNT_LOCAL | MNT_LOCAL | N/A | N/A | N/A |
// | quota | MNT_QUOTA | MNT_QUOTA | MNT_QUOTA | N/A | N/A | N/A |
// | rootFileSystem | MNT_ROOTFS | MNT_ROOTFS | MNT_ROOTFS | N/A | N/A | N/A |
// | union | MNT_UNION | MNT_UNION | N/A | N/A | N/A | N/A |
// | automounted | MNT_AUTOMOUNTED | MNT_AUTOMOUNTED | N/A | N/A | N/A | N/A |
// | multiLabel | MNT_MULTILABEL | MNT_MULTILABEL | N/A | N/A | N/A | N/A |
// | exportedReadOnly | N/A | MNT_EXRDONLY | MNT_EXRDONLY | N/A | N/A | N/A |
// | exportedByDefault | N/A | MNT_DEFEXPORTED | MNT_DEFEXPORTED | N/A | N/A | N/A |
// | exportedAnonymously | N/A | MNT_EXPORTANON | MNT_EXPORTANON | N/A | N/A | N/A |
// | softUpdates | N/A | MNT_SOFTDEP | MNT_SOFTDEP | N/A | N/A | N/A |
// | contentProtection | MNT_CPROTECT | N/A | N/A | N/A | N/A | N/A |
// | removable | MNT_REMOVABLE | N/A | N/A | N/A | N/A | N/A |
// | quarantine | MNT_QUARANTINE | N/A | N/A | N/A | N/A | N/A |
// | volumeFileSystem | MNT_DOVOLFS | N/A | N/A | N/A | N/A | N/A |
// | noBrowsing | MNT_DONTBROWSE | N/A | N/A | N/A | N/A | N/A |
// | ignoreOwnership | MNT_IGNORE_OWNERSHIP | N/A | N/A | N/A | N/A | N/A |
// | journaled | MNT_JOURNALED | N/A | N/A | N/A | N/A | N/A |
// | noUserExtendedAttributes | MNT_NOUSERXATTR | N/A | N/A | N/A | N/A | N/A |
// | deferWrites | MNT_DEFWRITE | N/A | N/A | N/A | N/A | N/A |
// | noSymlinkFollowAtMountPoint | MNT_NOFOLLOW | N/A | N/A | N/A | N/A | N/A |
// | snapshot | MNT_SNAPSHOT | N/A | N/A | N/A | N/A | N/A |
// | strictAccessTime | MNT_STRICTATIME | N/A | N/A | N/A | N/A | N/A |
// | exportedKerberos | N/A | MNT_EXKERB | N/A | N/A | N/A | N/A |
// | exportedPublic | N/A | MNT_EXPUBLIC | N/A | N/A | N/A | N/A |
// | posixACLs | N/A | MNT_ACLS | N/A | N/A | N/A | N/A |
// | geomJournaled | N/A | MNT_GJOURNAL | N/A | N/A | N/A | N/A |
// | excludedFromDiskFreeReports | N/A | MNT_IGNORE | N/A | N/A | N/A | N/A |
// | nfs4ACLs | N/A | MNT_NFS4ACLS | N/A | N/A | N/A | N/A |
// | noClusterRead | N/A | MNT_NOCLUSTERR | N/A | N/A | N/A | N/A |
// | noClusterWrite | N/A | MNT_NOCLUSTERW | N/A | N/A | N/A | N/A |
// | setUserIDDirectory | N/A | MNT_SUIDDIR | N/A | N/A | N/A | N/A |
// | softUpdateJournaling | N/A | MNT_SUJ | N/A | N/A | N/A | N/A |
// | untrusted | N/A | MNT_UNTRUSTED | N/A | N/A | N/A | N/A |
// | mountedByUser | N/A | MNT_USER | N/A | N/A | N/A | N/A |
// | verified | N/A | MNT_VERIFIED | N/A | N/A | N/A | N/A |
// | noPermissionChecks | N/A | N/A | MNT_NOPERM | N/A | N/A | N/A |
// | writeExecuteAllowed | N/A | N/A | MNT_WXALLOWED | N/A | N/A | N/A |
// |-------------------------------------------------------------------------------------------------------------------------------------------|
#if !os(Windows)
/// Options employed when mounting a file system.
///
/// These are the flags reported in the `f_flags` field of a `statfs` struct on
/// Darwin and BSD, or the `f_flag` field of a `statvfs` struct on other
/// platforms.
///
/// - Note: Only available on Unix-like platforms.
@frozen
@available(System 199, *)
public struct MountFlags: OptionSet, Sendable, Hashable, Codable {
/// The raw C flags.
@_alwaysEmitIntoClient
public let rawValue: CInterop.MountFlags
/// Creates a strongly-typed `MountFlags` from the raw C value.
@_alwaysEmitIntoClient
public init(rawValue: CInterop.MountFlags) { self.rawValue = rawValue }
// MARK: Flags Available on All Platforms
/// The file system is mounted read-only, even for the super-user.
///
/// The corresponding C constant is `MNT_RDONLY` on Darwin and BSD,
/// or `ST_RDONLY` otherwise.
@_alwaysEmitIntoClient
public static var readOnly: MountFlags { MountFlags(rawValue: _MOUNT_RDONLY) }
/// The file system is written to synchronously.
///
/// The corresponding C constant is `MNT_SYNCHRONOUS` on Darwin and BSD,
/// or `ST_SYNCHRONOUS` otherwise.
@_alwaysEmitIntoClient
public static var synchronous: MountFlags { MountFlags(rawValue: _MOUNT_SYNCHRONOUS) }
/// Programs may not be executed from the file system.
///
/// The corresponding C constant is `MNT_NOEXEC` on Darwin and BSD,
/// or `ST_NOEXEC` otherwise.
@_alwaysEmitIntoClient
public static var noExecution: MountFlags { MountFlags(rawValue: _MOUNT_NOEXEC) }
/// Set-user-ID and set-group-ID bits are not honored on the file system.
///
/// The corresponding C constant is `MNT_NOSUID` on Darwin and BSD,
/// or `ST_NOSUID` otherwise.
@_alwaysEmitIntoClient
public static var noSetUserID: MountFlags { MountFlags(rawValue: _MOUNT_NOSUID) }
/// Access times are not updated on the file system.
///
/// The corresponding C constant is `MNT_NOATIME` on Darwin and BSD,
/// or `ST_NOATIME` otherwise.
/// - Note: On OpenBSD, access time may still be updated when the
/// modification or status-change time is also being updated.
@_alwaysEmitIntoClient
public static var noAccessTime: MountFlags { MountFlags(rawValue: _MOUNT_NOATIME) }
// MARK: Flags Available on All Platforms Except FreeBSD
#if !os(FreeBSD)
/// Special files may not be interpreted on the file system.
///
/// The corresponding C constant is `MNT_NODEV` on Darwin and OpenBSD,
/// or `ST_NODEV` otherwise.
/// - Note: Not available on FreeBSD.
@_alwaysEmitIntoClient
public static var noDevices: MountFlags { MountFlags(rawValue: _MOUNT_NODEV) }
#endif
// MARK: Flags Available on Linux, WASI, and Android
#if os(Linux) || os(WASI) || os(Android)
/// The file system permits mandatory file locking.
///
/// The corresponding C constant is `ST_MANDLOCK`.
/// - Note: Only available on Linux, WASI, and Android.
/// - Note: Mandatory locking was deprecated and removed in Linux 5.15.
@_alwaysEmitIntoClient
public static var mandatoryLockingPermitted: MountFlags { MountFlags(rawValue: _ST_MANDLOCK) }
/// Directory access times are not updated on the file system.
///
/// The corresponding C constant is `ST_NODIRATIME`.
/// - Note: Only available on Linux, WASI, and Android.
@_alwaysEmitIntoClient
public static var noDirectoryAccessTime: MountFlags { MountFlags(rawValue: _ST_NODIRATIME) }
/// The access time is only updated if it's earlier than or equal to the file's
/// last modification or status-change time, or if it's more than a day old.
///
/// The corresponding C constant is `ST_RELATIME`.
/// - Note: Only available on Linux, WASI, and Android.
@_alwaysEmitIntoClient
public static var relativeAccessTime: MountFlags { MountFlags(rawValue: _ST_RELATIME) }
#endif
// MARK: Flags Available on Linux and WASI Only
#if os(Linux) || os(WASI)
/// Files, directories, and symbolic links on the file system are writable.
///
/// The corresponding C constant is `ST_WRITE`.
/// - Note: Only available on Linux and WASI.
@_alwaysEmitIntoClient
public static var write: MountFlags { MountFlags(rawValue: _ST_WRITE) }
/// Files on the file system are append-only.
///
/// The corresponding C constant is `ST_APPEND`.
/// - Note: Only available on Linux and WASI.
@_alwaysEmitIntoClient
public static var appendOnly: MountFlags { MountFlags(rawValue: _ST_APPEND) }
/// Files on the file system are immutable.
///
/// The corresponding C constant is `ST_IMMUTABLE`.
/// - Note: Only available on Linux and WASI.
@_alwaysEmitIntoClient
public static var immutable: MountFlags { MountFlags(rawValue: _ST_IMMUTABLE) }
#endif
// MARK: Flags Available on Linux, Android, and FreeBSD
#if os(Linux) || os(Android) || os(FreeBSD)
/// Symbolic links are not followed when resolving paths on the file system.
///
/// Unlike Darwin's `noSymlinkFollowAtMountPoint`, this suppresses symlink
/// following for all path resolution on the mount, not just when resolving
/// the mount point.
///
/// The corresponding C constant is `MNT_NOSYMFOLLOW` on FreeBSD,
/// or `ST_NOSYMFOLLOW` on Linux and Android.
/// - Note: Only available on Linux, Android, and FreeBSD.
@_alwaysEmitIntoClient
public static var noSymlinkFollow: MountFlags { MountFlags(rawValue: _MOUNT_NOSYMFOLLOW) }
#endif
// MARK: Flags Available on Darwin, FreeBSD, and OpenBSD
#if SYSTEM_PACKAGE_DARWIN || os(FreeBSD) || os(OpenBSD)
/// The file system is written to asynchronously.
///
/// The corresponding C constant is `MNT_ASYNC`.
/// - Note: Only available on Darwin and BSD.
@_alwaysEmitIntoClient
public static var asynchronous: MountFlags { MountFlags(rawValue: _MNT_ASYNC) }
/// The file system is exported for use over the network via NFS.
///
/// The corresponding C constant is `MNT_EXPORTED`.
/// - Note: Only available on Darwin and BSD.
@_alwaysEmitIntoClient
public static var exported: MountFlags { MountFlags(rawValue: _MNT_EXPORTED) }
/// The file system is stored locally, rather than being accessed over a network.
///
/// The corresponding C constant is `MNT_LOCAL`.
/// - Note: Only available on Darwin and BSD.
@_alwaysEmitIntoClient
public static var local: MountFlags { MountFlags(rawValue: _MNT_LOCAL) }
/// Quotas are enabled on the file system.
///
/// The corresponding C constant is `MNT_QUOTA`.
/// - Note: Only available on Darwin and BSD.
@_alwaysEmitIntoClient
public static var quota: MountFlags { MountFlags(rawValue: _MNT_QUOTA) }
/// The file system is the root file system.
///
/// The corresponding C constant is `MNT_ROOTFS`.
/// - Note: Only available on Darwin and BSD.
@_alwaysEmitIntoClient
public static var rootFileSystem: MountFlags { MountFlags(rawValue: _MNT_ROOTFS) }
#endif
// MARK: Flags Available on Darwin and FreeBSD
#if SYSTEM_PACKAGE_DARWIN || os(FreeBSD)
/// The file system is unioned with the underlying file system, rather than
/// obscuring it.
///
/// The corresponding C constant is `MNT_UNION`.
/// - Note: Only available on Darwin and FreeBSD.
@_alwaysEmitIntoClient
public static var union: MountFlags { MountFlags(rawValue: _MNT_UNION) }
/// The file system was mounted by the automounter.
///
/// The corresponding C constant is `MNT_AUTOMOUNTED`.
/// - Note: Only available on Darwin and FreeBSD. See `autofs(4)`.
@_alwaysEmitIntoClient
public static var automounted: MountFlags { MountFlags(rawValue: _MNT_AUTOMOUNTED) }
/// The file system supports Mandatory Access Control (MAC) labels for
/// individual objects.
///
/// The corresponding C constant is `MNT_MULTILABEL`.
/// - Note: Only available on Darwin and FreeBSD.
@_alwaysEmitIntoClient
public static var multiLabel: MountFlags { MountFlags(rawValue: _MNT_MULTILABEL) }
#endif
// MARK: Flags Available on FreeBSD and OpenBSD
#if os(FreeBSD) || os(OpenBSD)
/// The file system is exported for reading only.
///
/// The corresponding C constant is `MNT_EXRDONLY`.
/// - Note: Only available on FreeBSD and OpenBSD.
@_alwaysEmitIntoClient
public static var exportedReadOnly: MountFlags { MountFlags(rawValue: _MNT_EXRDONLY) }
/// The file system is exported for reading and writing to any host by default.
///
/// The corresponding C constant is `MNT_DEFEXPORTED`.
/// - Note: Only available on FreeBSD and OpenBSD.
@_alwaysEmitIntoClient
public static var exportedByDefault: MountFlags { MountFlags(rawValue: _MNT_DEFEXPORTED) }
/// The file system maps all remote users to the anonymous user account.
///
/// The corresponding C constant is `MNT_EXPORTANON`.
/// - Note: Only available on FreeBSD and OpenBSD.
@_alwaysEmitIntoClient
public static var exportedAnonymously: MountFlags { MountFlags(rawValue: _MNT_EXPORTANON) }
/// The file system uses soft updates.
///
/// The corresponding C constant is `MNT_SOFTDEP`.
/// - Note: Only available on FreeBSD and OpenBSD. Accepted for compatibility
/// on OpenBSD, but has no effect there.
@_alwaysEmitIntoClient
public static var softUpdates: MountFlags { MountFlags(rawValue: _MNT_SOFTDEP) }
#endif
// MARK: Flags Available on Darwin Only
#if SYSTEM_PACKAGE_DARWIN
/// The file system supports per-file encrypted data protection.
///
/// The corresponding C constant is `MNT_CPROTECT`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var contentProtection: MountFlags { MountFlags(rawValue: _MNT_CPROTECT) }
/// The file system resides on removable media.
///
/// The corresponding C constant is `MNT_REMOVABLE`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var removable: MountFlags { MountFlags(rawValue: _MNT_REMOVABLE) }
/// The file system is quarantined.
///
/// The corresponding C constant is `MNT_QUARANTINE`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var quarantine: MountFlags { MountFlags(rawValue: _MNT_QUARANTINE) }
/// The file system supports volfs.
///
/// The corresponding C constant is `MNT_DOVOLFS`.
/// - Note: Only available on Darwin. Deprecated since Mac OS X 10.5 and
/// not set on modern systems.
@_alwaysEmitIntoClient
public static var volumeFileSystem: MountFlags { MountFlags(rawValue: _MNT_DOVOLFS) }
/// The file system should not be presented to the user for browsing
/// (e.g. hidden in Finder).
///
/// The corresponding C constant is `MNT_DONTBROWSE`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var noBrowsing: MountFlags { MountFlags(rawValue: _MNT_DONTBROWSE) }
/// Ownership information on the file system is ignored.
///
/// The corresponding C constant is `MNT_IGNORE_OWNERSHIP`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var ignoreOwnership: MountFlags { MountFlags(rawValue: _MNT_IGNORE_OWNERSHIP) }
/// The file system is journaled.
///
/// The corresponding C constant is `MNT_JOURNALED`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var journaled: MountFlags { MountFlags(rawValue: _MNT_JOURNALED) }
/// User extended attributes are not allowed on the file system.
///
/// The corresponding C constant is `MNT_NOUSERXATTR`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var noUserExtendedAttributes: MountFlags { MountFlags(rawValue: _MNT_NOUSERXATTR) }
/// The file system defers writes.
///
/// The corresponding C constant is `MNT_DEFWRITE`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var deferWrites: MountFlags { MountFlags(rawValue: _MNT_DEFWRITE) }
/// Symbolic links are not followed when resolving the mount point.
///
/// The corresponding C constant is `MNT_NOFOLLOW`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var noSymlinkFollowAtMountPoint: MountFlags { MountFlags(rawValue: _MNT_NOFOLLOW) }
/// The mount is a snapshot.
///
/// The corresponding C constant is `MNT_SNAPSHOT`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var snapshot: MountFlags { MountFlags(rawValue: _MNT_SNAPSHOT) }
/// Access times are always updated on access. Relatime-style optimizations
/// are disabled.
///
/// The corresponding C constant is `MNT_STRICTATIME`.
/// - Note: Only available on Darwin.
@_alwaysEmitIntoClient
public static var strictAccessTime: MountFlags { MountFlags(rawValue: _MNT_STRICTATIME) }
#endif
// MARK: Flags Available on FreeBSD Only
#if os(FreeBSD)
/// The file system is exported with Kerberos user-ID mapping.
///
/// The corresponding C constant is `MNT_EXKERB`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var exportedKerberos: MountFlags { MountFlags(rawValue: _MNT_EXKERB) }
/// The file system is exported publicly for WebNFS clients.
///
/// The corresponding C constant is `MNT_EXPUBLIC`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var exportedPublic: MountFlags { MountFlags(rawValue: _MNT_EXPUBLIC) }
/// The file system supports POSIX.1e ACLs.
///
/// The corresponding C constant is `MNT_ACLS`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var posixACLs: MountFlags { MountFlags(rawValue: _MNT_ACLS) }
/// The file system uses `gjournal`.
///
/// The corresponding C constant is `MNT_GJOURNAL`.
/// - Note: Only available on FreeBSD. See `gjournal(8)`.
@_alwaysEmitIntoClient
public static var geomJournaled: MountFlags { MountFlags(rawValue: _MNT_GJOURNAL) }
/// The file system is omitted from `df(1)` listings.
///
/// The corresponding C constant is `MNT_IGNORE`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var excludedFromDiskFreeReports: MountFlags { MountFlags(rawValue: _MNT_IGNORE) }
/// The file system supports NFSv4 ACLs.
///
/// The corresponding C constant is `MNT_NFS4ACLS`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var nfs4ACLs: MountFlags { MountFlags(rawValue: _MNT_NFS4ACLS) }
/// Clustered reads are disabled on the file system.
///
/// The corresponding C constant is `MNT_NOCLUSTERR`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var noClusterRead: MountFlags { MountFlags(rawValue: _MNT_NOCLUSTERR) }
/// Clustered writes are disabled on the file system.
///
/// The corresponding C constant is `MNT_NOCLUSTERW`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var noClusterWrite: MountFlags { MountFlags(rawValue: _MNT_NOCLUSTERW) }
/// Newly created files in a directory with the set-user-ID bit set are owned
/// by that directory's owner, rather than by the creating user.
///
/// The corresponding C constant is `MNT_SUIDDIR`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var setUserIDDirectory: MountFlags { MountFlags(rawValue: _MNT_SUIDDIR) }
/// The file system uses soft updates with journaling.
///
/// The corresponding C constant is `MNT_SUJ`.
/// - Note: Only available on FreeBSD. Combines `softUpdates` with a journal
/// for fast recovery.
@_alwaysEmitIntoClient
public static var softUpdateJournaling: MountFlags { MountFlags(rawValue: _MNT_SUJ) }
/// The file system is untrusted, as the integrity of its media is unknown.
///
/// The corresponding C constant is `MNT_UNTRUSTED`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var untrusted: MountFlags { MountFlags(rawValue: _MNT_UNTRUSTED) }
/// The file system was mounted by a non-root user.
///
/// The corresponding C constant is `MNT_USER`.
/// - Note: Only available on FreeBSD.
@_alwaysEmitIntoClient
public static var mountedByUser: MountFlags { MountFlags(rawValue: _MNT_USER) }
/// The file system is marked as verified, so per-file integrity checks are
/// skipped on execution.
///
/// The corresponding C constant is `MNT_VERIFIED`.
/// - Note: Only available on FreeBSD. See `mac_veriexec(4)`.
@_alwaysEmitIntoClient
public static var verified: MountFlags { MountFlags(rawValue: _MNT_VERIFIED) }
#endif
// MARK: Flags Available on OpenBSD Only
#if os(OpenBSD)
/// File permissions are not checked on the file system (FFS only).
///
/// The corresponding C constant is `MNT_NOPERM`.
/// - Note: Only available on OpenBSD.
@_alwaysEmitIntoClient
public static var noPermissionChecks: MountFlags { MountFlags(rawValue: _MNT_NOPERM) }
/// Programs residing on the file system may create memory mappings that are
/// both writable and executable.
///
/// By default, requesting such a mapping (via `mmap(2)` or `mprotect(2)`)
/// kills the process. This flag lifts that restriction.
///
/// The corresponding C constant is `MNT_WXALLOWED`.
/// - Note: Only available on OpenBSD.
@_alwaysEmitIntoClient
public static var writeExecuteAllowed: MountFlags { MountFlags(rawValue: _MNT_WXALLOWED) }
#endif
}
#endif // !os(Windows)