The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: clemc@ccc.com (Clem Cole)
Subject: [TUHS] History of strncpy
Date: Wed, 23 Jan 2013 09:16:59 -0500	[thread overview]
Message-ID: <CAC20D2N_XbQ1Hb=bh-rAChVrRw+C3LOErWS0M845VreFvPaPTQ@mail.gmail.com> (raw)
In-Reply-To: <CAGg_6+MMAB9pqrMkiD7kd8gGyRYdSDeV9AZ7zaAOC9etO=GP1Q@mail.gmail.com>

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>


  parent reply	other threads:[~2013-01-23 14:16 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23  4:03 Nevin Liber
2013-01-23  4:41 ` Warren Toomey
2013-01-23  4:58 ` Warner Losh
2013-01-23 14:16 ` Clem Cole [this message]
2013-01-23 15:01   ` Ronald Natalie
2013-01-23 15:24     ` Armando Stettner
2013-01-23 17:49       ` scj
2013-01-23 18:19       ` Ronald Natalie
2013-01-23 19:33         ` Ronald Natalie
2013-01-23 19:59           ` Clem Cole
2013-01-23 22:43     ` Mary Ann Horton
2013-01-24  0:01       ` Clem Cole
2013-01-24  0:37 ` Jonathan Gevaryahu
2013-01-23 17:56 Michael Spacefalcon
2013-01-23 21:08 ` Larry McVoy
2013-01-23 21:39 ` Ronald Natalie
2013-01-23 21:46   ` John Cowan
2013-01-24  6:02     ` Larry McVoy
2013-01-24  6:34       ` Steve Nickolas
2013-01-24 14:42       ` Ronald Natalie
2013-01-24 14:52         ` Warner Losh
2013-01-24 16:01           ` Ronald Natalie
2013-01-24 18:31             ` Tom Ivar Helbekkmo
2013-01-25  2:06               ` Warner Losh
2013-01-24 16:21           ` Clem Cole
2013-02-01  0:28             ` Larry McVoy
2013-01-31 23:52           ` Random832
2013-02-01  0:06             ` Warner Losh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC20D2N_XbQ1Hb=bh-rAChVrRw+C3LOErWS0M845VreFvPaPTQ@mail.gmail.com' \
    --to=clemc@ccc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).