linprocfs.c (94620) | linprocfs.c (96886) |
---|---|
1/* 2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav 3 * Copyright (c) 1999 Pierre Beyssac 4 * Copyright (c) 1993 Jan-Simon Pendry 5 * Copyright (c) 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 40 * | 1/* 2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav 3 * Copyright (c) 1999 Pierre Beyssac 4 * Copyright (c) 1993 Jan-Simon Pendry 5 * Copyright (c) 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 40 * |
41 * $FreeBSD: head/sys/compat/linprocfs/linprocfs.c 94620 2002-04-13 23:09:41Z jhb $ | 41 * $FreeBSD: head/sys/compat/linprocfs/linprocfs.c 96886 2002-05-19 00:14:50Z jhb $ |
42 */ 43 44#include <sys/param.h> 45#include <sys/queue.h> 46#include <sys/blist.h> 47#include <sys/conf.h> 48#include <sys/dkstat.h> 49#include <sys/exec.h> --- 618 unchanged lines hidden (view full) --- 668 * for the currept process and just p->p_comm for all other 669 * processes. 670 * Note that if the argv is no longer available, we deliberately 671 * don't fall back on p->p_comm or return an error: the authentic 672 * Linux behaviour is to return zero-length in this case. 673 */ 674 675 PROC_LOCK(p); | 42 */ 43 44#include <sys/param.h> 45#include <sys/queue.h> 46#include <sys/blist.h> 47#include <sys/conf.h> 48#include <sys/dkstat.h> 49#include <sys/exec.h> --- 618 unchanged lines hidden (view full) --- 668 * for the currept process and just p->p_comm for all other 669 * processes. 670 * Note that if the argv is no longer available, we deliberately 671 * don't fall back on p->p_comm or return an error: the authentic 672 * Linux behaviour is to return zero-length in this case. 673 */ 674 675 PROC_LOCK(p); |
676 if (p->p_args && (ps_argsopen || !p_cansee(td->td_proc, p))) { | 676 if (p->p_args && (ps_argsopen || !p_cansee(td, p))) { |
677 sbuf_bcpy(sb, p->p_args->ar_args, p->p_args->ar_length); 678 PROC_UNLOCK(p); 679 } else if (p != td->td_proc) { 680 PROC_UNLOCK(p); 681 sbuf_printf(sb, "%.*s", MAXCOMLEN, p->p_comm); 682 } else { 683 PROC_UNLOCK(p); 684 error = copyin((void*)PS_STRINGS, &pstr, sizeof(pstr)); --- 152 unchanged lines hidden --- | 677 sbuf_bcpy(sb, p->p_args->ar_args, p->p_args->ar_length); 678 PROC_UNLOCK(p); 679 } else if (p != td->td_proc) { 680 PROC_UNLOCK(p); 681 sbuf_printf(sb, "%.*s", MAXCOMLEN, p->p_comm); 682 } else { 683 PROC_UNLOCK(p); 684 error = copyin((void*)PS_STRINGS, &pstr, sizeof(pstr)); --- 152 unchanged lines hidden --- |