File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 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 {
10141014 /// Some C APIs from provide `len`, and others do not. If it's provided it
10151015 /// will be validated. If not, it will be guessed based on the family.
10161016 ///
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+ ///
10171029 /// # Safety
10181030 ///
10191031 /// `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`.
10211033 unsafe fn from_raw ( addr : * const libc:: sockaddr , len : Option < libc:: socklen_t > )
10221034 -> Option < Self > where Self : Sized ;
10231035
You can’t perform that action at this time.
0 commit comments