Rolf Eike Beer
2016-Jul-07 14:11 UTC
[PATCH] apply the struct dirent penalty only when needed
(resend, looks like I missed the confirmation mail on first attempt) Hi, attached is a patch that reduces the memory in use on all systems where BROKEN_ONE_BYTE_DIRENT_D_NAME is not defined. It would be good if there was a ac_something variable that could be given to configure to tell it if this workaround is needed or not when cross compiling. We currently do it another way after running configure: ===cat >>conftest.c <<EOF #include <sys/types.h> #include <dirent.h> #include <assert.h> int main() { struct dirent d; static_assert(sizeof(d.d_name) > sizeof(char), "struct to small"); return 0; } EOF ${target_platform}-gcc ${optflags} conftest.c && \ sed -ri 's/#define (BROKEN_ONE_BYTE_DIRENT_D_NAME) 1/#undef \1/' config.h === Of course that only works when one has a compiler that is new enough (what we can guarantee). Greetings, Eike -- Rolf Eike Beer, emlix GmbH, http://www.emlix.com Fon +49 551 30664-0, Fax +49 551 30664-11 Bertha-von-Suttner-Str. 9, 37085 G?ttingen, Germany Sitz der Gesellschaft: G?ttingen, Amtsgericht G?ttingen HR B 3160 Geschaeftsfuehrung: Heike Jordan, Dr. Uwe Kracke ? Ust-IdNr.: DE 205 198 055 emlix ? smart embedded open source -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-apply-the-struct-dirent-penalty-only-when-needed.patch Type: text/x-patch Size: 1383 bytes Desc: not available URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20160707/e8109b18/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 299 bytes Desc: This is a digitally signed message part. URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20160707/e8109b18/attachment-0001.bin>