File tree 1 file changed +12
-4
lines changed
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;
1014
1014
pub const PRIO_PGRP : c_int = 1 ;
1015
1015
pub const PRIO_USER : c_int = 2 ;
1016
1016
1017
- // wait.h
1018
1017
f ! {
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
1019
1030
pub fn FD_CLR ( fd: c_int, set: * mut fd_set) -> ( ) {
1020
1031
let fd = fd as usize ;
1021
1032
let size = mem:: size_of_val( & ( * set) . fds_bits[ 0 ] ) * 8 ;
@@ -1228,12 +1239,9 @@ extern "C" {
1228
1239
pub fn setrlimit ( resource : c_int , rlim : * const crate :: rlimit ) -> c_int ;
1229
1240
1230
1241
// sys/socket.h
1231
- pub fn CMSG_ALIGN ( len : size_t ) -> size_t ;
1232
1242
pub fn CMSG_DATA ( cmsg : * const cmsghdr ) -> * mut c_uchar ;
1233
1243
pub fn CMSG_FIRSTHDR ( mhdr : * const msghdr ) -> * mut cmsghdr ;
1234
- pub fn CMSG_LEN ( len : c_uint ) -> c_uint ;
1235
1244
pub fn CMSG_NXTHDR ( mhdr : * const msghdr , cmsg : * const cmsghdr ) -> * mut cmsghdr ;
1236
- pub fn CMSG_SPACE ( len : c_uint ) -> c_uint ;
1237
1245
pub fn bind (
1238
1246
socket : c_int ,
1239
1247
address : * const crate :: sockaddr ,
You can’t perform that action at this time.
0 commit comments