1
1
/*
2
2
This source file is part of the Swift System open source project
3
3
4
- Copyright (c) 2020 Apple Inc. and the Swift System project authors
4
+ Copyright (c) 2021 - 2024 Apple Inc. and the Swift System project authors
5
5
Licensed under Apache License v2.0 with Runtime Library Exception
6
6
7
7
See https://swift.org/LICENSE.txt for license information
@@ -229,7 +229,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
229
229
@available ( * , unavailable, renamed: " badAddress " )
230
230
public static var EFAULT : Errno { badAddress }
231
231
232
- #if !os(Windows)
232
+ #if !os(Windows) && !os(WASI)
233
233
/// Not a block device.
234
234
///
235
235
/// You attempted a block device operation on a nonblock device or file.
@@ -621,6 +621,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
621
621
@available ( * , unavailable, renamed: " protocolNotSupported " )
622
622
public static var EPROTONOSUPPORT : Errno { protocolNotSupported }
623
623
624
+ #if !os(WASI)
624
625
/// Socket type not supported.
625
626
///
626
627
/// Support for the socket type hasn't been configured into the system
@@ -633,6 +634,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
633
634
@_alwaysEmitIntoClient
634
635
@available ( * , unavailable, renamed: " socketTypeNotSupported " )
635
636
public static var ESOCKTNOSUPPORT : Errno { socketTypeNotSupported }
637
+ #endif
636
638
637
639
/// Not supported.
638
640
///
@@ -647,6 +649,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
647
649
@available ( * , unavailable, renamed: " notSupported " )
648
650
public static var ENOTSUP : Errno { notSupported }
649
651
652
+ #if !os(WASI)
650
653
/// Protocol family not supported.
651
654
///
652
655
/// The protocol family hasn't been configured into the system
@@ -659,6 +662,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
659
662
@_alwaysEmitIntoClient
660
663
@available ( * , unavailable, renamed: " protocolFamilyNotSupported " )
661
664
public static var EPFNOSUPPORT : Errno { protocolFamilyNotSupported }
665
+ #endif
662
666
663
667
/// The address family isn't supported by the protocol family.
664
668
///
@@ -805,6 +809,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
805
809
@available ( * , unavailable, renamed: " socketNotConnected " )
806
810
public static var ENOTCONN : Errno { socketNotConnected }
807
811
812
+ #if !os(WASI)
808
813
/// Can't send after socket shutdown.
809
814
///
810
815
/// A request to send data wasn't permitted
@@ -818,6 +823,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
818
823
@_alwaysEmitIntoClient
819
824
@available ( * , unavailable, renamed: " socketShutdown " )
820
825
public static var ESHUTDOWN : Errno { socketShutdown }
826
+ #endif
821
827
822
828
/// Operation timed out.
823
829
///
@@ -874,6 +880,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
874
880
@available ( * , unavailable, renamed: " fileNameTooLong " )
875
881
public static var ENAMETOOLONG : Errno { fileNameTooLong }
876
882
883
+ #if !os(WASI)
877
884
/// The host is down.
878
885
///
879
886
/// A socket operation failed because the destination host was down.
@@ -885,6 +892,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
885
892
@_alwaysEmitIntoClient
886
893
@available ( * , unavailable, renamed: " hostIsDown " )
887
894
public static var EHOSTDOWN : Errno { hostIsDown }
895
+ #endif
888
896
889
897
/// No route to host.
890
898
///
@@ -923,6 +931,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
923
931
public static var EPROCLIM : Errno { tooManyProcesses }
924
932
#endif
925
933
934
+ #if !os(WASI)
926
935
/// Too many users.
927
936
///
928
937
/// The quota system ran out of table entries.
@@ -934,6 +943,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
934
943
@_alwaysEmitIntoClient
935
944
@available ( * , unavailable, renamed: " tooManyUsers " )
936
945
public static var EUSERS : Errno { tooManyUsers }
946
+ #endif
937
947
938
948
/// Disk quota exceeded.
939
949
///
@@ -1287,6 +1297,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
1287
1297
@available ( * , unavailable, renamed: " multiHop " )
1288
1298
public static var EMULTIHOP : Errno { multiHop }
1289
1299
1300
+ #if !os(WASI)
1290
1301
/// No message available.
1291
1302
///
1292
1303
/// No message was available to be received by the requested operation.
@@ -1298,6 +1309,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
1298
1309
@_alwaysEmitIntoClient
1299
1310
@available ( * , unavailable, renamed: " noData " )
1300
1311
public static var ENODATA : Errno { noData }
1312
+ #endif
1301
1313
1302
1314
/// Reserved.
1303
1315
///
@@ -1311,6 +1323,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
1311
1323
@available ( * , unavailable, renamed: " noLink " )
1312
1324
public static var ENOLINK : Errno { noLink }
1313
1325
1326
+ #if !os(WASI)
1314
1327
/// Reserved.
1315
1328
///
1316
1329
/// This error is reserved for future use.
@@ -1334,6 +1347,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
1334
1347
@_alwaysEmitIntoClient
1335
1348
@available ( * , unavailable, renamed: " notStream " )
1336
1349
public static var ENOSTR : Errno { notStream }
1350
+ #endif
1337
1351
#endif
1338
1352
1339
1353
/// Protocol error.
@@ -1350,7 +1364,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
1350
1364
@available ( * , unavailable, renamed: " protocolError " )
1351
1365
public static var EPROTO : Errno { protocolError }
1352
1366
1353
- #if !os(OpenBSD)
1367
+ #if !os(OpenBSD) && !os(WASI)
1354
1368
/// Reserved.
1355
1369
///
1356
1370
/// This error is reserved for future use.
@@ -1382,7 +1396,6 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
1382
1396
// Constants defined in header but not man page
1383
1397
@available ( /*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8 , * )
1384
1398
extension Errno {
1385
-
1386
1399
/// Operation would block.
1387
1400
///
1388
1401
/// The corresponding C error is `EWOULDBLOCK`.
@@ -1393,6 +1406,7 @@ extension Errno {
1393
1406
@available ( * , unavailable, renamed: " wouldBlock " )
1394
1407
public static var EWOULDBLOCK : Errno { wouldBlock }
1395
1408
1409
+ #if !os(WASI)
1396
1410
/// Too many references: can't splice.
1397
1411
///
1398
1412
/// The corresponding C error is `ETOOMANYREFS`.
@@ -1412,6 +1426,7 @@ extension Errno {
1412
1426
@_alwaysEmitIntoClient
1413
1427
@available ( * , unavailable, renamed: " tooManyRemoteLevels " )
1414
1428
public static var EREMOTE : Errno { tooManyRemoteLevels }
1429
+ #endif
1415
1430
1416
1431
#if SYSTEM_PACKAGE_DARWIN
1417
1432
/// No such policy registered.
0 commit comments