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

Re: [MiNT] kern_ioctl() should return ENOSYS



> It returns 200

Mine doesn't. 

 ~ $ strace cat /kern/hz
Mshrink(0 /*zero*/, 0x2bd8000, 409280)  = 0
Ssystem(S_INQUIRE, 0, 0)                = 0
Ssystem(S_GETLVAL, 0x4ba, 0)            = 0x5f06
Ssystem(S_INQUIRE, 0, 0)                = 0
Ssystem(S_GETCOOKIE, 'MiNT', 0x2c3bdf4=[113]) = 0
Pdomain(DOM_MINT)                       = 0 (DOM_TOS)
Pgeteuid()                              = 0
Pgetuid()                               = 0
Pgetegid()                              = 0
Pgetgid()                               = 0
Dgetdrv()                               = 20 ('U')
Fcntl(1, =[18], TIOCGPGRP)              = 0
Ffstat64(0, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Fcntl(0, =[18], TIOCGPGRP)              = 0
Ffstat64(0, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Ffstat64(1, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Ffstat64(1, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Ffstat64(2, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Psysctl([CTL_HW, HW_PAGESIZE], 2, 8192, 4, NULL, 0) = 0
Malloc(8192)                            = 0x15fe000
Psysctl([CTL_HW, HW_PAGESIZE], 2, 8192, 4, NULL, 0) = 0
Ffstat64(1, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Pumask(0)                               = 0
Pumask(0)                               = 0
Fstat64(0, "/kern/hz", {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
Fopen("/kern/hz", O_RDONLY|O_DENYNONE)  = 6
Fcntl(6, 0, F_DUPFD)                    = 4
Fclose(6)                               = 0
Fcntl(4, 0, F_GETFD)                    = 0
Fcntl(4, 0x2c3b790, TIOCGPGRP)          = -EINVAL (Invalid argument)
Ffstat64(4, 0x2c3bd98)                  = -EINVAL (Invalid argument)
Fcntl(1, 45984430, F_GETFL)             = 0x42 (O_RDWR|O_DENYNONE)
Fcntl(1, 0, F_GETFD)                    = 0
Fseek(0, 2, SEEK_CUR)                   = -ESPIPE (Illegal seek)
Fwrite(2, "cat: ", 5cat: )                   = 5
Fwrite(2, "/kern/hz", 8/kern/hz)                = 8
Fwrite(2, ": Invalid argument", 18: Invalid argument)     = 18
Fwrite(2, "\n", 1
)                      = 1
Fclose(4)                               = 0
Fclose(1)                               = 0
Fclose(2)                               = 0
Fclose(0)                               = 0
Pterm(1)                                = ?
+++ exited with 1 +++
~ 
 
You will notice that the call to Fstat64() succeeds, but Ffstat64() on the already open file fails.
When i change kern_ioctl to return ENOSYS, i get

~ $ strace cat /kern/hz
Mshrink(0 /*zero*/, 0x2b8c000, 409280)  = 0
Ssystem(S_INQUIRE, 0, 0)                = 0
Ssystem(S_GETLVAL, 0x4ba, 0)            = 0xe1c
Ssystem(S_INQUIRE, 0, 0)                = 0
Ssystem(S_GETCOOKIE, 'MiNT', 0x2befdf4=[113]) = 0
Pdomain(DOM_MINT)                       = 0 (DOM_TOS)
Pgeteuid()                              = 0
Pgetuid()                               = 0
Pgetegid()                              = 0
Pgetgid()                               = 0
Dgetdrv()                               = 20 ('U')
Fcntl(1, =[18], TIOCGPGRP)              = 0
Ffstat64(0, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Fcntl(0, =[18], TIOCGPGRP)              = 0
Ffstat64(0, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Ffstat64(1, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Ffstat64(1, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Ffstat64(2, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Psysctl([CTL_HW, HW_PAGESIZE], 2, 8192, 4, NULL, 0) = 0
Malloc(8192)                            = 0x15aa000
Psysctl([CTL_HW, HW_PAGESIZE], 2, 8192, 4, NULL, 0) = 0
Ffstat64(1, {st_mode=S_IFCHR|0644, st_rdev=makedev(126, 1), ...}) = 0
Pumask(0)                               = 0
Pumask(0)                               = 0
Fstat64(0, "/kern/hz", {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
Fopen("/kern/hz", O_RDONLY|O_DENYNONE)  = 6
Fcntl(6, 0, F_DUPFD)                    = 4
Fclose(6)                               = 0
Fcntl(4, 0, F_GETFD)                    = 0
Fcntl(4, 0x2bef790, TIOCGPGRP)          = -ENOSYS (Function not implemented)
Fseek(0, 4, SEEK_CUR)                   = 0
Fseek(1, 4, SEEK_CUR)                   = 1
Fseek(0, 4, SEEK_SET)                   = 0
Ffstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
Malloc(81920)                           = 0x15ac000
Ffstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
Fcntl(4, 0, F_GETFL)                    = 0x40 (O_RDONLY|O_DENYNONE)
Fread(4, "200\n", 65536)                = 4
Fwrite(1, "200\n", 4200
)                   = 4
Fread(4, "", 65536)                     = 0
Fclose(4)                               = 0
Fclose(1)                               = 0
Fclose(2)                               = 0
Fclose(0)                               = 0
Pterm(0)                                = ?
+++ exited with 0 +++