Deleted Added
full compact
kern_time.c (248186) kern_time.c (253325)
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)kern_time.c 8.1 (Berkeley) 6/10/93
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)kern_time.c 8.1 (Berkeley) 6/10/93
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/kern/kern_time.c 248186 2013-03-12 06:58:49Z mav $");
33__FBSDID("$FreeBSD: head/sys/kern/kern_time.c 253325 2013-07-13 19:32:50Z kib $");
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/limits.h>
38#include <sys/clock.h>
39#include <sys/lock.h>
40#include <sys/mutex.h>
41#include <sys/sysproto.h>

--- 250 unchanged lines hidden (view full) ---

292 tid = clock_id & CPUCLOCK_ID_MASK;
293 td2 = tdfind(tid, p->p_pid);
294 if (td2 == NULL)
295 return (EINVAL);
296 get_thread_cputime(td2, ats);
297 PROC_UNLOCK(td2->td_proc);
298 } else {
299 pid = clock_id & CPUCLOCK_ID_MASK;
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/limits.h>
38#include <sys/clock.h>
39#include <sys/lock.h>
40#include <sys/mutex.h>
41#include <sys/sysproto.h>

--- 250 unchanged lines hidden (view full) ---

292 tid = clock_id & CPUCLOCK_ID_MASK;
293 td2 = tdfind(tid, p->p_pid);
294 if (td2 == NULL)
295 return (EINVAL);
296 get_thread_cputime(td2, ats);
297 PROC_UNLOCK(td2->td_proc);
298 } else {
299 pid = clock_id & CPUCLOCK_ID_MASK;
300 p2 = pfind(pid);
301 if (p2 == NULL)
300 error = pget(pid, PGET_CANSEE, &p2);
301 if (error != 0)
302 return (EINVAL);
302 return (EINVAL);
303 error = p_cansee(td, p2);
304 if (error) {
305 PROC_UNLOCK(p2);
306 return (EINVAL);
307 }
308 get_process_cputime(p2, ats);
309 PROC_UNLOCK(p2);
310 }
311 return (0);
312}
313
314int
315kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats)

--- 1320 unchanged lines hidden ---
303 get_process_cputime(p2, ats);
304 PROC_UNLOCK(p2);
305 }
306 return (0);
307}
308
309int
310kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats)

--- 1320 unchanged lines hidden ---