Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] deprecated ustat() vs. statfs()
Date: Wed, 31 Dec 2008 18:28:28 +0100	[thread overview]
Message-ID: <20081231172828.GI8563@mx.loc> (raw)
In-Reply-To: <495B8284.3080805@lbsd.net>

On Wed, Dec 31, 2008 at 02:32:36PM +0000, Nigel Kukard wrote:
>I dont suppose this is the correct way to switch to statfs()?

Switching to {f,}statfs is per se not really desirable.

quote from the manpage:
       LSB has deprecated the library calls statfs() and fstatfs()  and  tells
       us to use statvfs(2) and fstatvfs(2) instead.

statvfs is at least POSIX.

A simpler thing (i didn't look at the exact meaning of that function) may
be to just stat the path like e.g. the mountpoint applet ?) does.

HTH,
?) http://sources.busybox.net/index.py/trunk/busybox/miscutils/mountpoint.c?view=markup
>
>
>--- xfsprogs-2.10.2_vanilla/libxfs/linux.c    2008-12-09
>23:33:26.000000000 +0000
>+++ xfsprogs-2.10.2_remove-deprecated/libxfs/linux.c    2008-12-31
>14:30:45.000000000 +0000
>@@ -21,7 +21,7 @@
> #include <mntent.h>
> #include <sys/stat.h>
> #undef ustat
>-#include <sys/ustat.h>
>+#include <sys/statfs.h>
> #include <sys/mount.h>
> #include <sys/ioctl.h>
> #include <sys/sysinfo.h>
>@@ -49,7 +49,7 @@
> int
> platform_check_ismounted(char *name, char *block, struct stat64 *s, int
>verbose)
> {
>-    struct ustat    ust;
>+    struct statfs    ust;
>     struct stat64    st;
> 
>     if (!s) {
>@@ -60,7 +60,7 @@
>         s = &st;
>     }
> 
>-    if (ustat(s->st_rdev, &ust) >= 0) {
>+    if (statfs(s->st_rdev, &ust) >= 0) {
>         if (verbose)
>             fprintf(stderr,
>                 _("%s: %s contains a mounted filesystem\n"),
>

      reply	other threads:[~2008-12-31 17:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-31 14:32 [Buildroot] deprecated ustat() vs. statfs() Nigel Kukard
2008-12-31 17:28 ` Bernhard Reutner-Fischer [this message]

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=20081231172828.GI8563@mx.loc \
    --to=rep.dot.nop@gmail.com \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox