tests: rewrite getdents test in C for better coverage

* tests/getdents.awk: Remove.
* tests/getdents.out: Remove.
* tests/getdents.c: New file.
* tests/getdents.test: Rewrite.
* tests/getdents64.c: New file.
* tests/getdents64.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add getdents and getdents64.
(TESTS): Add getdents64.test.
(EXTRA_DIST): Remove getdents.awk and getdents.out.
* tests/.gitignore: Add getdents and getdents64.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0ca46dd..86a9a50 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,6 +23,8 @@
 	execveat \
 	fanotify_mark \
 	filter-unavailable \
+	getdents \
+	getdents64 \
 	getrandom \
 	inet-accept-connect-send-recv \
 	ioctl \
@@ -121,6 +123,7 @@
 	fanotify_mark.test \
 	filter-unavailable.test \
 	getdents.test \
+	getdents64.test \
 	getrandom.test \
 	ioctl.test \
 	ip_mreq.test \
@@ -208,8 +211,6 @@
 	     execveat-v.expected \
 	     fanotify_mark.expected \
 	     filter-unavailable.expected \
-	     getdents.awk \
-	     getdents.out \
 	     ip_mreq.expected \
 	     ipc.sh \
 	     ipc_msgbuf.expected \