strace/tests/statfs.c
Dmitry V. Levin 4176d533e0 fsmagic: sort array by value and use bsearch for faster lookup
* defs.h (xlat_search): New prototype.
* util.c (xlat_bsearch_compare, xlat_search): New functions.
* file.c (sprintfstype): Use xlat_search for fsmagic lookup.
* xlat/fsmagic.in: Sort by value and mark as not NULL-terminated.
* tests/statfs.c: New file.
* tests/statfs.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add statfs.
(statfs_CFLAGS): Define.
(TESTS): Add statfs.test.
* tests/.gitignore: Add statfs.
2014-09-22 00:31:06 +00:00

14 lines
193 B
C

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <sys/statfs.h>
#include <assert.h>
int
main(void)
{
struct statfs stb;
assert(statfs("/proc/self/status", &stb) == 0);
return 0;
}