Module Name: src
Committed By: kamil
Date: Sat Jun 1 19:48:29 UTC 2019
Modified Files:
src/sys/kern: kern_proc.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/sys/kern/kern_proc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.231 src/sys/kern/kern_proc.c:1.232
--- src/sys/kern/kern_proc.c:1.231 Sat Jun 1 00:19:43 2019
+++ src/sys/kern/kern_proc.c Sat Jun 1 19:48:29 2019
@@ -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 @@ fill_cwd(struct lwp *l, pid_t pid, void
return error;
len = MAXPATHLEN * 4;
- if (*oldlenp < 2) {
- if (pid != -1)
- mutex_exit(p->p_lock);
- return ERANGE;
- }
path = kmem_alloc(len, KM_SLEEP);