test-scandirat.c 344 B

12345678910111213
  1. // SPDX-License-Identifier: GPL-2.0
  2. #ifndef _GNU_SOURCE
  3. #define _GNU_SOURCE
  4. #endif
  5. #include <dirent.h>
  6. int main(void)
  7. {
  8. // expects non-NULL, arg3 is 'restrict' so "pointers" have to be different
  9. return scandirat(/*dirfd=*/ 0, /*dirp=*/ (void *)1, /*namelist=*/ (void *)2, /*filter=*/ (void *)3, /*compar=*/ (void *)4);
  10. }
  11. #undef _GNU_SOURCE