[TUHS] History of strncpy

Clem Cole clemc at ccc.com
Thu Jan 24 00:16:59 AEST 2013


Nevin/Warren,

RE: strncpy being related the DIRSIZ

I do not think so, certainly not my memory of programming at the time.
 Back then, many other languages I was using such as SAIL and some of the
Algol family had similarly named functions.  I wish he were still with us
to ask, but I really think that when Dennis rewrote the V5/V6 "portable C
library" into what would become stdio and friends, adding the str*.c family
was natural - all the other cool kids had one and it was just a
convenient function
when we all were writing code for C to have it also.

This is pre "white book" (aka V5 & 6) but I have definite memories of the
late Ted Kowalski teaching me what function libraries that were available
for C.  One of my first programs (after helping Ted with fsck) was
rewriting a SAIL based 6502 assembler in C and needing string functions.
I have distinct memory of b*tching to Ted about having to write my own
string functions.

By the mid-late 70s a number of "ctools"or "c libraries" would appear from
UCB, CMU, MIT et al with many of the same basic functions just with
slightly different parameters.  Go look in the old USENIX tapes, you should
see the same stuff getting recreated in many places.

Clem


On Tue, Jan 22, 2013 at 11:03 PM, Nevin Liber <nevin at eviloverlord.com>wrote:

> On another list I am on, a discussion about the history and purpose of
> strncpy has arisen.  The only reference I have found to it is <
> http://lwn.net/Articles/507432/>:
>
> The original reason for strncpy() was when directory names were limited to
> 14 chars. The other two bytes contained the inode number. For that
> particular case, strncpy() worked quite well.
>
> Is that really the reason it came into being?
>
> Just a bit curious,
> --
>  Nevin ":-)" Liber  <mailto:nevin at eviloverlord.com>  (847) 691-1404
>
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20130123/0b64e705/attachment.html>


More information about the TUHS mailing list