return(ret);
fd_unlock(fd, FD_RDWR); } else { pthread_mutex_unlock(mutex); } break; } } else {  pthread_mutex_unlock(&fd_table_mutex); ret = machdep_sys_close(fd); } if( ret < 0) { SET_ERRNO(-ret); ret = -1; } return(ret);
int close(int fd){	union fd_data realfd;	int ret, flags;	if ((ret = fd_lock(fd, FD_RDWR)) == OK) {		flags = fd_table[fd]->flags;		realfd = fd_table[fd]->fd;		if (fd_free(fd) == OK) {     		ret = fd_table[fd]->ops->close(realfd, flags);		}		fd_unlock(fd, FD_RDWR);	}	return(ret);}