Skip to content

Commit a5e062f

Browse files
committed
Rename CNIOBSD to CNIOOpenBSD.
1 parent 25343db commit a5e062f

22 files changed

+89
-89
lines changed

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let package = Package(
5959
dependencies: [
6060
"NIOConcurrencyHelpers",
6161
"_NIOBase64",
62-
"CNIOBSD",
62+
"CNIOOpenBSD",
6363
"CNIODarwin",
6464
"CNIOLinux",
6565
"CNIOWindows",
@@ -92,7 +92,7 @@ let package = Package(
9292
.target(
9393
name: "NIOPosix",
9494
dependencies: [
95-
"CNIOBSD",
95+
"CNIOOpenBSD",
9696
"CNIOLinux",
9797
"CNIODarwin",
9898
"CNIOWindows",
@@ -150,7 +150,7 @@ let package = Package(
150150
dependencies: []
151151
),
152152
.target(
153-
name: "CNIOBSD",
153+
name: "CNIOOpenBSD",
154154
dependencies: []
155155
),
156156
.target(
@@ -488,7 +488,7 @@ let package = Package(
488488
"NIOTestUtils",
489489
"NIOConcurrencyHelpers",
490490
"NIOEmbedded",
491-
"CNIOBSD",
491+
"CNIOOpenBSD",
492492
"CNIOLinux",
493493
"CNIODarwin",
494494
"NIOTLS",

Sources/CNIOBSD/include/CNIOBSD.h renamed to Sources/CNIOOpenBSD/include/CNIOOpenBSD.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,47 +52,47 @@
5252
typedef struct {
5353
struct msghdr msg_hdr;
5454
unsigned int msg_len;
55-
} CNIOBSD_mmsghdr;
55+
} CNIOOpenBSD_mmsghdr;
5656

5757
typedef struct {
5858
struct in6_addr ipi6_addr;
5959
unsigned int ipi6_ifindex;
60-
} CNIOBSD_in6_pktinfo;
60+
} CNIOOpenBSD_in6_pktinfo;
6161

62-
int CNIOBSD_sendmmsg(int sockfd, CNIOBSD_mmsghdr *msgvec, unsigned int vlen, int flags);
63-
int CNIOBSD_recvmmsg(int sockfd, CNIOBSD_mmsghdr *msgvec, unsigned int vlen, int flags, struct timespec *timeout);
62+
int CNIOOpenBSD_sendmmsg(int sockfd, CNIOOpenBSD_mmsghdr *msgvec, unsigned int vlen, int flags);
63+
int CNIOOpenBSD_recvmmsg(int sockfd, CNIOOpenBSD_mmsghdr *msgvec, unsigned int vlen, int flags, struct timespec *timeout);
6464

65-
int CNIOBSD_pthread_set_name_np(pthread_t thread, const char *name);
66-
int CNIOBSD_pthread_get_name_np(pthread_t thread, char *name, size_t len);
65+
int CNIOOpenBSD_pthread_set_name_np(pthread_t thread, const char *name);
66+
int CNIOOpenBSD_pthread_get_name_np(pthread_t thread, char *name, size_t len);
6767

6868
// Non-standard socket stuff.
69-
int CNIOBSD_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
69+
int CNIOOpenBSD_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
7070

7171
// cmsghdr handling
72-
struct cmsghdr *CNIOBSD_CMSG_FIRSTHDR(const struct msghdr *);
73-
struct cmsghdr *CNIOBSD_CMSG_NXTHDR(struct msghdr *, struct cmsghdr *);
74-
const void *CNIOBSD_CMSG_DATA(const struct cmsghdr *);
75-
void *CNIOBSD_CMSG_DATA_MUTABLE(struct cmsghdr *);
76-
size_t CNIOBSD_CMSG_LEN(size_t);
77-
size_t CNIOBSD_CMSG_SPACE(size_t);
72+
struct cmsghdr *CNIOOpenBSD_CMSG_FIRSTHDR(const struct msghdr *);
73+
struct cmsghdr *CNIOOpenBSD_CMSG_NXTHDR(struct msghdr *, struct cmsghdr *);
74+
const void *CNIOOpenBSD_CMSG_DATA(const struct cmsghdr *);
75+
void *CNIOOpenBSD_CMSG_DATA_MUTABLE(struct cmsghdr *);
76+
size_t CNIOOpenBSD_CMSG_LEN(size_t);
77+
size_t CNIOOpenBSD_CMSG_SPACE(size_t);
7878

7979
// awkward time_T pain
80-
extern const int CNIOBSD_SO_TIMESTAMP;
81-
extern const int CNIOBSD_SO_RCVTIMEO;
80+
extern const int CNIOOpenBSD_SO_TIMESTAMP;
81+
extern const int CNIOOpenBSD_SO_RCVTIMEO;
8282

83-
int CNIOBSD_system_info(struct utsname *uname_data);
83+
int CNIOOpenBSD_system_info(struct utsname *uname_data);
8484

85-
extern const unsigned long CNIOBSD_IOCTL_VM_SOCKETS_GET_LOCAL_CID;
85+
extern const unsigned long CNIOOpenBSD_IOCTL_VM_SOCKETS_GET_LOCAL_CID;
8686

87-
const char* CNIOBSD_dirent_dname(struct dirent *ent);
87+
const char* CNIOOpenBSD_dirent_dname(struct dirent *ent);
8888

89-
extern const unsigned long CNIOBSD_UTIME_OMIT;
90-
extern const unsigned long CNIOBSD_UTIME_NOW;
89+
extern const unsigned long CNIOOpenBSD_UTIME_OMIT;
90+
extern const unsigned long CNIOOpenBSD_UTIME_NOW;
9191

92-
extern const long CNIOBSD_UDP_MAX_SEGMENTS;
92+
extern const long CNIOOpenBSD_UDP_MAX_SEGMENTS;
9393

9494
// A workaround for incorrect nullability annotations in the Android SDK.
9595
// Probably unnecessary on BSD, but copying for consistency for now.
96-
FTS *CNIOBSD_fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **));
96+
FTS *CNIOOpenBSD_fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **));
9797

9898
#endif

Sources/CNIOBSD/shim.c renamed to Sources/CNIOOpenBSD/shim.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,74 +14,74 @@
1414

1515
// Xcode's Archive builds with Xcode's Package support struggle with empty .c files
1616
// (https://bugs.swift.org/browse/SR-12939).
17-
void CNIOBSD_i_do_nothing_just_working_around_a_darwin_toolchain_bug(void) {}
17+
void CNIOOpenBSD_i_do_nothing_just_working_around_a_darwin_toolchain_bug(void) {}
1818

1919
#if defined(__OpenBSD__)
2020

21-
#include <CNIOBSD.h>
21+
#include <CNIOOpenBSD.h>
2222
#include <pthread.h>
2323
#include <assert.h>
2424
#include <unistd.h>
2525

26-
int CNIOBSD_pthread_set_name_np(pthread_t thread, const char *name) {
26+
int CNIOOpenBSD_pthread_set_name_np(pthread_t thread, const char *name) {
2727
pthread_set_name_np(thread, name);
2828
return 0;
2929
}
3030

31-
int CNIOBSD_pthread_get_name_np(pthread_t thread, char *name, size_t len) {
31+
int CNIOOpenBSD_pthread_get_name_np(pthread_t thread, char *name, size_t len) {
3232
pthread_get_name_np(thread, name, len);
3333
return 0;
3434
}
3535

36-
int CNIOBSD_sendmmsg(int sockfd, CNIOBSD_mmsghdr *msgvec, unsigned int vlen, int flags) {
36+
int CNIOOpenBSD_sendmmsg(int sockfd, CNIOOpenBSD_mmsghdr *msgvec, unsigned int vlen, int flags) {
3737
// This is technically undefined behaviour, but it's basically fine because these types are the same size, and we
3838
// don't think the compiler is inclined to blow anything up here.
3939
// This comment is from CNIOLinux, but I haven't reverified this applies for OpenBSD.
4040
return sendmmsg(sockfd, (struct mmsghdr *)msgvec, vlen, flags);
4141
}
4242

43-
int CNIOBSD_recvmmsg(int sockfd, CNIOBSD_mmsghdr *msgvec, unsigned int vlen, int flags, struct timespec *timeout) {
43+
int CNIOOpenBSD_recvmmsg(int sockfd, CNIOOpenBSD_mmsghdr *msgvec, unsigned int vlen, int flags, struct timespec *timeout) {
4444
// This is technically undefined behaviour, but it's basically fine because these types are the same size, and we
4545
// don't think the compiler is inclined to blow anything up here.
4646
// This comment is from CNIOLinux, but I haven't reverified this applies for OpenBSD.
4747
return recvmmsg(sockfd, (struct mmsghdr *)msgvec, vlen, flags, timeout);
4848
}
4949

50-
int CNIOBSD_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) {
50+
int CNIOOpenBSD_accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) {
5151
return accept4(sockfd, addr, addrlen, flags);
5252
}
5353

54-
struct cmsghdr *CNIOBSD_CMSG_FIRSTHDR(const struct msghdr *mhdr) {
54+
struct cmsghdr *CNIOOpenBSD_CMSG_FIRSTHDR(const struct msghdr *mhdr) {
5555
assert(mhdr != NULL);
5656
return CMSG_FIRSTHDR(mhdr);
5757
}
5858

59-
struct cmsghdr *CNIOBSD_CMSG_NXTHDR(struct msghdr *mhdr, struct cmsghdr *cmsg) {
59+
struct cmsghdr *CNIOOpenBSD_CMSG_NXTHDR(struct msghdr *mhdr, struct cmsghdr *cmsg) {
6060
assert(mhdr != NULL);
6161
assert(cmsg != NULL);
6262
return CMSG_NXTHDR(mhdr, cmsg);
6363
}
6464

65-
const void *CNIOBSD_CMSG_DATA(const struct cmsghdr *cmsg) {
65+
const void *CNIOOpenBSD_CMSG_DATA(const struct cmsghdr *cmsg) {
6666
assert(cmsg != NULL);
6767
return CMSG_DATA(cmsg);
6868
}
6969

70-
void *CNIOBSD_CMSG_DATA_MUTABLE(struct cmsghdr *cmsg) {
70+
void *CNIOOpenBSD_CMSG_DATA_MUTABLE(struct cmsghdr *cmsg) {
7171
assert(cmsg != NULL);
7272
return CMSG_DATA(cmsg);
7373
}
7474

75-
size_t CNIOBSD_CMSG_LEN(size_t payloadSizeBytes) {
75+
size_t CNIOOpenBSD_CMSG_LEN(size_t payloadSizeBytes) {
7676
return CMSG_LEN(payloadSizeBytes);
7777
}
7878

79-
size_t CNIOBSD_CMSG_SPACE(size_t payloadSizeBytes) {
79+
size_t CNIOOpenBSD_CMSG_SPACE(size_t payloadSizeBytes) {
8080
return CMSG_SPACE(payloadSizeBytes);
8181
}
8282

83-
const int CNIOBSD_SO_TIMESTAMP = SO_TIMESTAMP;
84-
const int CNIOBSD_SO_RCVTIMEO = SO_RCVTIMEO;
83+
const int CNIOOpenBSD_SO_TIMESTAMP = SO_TIMESTAMP;
84+
const int CNIOOpenBSD_SO_RCVTIMEO = SO_RCVTIMEO;
8585

8686
bool supports_udp_sockopt(int opt, int value) {
8787
int fd = socket(AF_INET, SOCK_DGRAM, 0);
@@ -93,39 +93,39 @@ bool supports_udp_sockopt(int opt, int value) {
9393
return rc == 0;
9494
}
9595

96-
bool CNIOBSD_supports_udp_segment() {
96+
bool CNIOOpenBSD_supports_udp_segment() {
9797
#ifndef UDP_SEGMENT
9898
return false;
9999
#else
100100
return supports_udp_sockopt(UDP_SEGMENT, 512);
101101
#endif
102102
}
103103

104-
bool CNIOBSD_supports_udp_gro() {
104+
bool CNIOOpenBSD_supports_udp_gro() {
105105
#ifndef UDP_GRO
106106
return false;
107107
#else
108108
return supports_udp_sockopt(UDP_GRO, 1);
109109
#endif
110110
}
111111

112-
int CNIOBSD_system_info(struct utsname* uname_data) {
112+
int CNIOOpenBSD_system_info(struct utsname* uname_data) {
113113
return uname(uname_data);
114114
}
115115

116-
const char* CNIOBSD_dirent_dname(struct dirent* ent) {
116+
const char* CNIOOpenBSD_dirent_dname(struct dirent* ent) {
117117
return ent->d_name;
118118
}
119119

120-
const unsigned long CNIOBSD_UTIME_OMIT = UTIME_OMIT;
121-
const unsigned long CNIOBSD_UTIME_NOW = UTIME_NOW;
120+
const unsigned long CNIOOpenBSD_UTIME_OMIT = UTIME_OMIT;
121+
const unsigned long CNIOOpenBSD_UTIME_NOW = UTIME_NOW;
122122

123123
#ifdef UDP_MAX_SEGMENTS
124-
const long CNIOBSD_UDP_MAX_SEGMENTS = UDP_MAX_SEGMENTS;
124+
const long CNIOOpenBSD_UDP_MAX_SEGMENTS = UDP_MAX_SEGMENTS;
125125
#endif
126-
const long CNIOBSD_UDP_MAX_SEGMENTS = -1;
126+
const long CNIOOpenBSD_UDP_MAX_SEGMENTS = -1;
127127

128-
FTS *CNIOBSD_fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)) {
128+
FTS *CNIOOpenBSD_fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)) {
129129
return fts_open(path_argv, options, compar);
130130
}
131131
#endif

Sources/NIOCore/BSDSocketAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private let sysInet_pton: @convention(c) (CInt, UnsafePointer<CChar>?, UnsafeMut
8585
#endif
8686
#elseif os(OpenBSD)
8787
@preconcurrency import Glibc
88-
import CNIOBSD
88+
import CNIOOpenBSD
8989

9090
private let sysInet_ntop:
9191
@convention(c) (CInt, UnsafeRawPointer?, UnsafeMutablePointer<CChar>?, socklen_t) -> UnsafePointer<CChar>? =

Sources/NIOCore/Interfaces.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#endif
2222
import CNIOLinux
2323
#elseif os(OpenBSD)
24-
import CNIOBSD
24+
import CNIOOpenBSD
2525
#elseif canImport(Darwin)
2626
import Darwin
2727
#elseif canImport(WASILibc)

Sources/NIOCore/SocketAddresses.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import Darwin
5454
import CNIOLinux
5555
#elseif os(OpenBSD)
5656
@preconcurrency import Glibc
57-
import CNIOBSD
57+
import CNIOOpenBSD
5858
#elseif canImport(WASILibc)
5959
@preconcurrency import WASILibc
6060
#else

Sources/NIOCore/SocketOptionProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Darwin
2424
import CNIOLinux
2525
#elseif os(OpenBSD)
2626
@preconcurrency import Glibc
27-
import CNIOBSD
27+
import CNIOOpenBSD
2828
#elseif os(Windows)
2929
import WinSDK
3030
#elseif canImport(WASILibc)

Sources/NIOCore/Utilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import CNIOLinux
2121
@preconcurrency import Android
2222
#endif
2323
#elseif os(OpenBSD)
24-
import CNIOBSD
24+
import CNIOOpenBSD
2525
@preconcurrency import Glibc
2626
#elseif os(Windows)
2727
import ucrt

Sources/NIOMulticastChat/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14-
import CNIOBSD
14+
import CNIOOpenBSD
1515
import CNIOLinux
1616
import NIOCore
1717
import NIOPosix

Sources/NIOPosix/BSDSocketAPIPosix.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,13 @@ private let CMSG_DATA_MUTABLE = CNIODarwin_CMSG_DATA_MUTABLE
277277
private let CMSG_SPACE = CNIODarwin_CMSG_SPACE
278278
private let CMSG_LEN = CNIODarwin_CMSG_LEN
279279
#elseif os(OpenBSD)
280-
import CNIOBSD
281-
private let CMSG_FIRSTHDR = CNIOBSD_CMSG_FIRSTHDR
282-
private let CMSG_NXTHDR = CNIOBSD_CMSG_NXTHDR
283-
private let CMSG_DATA = CNIOBSD_CMSG_DATA
284-
private let CMSG_DATA_MUTABLE = CNIOBSD_CMSG_DATA_MUTABLE
285-
private let CMSG_SPACE = CNIOBSD_CMSG_SPACE
286-
private let CMSG_LEN = CNIOBSD_CMSG_LEN
280+
import CNIOOpenBSD
281+
private let CMSG_FIRSTHDR = CNIOOpenBSD_CMSG_FIRSTHDR
282+
private let CMSG_NXTHDR = CNIOOpenBSD_CMSG_NXTHDR
283+
private let CMSG_DATA = CNIOOpenBSD_CMSG_DATA
284+
private let CMSG_DATA_MUTABLE = CNIOOpenBSD_CMSG_DATA_MUTABLE
285+
private let CMSG_SPACE = CNIOOpenBSD_CMSG_SPACE
286+
private let CMSG_LEN = CNIOOpenBSD_CMSG_LEN
287287
#else
288288
import CNIOLinux
289289
private let CMSG_FIRSTHDR = CNIOLinux_CMSG_FIRSTHDR

0 commit comments

Comments
 (0)