/*
+#ifdef linux
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
#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 HAVE_LONG_LONG_OFF_T
int
sys_lseek(tcp)
struct tcb *tcp;
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
-#ifndef FREEBSD
offset = tcp->u_arg[1];
_whence = tcp->u_arg[2];
if (_whence == SEEK_SET)
tprintf("%lu, ", offset);
else
tprintf("%ld, ", offset);
-#else /* FREEBSD */
- offset = ((off_t) tcp->u_arg[1] << 32) + tcp->u_arg[2];
- _whence = tcp->u_arg[4];
- if (_whence == SEEK_SET)
- tprintf("%llu, ", offset);
- else
- tprintf("%lld, ", offset);
-#endif
printxval(whence, _whence, "SEEK_???");
}
-#ifdef FREEBSD
- else
- if (!syserror(tcp))
- return RVAL_LUDECIMAL;
-#endif /* FREEBSD */
return RVAL_UDECIMAL;
}
+#endif
#ifdef linux
int
}
#endif
-#if _LFS_LARGEFILE
+#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
int
sys_lseek64 (tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
- long long offset = get64(tcp->u_arg [1], tcp->u_arg[2]);
+ long long offset;
+ ALIGN64 (tcp, 1); /* FreeBSD aligns off_t args */
+ 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 HAVE_LONG_LONG_OFF_T
int
sys_truncate(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
-#ifndef FREEBSD
tprintf(", %lu", tcp->u_arg[1]);
-#else
- tprintf(", %llu", ((off_t) tcp->u_arg[1] << 32) + tcp->u_arg[2]);
-#endif
}
return 0;
}
+#endif
+
+#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", LONG_LONG(tcp->u_arg[1],tcp->u_arg[2]));
+ }
+ return 0;
+}
+#endif
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_ftruncate(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
-#ifndef FREEBSD
tprintf("%ld, %lu", tcp->u_arg[0], tcp->u_arg[1]);
-#else
+ }
+ return 0;
+}
+#endif
+
+#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],
- ((off_t) tcp->u_arg[1] << 32) + tcp->u_arg[2]);
-#endif
+ LONG_LONG(tcp->u_arg[1] ,tcp->u_arg[2]));
}
return 0;
}
+#endif
/* several stats */
}
#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 */
}
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));
+#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 */
}
else
tprintf("...}");
}
#endif /* linux && !IA64 */
-
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_stat(tcp)
struct tcb *tcp;
}
return 0;
}
+#endif
-#ifdef linux
int
sys_stat64(tcp)
struct tcb *tcp;
#endif
}
+#ifdef linux
# if !defined(IA64)
int
sys_oldstat(tcp)
# endif /* !IA64 */
#endif /* linux */
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_fstat(tcp)
struct tcb *tcp;
}
return 0;
}
+#endif
-#ifdef linux
int
sys_fstat64(tcp)
struct tcb *tcp;
#endif
}
+#ifdef linux
# if !defined(IA64)
int
sys_oldfstat(tcp)
# endif /* !IA64 */
#endif
+#ifndef HAVE_LONG_LONG_OFF_T
int
sys_lstat(tcp)
struct tcb *tcp;
}
return 0;
}
+#endif
-#ifdef linux
int
sys_lstat64(tcp)
struct tcb *tcp;
#endif
}
+#ifdef linux
# if !defined(IA64)
int
sys_oldlstat(tcp)