# define off_t off_t
# define loff_t loff_t
# endif
+# ifdef HPPA /* asm-parisc/stat.h defines stat64 */
+# undef stat64
+# endif
# define stat libc_stat
# define stat64 libc_stat64
# include <sys/stat.h>
# undef stat
# undef stat64
+# ifdef HPPA
+# define stat64 hpux_stat64
+# endif
#else
# include <sys/stat.h>
#endif
#include <sys/stat.h>
#endif
+#if HAVE_LONG_LONG_OFF_T
+/*
+ * Ugly hacks for systems that have typedef long long off_t
+ */
+
+#define stat64 stat
+#define HAVE_STAT64 1 /* Ugly hack */
+
+#define sys_stat64 sys_stat
+#define sys_fstat64 sys_fstat
+#define sys_lstat64 sys_lstat
+#define sys_lseek64 sys_lseek
+#define sys_truncate64 sys_truncate
+#define sys_ftruncate64 sys_ftruncate
+#endif
+
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#endif
{ 0, NULL },
};
-#ifndef FREEBSD
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_lseek(tcp)
struct tcb *tcp;
if (tcp->u_arg[4] == SEEK_SET)
tprintf("%ld, %llu, ", tcp->u_arg[0],
(((long long int) tcp->u_arg[1]) << 32
- | (unsigned long long) tcp->u_arg[2]));
+ | (unsigned long long) (unsigned) tcp->u_arg[2]));
else
tprintf("%ld, %lld, ", tcp->u_arg[0],
(((long long int) tcp->u_arg[1]) << 32
- | (unsigned long long) tcp->u_arg[2]));
+ | (unsigned long long) (unsigned) tcp->u_arg[2]));
}
else {
long long int off;
}
#endif
-#if _LFS64_LARGEFILE || FREEBSD
+#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
int
sys_lseek64 (tcp)
struct tcb *tcp;
if (entering(tcp)) {
long long offset;
ALIGN64 (tcp, 1); /* FreeBSD aligns off_t args */
- offset = get64(tcp->u_arg [1], tcp->u_arg[2]);
+ offset = LONG_LONG(tcp->u_arg [1], tcp->u_arg[2]);
if (tcp->u_arg[3] == SEEK_SET)
tprintf("%ld, %llu, ", tcp->u_arg[0], offset);
else
}
#endif
-#ifndef FREEBSD
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_truncate(tcp)
struct tcb *tcp;
}
#endif
-#if _LFS64_LARGEFILE || FREEBSD
+#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
int
sys_truncate64(tcp)
struct tcb *tcp;
if (entering(tcp)) {
ALIGN64 (tcp, 1);
printpath(tcp, tcp->u_arg[0]);
- tprintf(", %llu", get64(tcp->u_arg[1],tcp->u_arg[2]));
+ tprintf(", %llu", LONG_LONG(tcp->u_arg[1],tcp->u_arg[2]));
}
return 0;
}
#endif
-#ifndef FREEBSD
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_ftruncate(tcp)
struct tcb *tcp;
}
#endif
-#if _LFS64_LARGEFILE || FREEBSD
+#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
int
sys_ftruncate64(tcp)
struct tcb *tcp;
if (entering(tcp)) {
ALIGN64 (tcp, 1);
tprintf("%ld, %llu", tcp->u_arg[0],
- get64(tcp->u_arg[1] ,tcp->u_arg[2]));
+ LONG_LONG(tcp->u_arg[1] ,tcp->u_arg[2]));
}
return 0;
}
}
#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;
}
#endif
+#ifndef HAVE_LONG_LONG_OFF_T
static void
realprintstat(tcp, statbuf)
struct tcb *tcp;
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=");
- if (statbuf->st_flags) {
- printflags(fileflags, statbuf->st_flags);
- } else
- tprintf("0");
- tprintf(", st_gen=%u}", statbuf->st_gen);
-#endif /* FREEBSD */
+ 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("...}");
realprintstat(tcp, &statbuf);
}
+#endif /* !HAVE_LONG_LONG_OFF_T */
#ifdef HAVE_STAT64
static void
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("...}");
}
#endif /* HAVE_STAT64 */
-#if defined(linux) && !defined(IA64)
+#if defined(linux) && !defined(IA64) && !defined(HPPA)
static void
convertoldstat(oldbuf, newbuf)
const struct __old_kernel_stat *oldbuf;
}
#endif /* linux && !IA64 */
-
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_stat(tcp)
struct tcb *tcp;
}
return 0;
}
+#endif
int
sys_stat64(tcp)
}
#ifdef linux
-# if !defined(IA64)
+# if !defined(IA64) && !defined(HPPA)
int
sys_oldstat(tcp)
struct tcb *tcp;
}
return 0;
}
-# endif /* !IA64 */
+# endif /* !IA64 && !HPPA*/
#endif /* linux */
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_fstat(tcp)
struct tcb *tcp;
}
return 0;
}
+#endif
int
sys_fstat64(tcp)
}
#ifdef linux
-# if !defined(IA64)
+# if !defined(IA64) && !defined(HPPA)
int
sys_oldfstat(tcp)
struct tcb *tcp;
}
return 0;
}
-# endif /* !IA64 */
+# endif /* !IA64 && !HPPA*/
#endif
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_lstat(tcp)
struct tcb *tcp;
}
return 0;
}
+#endif
int
sys_lstat64(tcp)
}
#ifdef linux
-# if !defined(IA64)
+# if !defined(IA64) && !defined(HPPA)
int
sys_oldlstat(tcp)
struct tcb *tcp;
}
return 0;
}
-# endif /* !IA64 */
+# endif /* !IA64 && !HPPA */
#endif