Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Dec 2008 19:13:40 +0100
From:      Florian Smeets <flo@kasimir.com>
To:        freebsd-arch@freebsd.org
Subject:   Adding strndup(3) to libc viable/useful?
Message-ID:  <49381DD4.2000506@kasimir.com>

next in thread | raw e-mail | index | archive | help
Hi,

first of all i hope arch is the correct place to discuss this.

While porting an application to FreeBSD i found that FreeBSDs libc does 
not have strndup. NetBSD added this about 2 years ago. A port of this to 
FreeBSD was very easy.

There are 13 ports in the ports tree right now that patch in strndup via 
a patch in the files/ dir, well actually 12 bring there own version of 
strndup and one replaces it with a call to malloc/strncpy.

Would it make sense to add this to our libc? A patch which does this is 
available here at http://webmail.solomo.de/~flo/strndup.patch

I don't know if there is such a thing as minimum number of ports to 
require a function so that it can be added to the base system...

Any feedback appreciated.

Cheers,
Florian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49381DD4.2000506>