Skip to content

Commit d0b133c

Browse files
committed
Remove unsupported target_os for SocketCred
1 parent 5964d59 commit d0b133c

File tree

1 file changed

+7
-125
lines changed

1 file changed

+7
-125
lines changed

library/std/src/sys/unix/ext/net/ancillary.rs

Lines changed: 7 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -166,38 +166,12 @@ impl<'a, T> Iterator for AncillaryDataIter<'a, T> {
166166
}
167167

168168
/// Unix credential.
169-
#[cfg(any(
170-
doc,
171-
target_os = "android",
172-
target_os = "dragonfly",
173-
target_os = "emscripten",
174-
target_os = "freebsd",
175-
target_os = "fuchsia",
176-
target_os = "ios",
177-
target_os = "linux",
178-
target_os = "macos",
179-
target_os = "netbsd",
180-
target_os = "openbsd",
181-
target_env = "uclibc",
182-
))]
169+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
183170
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
184171
#[derive(Clone)]
185172
pub struct SocketCred(libc::ucred);
186173

187-
#[cfg(any(
188-
doc,
189-
target_os = "android",
190-
target_os = "dragonfly",
191-
target_os = "emscripten",
192-
target_os = "freebsd",
193-
target_os = "fuchsia",
194-
target_os = "ios",
195-
target_os = "linux",
196-
target_os = "macos",
197-
target_os = "netbsd",
198-
target_os = "openbsd",
199-
target_env = "uclibc",
200-
))]
174+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
201175
impl SocketCred {
202176
/// Create a Unix credential struct.
203177
///
@@ -262,37 +236,11 @@ impl<'a> Iterator for ScmRights<'a> {
262236
/// This control message contains unix credentials.
263237
///
264238
/// The level is equal to `SOL_SOCKET` and the type is equal to `SCM_CREDENTIALS` or `SCM_CREDS`.
265-
#[cfg(any(
266-
doc,
267-
target_os = "android",
268-
target_os = "dragonfly",
269-
target_os = "emscripten",
270-
target_os = "freebsd",
271-
target_os = "fuchsia",
272-
target_os = "ios",
273-
target_os = "linux",
274-
target_os = "macos",
275-
target_os = "netbsd",
276-
target_os = "openbsd",
277-
target_env = "uclibc",
278-
))]
239+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
279240
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
280241
pub struct ScmCredentials<'a>(AncillaryDataIter<'a, libc::ucred>);
281242

282-
#[cfg(any(
283-
doc,
284-
target_os = "android",
285-
target_os = "dragonfly",
286-
target_os = "emscripten",
287-
target_os = "freebsd",
288-
target_os = "fuchsia",
289-
target_os = "ios",
290-
target_os = "linux",
291-
target_os = "macos",
292-
target_os = "netbsd",
293-
target_os = "openbsd",
294-
target_env = "uclibc",
295-
))]
243+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
296244
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
297245
impl<'a> Iterator for ScmCredentials<'a> {
298246
type Item = SocketCred;
@@ -314,20 +262,7 @@ pub enum AncillaryError {
314262
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
315263
pub enum AncillaryData<'a> {
316264
ScmRights(ScmRights<'a>),
317-
#[cfg(any(
318-
doc,
319-
target_os = "android",
320-
target_os = "dragonfly",
321-
target_os = "emscripten",
322-
target_os = "freebsd",
323-
target_os = "fuchsia",
324-
target_os = "ios",
325-
target_os = "linux",
326-
target_os = "macos",
327-
target_os = "netbsd",
328-
target_os = "openbsd",
329-
target_env = "uclibc",
330-
))]
265+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
331266
ScmCredentials(ScmCredentials<'a>),
332267
}
333268

@@ -350,20 +285,7 @@ impl<'a> AncillaryData<'a> {
350285
///
351286
/// `data` must contain a valid control message and the control message must be type of
352287
/// `SOL_SOCKET` and level of `SCM_CREDENTIALS` or `SCM_CREDENTIALS`.
353-
#[cfg(any(
354-
doc,
355-
target_os = "android",
356-
target_os = "dragonfly",
357-
target_os = "emscripten",
358-
target_os = "freebsd",
359-
target_os = "fuchsia",
360-
target_os = "ios",
361-
target_os = "linux",
362-
target_os = "macos",
363-
target_os = "netbsd",
364-
target_os = "openbsd",
365-
target_env = "uclibc",
366-
))]
288+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
367289
unsafe fn as_credentials(data: &'a [u8]) -> Self {
368290
let ancillary_data_iter = AncillaryDataIter::new(data);
369291
let scm_credentials = ScmCredentials(ancillary_data_iter);
@@ -383,20 +305,9 @@ impl<'a> AncillaryData<'a> {
383305
#[cfg(any(
384306
target_os = "android",
385307
target_os = "emscripten",
386-
target_os = "fuchsia",
387308
target_os = "linux",
388-
target_env = "uclibc",
389309
))]
390310
libc::SCM_CREDENTIALS => Ok(AncillaryData::as_credentials(data)),
391-
#[cfg(any(
392-
target_os = "dragonfly",
393-
target_os = "freebsd",
394-
target_os = "ios",
395-
target_os = "macos",
396-
target_os = "netbsd",
397-
target_os = "openbsd",
398-
))]
399-
libc::SCM_CREDS => Ok(AncillaryData::as_credentials(data)),
400311
cmsg_type => {
401312
Err(AncillaryError::Unknown { cmsg_level: libc::SOL_SOCKET, cmsg_type })
402313
}
@@ -593,20 +504,7 @@ impl<'a> SocketAncillary<'a> {
593504
/// Technically, that means this operation adds a control message with the level `SOL_SOCKET`
594505
/// and type `SCM_CREDENTIALS` or `SCM_CREDS`.
595506
///
596-
#[cfg(any(
597-
doc,
598-
target_os = "android",
599-
target_os = "dragonfly",
600-
target_os = "emscripten",
601-
target_os = "freebsd",
602-
target_os = "fuchsia",
603-
target_os = "ios",
604-
target_os = "linux",
605-
target_os = "macos",
606-
target_os = "netbsd",
607-
target_os = "openbsd",
608-
target_env = "uclibc",
609-
))]
507+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
610508
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
611509
pub fn add_creds(&mut self, creds: &[SocketCred]) -> bool {
612510
self.truncated = false;
@@ -615,23 +513,7 @@ impl<'a> SocketAncillary<'a> {
615513
&mut self.length,
616514
creds,
617515
libc::SOL_SOCKET,
618-
#[cfg(any(
619-
target_os = "android",
620-
target_os = "emscripten",
621-
target_os = "fuchsia",
622-
target_os = "linux",
623-
target_env = "uclibc",
624-
))]
625516
libc::SCM_CREDENTIALS,
626-
#[cfg(any(
627-
target_os = "dragonfly",
628-
target_os = "freebsd",
629-
target_os = "ios",
630-
target_os = "macos",
631-
target_os = "netbsd",
632-
target_os = "openbsd",
633-
))]
634-
libc::SCM_CREDS,
635517
)
636518
}
637519

0 commit comments

Comments
 (0)