File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1014,8 +1014,19 @@ pub const PRIO_PROCESS: c_int = 0;
10141014pub const PRIO_PGRP : c_int = 1 ;
10151015pub const PRIO_USER : c_int = 2 ;
10161016
1017- // wait.h
10181017f ! {
1018+ //sys/socket.h
1019+ pub { const } fn CMSG_ALIGN ( len: size_t) -> size_t {
1020+ ( len + mem:: size_of:: <size_t>( ) - 1 ) & !( mem:: size_of:: <size_t>( ) - 1 )
1021+ }
1022+ pub { const } fn CMSG_LEN ( length: c_uint) -> c_uint {
1023+ ( CMSG_ALIGN ( mem:: size_of:: <cmsghdr>( ) ) + length as usize ) as c_uint
1024+ }
1025+ pub { const } fn CMSG_SPACE ( len: c_uint) -> c_uint {
1026+ ( CMSG_ALIGN ( len as size_t) + CMSG_ALIGN ( mem:: size_of:: <cmsghdr>( ) ) ) as c_uint
1027+ }
1028+
1029+ // wait.h
10191030 pub fn FD_CLR ( fd: c_int, set: * mut fd_set) -> ( ) {
10201031 let fd = fd as usize ;
10211032 let size = mem:: size_of_val( & ( * set) . fds_bits[ 0 ] ) * 8 ;
@@ -1228,12 +1239,9 @@ extern "C" {
12281239 pub fn setrlimit ( resource : c_int , rlim : * const crate :: rlimit ) -> c_int ;
12291240
12301241 // sys/socket.h
1231- pub fn CMSG_ALIGN ( len : size_t ) -> size_t ;
12321242 pub fn CMSG_DATA ( cmsg : * const cmsghdr ) -> * mut c_uchar ;
12331243 pub fn CMSG_FIRSTHDR ( mhdr : * const msghdr ) -> * mut cmsghdr ;
1234- pub fn CMSG_LEN ( len : c_uint ) -> c_uint ;
12351244 pub fn CMSG_NXTHDR ( mhdr : * const msghdr , cmsg : * const cmsghdr ) -> * mut cmsghdr ;
1236- pub fn CMSG_SPACE ( len : c_uint ) -> c_uint ;
12371245 pub fn bind (
12381246 socket : c_int ,
12391247 address : * const crate :: sockaddr ,
You can’t perform that action at this time.
0 commit comments