summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bjm.c7
-rw-r--r--defs.h8
-rw-r--r--desc.c14
-rw-r--r--file.c22
-rw-r--r--ipc.c14
-rw-r--r--mem.c16
-rw-r--r--net.c32
-rw-r--r--proc.c10
-rw-r--r--process.c26
-rw-r--r--resource.c12
-rw-r--r--signal.c30
-rw-r--r--sock.c2
-rw-r--r--stream.c34
-rw-r--r--system.c72
-rw-r--r--term.c8
-rw-r--r--time.c8
-rw-r--r--util.c12
17 files changed, 163 insertions, 164 deletions
diff --git a/bjm.c b/bjm.c
index 586da53..2bd0279 100644
--- a/bjm.c
+++ b/bjm.c
@@ -77,7 +77,7 @@ struct module_info
long usecount;
};
-static struct xlat which[] = {
+static const struct xlat which[] = {
{ 0, "0" },
{ QM_MODULES, "QM_MODULES" },
{ QM_DEPS, "QM_DEPS" },
@@ -87,7 +87,7 @@ static struct xlat which[] = {
{ 0, NULL },
};
-static struct xlat modflags[] = {
+static const struct xlat modflags[] = {
{ MOD_UNINITIALIZED, "MOD_UNINITIALIZED" },
{ MOD_RUNNING, "MOD_RUNNING" },
{ MOD_DELETED, "MOD_DELETED" },
@@ -148,7 +148,7 @@ struct tcb *tcp;
}
free(data);
}
- } else
+ } else
tprintf(" /* %Zu entries */ ", ret);
tprintf("}, %Zu", ret);
} else if (tcp->u_arg[1]==QM_SYMBOLS) {
@@ -204,4 +204,3 @@ struct tcb *tcp;
return 0;
}
#endif /* LINUX */
-
diff --git a/defs.h b/defs.h
index f4e12a0..5dfae38 100644
--- a/defs.h
+++ b/defs.h
@@ -413,7 +413,7 @@ extern struct tcb *tcp_last;
#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 *));
@@ -425,10 +425,10 @@ extern void qualify P((char *));
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 *));
diff --git a/desc.c b/desc.c
index b563c86..f4e9257 100644
--- a/desc.c
+++ b/desc.c
@@ -44,7 +44,7 @@
#endif
-static struct xlat fcntlcmds[] = {
+static const struct xlat fcntlcmds[] = {
{ F_DUPFD, "F_DUPFD" },
{ F_GETFD, "F_GETFD" },
{ F_SETFD, "F_SETFD" },
@@ -142,7 +142,7 @@ static struct xlat fcntlcmds[] = {
{ 0, NULL },
};
-static struct xlat fdflags[] = {
+static const struct xlat fdflags[] = {
#ifdef FD_CLOEXEC
{ FD_CLOEXEC, "FD_CLOEXEC" },
#endif
@@ -151,7 +151,7 @@ static struct xlat fdflags[] = {
#ifdef LOCK_SH
-static struct xlat flockcmds[] = {
+static const struct xlat flockcmds[] = {
{ LOCK_SH, "LOCK_SH" },
{ LOCK_EX, "LOCK_EX" },
{ LOCK_NB, "LOCK_NB" },
@@ -161,7 +161,7 @@ static struct xlat flockcmds[] = {
#endif /* LOCK_SH */
-static struct xlat lockfcmds[] = {
+static const struct xlat lockfcmds[] = {
{ F_RDLCK, "F_RDLCK" },
{ F_WRLCK, "F_WRLCK" },
{ F_UNLCK, "F_UNLCK" },
@@ -174,7 +174,7 @@ static struct xlat lockfcmds[] = {
{ 0, NULL },
};
-static struct xlat whence[] = {
+static const struct xlat whence[] = {
{ SEEK_SET, "SEEK_SET" },
{ SEEK_CUR, "SEEK_CUR" },
{ SEEK_END, "SEEK_END" },
@@ -235,7 +235,7 @@ int getlk;
static char *
sprintflags(xlat, flags)
-struct xlat *xlat;
+const struct xlat *xlat;
int flags;
{
static char outstr[1024];
@@ -261,7 +261,7 @@ int
sys_fcntl(tcp)
struct tcb *tcp;
{
- extern struct xlat openmodes[];
+ extern const struct xlat openmodes[];
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
diff --git a/file.c b/file.c
index ed10644..7d9e7ab 100644
--- a/file.c
+++ b/file.c
@@ -205,7 +205,7 @@ struct stat_sparc64 {
* 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" },
@@ -312,7 +312,7 @@ struct tcb *tcp;
}
#ifdef LINUXSPARC
-struct xlat openmodessol[] = {
+const struct xlat openmodessol[] = {
{ 0, "O_RDWR" },
{ 1, "O_RDONLY" },
{ 2, "O_WRONLY" },
@@ -360,7 +360,7 @@ struct tcb *tcp;
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" },
@@ -396,7 +396,7 @@ struct tcb *tcp;
return RVAL_OCTAL;
}
-static struct xlat whence[] = {
+static const struct xlat whence[] = {
{ SEEK_SET, "SEEK_SET" },
{ SEEK_CUR, "SEEK_CUR" },
{ SEEK_END, "SEEK_END" },
@@ -544,7 +544,7 @@ struct tcb *tcp;
/* several stats */
-static struct xlat modetypes[] = {
+static const struct xlat modetypes[] = {
{ S_IFREG, "S_IFREG" },
{ S_IFSOCK, "S_IFSOCK" },
{ S_IFIFO, "S_IFIFO" },
@@ -737,7 +737,7 @@ long addr;
#endif /* SPARC64 */
#endif /* LINUXSPARC */
-struct xlat fileflags[] = {
+const struct xlat fileflags[] = {
#ifdef FREEBSD
{ UF_NODUMP, "UF_NODUMP" },
{ UF_IMMUTABLE, "UF_IMMUTABLE" },
@@ -1292,7 +1292,7 @@ struct tcb *tcp;
#include <sys/acl.h>
-struct xlat aclcmds[] = {
+const struct xlat aclcmds[] = {
#ifdef SETACL
{ SETACL, "SETACL" },
#endif
@@ -1357,7 +1357,7 @@ struct tcb *tcp;
}
-struct xlat aclipc[] = {
+const struct xlat aclipc[] = {
#ifdef IPC_SHM
{ IPC_SHM, "IPC_SHM" },
#endif
@@ -1400,7 +1400,7 @@ struct tcb *tcp;
#ifdef LINUX
-static struct xlat fsmagic[] = {
+static const struct xlat fsmagic[] = {
{ 0x73757245, "CODA_SUPER_MAGIC" },
{ 0x012ff7b7, "COH_SUPER_MAGIC" },
{ 0x1373, "DEVFS_SUPER_MAGIC" },
@@ -1994,7 +1994,7 @@ struct tcb *tcp;
#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" },
@@ -2327,7 +2327,7 @@ struct tcb *tcp;
#endif /* HAVE_SYS_ASYNCH_H */
-struct xlat xattrflags[] = {
+const struct xlat xattrflags[] = {
#ifdef XATTR_CREATE
{ XATTR_CREATE, "XATTR_CREATE" },
{ XATTR_REPLACE, "XATTR_REPLACE" },
diff --git a/ipc.c b/ipc.c
index 3755ab5..1a26472 100644
--- a/ipc.c
+++ b/ipc.c
@@ -67,10 +67,10 @@
# 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" },
@@ -82,7 +82,7 @@ static struct xlat msgctl_flags[] = {
{ 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" },
@@ -101,7 +101,7 @@ static struct xlat semctl_flags[] = {
{ 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" },
@@ -119,7 +119,7 @@ static struct xlat shmctl_flags[] = {
{ 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" },
@@ -129,7 +129,7 @@ static struct xlat resource_flags[] = {
{ 0, NULL },
};
-static struct xlat shm_flags[] = {
+static const struct xlat shm_flags[] = {
#ifdef LINUX
{ SHM_REMAP, "SHM_REMAP" },
#endif /* LINUX */
@@ -138,7 +138,7 @@ static struct xlat shm_flags[] = {
{ 0, NULL },
};
-static struct xlat msg_flags[] = {
+static const struct xlat msg_flags[] = {
{ MSG_NOERROR, "MSG_NOERROR" },
#ifdef LINUX
{ MSG_EXCEPT, "MSG_EXCEPT" },
diff --git a/mem.c b/mem.c
index 5ac9f1d..885ce2d 100644
--- a/mem.c
+++ b/mem.c
@@ -80,7 +80,7 @@ struct tcb *tcp;
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" },
@@ -97,7 +97,7 @@ static struct xlat mmap_prot[] = {
{ 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" },
@@ -345,7 +345,7 @@ struct tcb *tcp;
#ifdef LINUX
-static struct xlat mremap_flags[] = {
+static const struct xlat mremap_flags[] = {
{ MREMAP_MAYMOVE, "MREMAP_MAYMOVE" },
{ 0, NULL }
};
@@ -362,7 +362,7 @@ struct tcb *tcp;
return RVAL_HEX;
}
-static struct xlat madvise_flags[] = {
+static const struct xlat madvise_flags[] = {
#ifdef MADV_NORMAL
{ MADV_NORMAL, "MADV_NORMAL" },
#endif
@@ -394,7 +394,7 @@ struct tcb *tcp;
}
-static struct xlat mlockall_flags[] = {
+static const struct xlat mlockall_flags[] = {
#ifdef MCL_CURRENT
{ MCL_CURRENT, "MCL_CURRENT" },
#endif
@@ -419,7 +419,7 @@ struct tcb *tcp;
#ifdef MS_ASYNC
-static struct xlat mctl_sync[] = {
+static const struct xlat mctl_sync[] = {
#ifdef MS_SYNC
{ MS_SYNC, "MS_SYNC" },
#endif
@@ -448,7 +448,7 @@ struct tcb *tcp;
#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" },
@@ -457,7 +457,7 @@ static struct xlat mctl_funcs[] = {
{ 0, NULL },
};
-static struct xlat mctl_lockas[] = {
+static const struct xlat mctl_lockas[] = {
{ MCL_CURRENT, "MCL_CURRENT" },
{ MCL_FUTURE, "MCL_FUTURE" },
{ 0, NULL },
diff --git a/net.c b/net.c
index 02b0377..cfed9ba 100644
--- a/net.c
+++ b/net.c
@@ -116,7 +116,7 @@
#define IPPROTO_MAX IPPROTO_MAX
#endif
-static struct xlat domains[] = {
+static const struct xlat domains[] = {
#ifdef PF_AAL5
{ PF_AAL5, "PF_AAL5" },
#endif
@@ -218,7 +218,7 @@ static struct xlat domains[] = {
#endif
{ 0, NULL },
};
-struct xlat addrfams[] = {
+const struct xlat addrfams[] = {
#ifdef AF_APPLETALK
{ AF_APPLETALK, "AF_APPLETALK" },
#endif
@@ -314,7 +314,7 @@ struct xlat addrfams[] = {
#endif
{ 0, NULL },
};
-static struct xlat socktypes[] = {
+static const struct xlat socktypes[] = {
{ SOCK_STREAM, "SOCK_STREAM" },
{ SOCK_DGRAM, "SOCK_DGRAM" },
#ifdef SOCK_RAW
@@ -331,7 +331,7 @@ static struct xlat socktypes[] = {
#endif
{ 0, NULL },
};
-static struct xlat socketlayers[] = {
+static const struct xlat socketlayers[] = {
#if defined(SOL_IP)
{ SOL_IP, "SOL_IP" },
#endif
@@ -393,7 +393,7 @@ static struct xlat socketlayers[] = {
};
/*** 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" },
@@ -436,7 +436,7 @@ static struct xlat protocols[] = {
#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" },
@@ -492,7 +492,7 @@ static struct xlat msg_flags[] = {
{ 0, NULL },
};
-static struct xlat sockoptions[] = {
+static const struct xlat sockoptions[] = {
#ifdef SO_ACCEPTCONN
{ SO_ACCEPTCONN, "SO_ACCEPTCONN" },
#endif
@@ -627,7 +627,7 @@ static struct xlat sockoptions[] = {
#endif
#ifdef SOL_IP
-static struct xlat sockipoptions[] = {
+static const struct xlat sockipoptions[] = {
#ifdef IP_TOS
{ IP_TOS, "IP_TOS" },
#endif
@@ -714,7 +714,7 @@ static struct xlat sockipoptions[] = {
#endif /* SOL_IP */
#ifdef SOL_IPV6
-static struct xlat sockipv6options[] = {
+static const struct xlat sockipv6options[] = {
#ifdef IPV6_ADDRFORM
{ IPV6_ADDRFORM, "IPV6_ADDRFORM" },
#endif
@@ -774,14 +774,14 @@ static struct xlat sockipv6options[] = {
#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
@@ -790,7 +790,7 @@ static struct xlat sockrawoptions[] = {
#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)
@@ -811,7 +811,7 @@ static struct xlat sockpacketoptions[] = {
#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)
@@ -852,7 +852,7 @@ static struct xlat socktcpoptions[] = {
#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
@@ -897,7 +897,7 @@ static struct xlat icmpfilterflags[] = {
#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
@@ -1715,7 +1715,7 @@ struct tcb *tcp;
#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" },
diff --git a/proc.c b/proc.c
index 854657d..5752144 100644
--- a/proc.c
+++ b/proc.c
@@ -32,7 +32,7 @@
#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" },
@@ -57,7 +57,7 @@ static struct xlat proc_status_flags[] = {
{ 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" },
@@ -73,7 +73,7 @@ static struct xlat proc_status_why[] = {
{ 0, NULL },
};
-static struct xlat proc_run_flags[] = {
+static const struct xlat proc_run_flags[] = {
{ PRCSIG, "PRCSIG" },
{ PRCFAULT, "PRCFAULT" },
{ PRSTRACE, "PRSTRACE" },
@@ -189,7 +189,7 @@ int code, arg;
#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" },
@@ -199,7 +199,7 @@ static struct xlat proc_status_why[] = {
{ 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 }
diff --git a/process.c b/process.c
index 0011670..afeb8f2 100644
--- a/process.c
+++ b/process.c
@@ -143,7 +143,7 @@
/* 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
@@ -510,7 +510,7 @@ struct tcb *tcp;
#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" },
@@ -1442,7 +1442,7 @@ struct tcb *tcp;
#include <sys/privilege.h>
-static struct xlat procpriv_cmds [] = {
+static const struct xlat procpriv_cmds [] = {
{ SETPRV, "SETPRV" },
{ CLRPRV, "CLRPRV" },
{ PUTPRV, "PUTPRV" },
@@ -1452,7 +1452,7 @@ static struct xlat procpriv_cmds [] = {
};
-static struct xlat procpriv_priv [] = {
+static const struct xlat procpriv_priv [] = {
{ P_OWNER, "P_OWNER" },
{ P_AUDIT, "P_AUDIT" },
{ P_COMPAT, "P_COMPAT" },
@@ -1485,7 +1485,7 @@ static struct xlat procpriv_priv [] = {
};
-static struct xlat procpriv_type [] = {
+static const struct xlat procpriv_type [] = {
{ PS_FIX, "PS_FIX" },
{ PS_INH, "PS_INH" },
{ PS_MAX, "PS_MAX" },
@@ -1499,7 +1499,7 @@ printpriv(tcp, addr, len, opt)
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;
@@ -1743,7 +1743,7 @@ struct tcb *tcp;
#endif
#endif /* LINUX */
-static struct xlat wait4_options[] = {
+static const struct xlat wait4_options[] = {
{ WNOHANG, "WNOHANG" },
#ifndef WSTOPPED
{ WUNTRACED, "WUNTRACED" },
@@ -2015,7 +2015,7 @@ struct tcb *tcp;
#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" },
@@ -2115,7 +2115,7 @@ struct tcb *tcp;
#ifndef SVR4
-static struct xlat ptrace_cmds[] = {
+static const struct xlat ptrace_cmds[] = {
#ifndef FREEBSD
{ PTRACE_TRACEME, "PTRACE_TRACEME" },
{ PTRACE_PEEKTEXT, "PTRACE_PEEKTEXT", },
@@ -2204,7 +2204,7 @@ static struct xlat ptrace_cmds[] = {
#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" },
@@ -2887,7 +2887,7 @@ int
sys_ptrace(tcp)
struct tcb *tcp;
{
- struct xlat *x;
+ const struct xlat *x;
long addr;
if (entering(tcp)) {
@@ -2972,7 +2972,7 @@ struct tcb *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" },
@@ -3042,7 +3042,7 @@ struct tcb *tcp;
return 0;
}
-static struct xlat schedulers[] = {
+static const struct xlat schedulers[] = {
{ SCHED_OTHER, "SCHED_OTHER" },
{ SCHED_RR, "SCHED_RR" },
{ SCHED_FIFO, "SCHED_FIFO" },
diff --git a/resource.c b/resource.c
index 3bb464a..a32c2e9 100644
--- a/resource.c
+++ b/resource.c
@@ -59,7 +59,7 @@
#define sys_setrlimit64 sys_setrlimit
#endif
-static struct xlat resources[] = {
+static const struct xlat resources[] = {
#ifdef RLIMIT_CPU
{ RLIMIT_CPU, "RLIMIT_CPU" },
#endif
@@ -220,7 +220,7 @@ struct tcb *tcp;
#ifndef SVR4
-static struct xlat usagewho[] = {
+static const struct xlat usagewho[] = {
{ RUSAGE_SELF, "RUSAGE_SELF" },
{ RUSAGE_CHILDREN, "RUSAGE_CHILDREN" },
#ifdef RUSAGE_BOTH
@@ -388,7 +388,7 @@ struct tcb *tcp;
#endif /* LINUX */
-static struct xlat priorities[] = {
+static const struct xlat priorities[] = {
{ PRIO_PROCESS, "PRIO_PROCESS" },
{ PRIO_PGRP, "PRIO_PGRP" },
{ PRIO_USER, "PRIO_USER" },
@@ -461,7 +461,7 @@ struct tcb *tcp;
#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" },
@@ -488,7 +488,7 @@ static struct xlat quotacmds[] = {
{ 0, NULL },
};
-static struct xlat quotatypes[] = {
+static const struct xlat quotatypes[] = {
{ USRQUOTA, "USRQUOTA" },
{ GRPQUOTA, "GRPQUOTA" },
{ 0, NULL },
@@ -549,7 +549,7 @@ struct tcb *tcp;
#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" },
diff --git a/signal.c b/signal.c
index 743c9f3..268b095 100644
--- a/signal.c
+++ b/signal.c
@@ -177,7 +177,7 @@ int nsignals;
#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" },
@@ -197,7 +197,7 @@ static struct xlat sigvec_flags[] = {
# endif
#endif
-static struct xlat sigact_flags[] = {
+static const struct xlat sigact_flags[] = {
#ifdef SA_RESTORER
{ SA_RESTORER, "SA_RESTORER" },
#endif
@@ -240,7 +240,7 @@ static struct xlat sigact_flags[] = {
{ 0, NULL },
};
-static struct xlat sigprocmaskcmds[] = {
+static const struct xlat sigprocmaskcmds[] = {
{ SIG_BLOCK, "SIG_BLOCK" },
{ SIG_UNBLOCK, "SIG_UNBLOCK" },
{ SIG_SETMASK, "SIG_SETMASK" },
@@ -528,7 +528,7 @@ typedef struct siginfo
#if defined (SVR4) || defined (LINUX)
-static struct xlat siginfo_codes[] = {
+static const struct xlat siginfo_codes[] = {
#ifdef SI_NOINFO
{ SI_NOINFO, "SI_NOINFO" },
#endif
@@ -559,7 +559,7 @@ static struct xlat siginfo_codes[] = {
{ 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" },
@@ -571,7 +571,7 @@ static struct xlat sigill_codes[] = {
{ 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" },
@@ -583,13 +583,13 @@ static struct xlat sigfpe_codes[] = {
{ 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" },
@@ -599,7 +599,7 @@ static struct xlat sigchld_codes[] = {
{ 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" },
@@ -609,7 +609,7 @@ static struct xlat sigpoll_codes[] = {
{ 0, NULL },
};
-static struct xlat sigprof_codes[] = {
+static const struct xlat sigprof_codes[] = {
#ifdef PROF_SIG
{ PROF_SIG, "PROF_SIG" },
#endif
@@ -617,7 +617,7 @@ static struct xlat sigprof_codes[] = {
};
#ifdef SIGEMT
-static struct xlat sigemt_codes[] = {
+static const struct xlat sigemt_codes[] = {
#ifdef EMT_TAGOVF
{ EMT_TAGOVF, "EMT_TAGOVF" },
#endif
@@ -625,13 +625,13 @@ static struct xlat sigemt_codes[] = {
};
#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" },
@@ -1493,7 +1493,7 @@ struct tcb *tcp;
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" },
@@ -1525,7 +1525,7 @@ typedef struct
#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 },
diff --git a/sock.c b/sock.c
index 412577a..5c1e7ef 100644
--- a/sock.c
+++ b/sock.c
@@ -46,7 +46,7 @@
#endif
#include <net/if.h>
-extern struct xlat addrfams[];
+extern const struct xlat addrfams[];
int
sock_ioctl(tcp, code, arg)
diff --git a/stream.c b/stream.c
index 50bbca4..68be3a4 100644
--- a/stream.c
+++ b/stream.c
@@ -70,7 +70,7 @@ struct strbuf {
#endif /* HAVE_SYS_TIUSER_H */
#ifndef FREEBSD
-static struct xlat msgflags[] = {
+static const struct xlat msgflags[] = {
{ RS_HIPRI, "RS_HIPRI" },
{ 0, NULL },
};
@@ -179,7 +179,7 @@ struct tcb *tcp;
}
#if defined SYS_putpmsg || defined SYS_getpmsg
-static struct xlat pmsgflags[] = {
+static const struct xlat pmsgflags[] = {
#ifdef MSG_HIPRI
{ MSG_HIPRI, "MSG_HIPRI" },
#endif
@@ -274,7 +274,7 @@ struct tcb *tcp;
#ifdef HAVE_SYS_POLL_H
-static struct xlat pollflags[] = {
+static const struct xlat pollflags[] = {
#ifdef POLLIN
{ POLLIN, "POLLIN" },
{ POLLPRI, "POLLPRI" },
@@ -369,7 +369,7 @@ struct tcb *tcp;
#if !defined(LINUX) && !defined(FREEBSD)
-static struct xlat stream_flush_options[] = {
+static const struct xlat stream_flush_options[] = {
{ FLUSHR, "FLUSHR" },
{ FLUSHW, "FLUSHW" },
{ FLUSHRW, "FLUSHRW" },
@@ -379,7 +379,7 @@ static struct xlat stream_flush_options[] = {
{ 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" },
@@ -408,14 +408,14 @@ static struct xlat stream_setsig_flags[] = {
{ 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
@@ -433,7 +433,7 @@ static struct xlat stream_read_flags[] = {
#endif
#ifdef I_SWROPT
-static struct xlat stream_write_flags[] = {
+static const struct xlat stream_write_flags[] = {
{ SNDZERO, "SNDZERO" },
{ SNDPIPE, "SNDPIPE" },
{ 0, NULL },
@@ -441,7 +441,7 @@ static struct xlat stream_write_flags[] = {
#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 },
@@ -449,7 +449,7 @@ static struct xlat stream_atmark_options[] = {
#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" },
@@ -464,7 +464,7 @@ static struct xlat transport_user_options[] = {
{ 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" },
@@ -483,12 +483,12 @@ static struct xlat transport_user_flags [] = {
#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" },
@@ -574,14 +574,14 @@ int len;
-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" },
@@ -602,7 +602,7 @@ static struct xlat ts_state [] = {
{ 0, NULL },
};
-static struct xlat provider_flags [] = {
+static const struct xlat provider_flags [] = {
{ 0, "0" },
{ SENDZERO, "SENDZERO" },
{ EXPINLINE, "EXPINLINE" },
@@ -611,7 +611,7 @@ static struct xlat provider_flags [] = {
};
-static struct xlat tli_errors [] = {
+static const struct xlat tli_errors [] = {
{ TBADADDR, "TBADADDR" },
{ TBADOPT, "TBADOPT" },
{ TACCES, "TACCES" },
diff --git a/system.c b/system.c
index 2da801c..39a9183 100644
--- a/system.c
+++ b/system.c
@@ -67,7 +67,7 @@
#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" },
@@ -115,7 +115,7 @@ struct tcb *tcp;
/* 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" },
@@ -150,19 +150,19 @@ struct tcb *tcp;
}
#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" },
@@ -194,7 +194,7 @@ struct tcb *tcp;
}
#ifdef M68K
-static struct xlat cacheflush_scope[] = {
+static const struct xlat cacheflush_scope[] = {
#ifdef FLUSH_SCOPE_LINE
{ FLUSH_SCOPE_LINE, "FLUSH_SCOPE_LINE" },
#endif
@@ -207,7 +207,7 @@ static struct xlat cacheflush_scope[] = {
{ 0, NULL },
};
-static struct xlat cacheflush_flags[] = {
+static const struct xlat cacheflush_flags[] = {
#ifdef FLUSH_CACHE_BOTH
{ FLUSH_CACHE_BOTH, "FLUSH_CACHE_BOTH" },
#endif
@@ -262,7 +262,7 @@ struct tcb *tcp;
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 */
@@ -321,7 +321,7 @@ struct tcb *tcp;
return 0;
}
-static struct xlat mountflags[] = {
+static const struct xlat mountflags[] = {
{ M_RDONLY, "M_RDONLY" },
{ M_NOSUID, "M_NOSUID" },
{ M_NEWTYPE, "M_NEWTYPE" },
@@ -341,7 +341,7 @@ static struct xlat mountflags[] = {
{ 0, NULL },
};
-static struct xlat nfsflags[] = {
+static const struct xlat nfsflags[] = {
{ NFSMNT_SOFT, "NFSMNT_SOFT" },
{ NFSMNT_WSIZE, "NFSMNT_WSIZE" },
{ NFSMNT_RSIZE, "NFSMNT_RSIZE" },
@@ -462,7 +462,7 @@ struct tcb *tcp;
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 },
@@ -508,7 +508,7 @@ struct tcb *tcp;
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
@@ -549,7 +549,7 @@ struct tcb *tcp;
#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
@@ -616,7 +616,7 @@ struct tcb *tcp;
#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
@@ -704,7 +704,7 @@ struct tcb *tcp;
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" },
@@ -752,7 +752,7 @@ struct tcb *tcp;
#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" },
@@ -1141,7 +1141,7 @@ struct uio;
#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" },
@@ -1155,7 +1155,7 @@ static struct xlat mount_flags[] = {
{ 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" },
@@ -1242,7 +1242,7 @@ struct tcb *tcp;
#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" },
@@ -1256,7 +1256,7 @@ static struct xlat mount_flags[] = {
};
#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" },
@@ -1278,7 +1278,7 @@ static struct xlat vxfs_flags[] = {
};
#endif
-static struct xlat nfs_flags[] = {
+static const struct xlat nfs_flags[] = {
{ NFSMNT_SOFT, "NFSMNT_SOFT" },
{ NFSMNT_WSIZE, "NFSMNT_WSIZE" },
{ NFSMNT_RSIZE, "NFSMNT_RSIZE" },
@@ -1404,7 +1404,7 @@ struct tcb *tcp;
#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"},
@@ -1557,7 +1557,7 @@ struct tcb *tcp;
#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" },
@@ -1568,7 +1568,7 @@ static struct xlat sysctl_root[] = {
{ 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" },
@@ -1610,7 +1610,7 @@ static struct xlat sysctl_kern[] = {
{ 0, NULL }
};
-static struct xlat sysctl_vm[] = {
+static const struct xlat sysctl_vm[] = {
#ifdef VM_SWAPCTL
{ VM_SWAPCTL, "VM_SWAPCTL" },
#endif
@@ -1664,7 +1664,7 @@ static struct xlat sysctl_vm[] = {
{ 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" },
@@ -1683,7 +1683,7 @@ static struct xlat sysctl_net[] = {
{ 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" },
@@ -1696,13 +1696,13 @@ static struct xlat sysctl_net_core[] = {
{ 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" },
@@ -1745,7 +1745,7 @@ static struct xlat sysctl_net_ipv4[] = {
{ 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" },
@@ -1763,7 +1763,7 @@ static struct xlat sysctl_net_ipv4_route[] = {
{ 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" },
@@ -1778,14 +1778,14 @@ static struct xlat sysctl_net_ipv4_conf[] = {
{ 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" },
@@ -1995,7 +1995,7 @@ struct tcb *tcp;
#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" },
@@ -2038,7 +2038,7 @@ struct tcb *tcp;
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"},
@@ -2167,7 +2167,7 @@ struct tcb *tcp;
#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" },
diff --git a/term.c b/term.c
index 5fad3b5..e4bf2f8 100644
--- a/term.c
+++ b/term.c
@@ -48,7 +48,7 @@
#include <sys/filio.h>
#endif
-static struct xlat tcxonc_options[] = {
+static const struct xlat tcxonc_options[] = {
{ TCOOFF, "TCOOFF" },
{ TCOON, "TCOON" },
{ TCIOFF, "TCIOFF" },
@@ -57,7 +57,7 @@ static struct xlat tcxonc_options[] = {
};
#ifdef TCLFLSH
-static struct xlat tcflsh_options[] = {
+static const struct xlat tcflsh_options[] = {
{ TCIFLUSH, "TCIFLUSH" },
{ TCOFLUSH, "TCOFLUSH" },
{ TCIOFLUSH, "TCIOFLUSH" },
@@ -65,7 +65,7 @@ static struct xlat tcflsh_options[] = {
};
#endif
-static struct xlat baud_options[] = {
+static const struct xlat baud_options[] = {
{ B0, "B0" },
{ B50, "B50" },
{ B75, "B75" },
@@ -140,7 +140,7 @@ static struct xlat baud_options[] = {
{ 0, NULL },
};
-static struct xlat modem_flags[] = {
+static const struct xlat modem_flags[] = {
#ifdef TIOCM_LE
{ TIOCM_LE, "TIOCM_LE", },
#endif
diff --git a/time.c b/time.c
index da20f35..ff93d15 100644
--- a/time.c
+++ b/time.c
@@ -188,7 +188,7 @@ struct tcb *tcp;
return 0;
}
-static struct xlat which[] = {
+static const struct xlat which[] = {
{ ITIMER_REAL, "ITIMER_REAL" },
{ ITIMER_VIRTUAL,"ITIMER_VIRTUAL"},
{ ITIMER_PROF, "ITIMER_PROF" },
@@ -359,12 +359,12 @@ struct tcb *tcp;
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
@@ -425,7 +425,7 @@ struct tcb *tcp;
#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" },
diff --git a/util.c b/util.c
index 68b0f7d..5fa9aa7 100644
--- a/util.c
+++ b/util.c
@@ -231,7 +231,7 @@ int n;
char *
xlookup(xlat, val)
-struct xlat *xlat;
+const struct xlat *xlat;
int val;
{
for (; xlat->str != NULL; xlat++)
@@ -245,7 +245,7 @@ int val;
*/
void
printxval(xlat, val, dflt)
-struct xlat *xlat;
+const struct xlat *xlat;
int val;
char *dflt;
{
@@ -264,7 +264,7 @@ char *dflt;
*/
int
addflags(xlat, flags)
-struct xlat *xlat;
+const struct xlat *xlat;
int flags;
{
int n;
@@ -285,7 +285,7 @@ int flags;
int
printflags(xlat, flags)
-struct xlat *xlat;
+const struct xlat *xlat;
int flags;
{
int n;
@@ -933,8 +933,8 @@ long *res;
}
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;