diff --git a/tokio/src/net/tcp/socket.rs b/tokio/src/net/tcp/socket.rs
index a6605dc10ca..b00df95f4a6 100644
--- a/tokio/src/net/tcp/socket.rs
+++ b/tokio/src/net/tcp/socket.rs
@@ -453,6 +453,34 @@ impl TcpSocket {
self.inner.set_tos(tos)
}
+ /// Gets the value for the `SO_BINDTODEVICE` option on this socket
+ ///
+ /// This value gets the socket binded device's interface name.
+ #[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux",))]
+ #[cfg_attr(
+ docsrs,
+ doc(cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux",)))
+ )]
+ pub fn device(&self) -> io::Result