该bind()函数const struct sockaddr *addr作为参数之一。我可以传递一个临时sockaddr结构,它会在bind()调用后立即被删除吗?
void bindMe(int socket) {
struct sockaddr_in addr = {...};
bind(socket, (struct sockaddr_in*)&addr, sizeof(sockaddr_in));
}
// addr is no more exist after function calling,
// but I still want to work with the socket.
此外,POSIX 中有很多函数都指向结构。如何确定函数调用后是否可以释放结构?