Thu Sep 24 14:33:31 2015 UTC ()
Add proc_find_locked(), which returns the process locked and does the
sysctl access check.


(christos)
diff -r1.322 -r1.323 src/sys/sys/proc.h

cvs diff -r1.322 -r1.323 src/sys/sys/proc.h (expand / switch to unified diff)

--- src/sys/sys/proc.h 2015/06/19 10:18:19 1.322
+++ src/sys/sys/proc.h 2015/09/24 14:33:31 1.323
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: proc.h,v 1.322 2015/06/19 10:18:19 martin Exp $ */ 1/* $NetBSD: proc.h,v 1.323 2015/09/24 14:33:31 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -448,26 +448,27 @@ extern u_int nprocs; /* Current number @@ -448,26 +448,27 @@ extern u_int nprocs; /* Current number
448extern int maxproc; /* Max number of procs */ 448extern int maxproc; /* Max number of procs */
449#define vmspace_kernel() (proc0.p_vmspace) 449#define vmspace_kernel() (proc0.p_vmspace)
450 450
451extern kmutex_t *proc_lock; 451extern kmutex_t *proc_lock;
452extern struct proclist allproc; /* List of all processes */ 452extern struct proclist allproc; /* List of all processes */
453extern struct proclist zombproc; /* List of zombie processes */ 453extern struct proclist zombproc; /* List of zombie processes */
454 454
455extern struct proc *initproc; /* Process slots for init, pager */ 455extern struct proc *initproc; /* Process slots for init, pager */
456 456
457extern const struct proclist_desc proclists[]; 457extern const struct proclist_desc proclists[];
458 458
459extern struct pool ptimer_pool; /* Memory pool for ptimers */ 459extern struct pool ptimer_pool; /* Memory pool for ptimers */
460 460
 461int proc_find_locked(struct lwp *, struct proc **, pid_t);
461proc_t * proc_find_raw(pid_t); 462proc_t * proc_find_raw(pid_t);
462proc_t * proc_find(pid_t); /* Find process by ID */ 463proc_t * proc_find(pid_t); /* Find process by ID */
463struct pgrp * pgrp_find(pid_t); /* Find process group by ID */ 464struct pgrp * pgrp_find(pid_t); /* Find process group by ID */
464 465
465void procinit(void); 466void procinit(void);
466void procinit_sysctl(void); 467void procinit_sysctl(void);
467int proc_enterpgrp(struct proc *, pid_t, pid_t, bool); 468int proc_enterpgrp(struct proc *, pid_t, pid_t, bool);
468void proc_leavepgrp(struct proc *); 469void proc_leavepgrp(struct proc *);
469void proc_sesshold(struct session *); 470void proc_sesshold(struct session *);
470void proc_sessrele(struct session *); 471void proc_sessrele(struct session *);
471void fixjobc(struct proc *, struct pgrp *, int); 472void fixjobc(struct proc *, struct pgrp *, int);
472 473
473int tsleep(wchan_t, pri_t, const char *, int); 474int tsleep(wchan_t, pri_t, const char *, int);