From 7bec4503678f06e3f5219912e9adc1a18160c3aa Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 24 Jun 2013 19:43:23 +0200 Subject: [PATCH] Add _D_EXACT_NAMLEN and _D_ALLOC_NAMLEN macros to dirent.h. --- libc/include/dirent.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/include/dirent.h b/libc/include/dirent.h index a899fad0..7a25fce0 100644 --- a/libc/include/dirent.h +++ b/libc/include/dirent.h @@ -45,6 +45,9 @@ struct dirent #define _DIRENT_HAVE_D_OFF #undef _DIRENT_HAVE_D_TYPE +#define _D_EXACT_NAMLEN(d) ((d)->d_reclen - __builtin_offsetof(struct dirent, d_name) - 1) +#define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN(d) + 1) + int alphasort(const struct dirent**, const struct dirent**); int closedir(DIR* dir); int dirfd(DIR* dir);