Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/miscfs/procfs Add an environ node
details: https://anonhg.NetBSD.org/src/rev/d536f7175b9f
branches: trunk
changeset: 828760:d536f7175b9f
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 31 03:02:23 2017 +0000
description:
Add an environ node
diffstat:
sys/miscfs/procfs/procfs.h | 5 +++--
sys/miscfs/procfs/procfs_cmdline.c | 9 +++++----
sys/miscfs/procfs/procfs_subr.c | 11 ++++++++---
sys/miscfs/procfs/procfs_vfsops.c | 5 +++--
sys/miscfs/procfs/procfs_vnops.c | 7 +++++--
5 files changed, 24 insertions(+), 13 deletions(-)
diffs (170 lines):
diff -r 702ca0163c1d -r d536f7175b9f sys/miscfs/procfs/procfs.h
--- a/sys/miscfs/procfs/procfs.h Sun Dec 31 00:53:29 2017 +0000
+++ b/sys/miscfs/procfs/procfs.h Sun Dec 31 03:02:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs.h,v 1.72 2017/08/28 00:46:07 kamil Exp $ */
+/* $NetBSD: procfs.h,v 1.73 2017/12/31 03:02:23 christos Exp $ */
/*
* Copyright (c) 1993
@@ -94,6 +94,7 @@
PFSnotepg, /* process group notifier */
PFSmap, /* memory map */
PFScmdline, /* process command line args */
+ PFSenviron, /* process environment */
PFSmeminfo, /* system memory info (if -o linux) */
PFScpuinfo, /* CPU info (if -o linux) */
PFSmaps, /* memory map, Linux style (if -o linux) */
@@ -208,7 +209,7 @@
int procfs_domap(struct lwp *, struct proc *, struct pfsnode *,
struct uio *, int);
int procfs_docmdline(struct lwp *, struct proc *, struct pfsnode *,
- struct uio *);
+ struct uio *, int);
int procfs_domeminfo(struct lwp *, struct proc *, struct pfsnode *,
struct uio *);
int procfs_dodevices(struct lwp *, struct proc *, struct pfsnode *,
diff -r 702ca0163c1d -r d536f7175b9f sys/miscfs/procfs/procfs_cmdline.c
--- a/sys/miscfs/procfs/procfs_cmdline.c Sun Dec 31 00:53:29 2017 +0000
+++ b/sys/miscfs/procfs/procfs_cmdline.c Sun Dec 31 03:02:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_cmdline.c,v 1.28 2011/03/04 22:25:32 joerg Exp $ */
+/* $NetBSD: procfs_cmdline.c,v 1.29 2017/12/31 03:02:23 christos Exp $ */
/*
* Copyright (c) 1999 Jaromir Dolecek <dolecek%ics.muni.cz@localhost>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_cmdline.c,v 1.28 2011/03/04 22:25:32 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_cmdline.c,v 1.29 2017/12/31 03:02:23 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -65,7 +65,8 @@
struct lwp *curl,
struct proc *p,
struct pfsnode *pfs,
- struct uio *uio
+ struct uio *uio,
+ int oid
)
{
size_t len, start;
@@ -104,7 +105,7 @@
len = uio->uio_offset + uio->uio_resid;
- error = copy_procargs(p, KERN_PROC_ARGV, &len,
+ error = copy_procargs(p, oid, &len,
procfs_docmdline_helper, uio);
return error;
}
diff -r 702ca0163c1d -r d536f7175b9f sys/miscfs/procfs/procfs_subr.c
--- a/sys/miscfs/procfs/procfs_subr.c Sun Dec 31 00:53:29 2017 +0000
+++ b/sys/miscfs/procfs/procfs_subr.c Sun Dec 31 03:02:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_subr.c,v 1.109 2017/08/28 00:46:07 kamil Exp $ */
+/* $NetBSD: procfs_subr.c,v 1.110 2017/12/31 03:02:23 christos Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.109 2017/08/28 00:46:07 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.110 2017/12/31 03:02:23 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -114,6 +114,7 @@
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/kauth.h>
+#include <sys/sysctl.h>
#include <miscfs/procfs/procfs.h>
@@ -221,7 +222,11 @@
break;
case PFScmdline:
- error = procfs_docmdline(curl, p, pfs, uio);
+ error = procfs_docmdline(curl, p, pfs, uio, KERN_PROC_ARGV);
+ break;
+
+ case PFSenviron:
+ error = procfs_docmdline(curl, p, pfs, uio, KERN_PROC_ENV);
break;
case PFSmeminfo:
diff -r 702ca0163c1d -r d536f7175b9f sys/miscfs/procfs/procfs_vfsops.c
--- a/sys/miscfs/procfs/procfs_vfsops.c Sun Dec 31 00:53:29 2017 +0000
+++ b/sys/miscfs/procfs/procfs_vfsops.c Sun Dec 31 03:02:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_vfsops.c,v 1.98 2017/08/28 00:46:07 kamil Exp $ */
+/* $NetBSD: procfs_vfsops.c,v 1.99 2017/12/31 03:02:23 christos Exp $ */
/*
* Copyright (c) 1993
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.98 2017/08/28 00:46:07 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.99 2017/12/31 03:02:23 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -395,6 +395,7 @@
case PFSstatus: /* /proc/N/status = -r--r--r-- */
case PFSstat: /* /proc/N/stat = -r--r--r-- */
case PFScmdline: /* /proc/N/cmdline = -r--r--r-- */
+ case PFSenviron: /* /proc/N/cmdline = -r--r--r-- */
case PFSemul: /* /proc/N/emul = -r--r--r-- */
case PFSmeminfo: /* /proc/meminfo = -r--r--r-- */
case PFScpustat: /* /proc/stat = -r--r--r-- */
diff -r 702ca0163c1d -r d536f7175b9f sys/miscfs/procfs/procfs_vnops.c
--- a/sys/miscfs/procfs/procfs_vnops.c Sun Dec 31 00:53:29 2017 +0000
+++ b/sys/miscfs/procfs/procfs_vnops.c Sun Dec 31 03:02:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_vnops.c,v 1.201 2017/12/01 19:01:34 christos Exp $ */
+/* $NetBSD: procfs_vnops.c,v 1.202 2017/12/31 03:02:23 christos Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.201 2017/12/01 19:01:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.202 2017/12/31 03:02:23 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -171,6 +171,7 @@
{ DT_REG, N("map"), PFSmap, procfs_validmap },
{ DT_REG, N("maps"), PFSmaps, procfs_validmap },
{ DT_REG, N("cmdline"), PFScmdline, NULL },
+ { DT_REG, N("environ"), PFSenviron, NULL },
{ DT_REG, N("exe"), PFSexe, procfs_validfile },
{ DT_LNK, N("cwd"), PFScwd, NULL },
{ DT_LNK, N("root"), PFSchroot, NULL },
@@ -728,6 +729,7 @@
case PFSnote:
case PFSnotepg:
case PFScmdline:
+ case PFSenviron:
case PFSemul:
case PFSstatm:
@@ -860,6 +862,7 @@
case PFSnote:
case PFSnotepg:
case PFScmdline:
+ case PFSenviron:
case PFSmeminfo:
case PFSdevices:
case PFScpuinfo:
Home |
Main Index |
Thread Index |
Old Index