strace/tests/get_page_size.c
Dmitry V. Levin 87e6b230ff tests: introduce libtests
Introduce tests/libtests.a with common functions for use in tests.

* tests/tests.h: New file.
* tests/error_msg.c: Likewise.
* tests/tail_alloc.c: Likewise.
* tests/get_page_size.c: Likewise.
* tests/Makefile.am (libtests_a_SOURCES, libtests_a_CPPFLAGS,
check_LIBRARIES, LDADD): New variables.
(clock_xettime_LDADD, filter_unavailable_LDADD, mq_LDADD,
pc_LDADD, times_LDADD): Add $(LDADD).
* tests/.gitignore: Add libtests.a.
2016-01-05 23:17:07 +00:00

14 lines
172 B
C

#include "tests.h"
#include <unistd.h>
size_t
get_page_size(void)
{
static size_t page_size;
if (!page_size)
page_size = sysconf(_SC_PAGESIZE);
return page_size;
}