svn commit: r213002 - in stable/8: include lib/libc/gen

Gavin Atkinson gavin at
Wed Sep 22 18:43:47 UTC 2010

On Wed, 2010-09-22 at 18:00 +0000, Rui Paulo wrote:
> Author: rpaulo
> Date: Wed Sep 22 18:00:34 2010
> New Revision: 213002
> URL:
> Log:
>   MFC r197804 (rwatson):
>     Add basename_r(3) to complement basename(3).  basename_r(3) which accepts
>     a caller-allocated buffer of at least MAXPATHLEN, rather than using a
>     global buffer.
>   Note about semantics: while this interface is not POSIXy, there's
>   another major platform that uses it (Android) and the semantics between
>   the two platforms are pretty much the same.

Are you sure?

Ours (just introduced):

    char * basename_r(path, bname)

Android (from [1]):

    int    basename_r(const char* path, char*  buffer, size_t  bufflen)

The semantics seem very different.  Ours allocates a buffer, on Android
you pass in a buffer, for a start.



Gavin Atkinson
FreeBSD committer and bugmeister
GPG: A093262B (313A A79F 697D 3A5C 216A  EDF5 935D EF44 A093 262B)

More information about the svn-src-stable-8 mailing list