summaryrefslogtreecommitdiff
path: root/src/arch.h
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2021-08-04 11:51:12 -0400
committerPaul Moore <paul@paul-moore.com>2021-08-12 12:30:34 -0400
commit17cbd2c253ce63e5e9e3cec867ff58efbe8b5fdc (patch)
treedb15f9ddc82f016889ba2c8bf2fafa8002d751a3 /src/arch.h
parentc261232174c8432e12c39e2fc938a64d562de1d6 (diff)
downloadlibseccomp-17cbd2c253ce63e5e9e3cec867ff58efbe8b5fdc.tar.gz
arch: consolidate all of the multiplexed syscall handling
Not only does this reduce the amount of duplicated code significantly, it removes a lot of the "magic" numbers in the code, and it happened to catch some bugs too. Acked-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'src/arch.h')
-rw-r--r--src/arch.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/arch.h b/src/arch.h
index 38c3a9c..b6484f9 100644
--- a/src/arch.h
+++ b/src/arch.h
@@ -49,10 +49,18 @@ struct arch_def {
ARCH_ENDIAN_BIG,
} endian;
+ /* arch specific constants */
+ int sys_socketcall;
+ int sys_ipc;
+
/* arch specific functions */
- int (*syscall_resolve_name)(const char *name);
- const char *(*syscall_resolve_num)(int num);
- int (*syscall_rewrite)(int *syscall);
+ int (*syscall_resolve_name)(const struct arch_def *arch,
+ const char *name);
+ int (*syscall_resolve_name_raw)(const char *name);
+ const char *(*syscall_resolve_num)(const struct arch_def *arch,
+ int num);
+ const char *(*syscall_resolve_num_raw)(int num);
+ int (*syscall_rewrite)(const struct arch_def *arch, int *syscall);
int (*rule_add)(struct db_filter *db, struct db_api_rule_list *rule);
};