/dev/zero open versus stat system call sequence?

/dev/zero open versus stat system call sequence?

Post by Richard Aulet » Sat, 06 Oct 2001 10:53:48

While debugging a NIS problem, I noticed that on most of our machines
Solaris 7 truss shows:

execve("/bin/ls", 0xEFFFED10, 0xEFFFED18)  argc = 1
open("/dev/zero", O_RDONLY)                     = 3
mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xEF

But on one system (Solaris 7) truss displays a different set of
system calls.

execve("/usr/bin/ls", 0xFFBEFBAC, 0xFFBEFBB4)  argc = 1
stat("/usr/bin/ls", 0xFFBEF8A0)                 = 0
open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
open("/usr/openwin/lib/libc.so.1", O_RDONLY)    Err#2 ENOENT
open("/usr/lib/libc.so.1", O_RDONLY)            = 3
fstat(3, 0xFFBEF63C)                            = 0
mmap(0x00000000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xF97A0000

Maybe I would attribute this to patch differences, or maybe the
hardware (Ultra 60 versus Sun Enterprise) but beyond speculating
on what the actual system call are doing, any explanation for
the difference?

-Rich Auletta