int fd_lock(unsigned int fd, int lock_type)
int fd_lock(unsigned int fd, int lock_type, struct timespec * timeout)
int fd_lock(unsigned int fd, int lock_type){	semaphore *lock;	int error;	if (fd < dtablesize) { 		lock = &(fd_table[fd]->lock);		while (SEMAPHORE_TEST_AND_SET(lock)) {			pthread_yield();		}		error = fd_basic_lock(fd, lock_type, lock);		SEMAPHORE_RESET(lock);		return(error);	}	return(NOTOK);}