rc, errno2name());
void *efault = tail_alloc(1);
- (void) tail_alloc(1);
rc = syscall(__NR_clock_adjtime, CLOCK_REALTIME, efault);
printf("clock_adjtime(CLOCK_REALTIME, %p) = %ld %s (%m)\n",
sample, rc, errno2name());
struct timeval *const ts = tail_alloc(sizeof(*ts) * 2);
- (void) tail_alloc(1);
dirfd = (unsigned long) 0xdeadbeefffffffff;
rc = syscall(__NR_futimesat, dirfd, 0, ts + 1);
{
unsigned long *const nodemask =
tail_alloc(sizeof(*nodemask) * NLONGS(maxnode));
- (void) tail_alloc(1);
if (syscall(__NR_get_mempolicy, 0, nodemask, maxnode, 0, 0)) {
printf("get_mempolicy(NULL, %p, %lu, NULL, 0) = -1 %s (%m)\n",
"MPOL_F_NODE|MPOL_F_ADDR",
flags & ~3, rc, errno2name());
- (void) tail_alloc(1);
mode = tail_alloc(sizeof(*mode));
- (void) tail_alloc(1);
rc = syscall(__NR_get_mempolicy, mode, 0, 0, 0, 0);
printf("get_mempolicy([");
tail_alloc(ngroups ? sizeof(*g1) * ngroups : 1);
GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * (ngroups + 1));
void *efault = g2 + ngroups + 1;
- (void) tail_alloc(1);
get_groups(ngroups, g1);
get_groups(ngroups + 1, g1);
unsigned UGID_TYPE *const r = tail_alloc(sizeof(*r));
unsigned UGID_TYPE *const e = tail_alloc(sizeof(*e));
unsigned UGID_TYPE *const s = tail_alloc(sizeof(*s));
- (void) tail_alloc(1);
if (syscall(SYSCALL_NR, r, e, s))
perror_msg_and_fail(SYSCALL_NAME);
perror_msg_and_skip("userfaultfd");
/* ---- API ---- */
- (void) tail_alloc(1);
struct uffdio_api *api_struct = tail_alloc(sizeof(*api_struct));
/* With a bad fd */
*(char *)area1 = 42;
/* ---- REGISTER ---- */
- (void) tail_alloc(1);
struct uffdio_register *register_struct =
tail_alloc(sizeof(*register_struct));
memset(register_struct, 0, sizeof(*register_struct));
* userfaultfd will cause us to stall.
*/
/* ---- COPY ---- */
- (void) tail_alloc(1);
struct uffdio_copy *copy_struct = tail_alloc(sizeof(*copy_struct));
memset(copy_struct, 0, sizeof(*copy_struct));
fd, area2, area1, pagesize, pagesize, rc);
/* ---- ZEROPAGE ---- */
- (void) tail_alloc(1);
struct uffdio_zeropage *zero_struct = tail_alloc(sizeof(*zero_struct));
madvise(area2, pagesize, MADV_DONTNEED);
fd, area2, pagesize, pagesize, rc);
/* ---- WAKE ---- */
- (void) tail_alloc(1);
struct uffdio_range *range_struct = tail_alloc(sizeof(*range_struct));
memset(range_struct, 0, sizeof(*range_struct));
int
main(void )
{
- (void) tail_alloc(1);
const unsigned int size = get_page_size();
- (void) tail_alloc(1);
void *const page = tail_alloc(size);
- (void) tail_alloc(1);
init_magic(page, size);
const union u_pixel_format {
const unsigned long pid =
(unsigned long) 0xfacefeed00000000 | getpid();
unsigned long count = 1;
- (void) tail_alloc(1);
const unsigned page_size = get_page_size();
const void *const page = tail_alloc(page_size);
const void *const efault = page + page_size;
const void **pages = tail_alloc(sizeof(*pages));
int *nodes = tail_alloc(sizeof(*nodes));
int *status = tail_alloc(sizeof(*status));
- (void) tail_alloc(1);
print_stat_pages(pid, 0, pages, status);
print_move_pages(pid, 0, 0, pages, nodes, status);
printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0) = -1 %s (%m)\n",
errno2name());
- (void) tail_alloc(1);
socklen_t *const plen = tail_alloc(sizeof(*plen));
void *const efault = plen + 1;
struct icmp_filter *const f = tail_alloc(sizeof(*f));
unsigned long long off;
unsigned int flags, nr;
} *const psi = tail_alloc(sizeof(*psi));
- (void) tail_alloc(1);
psi->off = 0xdeadbeeffacefeed;
psi->flags = 1;
const unsigned int nsigs = 4;
const uid_t uid = geteuid();
siginfo_t *sigs = tail_alloc(sizeof(*sigs) * nsigs);
- (void) tail_alloc(1);
psi->off = 0;
psi->flags = 0;
if (!sigset_size)
perror_msg_and_fail("rt_sigprocmask");
- (void) tail_alloc(1);
void *const k_set = tail_alloc(sigset_size);
siginfo_t *const sip = tail_alloc(sizeof(*sip));
- (void) tail_alloc(1);
long rc = do_ptrace(bad_request, pid, 0, 0);
printf("ptrace(%#lx /* PTRACE_??? */, %u, NULL, NULL) = %ld %s (%m)\n",
iov[i].iov_base = &buf[i];
iov[i].iov_len = LEN - i;
}
- tail_alloc(1);
const off_t offset = 0xdefaceddeadbeefLL;
long rc;
unsigned long *const nodemask =
tail_alloc(size ? size : (offset ? 1 : 0));
memset(nodemask, 0, size);
- (void) tail_alloc(1);
long rc = syscall(__NR_set_mempolicy, 0, nodemask, maxnode);
int saved_errno = errno;
const GID_TYPE *const g1 = tail_alloc(sizeof(*g1));
GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * 2);
GID_TYPE *const g3 = tail_alloc(sizeof(*g3) * 3);
- (void) tail_alloc(1);
if (syscall(SYSCALL_NR, 0, g1 + 1))
printf("%s(0, []) = -1 %s (%m)\n",
int
main(void)
{
- (void) tail_alloc(1);
const unsigned int size = PATH_MAX - 1;
const char *p = tail_alloc(size);
const char *const efault = p + size;
- (void) tail_alloc(1);
- (void) tail_alloc(1);
for (; p <= efault; ++p) {
int rc = chdir(p);
sample, rc, errno2name());
struct timeval *const ts = tail_alloc(sizeof(*ts) * 2);
- (void) tail_alloc(1);
rc = syscall(__NR_utimes, 0, ts + 1);
printf("utimes(NULL, %p) = %ld %s (%m)\n",
static const char c_value[] = "foo\0bar";
static const char q_value[] = "foo\\0bar";
- tail_alloc(1);
const char *const z_value = tail_memdup(c_value, sizeof(c_value));
char *const efault = tail_alloc(1) + 1;
const char *const value = tail_memdup(c_value, sizeof(c_value) - 1);
char *const big = tail_alloc(XATTR_SIZE_MAX + 1);
- tail_alloc(1);
assert(fsetxattr(-1, 0, 0, 0, XATTR_CREATE) == -1);
printf("fsetxattr(-1, NULL, NULL, 0, XATTR_CREATE) = -1 %s (%m)\n",