chiark / gitweb /
timedfd: Add note re nonblock open-file
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 13:48:35 +0000 (14:48 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 17 May 2021 13:57:32 +0000 (14:57 +0100)
This is why we must swap both ends of a mgmtchannel at once.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/timedfd.rs

index 91eed394839b65d4ae712def4bf399a26827106b..cffd5891a4a5cb8828e1ffb6168fc4be2ecfc581 100644 (file)
@@ -61,12 +61,17 @@ impl nix::Error {
 }
 
 impl<RW> TimedFd<RW> where RW: TimedFdReadWrite {
+  /// Takes ownership of the fd
+  ///
+  /// Will change the fd's open-file to nonblocking.
   #[throws(io::Error)]
   pub fn new<F>(fd: F) -> TimedFd<RW> where F: IntoRawFd {
     Self::from_fd( Fd::from_raw_fd( fd.into_raw_fd() ))?
   }
 
   /// Takes ownership of the fd
+  ///
+  /// Will change the fd's open-file to nonblocking.
   #[throws(io::Error)]
   fn from_fd(fd: Fd) -> Self {
     fcntl(fd.as_raw_fd(), FcntlArg::F_SETFL(OFlag::O_NONBLOCK))