NetBSD-Bugs archive

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

Re: pkg/57145: gmake: *** INTERNAL: readdir: Operation not supported. Stop.



The following reply was made to PR kern/57145; it has been noted by GNATS.

From: Andrew Cagney <andrew.cagney%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: mrg%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: pkg/57145: gmake: *** INTERNAL: readdir: Operation not supported. Stop.
Date: Sat, 7 Sep 2024 14:56:51 -0400

 This is after a reboot, /source and /testing are automounted.
 
 [root@netbsd ~]# cd /source
 
 [root@netbsd source]# df
 Filesystem     512-blocks         Used        Avail %Cap Mounted on
 /dev/wd0a        20643484      4176144     15435168  21% /
 kernfs                  2            2            0 100% /kern
 ptyfs                   2            2            0 100% /dev/pts
 procfs                  8            8            0 100% /proc
 tmpfs             1048312            0      1048312   0% /var/shm
 tmpfs             3897616            8      3897608   0% /tmp
 map -noauto             0            0            0 100% /source
 map -noauto             0            0            0 100% /testing
 
 [root@netbsd source]# mount
 
 /dev/wd0a on / type ffs (noatime, local)
 kernfs on /kern type kernfs (local)
 ptyfs on /dev/pts type ptyfs (local)
 procfs on /proc type procfs (local)
 tmpfs on /var/shm type tmpfs (local)
 tmpfs on /tmp type tmpfs (local)
 map -noauto on /source type autofs
 map -noauto on /testing type autofs
 
 Note that the mount of /source hasn't yet triggered.  Now what I
 believe is the test case:
 
 [root@netbsd source]# cc open-lseek.c
 [root@netbsd source]# ./a.out
 missing mount-point[root@netbsd source 1]# ./a.out /testing
 chdir(/testing)
 flags 600004 vs 600004
 mode f0 vs f0
 open(.,600004,f0)
 lseek(3, 0, SEEK_CUR)
 lseek: Operation not supported
 
 for comparison:
 
 [root@freebsd source]# cc open-lseek.c
 [root@freebsd source]# ./a.out
 missing mount-point[root@freebsd source 1]# ./a.out /testing
 chdir(/testing)
 flags 120004 vs 120004
 mode f0 vs f0
 open(.,120004,f0)
 lseek(3, 0, SEEK_CUR)
 [root@freebsd source]# df
 Filesystem                                     1K-blocks      Used
 Avail Capacity  Mounted on
 /dev/vtbd0s1a                                    9638812   5610152
 3257556    63%    /
 devfs                                                  1         0
    1     0%    /dev
 map -noauto                                            0         0
    0   100%    /source
 map -noauto                                            0         0
    0   100%    /testing
 192.168.234.1:/home/libreswan/mainline         960302096 886320800
 25126872    97%    /source
 192.168.234.1:/home/libreswan/mainline/testing 960302096 886320800
 25126872    97%    /testing
 
 and the code:
 
 #include <stdio.h>
 #include <stdlib.h> /* for exit() */
 #include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/param.h>
 #include <sys/mount.h>
 
 static void barf(const char *what)
 {
 perror(what);
 exit(1);
 }
 
 static unsigned flags(const char *what, unsigned actual, unsigned expected)
 {
 printf("%s %x vs %x\n", what, actual, expected);
 return expected;
 }
 
 int main(int argc, char *argv[])
 {
 if (argc < 2) {
 fprintf(stderr, "missing mount-point");
 exit(1);
 }
 
 const char *mount = argv[1];
 
 printf("chdir(%s)\n", mount);
 chdir(mount);
 if (errno > 0) {
 barf("chdir");
 }
 
 unsigned open_flags = flags("flags", O_DIRECTORY|O_CLOEXEC|O_NONBLOCK,
 O_DIRECTORY|O_CLOEXEC|O_NONBLOCK);
 unsigned open_mode = flags("mode", S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP, 0xf0);
 printf("open(%s,%x,%x)\n", ".", open_flags, open_mode);
 int fd = open(".", open_flags, open_mode);
 if (errno > 0) {
 barf("open");
 }
 
 printf("lseek(%d, 0, SEEK_CUR)\n", fd);
 lseek(fd, /*offset*/0, /*wence*/SEEK_CUR);
 if (errno > 0) {
 barf("lseek");
 }
 
 exit(0);
 }
 


Home | Main Index | Thread Index | Old Index