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/08f0c9db8835
branches:  trunk
changeset: 999438:08f0c9db8835
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 ab257138b889 -r 08f0c9db8835 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