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 @@ -975,10 +975,22 @@ pub trait SockaddrLike: private::SockaddrLikePriv {
975
975
/// Some C APIs from provide `len`, and others do not. If it's provided it
976
976
/// will be validated. If not, it will be guessed based on the family.
977
977
///
978
+ /// # Arguments
979
+ ///
980
+ /// - `addr`: raw pointer to something that can be cast to a
981
+ /// `libc::sockaddr`. For example, `libc::sockaddr_in`,
982
+ /// `libc::sockaddr_in6`, etc.
983
+ /// - `len`: For fixed-width types like `sockaddr_in`, it will be
984
+ /// validated if present and ignored if not. For variable-width
985
+ /// types it is required and must be the total length of valid
986
+ /// data. For example, if `addr` points to a
987
+ /// named `sockaddr_un`, then `len` must be the length of the
988
+ /// structure up to but not including the trailing NUL.
989
+ ///
978
990
/// # Safety
979
991
///
980
992
/// `addr` must be valid for the specific type of sockaddr. `len`, if
981
- /// present, must be the length of valid data in `addr`.
993
+ /// present, must not exceed the length of valid data in `addr`.
982
994
unsafe fn from_raw ( addr : * const libc:: sockaddr , len : Option < libc:: socklen_t > )
983
995
-> Option < Self > where Self : Sized ;
984
996
You can’t perform that action at this time.
0 commit comments