new_timer.expires = jiffies + left; __set_current_state(TASK_INTERRUPTIBLE); add_timer(&new_timer); 
schedule_timeout_interruptible(left); 
static int common_nsleep(clockid_t which_clock,			 int flags, struct timespec *tsave){	struct timespec t, dum;	struct timer_list new_timer;	DECLARE_WAITQUEUE(abs_wqueue, current);	u64 rq_time = (u64)0;	s64 left;	int abs;	struct restart_block *restart_block =	    &current_thread_info()->restart_block;	abs_wqueue.flags = 0;	init_timer(&new_timer);	new_timer.expires = 0;	new_timer.data = (unsigned long) current;	new_timer.function = nanosleep_wake_up;	abs = flags & TIMER_ABSTIME;	if (restart_block->fn == clock_nanosleep_restart) {		/*		 * Interrupted by a non-delivered signal, pick up remaining		 * time and continue.  Remaining time is in arg2 & 3.		 */		restart_block->fn = do_no_restart_syscall;		rq_time = restart_block->arg3;		rq_time = (rq_time << 32) + restart_block->arg2;		if (!rq_time)			return -EINTR;		left = rq_time - get_jiffies_64();		if (left <= (s64)0)			return 0;	/* Already passed */	}	if (abs && (posix_clocks[which_clock].clock_get !=			    posix_clocks[CLOCK_MONOTONIC].clock_get))		add_wait_queue(&nanosleep_abs_wqueue, &abs_wqueue);	do {		t = *tsave;		if (abs || !rq_time) {			adjust_abs_time(&posix_clocks[which_clock], &t, abs,					&rq_time, &dum);		}		left = rq_time - get_jiffies_64();		if (left >= (s64)MAX_JIFFY_OFFSET)			left = (s64)MAX_JIFFY_OFFSET;		if (left < (s64)0)			break;		new_timer.expires = jiffies + left;		__set_current_state(TASK_INTERRUPTIBLE);		add_timer(&new_timer);		schedule();		del_timer_sync(&new_timer);		left = rq_time - get_jiffies_64();	} while (left > (s64)0 && !test_thread_flag(TIF_SIGPENDING));	if (abs_wqueue.task_list.next)		finish_wait(&nanosleep_abs_wqueue, &abs_wqueue);	if (left > (s64)0) {		/*		 * Always restart abs calls from scratch to pick up any		 * clock shifting that happened while we are away.		 */		if (abs)			return -ERESTARTNOHAND;		left *= TICK_NSEC;		tsave->tv_sec = div_long_long_rem(left, 						  NSEC_PER_SEC, 						  &tsave->tv_nsec);		/*		 * Restart works by saving the time remaing in 		 * arg2 & 3 (it is 64-bits of jiffies).  The other		 * info we need is the clock_id (saved in arg0). 		 * The sys_call interface needs the users 		 * timespec return address which _it_ saves in arg1.		 * Since we have cast the nanosleep call to a clock_nanosleep		 * both can be restarted with the same code.		 */		restart_block->fn = clock_nanosleep_restart;		restart_block->arg0 = which_clock;		/*		 * Caller sets arg1		 */		restart_block->arg2 = rq_time & 0xffffffffLL;		restart_block->arg3 = rq_time >> 32;		return -ERESTART_RESTARTBLOCK;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4eb9af2a8a431a832830f986fead7332dab27229/posix-timers.c/clean/kernel/posix-timers.c