tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Import basename_r and dirname_r from FreeBSD?



In article <20120501082311.GA11672@marx.bitnet>,
Jukka Ruohonen  <jruohonen%iki.fi@localhost> wrote:
>On Tue, May 01, 2012 at 09:37:45AM +0200, Emmanuel Dreyfus wrote:
>> FreeBSD has thread-safe basename_r()and dirname_r(). Is it okay to import
>> them?
>> 
>> http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/basename.c?rev=1.9
>> http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/gen/dirname.c?rev=1.8
>
>What are these? I'd say: sure, but not to libc.

There are three flavors of basename_r that I can find:

char *basename_r(const char *, char *); FreeBSD, implicit MAXPATHLEN
char *basename_r(const char *, char *, size_t); Android, size_t len, what if
                                                does not fit?
char *basename_r(const char *); allocates

I am not sure that adding one of the three is beneficial at this point, since
the world has not decided which way to go yet, and this is going to create
more autoconf mess.

christos



Home | Main Index | Thread Index | Old Index