mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-21 17:06:25 +04:00
Merge branch 'ch9' into main
This commit is contained in:
commit
22178ba9b8
@ -2,13 +2,14 @@
|
||||
#![no_main]
|
||||
|
||||
use alloc::string::String;
|
||||
use user_lib::{connect, write, read};
|
||||
|
||||
#[macro_use]
|
||||
extern crate user_lib;
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
use user_lib::{connect, write, read};
|
||||
|
||||
#[no_mangle]
|
||||
pub fn main() -> i32 {
|
||||
println!("udp test open!");
|
||||
|
@ -12,6 +12,7 @@ mod file;
|
||||
mod task;
|
||||
mod sync;
|
||||
mod io;
|
||||
mod net;
|
||||
|
||||
extern crate alloc;
|
||||
#[macro_use]
|
||||
@ -24,6 +25,7 @@ pub use file::*;
|
||||
pub use task::*;
|
||||
pub use sync::*;
|
||||
pub use io::*;
|
||||
pub use net::*;
|
||||
|
||||
const USER_HEAP_SIZE: usize = 32768;
|
||||
|
||||
|
5
user/src/net.rs
Normal file
5
user/src/net.rs
Normal file
@ -0,0 +1,5 @@
|
||||
use super::*;
|
||||
|
||||
pub fn connect(ip: u32, sport: u16, dport: u16) -> isize {
|
||||
sys_connect(ip, sport, dport)
|
||||
}
|
Loading…
Reference in New Issue
Block a user