Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Align the KERN_PROC_CWD interface to semantics clos...



details:   https://anonhg.NetBSD.org/src/rev/61c0b1f39ced
branches:  trunk
changeset: 451747:61c0b1f39ced
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Jun 01 19:48:29 2019 +0000

description:
Align the KERN_PROC_CWD interface to semantics closer to KERN_PROC_PATHNAME

Allow specifying oldlenp as 0 and return size with success for oldp != NULL

diffstat:

 sys/kern/kern_proc.c |  9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diffs (30 lines):

diff -r f8005d7b4ee1 -r 61c0b1f39ced sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c      Sat Jun 01 19:32:19 2019 +0000
+++ b/sys/kern/kern_proc.c      Sat Jun 01 19:48:29 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_proc.c,v 1.231 2019/06/01 00:19:43 kamil Exp $    */
+/*     $NetBSD: kern_proc.c,v 1.232 2019/06/01 19:48:29 kamil Exp $    */
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.231 2019/06/01 00:19:43 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.232 2019/06/01 19:48:29 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -2599,11 +2599,6 @@
                return error;
 
        len = MAXPATHLEN * 4;
-       if (*oldlenp < 2) {
-               if (pid != -1)
-                       mutex_exit(p->p_lock);
-               return ERANGE;
-       }
 
        path = kmem_alloc(len, KM_SLEEP);
 



Home | Main Index | Thread Index | Old Index