oc.tv_sec -= now.tv_sec; oc.tv_nsec -= now.tv_nsec; /* * Normalize... */ while ((oc.tv_nsec - NSEC_PER_SEC) >= 0) { oc.tv_nsec -= NSEC_PER_SEC; oc.tv_sec++; } while ((oc.tv_nsec) < 0) { oc.tv_nsec += NSEC_PER_SEC; oc.tv_sec--; } 
set_normalized_timespec(&oc, oc.tv_sec - now.tv_sec, oc.tv_nsec - now.tv_nsec); 
static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, 			   int abs, u64 *exp, struct timespec *wall_to){	struct timespec now;	struct timespec oc = *tp;	u64 jiffies_64_f;	int rtn =0;	if (abs) {		/*		 * The mask pick up the 4 basic clocks 		 */		if (!((clock - &posix_clocks[0]) & ~CLOCKS_MASK)) {			jiffies_64_f = do_posix_clock_monotonic_gettime_parts(				&now,  wall_to);			/*			 * If we are doing a MONOTONIC clock			 */			if((clock - &posix_clocks[0]) & CLOCKS_MONO){				now.tv_sec += wall_to->tv_sec;				now.tv_nsec += wall_to->tv_nsec;			}		} else {			/*			 * Not one of the basic clocks			 */			clock->clock_get(clock - posix_clocks, &now);			jiffies_64_f = get_jiffies_64();		}		/*		 * Take away now to get delta		 */		oc.tv_sec -= now.tv_sec;		oc.tv_nsec -= now.tv_nsec;		/*		 * Normalize...		 */		while ((oc.tv_nsec - NSEC_PER_SEC) >= 0) {			oc.tv_nsec -= NSEC_PER_SEC;			oc.tv_sec++;		}		while ((oc.tv_nsec) < 0) {			oc.tv_nsec += NSEC_PER_SEC;			oc.tv_sec--;		}	}else{		jiffies_64_f = get_jiffies_64();	}	/*	 * Check if the requested time is prior to now (if so set now)	 */	if (oc.tv_sec < 0)		oc.tv_sec = oc.tv_nsec = 0;	if (oc.tv_sec | oc.tv_nsec)		set_normalized_timespec(&oc, oc.tv_sec,					oc.tv_nsec + clock->res);	tstojiffie(&oc, clock->res, exp);	/*	 * Check if the requested time is more than the timer code	 * can handle (if so we error out but return the value too).	 */	if (*exp > ((u64)MAX_JIFFY_OFFSET))			/*			 * This is a considered response, not exactly in			 * line with the standard (in fact it is silent on			 * possible overflows).  We assume such a large 			 * value is ALMOST always a programming error and			 * try not to compound it by setting a really dumb			 * value.			 */			rtn = -EINVAL;	/*	 * return the actual jiffies expire time, full 64 bits	 */	*exp += jiffies_64_f;	return rtn;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/78fa74a23b16bdb0d944272b696915c4e0bb3ee1/posix-timers.c/buggy/kernel/posix-timers.c