Module Name:    src
Committed By:   riastradh
Date:           Mon Mar 10 21:21:20 UTC 2025

Modified Files:
        src/usr.sbin/puffs/mount_9p: ninepuffs.c node.c

Log Message:
mount_9p(8): Implement pathconf stub.

Doesn't actually do anything useful -- it just returns EINVAL as
pathconf is supposed to for unknown pathconf key names; by default, it
will return ENOTSUPP, which leads applications like ls(1) to print:

ls: /mnt/.git: Operation not supported

This is a little silly; perhaps puffs should use EINVAL itself instead
of ENOTSUPP.  But this change is less risky for now.

PR bin/58768: mount_9p: missing pathconf(2) support


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/puffs/mount_9p/ninepuffs.c
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/puffs/mount_9p/node.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/puffs/mount_9p/ninepuffs.c
diff -u src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.34 src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.35
--- src/usr.sbin/puffs/mount_9p/ninepuffs.c:1.34	Thu Feb 10 09:29:39 2022
+++ src/usr.sbin/puffs/mount_9p/ninepuffs.c	Mon Mar 10 21:21:20 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: ninepuffs.c,v 1.34 2022/02/10 09:29:39 ozaki-r Exp $	*/
+/*	$NetBSD: ninepuffs.c,v 1.35 2025/03/10 21:21:20 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ninepuffs.c,v 1.34 2022/02/10 09:29:39 ozaki-r Exp $");
+__RCSID("$NetBSD: ninepuffs.c,v 1.35 2025/03/10 21:21:20 riastradh Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -240,6 +240,7 @@ main(int argc, char *argv[])
 	PUFFSOP_SET(pops, puffs9p, node, rename);
 	PUFFSOP_SET(pops, puffs9p, node, inactive);
 	PUFFSOP_SET(pops, puffs9p, node, reclaim);
+	PUFFSOP_SET(pops, puffs9p, node, pathconf);
 #if 0
 	PUFFSOP_SET(pops, puffs9p, node, mknod);
 #endif

Index: src/usr.sbin/puffs/mount_9p/node.c
diff -u src/usr.sbin/puffs/mount_9p/node.c:1.31 src/usr.sbin/puffs/mount_9p/node.c:1.32
--- src/usr.sbin/puffs/mount_9p/node.c:1.31	Wed Mar  2 07:48:20 2022
+++ src/usr.sbin/puffs/mount_9p/node.c	Mon Mar 10 21:21:20 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: node.c,v 1.31 2022/03/02 07:48:20 ozaki-r Exp $	*/
+/*	$NetBSD: node.c,v 1.32 2025/03/10 21:21:20 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: node.c,v 1.31 2022/03/02 07:48:20 ozaki-r Exp $");
+__RCSID("$NetBSD: node.c,v 1.32 2025/03/10 21:21:20 riastradh Exp $");
 #endif /* !lint */
 
 #include <assert.h>
@@ -646,3 +646,15 @@ puffs9p_node_reclaim(struct puffs_usermo
 
 	return 0;
 }
+
+int
+puffs9p_node_pathconf(struct puffs_usermount *pu, void *opc, int name,
+    register_t *retval)
+{
+
+	/*
+	 * Without this, pathconf(2) and fpathconf(2) fail with
+	 * ENOTSUPP instead of EINVAL.
+	 */
+	return EINVAL;
+}

Reply via email to