Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/procfs rename some "cmdline" stuff now that it is...



details:   https://anonhg.NetBSD.org/src/rev/74ca7520a10b
branches:  trunk
changeset: 828763:74ca7520a10b
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 31 03:29:18 2017 +0000

description:
rename some "cmdline" stuff now that it is used to print environment too

diffstat:

 sys/miscfs/procfs/procfs.h         |   4 ++--
 sys/miscfs/procfs/procfs_cmdline.c |  23 ++++++++++-------------
 sys/miscfs/procfs/procfs_subr.c    |   8 ++++----
 sys/miscfs/procfs/procfs_vfsops.c  |   6 +++---
 4 files changed, 19 insertions(+), 22 deletions(-)

diffs (156 lines):

diff -r 088f9ebfe5ed -r 74ca7520a10b sys/miscfs/procfs/procfs.h
--- a/sys/miscfs/procfs/procfs.h        Sun Dec 31 03:08:49 2017 +0000
+++ b/sys/miscfs/procfs/procfs.h        Sun Dec 31 03:29:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs.h,v 1.73 2017/12/31 03:02:23 christos Exp $     */
+/*     $NetBSD: procfs.h,v 1.74 2017/12/31 03:29:18 christos Exp $     */
 
 /*
  * Copyright (c) 1993
@@ -208,7 +208,7 @@
     struct uio *);
 int procfs_domap(struct lwp *, struct proc *, struct pfsnode *,
     struct uio *, int);
-int procfs_docmdline(struct lwp *, struct proc *, struct pfsnode *,
+int procfs_doprocargs(struct lwp *, struct proc *, struct pfsnode *,
     struct uio *, int);
 int procfs_domeminfo(struct lwp *, struct proc *, struct pfsnode *,
     struct uio *);
diff -r 088f9ebfe5ed -r 74ca7520a10b sys/miscfs/procfs/procfs_cmdline.c
--- a/sys/miscfs/procfs/procfs_cmdline.c        Sun Dec 31 03:08:49 2017 +0000
+++ b/sys/miscfs/procfs/procfs_cmdline.c        Sun Dec 31 03:29:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_cmdline.c,v 1.29 2017/12/31 03:02:23 christos Exp $     */
+/*     $NetBSD: procfs_cmdline.c,v 1.30 2017/12/31 03:29:18 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.29 2017/12/31 03:02:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_cmdline.c,v 1.30 2017/12/31 03:29:18 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -46,7 +46,7 @@
 #include <uvm/uvm_extern.h>
 
 static int
-procfs_docmdline_helper(void *cookie, const void *src, size_t off, size_t len)
+procfs_doprocargs_helper(void *cookie, const void *src, size_t off, size_t len)
 {
        struct uio *uio = cookie;
        char *buf = __UNCONST(src);
@@ -58,10 +58,10 @@
 }
 
 /*
- * code for returning process's command line arguments
+ * code for returning process's command line arguments/environment
  */
 int
-procfs_docmdline(
+procfs_doprocargs(
     struct lwp *curl,
     struct proc *p,
     struct pfsnode *pfs,
@@ -74,7 +74,7 @@
 
        /* Don't allow writing. */
        if (uio->uio_rw != UIO_READ)
-               return (EOPNOTSUPP);
+               return EOPNOTSUPP;
 
        /*
         * Zombies don't have a stack, so we can't read their psstrings.
@@ -87,25 +87,22 @@
                if (0 == uio->uio_offset) {
                        error = uiomove(msg, 1, uio);
                        if (error)
-                               return (error);
+                               return error;
                }
                len = strlen(p->p_comm);
                if (len >= uio->uio_offset) {
                        start = uio->uio_offset - 1;
                        error = uiomove(p->p_comm + start, len - start, uio);
                        if (error)
-                               return (error);
+                               return error;
                }
                if (len + 2 >= uio->uio_offset) {
                        start = uio->uio_offset - 1 - len;
                        error = uiomove(msg + 1 + start, 2 - start, uio);
                }
-               return (error);
+               return error;
        }
 
        len = uio->uio_offset + uio->uio_resid;
-
-       error = copy_procargs(p, oid, &len,
-           procfs_docmdline_helper, uio);
-       return error;
+       return copy_procargs(p, oid, &len, procfs_doprocargs_helper, uio);
 }
diff -r 088f9ebfe5ed -r 74ca7520a10b sys/miscfs/procfs/procfs_subr.c
--- a/sys/miscfs/procfs/procfs_subr.c   Sun Dec 31 03:08:49 2017 +0000
+++ b/sys/miscfs/procfs/procfs_subr.c   Sun Dec 31 03:29:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_subr.c,v 1.110 2017/12/31 03:02:23 christos Exp $       */
+/*     $NetBSD: procfs_subr.c,v 1.111 2017/12/31 03:29:18 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.110 2017/12/31 03:02:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.111 2017/12/31 03:29:18 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -222,11 +222,11 @@
                break;
 
        case PFScmdline:
-               error = procfs_docmdline(curl, p, pfs, uio, KERN_PROC_ARGV);
+               error = procfs_doprocargs(curl, p, pfs, uio, KERN_PROC_ARGV);
                break;
 
        case PFSenviron:
-               error = procfs_docmdline(curl, p, pfs, uio, KERN_PROC_ENV);
+               error = procfs_doprocargs(curl, p, pfs, uio, KERN_PROC_ENV);
                break;
 
        case PFSmeminfo:
diff -r 088f9ebfe5ed -r 74ca7520a10b sys/miscfs/procfs/procfs_vfsops.c
--- a/sys/miscfs/procfs/procfs_vfsops.c Sun Dec 31 03:08:49 2017 +0000
+++ b/sys/miscfs/procfs/procfs_vfsops.c Sun Dec 31 03:29:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_vfsops.c,v 1.99 2017/12/31 03:02:23 christos Exp $      */
+/*     $NetBSD: procfs_vfsops.c,v 1.100 2017/12/31 03:29:18 christos Exp $     */
 
 /*
  * Copyright (c) 1993
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.99 2017/12/31 03:02:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.100 2017/12/31 03:29:18 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -395,7 +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 PFSenviron:        /* /proc/N/environ = -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-- */



Home | Main Index | Thread Index | Old Index