Messages in this thread | | | From | Roland McGrath <> | Subject | Re: [PATCH -mm v2] coredump: extend core dump note section to contain file names of mapped files | Date | Tue, 18 Sep 2012 09:58:19 -0700 (PDT) |
| |
The code needs to be macroized a bit so that compat_binfmt_elf.c will produce a version that encodes 32-bit values correctly so as to be compatible with the output of a native 32-bit kernel.
It's doubtful that rolling your own single loop actually performs better than just calling strlen and memcpy.
Since you're just counting to estimate the size of a temporary buffer, you could skip the initial loop and just estimate based on mm->map_count. Then collect the count in the main loop and write the first word of the buffer last.
Thanks, Roland
| |