return(ret);
} return(ret);
ssize_t __fd_kern_write(int fd, int flags, const void *buf, size_t nbytes){	semaphore *lock, *plock;	int ret;    while ((ret = machdep_sys_write(fd, buf, nbytes)) < OK) {         if (pthread_run->error == -EWOULDBLOCK) {			/* Lock queue */			lock = &fd_wait_lock;			while (SEMAPHORE_TEST_AND_SET(lock)) {				pthread_yield();			}			/* Lock pthread */			plock = &(pthread_run->lock);			while (SEMAPHORE_TEST_AND_SET(plock)) {				pthread_yield();			}			/* queue pthread for a FDW_WAIT */			pthread_run->next = fd_wait_write;			fd_wait_write = pthread_run;			pthread_run->fd = fd;			SEMAPHORE_RESET(lock);			reschedule(PS_FDW_WAIT);        } else {			pthread_run->error = ret;            break;        }    }    return(ret);}