support ohos (#974)

* support ohos

---------

Co-authored-by: FrankHan <2777926911@qq.com>
This commit is contained in:
韩嘉乐
2025-07-02 09:44:45 +08:00
committed by GitHub
parent bf021a9ead
commit 01e491ec07
22 changed files with 668 additions and 21 deletions
+1 -1
View File
@@ -388,7 +388,7 @@ pub(crate) fn setup_sokcet2_ext(
}
}
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux", target_env = "ohos"))]
if let Some(dev_name) = bind_dev {
tracing::trace!(dev_name = ?dev_name, "bind device");
socket2_socket.bind_device(Some(dev_name.as_bytes()))?;