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.
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);
/* 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
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);
/* 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)