diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-05-29 02:31:09 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-05-29 02:31:09 +0000 |
commit | 21d9736a2ff5dae65cf0e6bbdc1b1e99c25bc439 (patch) | |
tree | c0284bdacf5548994616cff7d7b05db5f6eba704 | |
parent | 2010-05-28 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-21d9736a2ff5dae65cf0e6bbdc1b1e99c25bc439.tar.bz2 |
2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org>
* libfs/src/nfsclient/src/dirutils.c: Add PRIomode_t, PRIdoff_t.
* configure.ac: Add AC_CHECK_SIZEOF(mode_t), AC_CHECK_SIZEOF(off_t).
-rw-r--r-- | cpukit/ChangeLog | 5 | ||||
-rw-r--r-- | cpukit/configure.ac | 6 | ||||
-rw-r--r-- | cpukit/libfs/src/nfsclient/src/dirutils.c | 20 |
3 files changed, 30 insertions, 1 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index dbc4830f04..e6ef2132d3 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,8 @@ +2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org> + + * libfs/src/nfsclient/src/dirutils.c: Add PRIomode_t, PRIdoff_t. + * configure.ac: Add AC_CHECK_SIZEOF(mode_t), AC_CHECK_SIZEOF(off_t). + 2010-05-28 Ralf Corsépius <ralf.corsepius@rtems.org> * libfs/src/rfs/rtems-rfs-rtems.c: Use size_t for node_len. diff --git a/cpukit/configure.ac b/cpukit/configure.ac index 6957271dea..ad250b4ec0 100644 --- a/cpukit/configure.ac +++ b/cpukit/configure.ac @@ -248,6 +248,12 @@ AC_CHECK_HEADERS([sys/queue.h],[NEED_SYS_QUEUE_H=no],[NEED_SYS_QUEUE_H=yes]) # configuration-time diagnostics and are not really used. AC_CHECK_DECLS([_POSIX_LOGIN_NAME_MAX],,,[#include <limits.h>]) AC_CHECK_DECLS([CHAR_BIT],,,[#include <limits.h>]) + +# FIXME: We should get rid of this. +# So far, only used in libfs/src/nfsclient/src/dirutils.c +AC_CHECK_SIZEOF([mode_t]) +AC_CHECK_SIZEOF([off_t]) + # FIXME: Mandatory in SUSv4, optional in SUSv3. # Not implemented in GCC/newlib, so far. AC_CHECK_DECLS([WORD_BIT],,,[#include <limits.h>]) diff --git a/cpukit/libfs/src/nfsclient/src/dirutils.c b/cpukit/libfs/src/nfsclient/src/dirutils.c index bd84e8aa2a..99c65876f3 100644 --- a/cpukit/libfs/src/nfsclient/src/dirutils.c +++ b/cpukit/libfs/src/nfsclient/src/dirutils.c @@ -66,6 +66,24 @@ #include <stdlib.h> #include <limits.h> /* PATH_MAX */ +#include <inttypes.h> /* PRI* */ + +#if SIZEOF_MODE_T == 8 +#define PRIomode_t PRIo64 +#elif SIZEOF_MODE_T == 4 +#define PRIomode_t PRIo32 +#else +#error "unsupport size of mode_t" +#endif + +#if SIZEOF_OFF_T == 8 +#define PRIdoff_t PRIo64 +#elif SIZEOF_OFF_T == 4 +#define PRIdoff_t PRIo32 +#else +#error "unsupported size of off_t" +#endif + #ifdef HAVE_CEXP #include <cexpHelp.h> #endif @@ -109,7 +127,7 @@ char *t; t = "@"; break; } - printf("%10li, %10lib, %5i.%-5i 0%04o %s%s\n", + printf("%10li, %10" PRIdoff_t "b, %5i.%-5i 0%04" PRIomode_t " %s%s\n", buf->st_ino, buf->st_size, buf->st_uid, |