Skip to content

add unixsocket without real inode#145

Merged
ken4647 merged 1 commit into
syswonder:devfrom
lhw2002426:dev
Dec 2, 2024
Merged

add unixsocket without real inode#145
ken4647 merged 1 commit into
syswonder:devfrom
lhw2002426:dev

Conversation

@lhw2002426

Copy link
Copy Markdown
Contributor

add unix socket ans AF_UNIX type for socket
but not impl SOCK_DGRAM, and use alloced index rather than inode for unixsocket because inode is not impl yet

Comment thread crates/axfs_ramfs/src/file.rs Outdated
Comment thread api/ruxos_posix_api/src/imp/net.rs Outdated
Comment thread api/arceos_posix_api/src/ctypes_gen.rs Outdated
Comment thread api/ruxos_posix_api/src/imp/net.rs Outdated
}
}

pub enum Sockaddr {

@ken4647 ken4647 Nov 28, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Sockaddr is an illegal Camel case varibale name, and it should be more distinguishable with existing name SocketAddr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SockaddrUn is the same.

@lhw2002426 lhw2002426 Nov 30, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SockaddrUn is clear enough to represent unix socket address, and i just change it into SockAddrUn

@ken4647 ken4647 Nov 30, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think SockaddrUn is clear enough to represent unix socket address, and i just change it into SockAddrUn

Using "SocketAddrUnix" as a variable name is better; Sock is somewhat less intuitive and can easily lead to confusion.

Comment thread api/ruxos_posix_api/src/imp/net.rs Outdated
}

fn un_into_sockaddr(addr: SockaddrUn) -> (ctypes::sockaddr, ctypes::socklen_t) {
debug!(" Sockaddr: {:?}", addr);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug message should more clear, let it tell about which function it from and other more information.

Comment thread api/ruxos_posix_api/src/imp/net.rs Outdated
}

fn into_sockaddr(addr: SocketAddr) -> (ctypes::sockaddr, ctypes::socklen_t) {
debug!(" Sockaddr: {}", addr);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this message too.

@lhw2002426 lhw2002426 force-pushed the dev branch 2 times, most recently from c295505 to 213d065 Compare December 1, 2024 12:00
@ken4647 ken4647 merged commit 4ab23d3 into syswonder:dev Dec 2, 2024
ken4647 added a commit to ken4647/ruxos that referenced this pull request Jan 14, 2025
add unixsocket without real inode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants