Merge branch 'socklen-t-dedup' into 'master'
remove duplicate socklen_t definition See merge request redox-os/relibc!1081
This commit is contained in:
@@ -10,9 +10,10 @@ use core::{
|
||||
use crate::{
|
||||
c_str::CStr,
|
||||
header::{
|
||||
bits_socklen_t::socklen_t,
|
||||
errno::{EAFNOSUPPORT, ENOSPC},
|
||||
netinet_in::{INADDR_NONE, in_addr, in_addr_t, ntohl},
|
||||
sys_socket::{constants::AF_INET, socklen_t},
|
||||
sys_socket::constants::AF_INET,
|
||||
},
|
||||
platform::{
|
||||
self,
|
||||
|
||||
@@ -10,13 +10,14 @@ use crate::{
|
||||
};
|
||||
|
||||
use crate::header::{
|
||||
bits_socklen_t::socklen_t,
|
||||
bits_time::timespec,
|
||||
errno::*,
|
||||
netinet_in::{IPPROTO_UDP, htons, in_addr, sockaddr_in},
|
||||
sys_socket::{
|
||||
self,
|
||||
constants::{AF_INET, SOCK_DGRAM},
|
||||
sockaddr, socklen_t,
|
||||
sockaddr,
|
||||
},
|
||||
time,
|
||||
};
|
||||
|
||||
@@ -13,12 +13,13 @@ use crate::{
|
||||
error::ResultExt,
|
||||
header::{
|
||||
arpa_inet::inet_aton,
|
||||
bits_socklen_t::socklen_t,
|
||||
errno::*,
|
||||
fcntl::O_RDONLY,
|
||||
netinet_in::{htons, in_addr, ntohl, sockaddr_in, sockaddr_in6},
|
||||
stdlib::atoi,
|
||||
strings::strcasecmp,
|
||||
sys_socket::{constants::AF_INET, sa_family_t, sockaddr, socklen_t},
|
||||
sys_socket::{constants::AF_INET, sa_family_t, sockaddr},
|
||||
unistd::SEEK_SET,
|
||||
},
|
||||
platform::{
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
sys_includes = ["stddef.h", "stdint.h", "sys/types.h", "sys/uio.h"]
|
||||
include_guard = "_SYS_SOCKET_H"
|
||||
after_includes = """
|
||||
#include <bits/socklen-t.h> // for socklen_t
|
||||
"""
|
||||
trailer = "#include <bits/sys/socket.h>"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
|
||||
@@ -6,7 +6,7 @@ use core::{mem, ptr};
|
||||
|
||||
use crate::{
|
||||
error::ResultExt,
|
||||
header::sys_uio::iovec,
|
||||
header::{bits_socklen_t::socklen_t, sys_uio::iovec},
|
||||
platform::{
|
||||
PalSocket, Sys,
|
||||
types::{
|
||||
@@ -18,7 +18,6 @@ use crate::{
|
||||
pub mod constants;
|
||||
|
||||
pub type sa_family_t = u16;
|
||||
pub type socklen_t = u32;
|
||||
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_socket.h.html>.
|
||||
#[repr(C)]
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
use super::{Sys, e_raw};
|
||||
use crate::{
|
||||
error::Result,
|
||||
header::sys_socket::{msghdr, sockaddr, socklen_t},
|
||||
platform::{PalSocket, types::*},
|
||||
header::{
|
||||
bits_socklen_t::socklen_t,
|
||||
sys_socket::{msghdr, sockaddr},
|
||||
},
|
||||
platform::{
|
||||
PalSocket,
|
||||
types::{c_int, c_void, size_t},
|
||||
},
|
||||
};
|
||||
|
||||
impl PalSocket for Sys {
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
use crate::{
|
||||
error::Result,
|
||||
header::sys_socket::{msghdr, sockaddr, socklen_t},
|
||||
platform::{Pal, types::*},
|
||||
header::{
|
||||
bits_socklen_t::socklen_t,
|
||||
sys_socket::{msghdr, sockaddr},
|
||||
},
|
||||
platform::{
|
||||
Pal,
|
||||
types::{c_int, c_void, size_t},
|
||||
},
|
||||
};
|
||||
|
||||
pub trait PalSocket: Pal {
|
||||
|
||||
@@ -13,6 +13,7 @@ use crate::{
|
||||
error::{Errno, Result},
|
||||
header::{
|
||||
arpa_inet::inet_aton,
|
||||
bits_socklen_t::socklen_t,
|
||||
errno::{
|
||||
EAFNOSUPPORT, EDOM, EFAULT, EINVAL, EMSGSIZE, ENOMEM, ENOSYS, ENOTCONN, ENOTSOCK,
|
||||
EOPNOTSUPP, EPROTONOSUPPORT,
|
||||
@@ -22,7 +23,7 @@ use crate::{
|
||||
sys_select::timeval,
|
||||
sys_socket::{
|
||||
CMSG_ALIGN, CMSG_DATA, CMSG_FIRSTHDR, CMSG_LEN, CMSG_NXTHDR, CMSG_SPACE, cmsghdr,
|
||||
constants::*, msghdr, sa_family_t, sockaddr, socklen_t, ucred,
|
||||
constants::*, msghdr, sa_family_t, sockaddr, ucred,
|
||||
},
|
||||
sys_uio::iovec,
|
||||
sys_un::sockaddr_un,
|
||||
|
||||
Reference in New Issue
Block a user