July 14, 2009 posted by Roy Marples
Last night I added getdelim(3) and getline(3) to NetBSD.
A few programs in base system needed to be changed due to having their own getline function, most of which aren't anything like getline(3). Hopefully there won't be much fallout in pkgsrc as a result.
getline(3) is prefered over over functions such as fgetln(3) and fgets(3) because it's standards based and you get a dynamic buffer for really really long lines. However, POSIX did drop the ball on making it a standard from the GNU extension - it should return 0 on EOF and more importantly be called fgetline. Oh well.
I shall be rolling getline(3) support into dhcpcd later, but I'll have to do a link test in the Makefile to see if we can use it. I'm unsure if I want to have a mini configure for dhcpcd or to keep using just make extensions ....