summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-02-22 13:26:10 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2013-02-22 13:26:10 +0100
commita9fe13c9437707fa132fde4e51a20d88381e7430 (patch)
treee1949f82be3db26d69c910610461e967d552b544 /syscall.c
parent40d63b9a92e049986fce1fb91cca10fdd3d3a64a (diff)
downloadstrace-a9fe13c9437707fa132fde4e51a20d88381e7430.tar.gz
strace-a9fe13c9437707fa132fde4e51a20d88381e7430.tar.bz2
strace-a9fe13c9437707fa132fde4e51a20d88381e7430.tar.xz
Create and use struct_sysent and struct_ioctlent typedefs.
This is a preparatory mass replace patch with no code changes. The future change will need to typedef sysent to sysent0, which results in compile failures when "struct sysent" string gets mangled into "struct sysent0". Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/syscall.c b/syscall.c
index 5fce9d8..b92ddc0 100644
--- a/syscall.c
+++ b/syscall.c
@@ -118,18 +118,18 @@
#define NF SYSCALL_NEVER_FAILS
#define MA MAX_ARGS
-static const struct sysent sysent0[] = {
+static const struct_sysent sysent0[] = {
#include "syscallent.h"
};
-#if SUPPORTED_PERSONALITIES >= 2
-static const struct sysent sysent1[] = {
+#if SUPPORTED_PERSONALITIES > 1
+static const struct_sysent sysent1[] = {
# include "syscallent1.h"
};
#endif
-#if SUPPORTED_PERSONALITIES >= 3
-static const struct sysent sysent2[] = {
+#if SUPPORTED_PERSONALITIES > 2
+static const struct_sysent sysent2[] = {
# include "syscallent2.h"
};
#endif
@@ -159,7 +159,7 @@ static const char *const errnoent0[] = {
static const char *const signalent0[] = {
#include "signalent.h"
};
-static const struct ioctlent ioctlent0[] = {
+static const struct_ioctlent ioctlent0[] = {
#include "ioctlent.h"
};
enum { nsyscalls0 = ARRAY_SIZE(sysent0) };
@@ -168,14 +168,14 @@ enum { nsignals0 = ARRAY_SIZE(signalent0) };
enum { nioctlents0 = ARRAY_SIZE(ioctlent0) };
qualbits_t qual_flags0[MAX_QUALS];
-#if SUPPORTED_PERSONALITIES >= 2
+#if SUPPORTED_PERSONALITIES > 1
static const char *const errnoent1[] = {
# include "errnoent1.h"
};
static const char *const signalent1[] = {
# include "signalent1.h"
};
-static const struct ioctlent ioctlent1[] = {
+static const struct_ioctlent ioctlent1[] = {
# include "ioctlent1.h"
};
enum { nsyscalls1 = ARRAY_SIZE(sysent1) };
@@ -185,14 +185,14 @@ enum { nioctlents1 = ARRAY_SIZE(ioctlent1) };
qualbits_t qual_flags1[MAX_QUALS];
#endif
-#if SUPPORTED_PERSONALITIES >= 3
+#if SUPPORTED_PERSONALITIES > 2
static const char *const errnoent2[] = {
# include "errnoent2.h"
};
static const char *const signalent2[] = {
# include "signalent2.h"
};
-static const struct ioctlent ioctlent2[] = {
+static const struct_ioctlent ioctlent2[] = {
# include "ioctlent2.h"
};
enum { nsyscalls2 = ARRAY_SIZE(sysent2) };
@@ -202,10 +202,10 @@ enum { nioctlents2 = ARRAY_SIZE(ioctlent2) };
qualbits_t qual_flags2[MAX_QUALS];
#endif
-const struct sysent *sysent = sysent0;
+const struct_sysent *sysent = sysent0;
const char *const *errnoent = errnoent0;
const char *const *signalent = signalent0;
-const struct ioctlent *ioctlent = ioctlent0;
+const struct_ioctlent *ioctlent = ioctlent0;
unsigned nsyscalls = nsyscalls0;
unsigned nerrnos = nerrnos0;
unsigned nsignals = nsignals0;
@@ -254,7 +254,7 @@ set_personality(int personality)
qual_flags = qual_flags1;
break;
-# if SUPPORTED_PERSONALITIES >= 3
+# if SUPPORTED_PERSONALITIES > 2
case 2:
errnoent = errnoent2;
nerrnos = nerrnos2;
@@ -358,7 +358,7 @@ qualify_one(int n, int bitflag, int not, int pers)
qual_flags0[n] |= bitflag;
}
-#if SUPPORTED_PERSONALITIES >= 2
+#if SUPPORTED_PERSONALITIES > 1
if (pers == 1 || pers < 0) {
if (not)
qual_flags1[n] &= ~bitflag;
@@ -367,7 +367,7 @@ qualify_one(int n, int bitflag, int not, int pers)
}
#endif
-#if SUPPORTED_PERSONALITIES >= 3
+#if SUPPORTED_PERSONALITIES > 2
if (pers == 2 || pers < 0) {
if (not)
qual_flags2[n] &= ~bitflag;
@@ -397,7 +397,7 @@ qual_syscall(const char *s, int bitflag, int not)
rc = 0;
}
-#if SUPPORTED_PERSONALITIES >= 2
+#if SUPPORTED_PERSONALITIES > 1
for (i = 0; i < nsyscalls1; i++)
if (sysent1[i].sys_name &&
strcmp(s, sysent1[i].sys_name) == 0) {
@@ -406,7 +406,7 @@ qual_syscall(const char *s, int bitflag, int not)
}
#endif
-#if SUPPORTED_PERSONALITIES >= 3
+#if SUPPORTED_PERSONALITIES > 2
for (i = 0; i < nsyscalls2; i++)
if (sysent2[i].sys_name &&
strcmp(s, sysent2[i].sys_name) == 0) {
@@ -519,13 +519,13 @@ qualify(const char *s)
if (sysent0[i].sys_flags & n)
qualify_one(i, opt->bitflag, not, 0);
-#if SUPPORTED_PERSONALITIES >= 2
+#if SUPPORTED_PERSONALITIES > 1
for (i = 0; i < nsyscalls1; i++)
if (sysent1[i].sys_flags & n)
qualify_one(i, opt->bitflag, not, 1);
#endif
-#if SUPPORTED_PERSONALITIES >= 3
+#if SUPPORTED_PERSONALITIES > 2
for (i = 0; i < nsyscalls2; i++)
if (sysent2[i].sys_flags & n)
qualify_one(i, opt->bitflag, not, 2);
@@ -1452,7 +1452,7 @@ get_scno(struct tcb *tcp)
tcp->s_ent = &sysent[scno];
tcp->qual_flg = qual_flags[scno];
} else {
- static const struct sysent unknown = {
+ static const struct_sysent unknown = {
.nargs = MAX_ARGS,
.sys_flags = 0,
.sys_func = printargs,