From c31750aa5f6d2e769acc6d7c07e8c78f7eebf6a3 Mon Sep 17 00:00:00 2001 From: "hongwei.li" Date: Thu, 28 Jul 2022 11:53:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=8E=B7=E5=8F=96fd=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E5=89=8D=E6=9C=9F=E5=BC=80=E5=8F=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/net/sys/unix/socket.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/net/sys/unix/socket.rs b/src/net/sys/unix/socket.rs index 3e8c202..476cb5b 100644 --- a/src/net/sys/unix/socket.rs +++ b/src/net/sys/unix/socket.rs @@ -30,6 +30,11 @@ pub enum Shutdown { } impl Socket { pub const ADDR_SIZE: u32 = size_of::() as u32; + + pub fn get_fd(&self) -> i32 { + self.inner.fd + } + fn get_pool() -> &'static ObjPool { static P: ObjPool = ObjPool::new(); &P -- Gitee From f33a6a99928232d314bd2b57b731a409b6f21333 Mon Sep 17 00:00:00 2001 From: "hongwei.li" Date: Wed, 10 Aug 2022 13:58:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9D=83?= =?UTF-8?q?=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib.rs | 3 +++ src/net/mod.rs | 3 +++ src/net/sys/mod.rs | 3 +++ src/reactor.rs | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 57dbd1f..5e0cd70 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,5 @@ +// Copyright (C) 2022-2022 Agilor Co.,Ltd. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 #![cfg_attr(feature = "alloc", no_std, feature(prelude_import))] #![feature(once_cell)] #[allow(unused_imports)] @@ -25,3 +27,4 @@ mod reactor; pub use drive_s::{block_on, spawn}; pub use net::*; + diff --git a/src/net/mod.rs b/src/net/mod.rs index 6f3cd7a..b6df8a9 100644 --- a/src/net/mod.rs +++ b/src/net/mod.rs @@ -1,4 +1,7 @@ +// Copyright (C) 2022-2022 Agilor Co.,Ltd. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 #[allow(dead_code)] #[allow(dead_code)] mod sys; pub use sys::*; + diff --git a/src/net/sys/mod.rs b/src/net/sys/mod.rs index d1cce2d..25923ca 100644 --- a/src/net/sys/mod.rs +++ b/src/net/sys/mod.rs @@ -1,3 +1,6 @@ +// Copyright (C) 2022-2022 Agilor Co.,Ltd. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 mod unix; pub use unix::*; + diff --git a/src/reactor.rs b/src/reactor.rs index 51a0b7e..58d9e4f 100644 --- a/src/reactor.rs +++ b/src/reactor.rs @@ -1,3 +1,5 @@ +// Copyright (C) 2022-2022 Agilor Co.,Ltd. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 use core::{mem::MaybeUninit, task::Waker}; use stdlib::{io::Result, lazy::SyncLazy}; @@ -31,3 +33,4 @@ impl Reactor { Ok(()) } } + -- Gitee