Skip to content

Conversation

robinyuan1002
Copy link
Collaborator

No description provided.

@Yaxuan-w Yaxuan-w changed the title Add network sockaddr data structure in sysdefs lib [Refactor] Add network sockaddr data structure in sysdefs lib Apr 16, 2025
@rennergade
Copy link
Contributor

Looks fine. I'm a bit confused though is the only thing this file is doing is exposing a unix sockaddr constructor? If so does it make sense to do this in a different file.

Comment on lines +1 to +2
use libc::{sa_family_t, sockaddr_un, sockaddr_in, sockaddr_in6, AF_UNIX, AF_INET, AF_INET6};
use libc::sockaddr;
Copy link
Member

Choose a reason for hiding this comment

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

Do we need these imports?

Comment on lines 90 to +104
#[repr(C)]
pub struct PollStruct {
pub fd: i32,
pub events: i16,
pub revents: i16,
}

#[derive(Debug)]
#[repr(C)]
pub struct EpollEvent {
pub events: u32,
pub fd: i32, //in native this is a union which could be one of a number of things
//however, we only support EPOLL_CTL subcommands which take the fd
}

Copy link
Member

Choose a reason for hiding this comment

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

We don't need to include poll/epoll related things in this PR

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.

3 participants