Re: small change to the scandir(3) manual page

2012-01-20 Thread Tobias Ulmer
On Thu, Jan 19, 2012 at 10:17:02AM -0800, Philip Guenther wrote: On Thu, Jan 19, 2012 at 4:18 AM, Edd Barrett vex...@gmail.com wrote: I recently got caught out by scandir's quirky memory allocation. Should we add a note so that others don't have to go through this pain too? Could you

Re: small change to the scandir(3) manual page

2012-01-20 Thread Edd Barrett
On Fri, Jan 20, 2012 at 02:34:51PM +0100, Tobias Ulmer wrote: - builds an array of pointers to variable-size directory entries using malloc(3) ^ Something like this could work. Perhaps also a note that we do this because POSIX says so. -- Best Regards Edd Barrett

Re: small change to the scandir(3) manual page

2012-01-20 Thread Marc Espie
On Fri, Jan 20, 2012 at 02:33:29PM +, Edd Barrett wrote: On Fri, Jan 20, 2012 at 02:34:51PM +0100, Tobias Ulmer wrote: - builds an array of pointers to variable-size directory entries using malloc(3) ^ Something like this could work. Perhaps also a note that we do this because POSIX

Re: small change to the scandir(3) manual page

2012-01-19 Thread Philip Guenther
On Thu, Jan 19, 2012 at 4:18 AM, Edd Barrett vex...@gmail.com wrote: I recently got caught out by scandir's quirky memory allocation. Should we add a note so that others don't have to go through this pain too? Could you elaborate on how this affected your code? I'm trying to think of some way