]> granicus.if.org Git - strace/blobdiff - defs.h
Move ioctl syscall parser to ioctl.c
[strace] / defs.h
diff --git a/defs.h b/defs.h
index e6aca3714fac68fc024de5d942128ce93d1f3a49..6fcb5186a025fa9d9bcf94898235d19e711745fd 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -434,6 +434,13 @@ void perror_msg_and_die(const char *fmt, ...)
        ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
 void die_out_of_memory(void) ATTRIBUTE_NORETURN;
 
+void *xmalloc(size_t size) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1));
+void *xcalloc(size_t nmemb, size_t size)
+       ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2));
+void *xreallocarray(void *ptr, size_t nmemb, size_t size)
+       ATTRIBUTE_ALLOC_SIZE((2, 3));
+char *xstrdup(const char *str) ATTRIBUTE_MALLOC;
+
 #if USE_CUSTOM_PRINTF
 /*
  * See comment in vsprintf.c for allowed formats.
@@ -478,6 +485,7 @@ extern int getfdpath(struct tcb *, int, char *, unsigned);
 extern const char *xlookup(const struct xlat *, const unsigned int);
 extern const char *xlat_search(const struct xlat *, const size_t, const unsigned int);
 
+extern unsigned long get_pagesize(void);
 extern int string_to_uint(const char *str);
 extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits);
 
@@ -489,7 +497,7 @@ extern int print_quoted_string(const char *, unsigned int, unsigned int);
 /* a refers to the lower numbered u_arg,
  * b refers to the higher numbered u_arg
  */
-#if HAVE_LITTLE_ENDIAN_LONG_LONG
+#ifdef HAVE_LITTLE_ENDIAN_LONG_LONG
 # define LONG_LONG(a,b) \
        ((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)))
 #else
@@ -554,11 +562,6 @@ extern const char *sprint_open_modes(int);
 extern void print_loff_t(struct tcb *, long);
 extern void print_seccomp_filter(struct tcb *tcp, unsigned long);
 
-extern const struct_ioctlent *ioctl_lookup(const unsigned int);
-extern const struct_ioctlent *ioctl_next_match(const struct_ioctlent *);
-extern void ioctl_print_code(const unsigned int);
-extern int ioctl_decode(struct tcb *, const unsigned int, long);
-extern int ioctl_decode_command_number(const unsigned int);
 extern int block_ioctl(struct tcb *, const unsigned int, long);
 extern int evdev_ioctl(struct tcb *, const unsigned int, long);
 extern int loop_ioctl(struct tcb *, const unsigned int, long);
@@ -672,3 +675,9 @@ extern unsigned num_quals;
 /* Only ensures that sysent[scno] isn't out of range */
 #define SCNO_IN_RANGE(scno) \
        ((unsigned long)(scno) < nsyscalls)
+
+#ifndef SYS_FUNC_NAME
+# define SYS_FUNC_NAME(syscall_name) sys_ ## syscall_name
+#endif
+
+#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(syscall_name)(struct tcb *tcp)