* @brief Retrieves the local address of a socket. * * This function obtains the local address (IP address and port) associated with the socket 's'. * It is typically used to determine the local address and port of a bound or connected socket. * * @param s The file descriptor of the socket. * @param name A pointer to a 'sockaddr' structure that will be filled with the local address
| 237 | * @see getpeername() Retrieves the address of the peer connected to a socket. |
| 238 | */ |
| 239 | int getsockname(int s, struct sockaddr *name, socklen_t *namelen) |
| 240 | { |
| 241 | int socket = dfs_net_getsocket(s); |
| 242 | |
| 243 | return sal_getsockname(socket, name, namelen); |
| 244 | } |
| 245 | RTM_EXPORT(getsockname); |
| 246 | |
| 247 | /** |
no test coverage detected