Function lrs::syscall::getpeername

Retrieves the address a socket is connected to.

Syntax

fn getpeername(sockfd: i32, addr: &mut [u8], addrlen: &mut usize) -> i32

Arguments

NameDescription
sockfd

The socket.

addr

The buffer into which the address is placed.

addrlen

A place into which the length of the address is placed.

Return value

Returns success or an error value.

See also