From: DervishD <lkml@dervishd.net>
To: Paulo Marques <pmarques@grupopie.com>
Cc: Andreas Schwab <schwab@suse.de>, Olaf Hering <olh@suse.de>,
Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org
Subject: Re: OOM & [OT] util-linux-2.12e
Date: Mon, 20 Sep 2004 14:11:54 +0200 [thread overview]
Message-ID: <20040920121154.GJ5684@DervishD> (raw)
In-Reply-To: <414EC43B.8040507@grupopie.com>
Hi Paulo :)
* Paulo Marques <pmarques@grupopie.com> dixit:
> >>>>- fix all broken apps that still rely on mtab. like GNU df(1)
> >>>df does not rely on /etc/mtab. It relies on getmntent.
> >> Then my GNU df has any problem :???
> >No, if any then getmntent.
> I don't get this. From "man getmntent" it seems that getmntent is just a
> parser for /etc/mtab, and that you must call "setmntent" with the
> filename you want to parse.
From the code of coreutils 5.2.1, lib/mountlist.c, df uses the
default name for the mounted filesystems table. Under glibc, it uses
_PATH_MOUNTED that is, effectively, "/etc/mtab". BTW, 'MOUNTED' is
shown in glibc headers as a deprecated alias.
> So if you do "setmntent("/etc/mtab",...)" you're explicitly saying
> that you want getmntent to use /etc/mtab. This is just a open/read
> in disguise.
> Am I missing something?
Maybe: df (well, lib/mountlist.c) shouldn't try to 'detect' which
kernel are you running, if one with /etc/mtab or a newer one that
only supports /proc/mounts (which needs procfs support, BTW, and that
can be a problem too). Is glibc who should do all that, and try to
open /etc/mtab and /proc/mounts, in that order. Being a userspace
app, df should not mess with kernel interface changes. In the worst
case, it *could* try to open /etc/mtab (with setmntent, I mean) and
if that fails, open /proc/mounts if the operating system is Linux
(which can be easily decided at './configure' time).
I'm really not sure about what should be fixed. IMHO, getmntent
should only try to open _PATH_MOUNTED. Any other desired behaviour
should be set using setmntent. Just my 0,02 EUR.
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
next prev parent reply other threads:[~2004-09-20 12:10 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-19 22:05 OOM & [OT] util-linux-2.12e Andries.Brouwer
2004-09-20 9:46 ` Olaf Hering
2004-09-20 10:12 ` Andreas Schwab
2004-09-20 10:54 ` DervishD
2004-09-20 11:43 ` Andreas Schwab
2004-09-20 11:51 ` Paulo Marques
2004-09-20 12:11 ` DervishD [this message]
2004-09-20 12:14 ` Andreas Schwab
2004-09-20 12:00 ` DervishD
2004-09-20 10:23 ` Roman Zippel
2004-09-20 10:56 ` Olaf Hering
2004-09-20 11:16 ` Roman Zippel
2004-09-20 11:26 ` Olaf Hering
2004-09-20 11:38 ` Roman Zippel
2004-09-20 11:50 ` Olaf Hering
2004-09-20 12:02 ` Roman Zippel
2004-09-20 12:07 ` Olaf Hering
2004-09-20 12:14 ` Roman Zippel
2004-09-20 12:19 ` Olaf Hering
2004-09-20 12:34 ` Roman Zippel
2004-09-20 12:38 ` Olaf Hering
2004-09-20 12:51 ` Andreas Schwab
2004-09-20 12:54 ` Olaf Hering
2004-09-20 13:19 ` CaT
2004-09-20 13:33 ` Andreas Schwab
2004-09-20 13:15 ` CaT
2004-09-20 10:59 ` DervishD
2004-09-20 13:24 ` Helge Hafting
2004-09-20 13:21 ` Olaf Hering
2004-09-20 13:32 ` Helge Hafting
2004-09-20 14:12 ` Herbert Poetzl
2004-09-21 7:20 ` Helge Hafting
2004-09-21 9:18 ` Herbert Poetzl
2004-09-20 15:24 ` Tonnerre
2004-09-20 11:11 ` David Gómez
2004-09-20 11:06 ` DervishD
2004-09-20 11:38 ` Xavier Bestel
2004-09-20 11:59 ` DervishD
2004-09-20 12:32 ` Xavier Bestel
2004-09-20 14:16 ` Herbert Poetzl
2004-09-21 16:45 ` Jari Ruusu
2004-09-21 21:26 ` Andries Brouwer
2004-09-22 17:05 ` Jari Ruusu
2004-09-22 18:39 ` Andries Brouwer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040920121154.GJ5684@DervishD \
--to=lkml@dervishd.net \
--cc=Andries.Brouwer@cwi.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=olh@suse.de \
--cc=pmarques@grupopie.com \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.