Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jun 1999 17:16:03 -0700
From:      Mika Nystrom <mika@cs.caltech.edu>
To:        mpp@mpp.pro-ns.net, Tim Vanderhoek <vanderh@ecf.utoronto.ca>
Cc:        sheldonh@FreeBSD.ORG, mika@cs.caltech.edu, freebsd-bugs@FreeBSD.ORG, freebsd-gnats-submit@FreeBSD.ORG
Subject:   Re: docs/12372: man page HISTORY for strdup is wrong 
Message-ID:  <199906250016.RAA12412@varese.cs.caltech.edu>
In-Reply-To: Your message of "Thu, 24 Jun 1999 18:09:46 EDT." <19990624180946.A5806@mad> 

next in thread | previous in thread | raw e-mail | index | archive | help
Tim Vanderhoek writes:
...
>
>If Mika (aka. the PR submitter, but Mika is such a cool-sounding name
>that I needed an excuse to say it twice) is right and it's not in
 
:)

>4.3-Tahoe, then it probably appeared in SVr3 and was quickly copied
>into 43-Reno (or Net/1).  It's rather curious that it appears
>in SunOS 4.1.1 but not 43BSD, though...
>
>A link to a strdup(3) manpage dated Oct. 6, 1987,
>http://wwwwbs.cs.tu-berlin.de/cgi/rtfm/usr/local/man/man3/string.3
>

This looks just like my SunOS man page (notice the reference to the "Sun
processor"!)

I don't remember if I included the following in my PR:
.\" @(#)string.3 1.33 90/02/15 SMI; from UCB 4.2 and S5

The reference to S5 I think ought to account for differences.
In case anyone is curious, I include the man page off the TAHOE 
UNIX tape for reference.

This is from a 9-track marked "4.3BSD-tahoe TAHOE UNIX System 
7/25/88"---sorry but I can't help much with the SysV.. I powered
up an old UNIX PC we have running "UNIX SYSTEM5 3.51m," but it did
not have a strdup declared in string.h.

   Mika


>Hmm...  Here's another one...  This HPUX man seems to state that
>strdup appeared in SVr2...
>http://www.informatik.uni-frankfurt.de/doc/man/hpux/strxfrm.3c.html
>
>Anyways, I'm inclined to place it in SVr2.
>
>
>-- 
>This is my .signature which gets appended to the end of my messages.

.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved.  The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\"	@(#)string.3	6.5 (Berkeley) 10/22/87
.\"
.TH STRING 3  "October 22, 1987"
.UC 4
.SH NAME
strcat, strncat, strcmp, strncmp, strcasecmp, strncasecmp, strcpy,
strncpy, strlen, index, rindex \- string operations
.SH SYNOPSIS
.nf
.B #include <strings.h>
.PP
.B char *strcat(s, append)
.B char *s, *append;
.PP
.B char *strncat(s, append, count)
.B char *s, *append;
.B int count;
.PP
.B strcmp(s1, s2)
.B char *s1, *s2;
.PP
.B strncmp(s1, s2, count)
.B char *s1, *s2;
.B int count;
.PP
.B strcasecmp(s1, s2)
.B char *s1, *s2;
.PP
.B strncasecmp(s1, s2, count)
.B char *s1, *s2;
.B int count;
.PP
.B char *strcpy(to, from)
.B char *to, *from;
.PP
.B char *strncpy(to, from, count)
.B char *to, *from;
.B int count;
.PP
.B strlen(s)
.B char *s;
.PP
.B char *index(s, c)
.B char *s, c;
.PP
.B char *rindex(s, c)
.B char *s, c;
.fi
.SH DESCRIPTION
These functions operate on null-terminated strings.
They do not check for overflow of any receiving string.
.PP
\fIStrcat\fP appends a copy of string \fIappend\fP to the end of string
\fIs\fP. \fIStrncat\fP copies at most \fIcount\fP characters.  Both
return a pointer to the null-terminated result.
.PP
\fIStrcmp\fP compares its arguments and returns an integer greater than,
equal to, or less than 0, according as \fIs1\fP is lexicographically
greater than, equal to, or less than \fIs2\fP.  \fIStrncmp\fP makes the
same comparison but looks at at most \fIcount\fP characters.
\fIStrcasecmp\fP and \fIstrncasecmp\fP are identical in function, but are
case insensitive.  The returned lexicographic difference reflects a
conversion to lower-case.
.PP
\fIStrcpy\fP copies string \fIfrom\fP to \fIto\fP, stopping after the
null character has been moved.  \fIStrncpy\fP copies exactly \fIcount\fP
characters, appending nulls if \fIfrom\fP is less than \fIcount\fP
characters in length; the target may not be null-terminated if the
length of \fIfrom\fP is \fIcount\fP or more.  Both return \fIto\fP.
.PP
\fIStrlen\fP returns the number of non-null characters in \fIs\fP.
.PP
.I Index
.RI ( rindex )
returns a pointer to the first (last) occurrence of character 
\fIc\fP in string \fIs\fP or zero if \fIc\fP does not occur in
the string.  Setting \fIc\fP to NULL works.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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