File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1014,10 +1014,22 @@ pub trait SockaddrLike: private::SockaddrLikePriv {
1014
1014
/// Some C APIs from provide `len`, and others do not. If it's provided it
1015
1015
/// will be validated. If not, it will be guessed based on the family.
1016
1016
///
1017
+ /// # Arguments
1018
+ ///
1019
+ /// - `addr`: raw pointer to something that can be cast to a
1020
+ /// `libc::sockaddr`. For example, `libc::sockaddr_in`,
1021
+ /// `libc::sockaddr_in6`, etc.
1022
+ /// - `len`: For fixed-width types like `sockaddr_in`, it will be
1023
+ /// validated if present and ignored if not. For variable-width
1024
+ /// types it is required and must be the total length of valid
1025
+ /// data. For example, if `addr` points to a
1026
+ /// named `sockaddr_un`, then `len` must be the length of the
1027
+ /// structure up to but not including the trailing NUL.
1028
+ ///
1017
1029
/// # Safety
1018
1030
///
1019
1031
/// `addr` must be valid for the specific type of sockaddr. `len`, if
1020
- /// present, must be the length of valid data in `addr`.
1032
+ /// present, must not exceed the length of valid data in `addr`.
1021
1033
unsafe fn from_raw ( addr : * const libc:: sockaddr , len : Option < libc:: socklen_t > )
1022
1034
-> Option < Self > where Self : Sized ;
1023
1035
You can’t perform that action at this time.
0 commit comments