#include <fcntl.h>
#include <sys/file.h>
-static struct xlat fcntlcmds[] = {
+#if HAVE_LONG_LONG_OFF_T
+/*
+ * Hacks for systems that have a long long off_t
+ */
+#define flock64 flock /* Horrid hack */
+#define printflock printflock64 /* Horrider hack */
+#endif
+
+
+static const struct xlat fcntlcmds[] = {
{ F_DUPFD, "F_DUPFD" },
{ F_GETFD, "F_GETFD" },
{ F_SETFD, "F_SETFD" },
{ 0, NULL },
};
-static struct xlat fdflags[] = {
+static const struct xlat fdflags[] = {
#ifdef FD_CLOEXEC
{ FD_CLOEXEC, "FD_CLOEXEC" },
#endif
#ifdef LOCK_SH
-static struct xlat flockcmds[] = {
+static const struct xlat flockcmds[] = {
{ LOCK_SH, "LOCK_SH" },
{ LOCK_EX, "LOCK_EX" },
{ LOCK_NB, "LOCK_NB" },
#endif /* LOCK_SH */
-static struct xlat lockfcmds[] = {
+static const struct xlat lockfcmds[] = {
{ F_RDLCK, "F_RDLCK" },
{ F_WRLCK, "F_WRLCK" },
{ F_UNLCK, "F_UNLCK" },
{ 0, NULL },
};
-static struct xlat whence[] = {
+static const struct xlat whence[] = {
{ SEEK_SET, "SEEK_SET" },
{ SEEK_CUR, "SEEK_CUR" },
{ SEEK_END, "SEEK_END" },
{ 0, NULL },
};
+#ifndef HAVE_LONG_LONG_OFF_T
/* fcntl/lockf */
static void
printflock(tcp, addr, getlk)
else
tprintf("}");
}
+#endif
-#if _LFS64_LARGEFILE
+#if _LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T
/* fcntl/lockf */
static void
printflock64(tcp, addr, getlk)
struct tcb *tcp;
-int addr;
+long addr;
int getlk;
{
struct flock64 fl;
printxval(lockfcmds, fl.l_type, "F_???");
tprintf(", whence=");
printxval(whence, fl.l_whence, "SEEK_???");
- tprintf(", start=%lld, len=%lld", fl.l_start, fl.l_len);
+ tprintf(", start=%lld, len=%lld", (long long) fl.l_start, (long long) fl.l_len);
if (getlk)
tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
else
static char *
sprintflags(xlat, flags)
-struct xlat *xlat;
+const struct xlat *xlat;
int flags;
{
static char outstr[1024];
sys_fcntl(tcp)
struct tcb *tcp;
{
- extern struct xlat openmodes[];
+ extern const struct xlat openmodes[];
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
#ifdef F_FREESP64
case F_FREESP64:
#endif
- /* Linux glibc defines SETLK64 as SETLK,
+ /* Linux glibc defines SETLK64 as SETLK,
even though the kernel has different values - as does Solaris. */
#if defined(F_SETLK64) && F_SETLK64+0!=F_SETLK
case F_SETLK64:
}
#ifdef ALPHA
+int
sys_osf_select(tcp)
struct tcb *tcp;
{