@@ -386,99 +386,6 @@ impl UnixStream {
386
386
self . 0 . set_nonblocking ( nonblocking)
387
387
}
388
388
389
- <<<<<<< HEAD
390
- =======
391
- /// Moves the socket to pass unix credentials as control message in [`SocketAncillary`].
392
- ///
393
- /// Set the socket option `SO_PASSCRED`.
394
- ///
395
- /// # Examples
396
- ///
397
- #[ cfg_attr(
398
- any(
399
- target_os = "android" ,
400
- target_os = "linux" ,
401
- target_os = "netbsd" ,
402
- target_os = "freebsd"
403
- ) ,
404
- doc = "```no_run"
405
- ) ]
406
- #[ cfg_attr(
407
- not( any(
408
- target_os = "android" ,
409
- target_os = "linux" ,
410
- target_os = "netbsd" ,
411
- target_os = "freebsd"
412
- ) ) ,
413
- doc = "```ignore"
414
- ) ]
415
- /// #![feature(unix_socket_ancillary_data)]
416
- /// use std::os::unix::net::UnixStream;
417
- ///
418
- /// fn main() -> std::io::Result<()> {
419
- /// let socket = UnixStream::connect("/tmp/sock")?;
420
- /// socket.set_passcred(true).expect("Couldn't set passcred");
421
- /// Ok(())
422
- /// }
423
- /// ```
424
- #[ cfg( any(
425
- doc,
426
- target_os = "android" ,
427
- target_os = "linux" ,
428
- target_os = "netbsd" ,
429
- target_os = "freebsd"
430
- ) ) ]
431
- #[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
432
- pub fn set_passcred ( & self , passcred : bool ) -> io:: Result < ( ) > {
433
- self . 0 . set_passcred ( passcred)
434
- }
435
-
436
- /// Get the current value of the socket for passing unix credentials in [`SocketAncillary`].
437
- /// This value can be change by [`set_passcred`].
438
- ///
439
- /// Get the socket option `SO_PASSCRED`.
440
- ///
441
- /// [`set_passcred`]: UnixStream::set_passcred
442
- #[ cfg( any(
443
- doc,
444
- target_os = "android" ,
445
- target_os = "linux" ,
446
- target_os = "netbsd" ,
447
- target_os = "freebsd"
448
- ) ) ]
449
- #[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
450
- pub fn passcred ( & self ) -> io:: Result < bool > {
451
- self . 0 . passcred ( )
452
- }
453
-
454
- /// Set a filter name on the socket to filter incoming connections to defer it before accept(2)
455
- ///
456
- /// an empty name allows to remove this connection's filter
457
- #[ cfg_attr( any( target_os = "freebsd" , target_os = "netbsd" ) , doc = "```no_run" ) ]
458
- #[ cfg_attr( not( any( target_os = "freebsd" , target_os = "netbsd" ) ) , doc = "```ignore" ) ]
459
- /// #![feature(unix_set_mark)]
460
- /// use std::os::unix::net::UnixStream;
461
- ///
462
- /// fn main() -> std::io::Result<()> {
463
- /// let sock = UnixStream::connect("/tmp/sock")?;
464
- /// sock.set_acceptfilter(&c"http")?;
465
- /// Ok(())
466
- /// }
467
- /// ```
468
- #[ cfg( any( doc, target_os = "netbsd" , target_os = "freebsd" ) ) ]
469
- #[ unstable( feature = "acceptfilter" , issue = "121891" ) ]
470
- pub fn set_acceptfilter ( & self , name : & CStr ) -> io:: Result < ( ) > {
471
- self . 0 . set_acceptfilter ( name)
472
- }
473
-
474
- /// Get a filter name if one had been set previously on the socket.
475
- ///
476
- #[ cfg( any( doc, target_os = "netbsd" , target_os = "freebsd" ) ) ]
477
- #[ unstable( feature = "acceptfilter" , issue = "121891" ) ]
478
- pub fn acceptfilter ( & self ) -> io:: Result < & CStr > {
479
- self . 0 . acceptfilter ( )
480
- }
481
- >>>>>>> 3257 f18365a ( adding the possiblity to remove the filter. )
482
389
/// Set the id of the socket for network filtering purpose
483
390
///
484
391
#[ cfg_attr(
0 commit comments