long usecount;
};
-static struct xlat which[] = {
+static const struct xlat which[] = {
{ 0, "0" },
{ QM_MODULES, "QM_MODULES" },
{ QM_DEPS, "QM_DEPS" },
{ 0, NULL },
};
-static struct xlat modflags[] = {
+static const struct xlat modflags[] = {
{ MOD_UNINITIALIZED, "MOD_UNINITIALIZED" },
{ MOD_RUNNING, "MOD_RUNNING" },
{ MOD_DELETED, "MOD_DELETED" },
}
free(data);
}
- } else
+ } else
tprintf(" /* %Zu entries */ ", ret);
tprintf("}, %Zu", ret);
} else if (tcp->u_arg[1]==QM_SYMBOLS) {
return 0;
}
#endif /* LINUX */
-
#endif
extern int set_personality P((int personality));
-extern char *xlookup P((struct xlat *, int));
+extern char *xlookup P((const struct xlat *, int));
extern struct tcb *alloctcb P((int));
extern struct tcb *pid2tcb P((int));
extern void droptcb P((struct tcb *));
extern void newoutf P((struct tcb *));
extern int get_scno P((struct tcb *));
extern int trace_syscall P((struct tcb *));
-extern void printxval P((struct xlat *, int, char *));
+extern void printxval P((const struct xlat *, int, char *));
extern int printargs P((struct tcb *));
-extern int addflags P((struct xlat *, int));
-extern int printflags P((struct xlat *, int));
+extern int addflags P((const struct xlat *, int));
+extern int printflags P((const struct xlat *, int));
extern int umoven P((struct tcb *, long, int, char *));
extern int umovestr P((struct tcb *, long, int, char *));
extern int upeek P((int, long, long *));
#endif
-static struct xlat fcntlcmds[] = {
+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" },
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]);
* Unix says r/w/rw are 0/1/2, so we make them true flags 1/2/3 by
* adding 1. Just remember to add 1 to any arg decoded with openmodes.
*/
-struct xlat openmodes[] = {
+const struct xlat openmodes[] = {
{ O_RDWR+1, "O_RDWR" },
{ O_RDONLY+1, "O_RDONLY" },
{ O_WRONLY+1, "O_WRONLY" },
}
#ifdef LINUXSPARC
-struct xlat openmodessol[] = {
+const struct xlat openmodessol[] = {
{ 0, "O_RDWR" },
{ 1, "O_RDONLY" },
{ 2, "O_WRONLY" },
return 0;
}
-static struct xlat access_flags[] = {
+static const struct xlat access_flags[] = {
{ F_OK, "F_OK", },
{ R_OK, "R_OK" },
{ W_OK, "W_OK" },
return RVAL_OCTAL;
}
-static struct xlat whence[] = {
+static const struct xlat whence[] = {
{ SEEK_SET, "SEEK_SET" },
{ SEEK_CUR, "SEEK_CUR" },
{ SEEK_END, "SEEK_END" },
/* several stats */
-static struct xlat modetypes[] = {
+static const struct xlat modetypes[] = {
{ S_IFREG, "S_IFREG" },
{ S_IFSOCK, "S_IFSOCK" },
{ S_IFIFO, "S_IFIFO" },
#endif /* SPARC64 */
#endif /* LINUXSPARC */
-struct xlat fileflags[] = {
+const struct xlat fileflags[] = {
#ifdef FREEBSD
{ UF_NODUMP, "UF_NODUMP" },
{ UF_IMMUTABLE, "UF_IMMUTABLE" },
#include <sys/acl.h>
-struct xlat aclcmds[] = {
+const struct xlat aclcmds[] = {
#ifdef SETACL
{ SETACL, "SETACL" },
#endif
}
-struct xlat aclipc[] = {
+const struct xlat aclipc[] = {
#ifdef IPC_SHM
{ IPC_SHM, "IPC_SHM" },
#endif
#ifdef LINUX
-static struct xlat fsmagic[] = {
+static const struct xlat fsmagic[] = {
{ 0x73757245, "CODA_SUPER_MAGIC" },
{ 0x012ff7b7, "COH_SUPER_MAGIC" },
{ 0x1373, "DEVFS_SUPER_MAGIC" },
#endif /* LINUX */
#if defined FREEBSD || defined LINUX
-struct xlat direnttypes[] = {
+const struct xlat direnttypes[] = {
{ DT_UNKNOWN, "DT_UNKNOWN" },
{ DT_FIFO, "DT_FIFO" },
{ DT_CHR, "DT_CHR" },
#endif /* HAVE_SYS_ASYNCH_H */
-struct xlat xattrflags[] = {
+const struct xlat xattrflags[] = {
#ifdef XATTR_CREATE
{ XATTR_CREATE, "XATTR_CREATE" },
{ XATTR_REPLACE, "XATTR_REPLACE" },
# define IPC_64 0x100
#endif
-extern struct xlat openmodes[];
+extern const struct xlat openmodes[];
extern void printsigevent(struct tcb *tcp, long arg);
-static struct xlat msgctl_flags[] = {
+static const struct xlat msgctl_flags[] = {
{ IPC_RMID, "IPC_RMID" },
{ IPC_SET, "IPC_SET" },
{ IPC_STAT, "IPC_STAT" },
{ 0, NULL },
};
-static struct xlat semctl_flags[] = {
+static const struct xlat semctl_flags[] = {
{ IPC_RMID, "IPC_RMID" },
{ IPC_SET, "IPC_SET" },
{ IPC_STAT, "IPC_STAT" },
{ 0, NULL },
};
-static struct xlat shmctl_flags[] = {
+static const struct xlat shmctl_flags[] = {
{ IPC_RMID, "IPC_RMID" },
{ IPC_SET, "IPC_SET" },
{ IPC_STAT, "IPC_STAT" },
{ 0, NULL },
};
-static struct xlat resource_flags[] = {
+static const struct xlat resource_flags[] = {
{ IPC_CREAT, "IPC_CREAT" },
{ IPC_EXCL, "IPC_EXCL" },
{ IPC_NOWAIT, "IPC_NOWAIT" },
{ 0, NULL },
};
-static struct xlat shm_flags[] = {
+static const struct xlat shm_flags[] = {
#ifdef LINUX
{ SHM_REMAP, "SHM_REMAP" },
#endif /* LINUX */
{ 0, NULL },
};
-static struct xlat msg_flags[] = {
+static const struct xlat msg_flags[] = {
{ MSG_NOERROR, "MSG_NOERROR" },
#ifdef LINUX
{ MSG_EXCEPT, "MSG_EXCEPT" },
return RVAL_HEX;
}
-static struct xlat mmap_prot[] = {
+static const struct xlat mmap_prot[] = {
{ PROT_NONE, "PROT_NONE", },
{ PROT_READ, "PROT_READ" },
{ PROT_WRITE, "PROT_WRITE" },
{ 0, NULL },
};
-static struct xlat mmap_flags[] = {
+static const struct xlat mmap_flags[] = {
{ MAP_SHARED, "MAP_SHARED" },
{ MAP_PRIVATE, "MAP_PRIVATE" },
{ MAP_FIXED, "MAP_FIXED" },
#ifdef LINUX
-static struct xlat mremap_flags[] = {
+static const struct xlat mremap_flags[] = {
{ MREMAP_MAYMOVE, "MREMAP_MAYMOVE" },
{ 0, NULL }
};
return RVAL_HEX;
}
-static struct xlat madvise_flags[] = {
+static const struct xlat madvise_flags[] = {
#ifdef MADV_NORMAL
{ MADV_NORMAL, "MADV_NORMAL" },
#endif
}
-static struct xlat mlockall_flags[] = {
+static const struct xlat mlockall_flags[] = {
#ifdef MCL_CURRENT
{ MCL_CURRENT, "MCL_CURRENT" },
#endif
#ifdef MS_ASYNC
-static struct xlat mctl_sync[] = {
+static const struct xlat mctl_sync[] = {
#ifdef MS_SYNC
{ MS_SYNC, "MS_SYNC" },
#endif
#ifdef MC_SYNC
-static struct xlat mctl_funcs[] = {
+static const struct xlat mctl_funcs[] = {
{ MC_LOCK, "MC_LOCK" },
{ MC_LOCKAS, "MC_LOCKAS" },
{ MC_SYNC, "MC_SYNC" },
{ 0, NULL },
};
-static struct xlat mctl_lockas[] = {
+static const struct xlat mctl_lockas[] = {
{ MCL_CURRENT, "MCL_CURRENT" },
{ MCL_FUTURE, "MCL_FUTURE" },
{ 0, NULL },
#define IPPROTO_MAX IPPROTO_MAX
#endif
-static struct xlat domains[] = {
+static const struct xlat domains[] = {
#ifdef PF_AAL5
{ PF_AAL5, "PF_AAL5" },
#endif
#endif
{ 0, NULL },
};
-struct xlat addrfams[] = {
+const struct xlat addrfams[] = {
#ifdef AF_APPLETALK
{ AF_APPLETALK, "AF_APPLETALK" },
#endif
#endif
{ 0, NULL },
};
-static struct xlat socktypes[] = {
+static const struct xlat socktypes[] = {
{ SOCK_STREAM, "SOCK_STREAM" },
{ SOCK_DGRAM, "SOCK_DGRAM" },
#ifdef SOCK_RAW
#endif
{ 0, NULL },
};
-static struct xlat socketlayers[] = {
+static const struct xlat socketlayers[] = {
#if defined(SOL_IP)
{ SOL_IP, "SOL_IP" },
#endif
};
/*** WARNING: DANGER WILL ROBINSON: NOTE "socketlayers" array above
falls into "protocols" array below!!!! This is intended!!! ***/
-static struct xlat protocols[] = {
+static const struct xlat protocols[] = {
{ IPPROTO_IP, "IPPROTO_IP" },
{ IPPROTO_ICMP, "IPPROTO_ICMP" },
{ IPPROTO_TCP, "IPPROTO_TCP" },
#endif
{ 0, NULL },
};
-static struct xlat msg_flags[] = {
+static const struct xlat msg_flags[] = {
{ MSG_OOB, "MSG_OOB" },
#ifdef MSG_DONTROUTE
{ MSG_DONTROUTE,"MSG_DONTROUTE" },
{ 0, NULL },
};
-static struct xlat sockoptions[] = {
+static const struct xlat sockoptions[] = {
#ifdef SO_ACCEPTCONN
{ SO_ACCEPTCONN, "SO_ACCEPTCONN" },
#endif
#endif
#ifdef SOL_IP
-static struct xlat sockipoptions[] = {
+static const struct xlat sockipoptions[] = {
#ifdef IP_TOS
{ IP_TOS, "IP_TOS" },
#endif
#endif /* SOL_IP */
#ifdef SOL_IPV6
-static struct xlat sockipv6options[] = {
+static const struct xlat sockipv6options[] = {
#ifdef IPV6_ADDRFORM
{ IPV6_ADDRFORM, "IPV6_ADDRFORM" },
#endif
#endif /* SOL_IPV6 */
#ifdef SOL_IPX
-static struct xlat sockipxoptions[] = {
+static const struct xlat sockipxoptions[] = {
{ IPX_TYPE, "IPX_TYPE" },
{ 0, NULL },
};
#endif /* SOL_IPX */
#ifdef SOL_RAW
-static struct xlat sockrawoptions[] = {
+static const struct xlat sockrawoptions[] = {
#if defined(ICMP_FILTER)
{ ICMP_FILTER, "ICMP_FILTER" },
#endif
#endif /* SOL_RAW */
#ifdef SOL_PACKET
-static struct xlat sockpacketoptions[] = {
+static const struct xlat sockpacketoptions[] = {
{ PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" },
{ PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"},
#if defined(PACKET_RECV_OUTPUT)
#endif
#ifdef SOL_TCP
-static struct xlat socktcpoptions[] = {
+static const struct xlat socktcpoptions[] = {
{ TCP_NODELAY, "TCP_NODELAY" },
{ TCP_MAXSEG, "TCP_MAXSEG" },
#if defined(TCP_CORK)
#endif /* SOL_TCP */
#ifdef SOL_RAW
-static struct xlat icmpfilterflags[] = {
+static const struct xlat icmpfilterflags[] = {
#if defined(ICMP_ECHOREPLY)
{ (1<<ICMP_ECHOREPLY), "ICMP_ECHOREPLY" },
#endif
#endif /* SOL_RAW */
#if defined(AF_PACKET) /* from e.g. linux/if_packet.h */
-static struct xlat af_packet_types[] = {
+static const struct xlat af_packet_types[] = {
#if defined(PACKET_HOST)
{ PACKET_HOST, "PACKET_HOST" },
#endif
#if UNIXWARE >= 7
-static struct xlat sock_version[] = {
+static const struct xlat sock_version[] = {
{ __NETLIB_UW211_SVR4, "UW211_SVR4" },
{ __NETLIB_UW211_XPG4, "UW211_XPG4" },
{ __NETLIB_GEMINI_SVR4, "GEMINI_SVR4" },
#ifdef SVR4
#ifndef HAVE_MP_PROCFS
-static struct xlat proc_status_flags[] = {
+static const struct xlat proc_status_flags[] = {
{ PR_STOPPED, "PR_STOPPED" },
{ PR_ISTOP, "PR_ISTOP" },
{ PR_DSTOP, "PR_DSTOP" },
{ 0, NULL },
};
-static struct xlat proc_status_why[] = {
+static const struct xlat proc_status_why[] = {
{ PR_REQUESTED, "PR_REQUESTED" },
{ PR_SIGNALLED, "PR_SIGNALLED" },
{ PR_SYSENTRY, "PR_SYSENTRY" },
{ 0, NULL },
};
-static struct xlat proc_run_flags[] = {
+static const struct xlat proc_run_flags[] = {
{ PRCSIG, "PRCSIG" },
{ PRCFAULT, "PRCFAULT" },
{ PRSTRACE, "PRSTRACE" },
#ifdef FREEBSD
#include <sys/pioctl.h>
-static struct xlat proc_status_why[] = {
+static const struct xlat proc_status_why[] = {
{ S_EXEC, "S_EXEC" },
{ S_SIG, "S_SIG" },
{ S_SCE, "S_SCE" },
{ 0, NULL }
};
-static struct xlat proc_status_flags[] = {
+static const struct xlat proc_status_flags[] = {
{ PF_LINGER, "PF_LINGER" },
{ PF_ISUGID, "PF_ISUGID" },
{ 0, NULL }
/* WTA: this was `&& !defined(LINUXSPARC)', this seems unneeded though? */
#if defined(HAVE_PRCTL)
-static struct xlat prctl_options[] = {
+static const struct xlat prctl_options[] = {
#ifdef PR_MAXPROCS
{ PR_MAXPROCS, "PR_MAXPROCS" },
#endif
#define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */
#define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */
-static struct xlat clone_flags[] = {
+static const struct xlat clone_flags[] = {
{ CLONE_VM, "CLONE_VM" },
{ CLONE_FS, "CLONE_FS" },
{ CLONE_FILES, "CLONE_FILES" },
#include <sys/privilege.h>
-static struct xlat procpriv_cmds [] = {
+static const struct xlat procpriv_cmds [] = {
{ SETPRV, "SETPRV" },
{ CLRPRV, "CLRPRV" },
{ PUTPRV, "PUTPRV" },
};
-static struct xlat procpriv_priv [] = {
+static const struct xlat procpriv_priv [] = {
{ P_OWNER, "P_OWNER" },
{ P_AUDIT, "P_AUDIT" },
{ P_COMPAT, "P_COMPAT" },
};
-static struct xlat procpriv_type [] = {
+static const struct xlat procpriv_type [] = {
{ PS_FIX, "PS_FIX" },
{ PS_INH, "PS_INH" },
{ PS_MAX, "PS_MAX" },
struct tcb *tcp;
long addr;
int len;
-struct xlat *opt;
+const struct xlat *opt;
{
priv_t buf [128];
int max = verbose (tcp) ? sizeof buf / sizeof buf [0] : 10;
#endif
#endif /* LINUX */
-static struct xlat wait4_options[] = {
+static const struct xlat wait4_options[] = {
{ WNOHANG, "WNOHANG" },
#ifndef WSTOPPED
{ WUNTRACED, "WUNTRACED" },
#if defined SVR4 || defined LINUX
-static struct xlat waitid_types[] = {
+static const struct xlat waitid_types[] = {
{ P_PID, "P_PID" },
#ifdef P_PPID
{ P_PPID, "P_PPID" },
#ifndef SVR4
-static struct xlat ptrace_cmds[] = {
+static const struct xlat ptrace_cmds[] = {
#ifndef FREEBSD
{ PTRACE_TRACEME, "PTRACE_TRACEME" },
{ PTRACE_PEEKTEXT, "PTRACE_PEEKTEXT", },
#ifndef SUNOS4_KERNEL_ARCH_KLUDGE
static
#endif /* !SUNOS4_KERNEL_ARCH_KLUDGE */
-struct xlat struct_user_offsets[] = {
+const struct xlat struct_user_offsets[] = {
#ifdef LINUX
#if defined(S390) || defined(S390X)
{ PT_PSWMASK, "psw_mask" },
sys_ptrace(tcp)
struct tcb *tcp;
{
- struct xlat *x;
+ const struct xlat *x;
long addr;
if (entering(tcp)) {
#endif /* !SVR4 */
#ifdef LINUX
-static struct xlat futexops[] = {
+static const struct xlat futexops[] = {
{ FUTEX_WAIT, "FUTEX_WAIT" },
{ FUTEX_WAKE, "FUTEX_WAKE" },
{ FUTEX_FD, "FUTEX_FD" },
return 0;
}
-static struct xlat schedulers[] = {
+static const struct xlat schedulers[] = {
{ SCHED_OTHER, "SCHED_OTHER" },
{ SCHED_RR, "SCHED_RR" },
{ SCHED_FIFO, "SCHED_FIFO" },
#define sys_setrlimit64 sys_setrlimit
#endif
-static struct xlat resources[] = {
+static const struct xlat resources[] = {
#ifdef RLIMIT_CPU
{ RLIMIT_CPU, "RLIMIT_CPU" },
#endif
#ifndef SVR4
-static struct xlat usagewho[] = {
+static const struct xlat usagewho[] = {
{ RUSAGE_SELF, "RUSAGE_SELF" },
{ RUSAGE_CHILDREN, "RUSAGE_CHILDREN" },
#ifdef RUSAGE_BOTH
#endif /* LINUX */
-static struct xlat priorities[] = {
+static const struct xlat priorities[] = {
{ PRIO_PROCESS, "PRIO_PROCESS" },
{ PRIO_PGRP, "PRIO_PGRP" },
{ PRIO_USER, "PRIO_USER" },
#define XQM_COMMAND(c) (( ((c) >> SUBCMDSHIFT) & ('X' << 8)) == ('X' << 8))
#define OLD_COMMAND(c) (!NEW_COMMAND(c) && !XQM_COMMAND(c))
-static struct xlat quotacmds[] = {
+static const struct xlat quotacmds[] = {
{ Q_QUOTAON, "Q_QUOTAON" },
{ Q_QUOTAOFF, "Q_QUOTAOFF" },
{ Q_GETQUOTA, "Q_GETQUOTA" },
{ 0, NULL },
};
-static struct xlat quotatypes[] = {
+static const struct xlat quotatypes[] = {
{ USRQUOTA, "USRQUOTA" },
{ GRPQUOTA, "GRPQUOTA" },
{ 0, NULL },
#include <ufs/ufs/quota.h>
#endif
-static struct xlat quotacmds[] = {
+static const struct xlat quotacmds[] = {
{ Q_QUOTAON, "Q_QUOTAON" },
{ Q_QUOTAOFF, "Q_QUOTAOFF" },
{ Q_GETQUOTA, "Q_GETQUOTA" },
#if defined(SUNOS4) || defined(FREEBSD)
-static struct xlat sigvec_flags[] = {
+static const struct xlat sigvec_flags[] = {
{ SV_ONSTACK, "SV_ONSTACK" },
{ SV_INTERRUPT, "SV_INTERRUPT" },
{ SV_RESETHAND, "SV_RESETHAND" },
# endif
#endif
-static struct xlat sigact_flags[] = {
+static const struct xlat sigact_flags[] = {
#ifdef SA_RESTORER
{ SA_RESTORER, "SA_RESTORER" },
#endif
{ 0, NULL },
};
-static struct xlat sigprocmaskcmds[] = {
+static const struct xlat sigprocmaskcmds[] = {
{ SIG_BLOCK, "SIG_BLOCK" },
{ SIG_UNBLOCK, "SIG_UNBLOCK" },
{ SIG_SETMASK, "SIG_SETMASK" },
#if defined (SVR4) || defined (LINUX)
-static struct xlat siginfo_codes[] = {
+static const struct xlat siginfo_codes[] = {
#ifdef SI_NOINFO
{ SI_NOINFO, "SI_NOINFO" },
#endif
{ 0, NULL },
};
-static struct xlat sigill_codes[] = {
+static const struct xlat sigill_codes[] = {
{ ILL_ILLOPC, "ILL_ILLOPC" },
{ ILL_ILLOPN, "ILL_ILLOPN" },
{ ILL_ILLADR, "ILL_ILLADR" },
{ 0, NULL },
};
-static struct xlat sigfpe_codes[] = {
+static const struct xlat sigfpe_codes[] = {
{ FPE_INTDIV, "FPE_INTDIV" },
{ FPE_INTOVF, "FPE_INTOVF" },
{ FPE_FLTDIV, "FPE_FLTDIV" },
{ 0, NULL },
};
-static struct xlat sigtrap_codes[] = {
+static const struct xlat sigtrap_codes[] = {
{ TRAP_BRKPT, "TRAP_BRKPT" },
{ TRAP_TRACE, "TRAP_TRACE" },
{ 0, NULL },
};
-static struct xlat sigchld_codes[] = {
+static const struct xlat sigchld_codes[] = {
{ CLD_EXITED, "CLD_EXITED" },
{ CLD_KILLED, "CLD_KILLED" },
{ CLD_DUMPED, "CLD_DUMPED" },
{ 0, NULL },
};
-static struct xlat sigpoll_codes[] = {
+static const struct xlat sigpoll_codes[] = {
{ POLL_IN, "POLL_IN" },
{ POLL_OUT, "POLL_OUT" },
{ POLL_MSG, "POLL_MSG" },
{ 0, NULL },
};
-static struct xlat sigprof_codes[] = {
+static const struct xlat sigprof_codes[] = {
#ifdef PROF_SIG
{ PROF_SIG, "PROF_SIG" },
#endif
};
#ifdef SIGEMT
-static struct xlat sigemt_codes[] = {
+static const struct xlat sigemt_codes[] = {
#ifdef EMT_TAGOVF
{ EMT_TAGOVF, "EMT_TAGOVF" },
#endif
};
#endif
-static struct xlat sigsegv_codes[] = {
+static const struct xlat sigsegv_codes[] = {
{ SEGV_MAPERR, "SEGV_MAPERR" },
{ SEGV_ACCERR, "SEGV_ACCERR" },
{ 0, NULL },
};
-static struct xlat sigbus_codes[] = {
+static const struct xlat sigbus_codes[] = {
{ BUS_ADRALN, "BUS_ADRALN" },
{ BUS_ADRERR, "BUS_ADRERR" },
{ BUS_OBJERR, "BUS_OBJERR" },
return 0;
}
#ifndef FREEBSD
-static struct xlat ucontext_flags[] = {
+static const struct xlat ucontext_flags[] = {
{ UC_SIGMASK, "UC_SIGMASK" },
{ UC_STACK, "UC_STACK" },
{ UC_CPU, "UC_CPU" },
#define stack_t struct sigaltstack
#endif
-static struct xlat sigaltstack_flags[] = {
+static const struct xlat sigaltstack_flags[] = {
{ SS_ONSTACK, "SS_ONSTACK" },
{ SS_DISABLE, "SS_DISABLE" },
{ 0, NULL },
#endif
#include <net/if.h>
-extern struct xlat addrfams[];
+extern const struct xlat addrfams[];
int
sock_ioctl(tcp, code, arg)
#endif /* HAVE_SYS_TIUSER_H */
#ifndef FREEBSD
-static struct xlat msgflags[] = {
+static const struct xlat msgflags[] = {
{ RS_HIPRI, "RS_HIPRI" },
{ 0, NULL },
};
}
#if defined SYS_putpmsg || defined SYS_getpmsg
-static struct xlat pmsgflags[] = {
+static const struct xlat pmsgflags[] = {
#ifdef MSG_HIPRI
{ MSG_HIPRI, "MSG_HIPRI" },
#endif
#ifdef HAVE_SYS_POLL_H
-static struct xlat pollflags[] = {
+static const struct xlat pollflags[] = {
#ifdef POLLIN
{ POLLIN, "POLLIN" },
{ POLLPRI, "POLLPRI" },
#if !defined(LINUX) && !defined(FREEBSD)
-static struct xlat stream_flush_options[] = {
+static const struct xlat stream_flush_options[] = {
{ FLUSHR, "FLUSHR" },
{ FLUSHW, "FLUSHW" },
{ FLUSHRW, "FLUSHRW" },
{ 0, NULL },
};
-static struct xlat stream_setsig_flags[] = {
+static const struct xlat stream_setsig_flags[] = {
{ S_INPUT, "S_INPUT" },
{ S_HIPRI, "S_HIPRI" },
{ S_OUTPUT, "S_OUTPUT" },
{ 0, NULL },
};
-static struct xlat stream_read_options[] = {
+static const struct xlat stream_read_options[] = {
{ RNORM, "RNORM" },
{ RMSGD, "RMSGD" },
{ RMSGN, "RMSGN" },
{ 0, NULL },
};
-static struct xlat stream_read_flags[] = {
+static const struct xlat stream_read_flags[] = {
#ifdef RPROTDAT
{ RPROTDAT, "RPROTDAT" },
#endif
#endif
#ifdef I_SWROPT
-static struct xlat stream_write_flags[] = {
+static const struct xlat stream_write_flags[] = {
{ SNDZERO, "SNDZERO" },
{ SNDPIPE, "SNDPIPE" },
{ 0, NULL },
#endif /* I_SWROPT */
#ifdef I_ATMARK
-static struct xlat stream_atmark_options[] = {
+static const struct xlat stream_atmark_options[] = {
{ ANYMARK, "ANYMARK" },
{ LASTMARK, "LASTMARK" },
{ 0, NULL },
#endif /* I_ATMARK */
#ifdef TI_BIND
-static struct xlat transport_user_options[] = {
+static const struct xlat transport_user_options[] = {
{ T_CONN_REQ, "T_CONN_REQ" },
{ T_CONN_RES, "T_CONN_RES" },
{ T_DISCON_REQ, "T_DISCON_REQ" },
{ 0, NULL },
};
-static struct xlat transport_user_flags [] = {
+static const struct xlat transport_user_flags [] = {
{ 0, "0" },
{ T_MORE, "T_MORE" },
{ T_EXPEDITED, "T_EXPEDITED" },
#ifdef HAVE_STRUCT_T_OPTHDR
-static struct xlat xti_level [] = {
+static const struct xlat xti_level [] = {
{ XTI_GENERIC, "XTI_GENERIC" },
{ 0, NULL },
};
-static struct xlat xti_generic [] = {
+static const struct xlat xti_generic [] = {
{ XTI_DEBUG, "XTI_DEBUG" },
{ XTI_LINGER, "XTI_LINGER" },
{ XTI_RCVBUF, "XTI_RCVBUF" },
-static struct xlat service_type [] = {
+static const struct xlat service_type [] = {
{ T_COTS, "T_COTS" },
{ T_COTS_ORD, "T_COTS_ORD" },
{ T_CLTS, "T_CLTS" },
{ 0, NULL },
};
-static struct xlat ts_state [] = {
+static const struct xlat ts_state [] = {
{ TS_UNBND, "TS_UNBND" },
{ TS_WACK_BREQ, "TS_WACK_BREQ" },
{ TS_WACK_UREQ, "TS_WACK_UREQ" },
{ 0, NULL },
};
-static struct xlat provider_flags [] = {
+static const struct xlat provider_flags [] = {
{ 0, "0" },
{ SENDZERO, "SENDZERO" },
{ EXPINLINE, "EXPINLINE" },
};
-static struct xlat tli_errors [] = {
+static const struct xlat tli_errors [] = {
{ TBADADDR, "TBADADDR" },
{ TBADOPT, "TBADOPT" },
{ TACCES, "TACCES" },
#include <linux/sysctl.h>
-static struct xlat mount_flags[] = {
+static const struct xlat mount_flags[] = {
{ MS_RDONLY, "MS_RDONLY" },
{ MS_NOSUID, "MS_NOSUID" },
{ MS_NODEV, "MS_NODEV" },
/* These are not macros, but enums. We just copy the values by hand
from Linux 2.6.9 here. */
-static struct xlat personality_options[] = {
+static const struct xlat personality_options[] = {
{ 0, "PER_LINUX" },
{ 0x00800000, "PER_LINUX_32BIT"},
{ 0x04100001, "PER_SVR4" },
}
#include <linux/reboot.h>
-static struct xlat bootflags1[] = {
+static const struct xlat bootflags1[] = {
{ LINUX_REBOOT_MAGIC1, "LINUX_REBOOT_MAGIC1" },
{ 0, NULL },
};
-static struct xlat bootflags2[] = {
+static const struct xlat bootflags2[] = {
{ LINUX_REBOOT_MAGIC2, "LINUX_REBOOT_MAGIC2" },
{ LINUX_REBOOT_MAGIC2A, "LINUX_REBOOT_MAGIC2A" },
{ LINUX_REBOOT_MAGIC2B, "LINUX_REBOOT_MAGIC2B" },
{ 0, NULL },
};
-static struct xlat bootflags3[] = {
+static const struct xlat bootflags3[] = {
{ LINUX_REBOOT_CMD_CAD_OFF, "LINUX_REBOOT_CMD_CAD_OFF" },
{ LINUX_REBOOT_CMD_RESTART, "LINUX_REBOOT_CMD_RESTART" },
{ LINUX_REBOOT_CMD_HALT, "LINUX_REBOOT_CMD_HALT" },
}
#ifdef M68K
-static struct xlat cacheflush_scope[] = {
+static const struct xlat cacheflush_scope[] = {
#ifdef FLUSH_SCOPE_LINE
{ FLUSH_SCOPE_LINE, "FLUSH_SCOPE_LINE" },
#endif
{ 0, NULL },
};
-static struct xlat cacheflush_flags[] = {
+static const struct xlat cacheflush_flags[] = {
#ifdef FLUSH_CACHE_BOTH
{ FLUSH_CACHE_BOTH, "FLUSH_CACHE_BOTH" },
#endif
return 0;
}
-static struct xlat bootflags[] = {
+static const struct xlat bootflags[] = {
{ RB_AUTOBOOT, "RB_AUTOBOOT" }, /* for system auto-booting itself */
{ RB_ASKNAME, "RB_ASKNAME" }, /* ask for file name to reboot from */
{ RB_SINGLE, "RB_SINGLE" }, /* reboot to single user only */
return 0;
}
-static struct xlat mountflags[] = {
+static const struct xlat mountflags[] = {
{ M_RDONLY, "M_RDONLY" },
{ M_NOSUID, "M_NOSUID" },
{ M_NEWTYPE, "M_NEWTYPE" },
{ 0, NULL },
};
-static struct xlat nfsflags[] = {
+static const struct xlat nfsflags[] = {
{ NFSMNT_SOFT, "NFSMNT_SOFT" },
{ NFSMNT_WSIZE, "NFSMNT_WSIZE" },
{ NFSMNT_RSIZE, "NFSMNT_RSIZE" },
return printargs(tcp);
}
-static struct xlat ex_auth_flags[] = {
+static const struct xlat ex_auth_flags[] = {
{ AUTH_UNIX, "AUTH_UNIX" },
{ AUTH_DES, "AUTH_DES" },
{ 0, NULL },
return 0;
}
-static struct xlat sysconflimits[] = {
+static const struct xlat sysconflimits[] = {
#ifdef _SC_ARG_MAX
{ _SC_ARG_MAX, "_SC_ARG_MAX" }, /* space for argv & envp */
#endif
#endif /* SUNOS4 */
#if defined(SUNOS4) || defined(FREEBSD)
-static struct xlat pathconflimits[] = {
+static const struct xlat pathconflimits[] = {
#ifdef _PC_LINK_MAX
{ _PC_LINK_MAX, "_PC_LINK_MAX" }, /* max links to file/dir */
#endif
#include <sys/systeminfo.h>
#include <sys/utsname.h>
-static struct xlat sysconfig_options[] = {
+static const struct xlat sysconfig_options[] = {
#ifdef _CONFIG_NGROUPS
{ _CONFIG_NGROUPS, "_CONFIG_NGROUPS" },
#endif
return 0;
}
-static struct xlat sysinfo_options[] = {
+static const struct xlat sysinfo_options[] = {
{ SI_SYSNAME, "SI_SYSNAME" },
{ SI_HOSTNAME, "SI_HOSTNAME" },
{ SI_RELEASE, "SI_RELEASE" },
#include <sys/syssgi.h>
-static struct xlat syssgi_options[] = {
+static const struct xlat syssgi_options[] = {
{ SGI_SYSID, "SGI_SYSID" },
#ifdef SGI_RDUBLK
{ SGI_RDUBLK, "SGI_RDUBLK" },
#include <sys/fs/nfs.h>
#include <sys/fs/nfs_clnt.h>
-static struct xlat mount_flags[] = {
+static const struct xlat mount_flags[] = {
{ MS_RDONLY, "MS_RDONLY" },
{ MS_FSS, "MS_FSS" },
{ MS_DATA, "MS_DATA" },
{ 0, NULL },
};
-static struct xlat nfs_flags[] = {
+static const struct xlat nfs_flags[] = {
{ NFSMNT_SOFT, "NFSMNT_SOFT" },
{ NFSMNT_WSIZE, "NFSMNT_WSIZE" },
{ NFSMNT_RSIZE, "NFSMNT_RSIZE" },
#include <sys/fs/vx_ioctl.h>
-static struct xlat mount_flags[] = {
+static const struct xlat mount_flags[] = {
{ MS_RDONLY, "MS_RDONLY" },
{ MS_FSS, "MS_FSS" },
{ MS_DATA, "MS_DATA" },
};
#ifdef VX_MS_MASK
-static struct xlat vxfs_flags[] = {
+static const struct xlat vxfs_flags[] = {
{ VX_MS_NOLOG, "VX_MS_NOLOG" },
{ VX_MS_BLKCLEAR, "VX_MS_BLKCLEAR" },
{ VX_MS_SNAPSHOT, "VX_MS_SNAPSHOT" },
};
#endif
-static struct xlat nfs_flags[] = {
+static const struct xlat nfs_flags[] = {
{ NFSMNT_SOFT, "NFSMNT_SOFT" },
{ NFSMNT_WSIZE, "NFSMNT_WSIZE" },
{ NFSMNT_RSIZE, "NFSMNT_RSIZE" },
#ifdef SYS_capget
-static struct xlat capabilities[] = {
+static const struct xlat capabilities[] = {
{ 1<<CAP_CHOWN, "CAP_CHOWN" },
{ 1<<CAP_DAC_OVERRIDE, "CAP_DAC_OVERRIDE"},
{ 1<<CAP_DAC_READ_SEARCH,"CAP_DAC_READ_SEARCH"},
#endif
#ifdef LINUX
-static struct xlat sysctl_root[] = {
+static const struct xlat sysctl_root[] = {
{ CTL_KERN, "CTL_KERN" },
{ CTL_VM, "CTL_VM" },
{ CTL_NET, "CTL_NET" },
{ 0, NULL }
};
-static struct xlat sysctl_kern[] = {
+static const struct xlat sysctl_kern[] = {
{ KERN_OSTYPE, "KERN_OSTYPE" },
{ KERN_OSRELEASE, "KERN_OSRELEASE" },
{ KERN_OSREV, "KERN_OSREV" },
{ 0, NULL }
};
-static struct xlat sysctl_vm[] = {
+static const struct xlat sysctl_vm[] = {
#ifdef VM_SWAPCTL
{ VM_SWAPCTL, "VM_SWAPCTL" },
#endif
{ 0, NULL },
};
-static struct xlat sysctl_net[] = {
+static const struct xlat sysctl_net[] = {
{ NET_CORE, "NET_CORE" },
{ NET_ETHER, "NET_ETHER" },
{ NET_802, "NET_802" },
{ 0, NULL }
};
-static struct xlat sysctl_net_core[] = {
+static const struct xlat sysctl_net_core[] = {
{ NET_CORE_WMEM_MAX, "NET_CORE_WMEM_MAX" },
{ NET_CORE_RMEM_MAX, "NET_CORE_RMEM_MAX" },
{ NET_CORE_WMEM_DEFAULT, "NET_CORE_WMEM_DEFAULT" },
{ 0, NULL }
};
-static struct xlat sysctl_net_unix[] = {
+static const struct xlat sysctl_net_unix[] = {
{ NET_UNIX_DESTROY_DELAY, "NET_UNIX_DESTROY_DELAY" },
{ NET_UNIX_DELETE_DELAY, "NET_UNIX_DELETE_DELAY" },
{ 0, NULL }
};
-static struct xlat sysctl_net_ipv4[] = {
+static const struct xlat sysctl_net_ipv4[] = {
{ NET_IPV4_FORWARD, "NET_IPV4_FORWARD" },
{ NET_IPV4_DYNADDR, "NET_IPV4_DYNADDR" },
{ NET_IPV4_CONF, "NET_IPV4_CONF" },
{ 0, NULL }
};
-static struct xlat sysctl_net_ipv4_route[] = {
+static const struct xlat sysctl_net_ipv4_route[] = {
{ NET_IPV4_ROUTE_FLUSH, "NET_IPV4_ROUTE_FLUSH" },
{ NET_IPV4_ROUTE_MIN_DELAY, "NET_IPV4_ROUTE_MIN_DELAY" },
{ NET_IPV4_ROUTE_MAX_DELAY, "NET_IPV4_ROUTE_MAX_DELAY" },
{ 0, NULL }
};
-static struct xlat sysctl_net_ipv4_conf[] = {
+static const struct xlat sysctl_net_ipv4_conf[] = {
{ NET_IPV4_CONF_FORWARDING, "NET_IPV4_CONF_FORWARDING" },
{ NET_IPV4_CONF_MC_FORWARDING, "NET_IPV4_CONF_MC_FORWARDING" },
{ NET_IPV4_CONF_PROXY_ARP, "NET_IPV4_CONF_PROXY_ARP" },
{ 0, NULL }
};
-static struct xlat sysctl_net_ipv6[] = {
+static const struct xlat sysctl_net_ipv6[] = {
{ NET_IPV6_CONF, "NET_IPV6_CONF" },
{ NET_IPV6_NEIGH, "NET_IPV6_NEIGH" },
{ NET_IPV6_ROUTE, "NET_IPV6_ROUTE" },
{ 0, NULL }
};
-static struct xlat sysctl_net_ipv6_route[] = {
+static const struct xlat sysctl_net_ipv6_route[] = {
{ NET_IPV6_ROUTE_FLUSH, "NET_IPV6_ROUTE_FLUSH" },
{ NET_IPV6_ROUTE_GC_THRESH, "NET_IPV6_ROUTE_GC_THRESH" },
{ NET_IPV6_ROUTE_MAX_SIZE, "NET_IPV6_ROUTE_MAX_SIZE" },
#include <sys/ksym.h>
#include <sys/elf.h>
-static struct xlat ksym_flags[] = {
+static const struct xlat ksym_flags[] = {
{ STT_NOTYPE, "STT_NOTYPE" },
{ STT_FUNC, "STT_FUNC" },
{ STT_OBJECT, "STT_OBJECT" },
struct cred;
#include <sys/nscsys.h>
-static struct xlat ssi_cmd [] = {
+static const struct xlat ssi_cmd [] = {
{ SSISYS_BADOP, "SSISYS_BADOP" },
{ SSISYS_LDLVL_INIT,"SSISYS_LDLVL_INIT"},
{ SSISYS_LDLVL_GETVEC,"SSISYS_LDLVL_GETVEC"},
#define __NEW_UTS_LEN 64
#endif
-static struct xlat sysmips_operations[] = {
+static const struct xlat sysmips_operations[] = {
{ SETNAME, "SETNAME" },
{ FLUSH_CACHE, "FLUSH_CACHE" },
{ MIPS_FIXADE, "MIPS_FIXADE" },
#include <sys/filio.h>
#endif
-static struct xlat tcxonc_options[] = {
+static const struct xlat tcxonc_options[] = {
{ TCOOFF, "TCOOFF" },
{ TCOON, "TCOON" },
{ TCIOFF, "TCIOFF" },
};
#ifdef TCLFLSH
-static struct xlat tcflsh_options[] = {
+static const struct xlat tcflsh_options[] = {
{ TCIFLUSH, "TCIFLUSH" },
{ TCOFLUSH, "TCOFLUSH" },
{ TCIOFLUSH, "TCIOFLUSH" },
};
#endif
-static struct xlat baud_options[] = {
+static const struct xlat baud_options[] = {
{ B0, "B0" },
{ B50, "B50" },
{ B75, "B75" },
{ 0, NULL },
};
-static struct xlat modem_flags[] = {
+static const struct xlat modem_flags[] = {
#ifdef TIOCM_LE
{ TIOCM_LE, "TIOCM_LE", },
#endif
return 0;
}
-static struct xlat which[] = {
+static const struct xlat which[] = {
{ ITIMER_REAL, "ITIMER_REAL" },
{ ITIMER_VIRTUAL,"ITIMER_VIRTUAL"},
{ ITIMER_PROF, "ITIMER_PROF" },
return 0;
}
-static struct xlat clockflags[] = {
+static const struct xlat clockflags[] = {
{ TIMER_ABSTIME, "TIMER_ABSTIME" },
{ 0, NULL }
};
-static struct xlat clocknames[] = {
+static const struct xlat clocknames[] = {
#ifdef CLOCK_REALTIME
{ CLOCK_REALTIME, "CLOCK_REALTIME" },
#endif
#ifndef SIGEV_THREAD_ID
# define SIGEV_THREAD_ID 4
#endif
-static struct xlat sigev_value[] = {
+static const struct xlat sigev_value[] = {
{ SIGEV_SIGNAL+1, "SIGEV_SIGNAL" },
{ SIGEV_NONE+1, "SIGEV_NONE" },
{ SIGEV_THREAD+1, "SIGEV_THREAD" },
char *
xlookup(xlat, val)
-struct xlat *xlat;
+const struct xlat *xlat;
int val;
{
for (; xlat->str != NULL; xlat++)
*/
void
printxval(xlat, val, dflt)
-struct xlat *xlat;
+const struct xlat *xlat;
int val;
char *dflt;
{
*/
int
addflags(xlat, flags)
-struct xlat *xlat;
+const struct xlat *xlat;
int flags;
{
int n;
int
printflags(xlat, flags)
-struct xlat *xlat;
+const struct xlat *xlat;
int flags;
{
int n;
}
is_sun4m = strcmp(name.machine, "sun4m") == 0;
if (is_sun4m) {
- extern struct xlat struct_user_offsets[];
- struct xlat *x;
+ extern const struct xlat struct_user_offsets[];
+ const struct xlat *x;
for (x = struct_user_offsets; x->str; x++)
x->val += 1024;