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