mtab and /proc/meminfo

View: New views
2 Messages — Rating Filter:   Alert me  

mtab and /proc/meminfo

by Victor Hugo Erminpour :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello all,

I'm running strace against 2.05b.0(1)-release and I can
see that bash is opening /etc/mtab and /proc/meminfo,
but I can't find any reference to this in the code.
Also, this appears when I run bash as "/bin/sh -c <command>".

Here's the strace output:

{{{
...
open("/etc/mtab", O_RDONLY)             = 3    
fstat64(3, {st_mode=S_IFREG|0644, st_size=22472, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb73e2000
read(3, "/dev/cciss/c0d0p2 / ext3 rw 0 0\n"..., 4096) = 4096
close(3)                                = 0    
munmap(0xb73e2000, 4096)                = 0    
open("/proc/meminfo", O_RDONLY)         = 3    
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb73e2000
read(3, "        total:    used:    free:"..., 4096) = 781
close(3)                                = 0    
munmap(0xb73e2000, 4096)
...
}}}

The code seems to be in shell.c, but again no specific
references to mtab or /proc/meminfo.  Any ideas?

Thanks,
--Victor






Re: mtab and /proc/meminfo

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Victor Hugo Erminpour on 10/20/2009 8:57 PM:
> I'm running strace against 2.05b.0(1)-release and I can
> see that bash is opening /etc/mtab and /proc/meminfo,
> but I can't find any reference to this in the code.

Have you considered that this might be libc's doing, as part of
implementing malloc()?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkregOMACgkQ84KuGfSFAYD9DwCgkg1cdzxYpz0tRQyPkh8FH3nr
tWEAn3IPwgpQJ02USFBHbZHfFVXBDCEv
=QFWj
-----END PGP SIGNATURE-----