static int (*real_close)(int);
LOAD_FUNCTION(real_close, "close");
static int (*real_close)(int);
LOAD_FUNCTION(real_close, "close");
struct list *entry = remove_sockfd(fd);
if (entry == NULL) {
DBG("close(%d): sockfd not found\n", fd);
return real_close(fd);
}
assert(fd == entry->orig_sockfd);
struct list *entry = remove_sockfd(fd);
if (entry == NULL) {
DBG("close(%d): sockfd not found\n", fd);
return real_close(fd);
}
assert(fd == entry->orig_sockfd);
static int (*real_bind)(int, const struct sockaddr *, socklen_t);
LOAD_FUNCTION(real_bind, "bind");
static int (*real_bind)(int, const struct sockaddr *, socklen_t);
LOAD_FUNCTION(real_bind, "bind");
if (addr == NULL || addrlen < sizeof(addr->sa_family)
|| addr->sa_family == AF_UNIX
|| addr->sa_family == AF_LOCAL) {
if (addr == NULL || addrlen < sizeof(addr->sa_family)
|| addr->sa_family == AF_UNIX
|| addr->sa_family == AF_LOCAL) {
struct list *entry = find_sockfd(sockfd);
if (!entry) {
DBG("accept(%d, ..): sockfd not found\n", sockfd);
struct list *entry = find_sockfd(sockfd);
if (!entry) {
DBG("accept(%d, ..): sockfd not found\n", sockfd);
if (addr == NULL || addrlen < sizeof(addr->sa_family)
|| addr->sa_family == AF_UNIX
|| addr->sa_family == AF_LOCAL) {
if (addr == NULL || addrlen < sizeof(addr->sa_family)
|| addr->sa_family == AF_UNIX
|| addr->sa_family == AF_LOCAL) {