Subject: vnd is broken?
To: None <current-users@netbsd.org>
From: Denis Lagno <dlagno@rambler.ru>
List: current-users
Date: 05/09/2005 21:08:37
Hi,

I have the same behaviour with fresh 3.99.3 and 3.99.2:

# ll some_file
-rw-r--r--  1 root  wheel  8388608 Mar 13 15:45 some_file
# vnconfig -c vnd0 some_file
vnconfig: vnd0d: VNDIOCSET: Inappropriate ioctl for device
# vnconfig -c vnd1 some_file
# vnconfig -l
vnconfig: VNDIOCGET: Inappropriate ioctl for device

FWIW, here is output of ktrace:

# ktruss vnconfig -l
vnconfig:   2019 ktruss   emul(netbsd)
  2019 ktruss   fcntl(0x4, 0x3, 0)                 = 1
  2019 ktruss   fcntl(0x4, 0x4, 0x1)               = 0
  2019 ktruss   execve("/sbin/vnconfig", 0xbfbfeb68, 0xbfbfeb74) Err#2 ENOENT
  2019 vnconfig emul(netbsd)
  2019 vnconfig execve("/usr/sbin/vnconfig", 0xbfbfeb68, 0xbfbfeb74) JUSTRETURN
  2019 vnconfig mmap(0, 0x8000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 0xbdbe9000
  2019 vnconfig open("/etc/ld.so.conf", 0, 0)      = 3
  2019 vnconfig __fstat13(0x3, 0xbfbfea70)         = 0
  2019 vnconfig mmap(0, 0x69, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbdbe8000
  2019 vnconfig close(0x3)                         = 0
  2019 vnconfig munmap(0xbdbe8000, 0x69)           = 0
  2019 vnconfig open("/usr/pkg/lib/libutil.so.7", 0, 0) Err#2 ENOENT
  2019 vnconfig open("/usr/local/lib/libutil.so.7", 0, 0) Err#2 ENOENT
  2019 vnconfig open("/usr/local/X11R6/lib/libutil.so.7", 0, 0) Err#2 ENOENT
  2019 vnconfig open("/usr/lib/libutil.so.7", 0, 0) = 3
  2019 vnconfig __fstat13(0x3, 0xbfbfe760)         = 0
  2019 vnconfig mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbdbe8000
  2019 vnconfig munmap(0xbdbe8000, 0x1000)         = 0
  2019 vnconfig mmap(0, 0xe000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xbdbdb000
  2019 vnconfig mmap(0xbdbe6000, 0x1000, 0x3, 0x12, 0x3, 0, 0xb000, 0) = 0xbdbe6000
  2019 vnconfig mmap(0xbdbe7000, 0x2000, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xbdbe7000
  2019 vnconfig close(0x3)                         = 0
  2019 vnconfig open("/usr/pkg/lib/libc.so.12", 0, 0xbfbfe760) Err#2 ENOENT
  2019 vnconfig open("/usr/local/lib/libc.so.12", 0, 0xbfbfe760) Err#2 ENOENT
  2019 vnconfig open("/usr/local/X11R6/lib/libc.so.12", 0, 0xbfbfe760) Err#2 ENOENT
  2019 vnconfig open("/usr/lib/libc.so.12", 0, 0xbfbfe760) = 3
  2019 vnconfig __fstat13(0x3, 0xbfbfe760)         = 0
  2019 vnconfig mmap(0, 0x1000, 0x1, 0x1, 0x3, 0, 0, 0) = 0xbdbda000
  2019 vnconfig munmap(0xbdbda000, 0x1000)         = 0
  2019 vnconfig mmap(0, 0xdf000, 0x5, 0x2, 0x3, 0, 0, 0) = 0xbdafc000
  2019 vnconfig mmap(0xbdbc5000, 0x7000, 0x3, 0x12, 0x3, 0, 0xc9000, 0) = 0xbdbc5000
  2019 vnconfig mmap(0xbdbcc000, 0xf000, 0x3, 0x1012, 0xffffffff, 0, 0, 0) = 0xbdbcc000
  2019 vnconfig close(0x3)                         = 0
  2019 vnconfig __sysctl(0xbfbfea28, 0x2, 0xbfbfea20, 0xbfbfea24, 0, 0) = 0
  2019 vnconfig open("vnd0", 0, 0xbdbe4e53)        Err#2 ENOENT
  2019 vnconfig open("vnd0d", 0, 0xbdbe532f)       = 3
  2019 vnconfig ioctl(0x3, VNDIOCGET, 0xbfbfeac4)  Err#25 ENOTTY
       "\0\0\0\0\M-lV\M-?\M-=\M^WZ\M-9\M-="
  2019 vnconfig write(0x2, 0xbfbfe120, 0xa)        = 10
       "vnconfig: "
VNDIOCGET: Inappropriate ioctl for device
  2019 vnconfig write(0x2, 0xbfbfe140, 0x9)        = 9
       "VNDIOCGET"
  2019 vnconfig write(0x2, 0xbdbbd01f, 0x2)        = 2
       ": "
  2019 vnconfig issetugid()                        = 0
  2019 vnconfig issetugid()                        = 0
  2019 vnconfig __sysctl(0xbfbfdb58, 0x2, 0xbfbfdb50, 0xbfbfdb54, 0, 0) = 0
  2019 vnconfig readlink("/etc/malloc.conf", 0xbfbfdc00, 0x3f) Err#2 ENOENT
  2019 vnconfig mmap(0, 0x1000, 0x3, 0x1002, 0xffffffff, 0, 0, 0) = 0xbdafb000
  2019 vnconfig break(0x804aa2c)                   = 0
  2019 vnconfig break(0x804ba2c)                   = 0
  2019 vnconfig break(0x804c000)                   = 0
  2019 vnconfig break(0x804d000)                   = 0
  2019 vnconfig open("/usr/share/nls/nls.alias.db", 0, 0xbdbff25c) Err#2 ENOENT
  2019 vnconfig open("/usr/share/nls/nls.alias", 0, 0xbdbff25c) = 5
  2019 vnconfig fcntl(0x5, 0x2, 0x1)               = 0
  2019 vnconfig __fstat13(0x5, 0xbfbfdc50)         = 0
  2019 vnconfig mmap(0, 0x5f0, 0x1, 0x2, 0x5, 0, 0, 0) = 0xbdafa000
  2019 vnconfig close(0x5)                         = 0
  2019 vnconfig break(0x804e000)                   = 0
  2019 vnconfig munmap(0xbdafa000, 0x5f0)          = 0
  2019 vnconfig open("/usr/share/nls/C/libc.cat", 0, 0xbdbb9438) = 5
  2019 vnconfig __fstat13(0x5, 0xbfbfe0e0)         = 0
  2019 vnconfig mmap(0, 0x105b, 0x1, 0x1, 0x5, 0, 0, 0) = 0xbdaf9000
  2019 vnconfig close(0x5)                         = 0
  2019 vnconfig munmap(0xbdaf9000, 0x105b)         = 0
  2019 vnconfig write(0x2, 0xbfbfe120, 0x1f)       = 31
       "Inappropriate ioctl for device\n"
  2019 vnconfig exit(0x1)