+2001-03-08 John Hughes <john@Calva.COM>
+
+ * acconfig.h: add new ST_xxx defines.
+ * aclocal.m4: macros to check for more fields in struct stat.
+ * configure.in: use new macros to check for fields in struct stat.
+ * file.c: use new defines to replace #ifdef FREEBSD by #if HAVE_ST_xxx.
+
2001-03-08 John Hughes <john@Calva.COM>
* defs.h: rename wimpy get64 as powerful new LONG_LONG
/* Define if linux struct sockaddr_in6 contains sin6_scope_id fiels. */
#undef HAVE_SIN6_SCOPE_ID_LINUX
+
+/* Define if have st_flags in struct stat */
+#undef HAVE_ST_FLAGS
+
+/* Define if have st_aclcnt in struct stat */
+#undef HAVE_ST_ACLCNT
+
+/* Define if have st_level in struct stat */
+#undef HAVE_ST_LEVEL
+
+/* Define if have st_fstype in struct stat */
+#undef HAVE_ST_FSTYPE
+
+/* Define if have st_gen in struct stat */
+#undef HAVE_ST_GEN
fi
])
+dnl ### A macro to check for st_flags in struct stat
+AC_DEFUN(AC_ST_FLAGS,
+[AC_MSG_CHECKING(for st_flags in struct stat)
+AC_CACHE_VAL(ac_cv_have_st_flags,
+[AC_TRY_COMPILE([#include <sys/stat.h>],
+[struct stat buf;
+buf.st_flags = 0;],
+ac_cv_have_st_flags=yes,
+ac_cv_have_st_flags=no)])
+AC_MSG_RESULT($ac_cv_have_st_flags)
+if test "$ac_cv_have_st_flags" = yes
+then
+ AC_DEFINE(HAVE_ST_FLAGS)
+fi
+])
+
+dnl ### A macro to check for st_aclcnt in struct stat
+AC_DEFUN(AC_ST_ACLCNT,
+[AC_MSG_CHECKING(for st_aclcnt in struct stat)
+AC_CACHE_VAL(ac_cv_have_st_aclcnt,
+[AC_TRY_COMPILE([#include <sys/stat.h>],
+[struct stat buf;
+buf.st_aclcnt = 0;],
+ac_cv_have_st_aclcnt=yes,
+ac_cv_have_st_aclcnt=no)])
+AC_MSG_RESULT($ac_cv_have_st_aclcnt)
+if test "$ac_cv_have_st_aclcnt" = yes
+then
+ AC_DEFINE(HAVE_ST_ACLCNT)
+fi
+])
+
+dnl ### A macro to check for st_level in struct stat
+AC_DEFUN(AC_ST_LEVEL,
+[AC_MSG_CHECKING(for st_level in struct stat)
+AC_CACHE_VAL(ac_cv_have_st_level,
+[AC_TRY_COMPILE([#include <sys/stat.h>],
+[struct stat buf;
+buf.st_level = 0;],
+ac_cv_have_st_level=yes,
+ac_cv_have_st_level=no)])
+AC_MSG_RESULT($ac_cv_have_st_level)
+if test "$ac_cv_have_st_level" = yes
+then
+ AC_DEFINE(HAVE_ST_LEVEL)
+fi
+])
+
+dnl ### A macro to check for st_fstype in struct stat
+AC_DEFUN(AC_ST_FSTYPE,
+[AC_MSG_CHECKING(for st_fstype in struct stat)
+AC_CACHE_VAL(ac_cv_have_st_fstype,
+[AC_TRY_COMPILE([#include <sys/stat.h>],
+[struct stat buf;
+buf.st_fstype[0] = 0;],
+ac_cv_have_st_fstype=yes,
+ac_cv_have_st_fstype=no)])
+AC_MSG_RESULT($ac_cv_have_st_fstype)
+if test "$ac_cv_have_st_fstype" = yes
+then
+ AC_DEFINE(HAVE_ST_FSTYPE)
+fi
+])
+
+dnl ### A macro to check for st_gen in struct stat
+AC_DEFUN(AC_ST_GEN,
+[AC_MSG_CHECKING(for st_gen in struct stat)
+AC_CACHE_VAL(ac_cv_have_st_gen,
+[AC_TRY_COMPILE([#include <sys/stat.h>],
+[struct stat buf;
+buf.st_gen = 0;],
+ac_cv_have_st_gen=yes,
+ac_cv_have_st_gen=no)])
+AC_MSG_RESULT($ac_cv_have_st_gen)
+if test "$ac_cv_have_st_gen" = yes
+then
+ AC_DEFINE(HAVE_ST_GEN)
+fi
+])
+
AC_LONG_LONG
AC_OFF_T_IS_LONG_LONG
AC_RLIM_T_IS_LONG_LONG
+AC_ST_FLAGS
+AC_ST_ACLCNT
+AC_ST_LEVEL
+AC_ST_FSTYPE
+AC_ST_GEN
if test x$OPSYS != xLINUX; then
AC_CHECK_LIB(nsl, main)
fi
}
#endif /* LINUXSPARC */
-#ifdef FREEBSD
static struct xlat fileflags[] = {
+#ifdef FREEBSD
{ UF_NODUMP, "UF_NODUMP" },
{ UF_IMMUTABLE, "UF_IMMUTABLE" },
{ UF_APPEND, "UF_APPEND" },
{ SF_IMMUTABLE, "SF_IMMUTABLE" },
{ SF_APPEND, "SF_APPEND" },
{ SF_NOUNLINK, "SF_NOUNLINK" },
+#elif UNIXWARE >= 2
+#ifdef _S_ISMLD
+ { _S_ISMLD, "_S_ISMLD" },
+#endif
+#ifdef _S_ISMOUNTED
+ { _S_ISMOUNTED, "_S_ISMOUNTED" },
+#endif
+#endif
{ 0, NULL },
};
+#ifdef FREEBSD
int
sys_chflags(tcp)
struct tcb *tcp;
if (!abbrev(tcp)) {
tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
- tprintf("st_ctime=%s}", sprinttime(statbuf->st_ctime));
+ tprintf("st_ctime=%s", sprinttime(statbuf->st_ctime));
+#if HAVE_ST_FLAGS
+ tprintf(", st_flags=");
+ if (statbuf->st_flags) {
+ printflags(fileflags, statbuf->st_flags);
+ } else
+ tprintf("0");
+#endif
+#if HAVE_ST_ACLCNT
+ tprintf(", st_aclcnt=%d", statbuf->st_aclcnt);
+#endif
+#if HAVE_ST_LEVEL
+ tprintf(", st_level=%ld", statbuf->st_level);
+#endif
+#if HAVE_ST_FSTYPE
+ tprintf(", st_fstype=%.*s",
+ (int) sizeof statbuf->st_fstype, statbuf->st_fstype);
+#endif
+#if HAVE_ST_GEN
+ tprintf(", st_gen=%u", statbuf->st_gen);
+#endif
+ tprintf("}");
}
else
tprintf("...}");
if (!abbrev(tcp)) {
tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
-#ifndef FREEBSD
- tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
-#else /* FREEBSD */
- tprintf("st_ctime=%s, ", sprinttime(statbuf.st_ctime));
- tprintf("st_flags=");
+ tprintf("st_ctime=%s", sprinttime(statbuf.st_ctime));
+#if HAVE_ST_FLAGS
+ tprintf(", st_flags=");
if (statbuf.st_flags) {
printflags(fileflags, statbuf.st_flags);
} else
tprintf("0");
- tprintf(", st_gen=%u}", statbuf.st_gen);
-#endif /* FREEBSD */
+#endif
+#if HAVE_ST_ACLCNT
+ tprintf(", st_aclcnt=%d", statbuf.st_aclcnt);
+#endif
+#if HAVE_ST_LEVEL
+ tprintf(", st_level=%ld", statbuf.st_level);
+#endif
+#if HAVE_ST_FSTYPE
+ tprintf(", st_fstype=%.*s",
+ (int) sizeof statbuf.st_fstype, statbuf.st_fstype);
+#endif
+#if HAVE_ST_GEN
+ tprintf(", st_gen=%u", statbuf.st_gen);
+#endif
+ tprintf("}");
}
else
tprintf("...}");