Dmitry V. Levin
eabace12c4
Automatically convert tests to use TAIL_ALLOC_OBJECT_CONST_PTR macro with the following sed expression: sed -ri \ 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*( *const )?([^ =]+) = tail_alloc\(sizeof\((\2|\*\6)\)\);/\1TAIL_ALLOC_OBJECT_CONST_PTR(\2, \6);/' \ tests/*.c
28 lines
443 B
C
28 lines
443 B
C
#include "tests.h"
|
|
#include <asm/unistd.h>
|
|
|
|
#ifdef __NR_epoll_wait
|
|
|
|
# include <stdio.h>
|
|
# include <sys/epoll.h>
|
|
# include <unistd.h>
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev);
|
|
|
|
long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2);
|
|
printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n",
|
|
ev, rc, errno2name());
|
|
|
|
puts("+++ exited with 0 +++");
|
|
return 0;
|
|
}
|
|
|
|
#else
|
|
|
|
SKIP_MAIN_UNDEFINED("__NR_epoll_wait")
|
|
|
|
#endif
|