Source-Changes-HG archive

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

[src/trunk]: src/lib/librefuse Implement a dummy pathconf() which always retu...



details:   https://anonhg.NetBSD.org/src/rev/dbbea3fd7882
branches:  trunk
changeset: 359764:dbbea3fd7882
user:      pho <pho%NetBSD.org@localhost>
date:      Sat Jan 22 08:00:17 2022 +0000

description:
Implement a dummy pathconf() which always returns EINVAL

diffstat:

 lib/librefuse/refuse.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r f3ed35ae17e1 -r dbbea3fd7882 lib/librefuse/refuse.c
--- a/lib/librefuse/refuse.c    Sat Jan 22 07:59:33 2022 +0000
+++ b/lib/librefuse/refuse.c    Sat Jan 22 08:00:17 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refuse.c,v 1.107 2022/01/22 07:59:33 pho Exp $ */
+/*     $NetBSD: refuse.c,v 1.108 2022/01/22 08:00:17 pho Exp $ */
 
 /*
  * Copyright © 2007 Alistair Crooks.  All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: refuse.c,v 1.107 2022/01/22 07:59:33 pho Exp $");
+__RCSID("$NetBSD: refuse.c,v 1.108 2022/01/22 08:00:17 pho Exp $");
 #endif /* !lint */
 
 /* We emit a compiler warning for anyone including <fuse.h> without
@@ -855,6 +855,19 @@
        return fuse_setattr(fuse, pn, path, va);
 }
 
+static int
+puffs_fuse_node_pathconf(struct puffs_usermount *pu, void *opc,
+       int name, __register_t *retval)
+{
+       /* Returning EINVAL for pathconf(2) means that this filesystem
+        * does not support an association of the given name with the
+        * file. This is necessary because the default error code
+        * returned by the puffs kernel module (ENOTSUPP) is not
+        * suitable for an errno from pathconf(2), and "ls -l"
+        * complains about it. */
+       return EINVAL;
+}
+
 /* ARGSUSED2 */
 static int
 puffs_fuse_node_open(struct puffs_usermount *pu, void *opc, int mode,
@@ -1296,6 +1309,7 @@
         PUFFSOP_SET(pops, puffs_fuse, node, lookup);
         PUFFSOP_SET(pops, puffs_fuse, node, getattr);
         PUFFSOP_SET(pops, puffs_fuse, node, setattr);
+       PUFFSOP_SET(pops, puffs_fuse, node, pathconf);
         PUFFSOP_SET(pops, puffs_fuse, node, readdir);
         PUFFSOP_SET(pops, puffs_fuse, node, readlink);
         PUFFSOP_SET(pops, puffs_fuse, node, mknod);



Home | Main Index | Thread Index | Old Index