[comp.sys.sequent] strtok and strerror

bruce@zuhause.MN.ORG (Bruce Albrecht) (01/13/91)

>In article <278d7266.2e32@petunia.CalPoly.EDU> guy@library.calpoly.edu (Guy Martin) writes:
>I am trying to install fingerd on our Symmetry 27 and I need implementations
>of these two functions.        

The functions strtok and strerror are both in the att C libraries.
--


bruce@zuhause.mn.org	   

rbj@uunet.UU.NET (Root Boy Jim) (01/17/91)

In article <bruce.7340@zuhause.MN.ORG> bruce@zuhause.MN.ORG (Bruce Albrecht) writes:
>The functions strtok and strerror are both in the att C libraries.

On what? I don't see them in our S81 system. We run 3.0.17.9.
Strtok is there, but I don't see strerror.


-- 

	Root Boy Jim Cottrell <rbj@uunet.uu.net>
	Close the gap of the dark year in between

david@torsqnt.UUCP (David Haynes) (01/17/91)

rbj@uunet.UU.NET (Root Boy Jim) writes:

>In article <bruce.7340@zuhause.MN.ORG> bruce@zuhause.MN.ORG (Bruce Albrecht) writes:
>>The functions strtok and strerror are both in the att C libraries.
>
>On what? I don't see them in our S81 system. We run 3.0.17.9.
>Strtok is there, but I don't see strerror.
>-- 
>	Root Boy Jim Cottrell <rbj@uunet.uu.net>
>	Close the gap of the dark year in between

As Chris Torek once posted...

A suitable implementation (which may be compiled and merged into
libc.a if necessary) appears below.  (I could delete the copyright,
since I wrote the thing, but I am feeling perverse. :-) )

/*
 * Copyright (c) 1989 The Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * by the University of California, Berkeley.  The name of the
 * University may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include <string.h>

/*
 * Return the error message corresponding to some error number.
 */
char *
strerror(e)
	int e;
{
	extern int sys_nerr;
	extern char *sys_errlist[];
	static char unknown[30];

	if ((unsigned)e < sys_nerr)
		return (sys_errlist[e]);
	(void) sprintf(unknown, "Unknown error: %d", e);
	return (unknown);
}
-- 
David Haynes	Sequent Computer Systems (Canada) Ltd.	 david@torsqnt.UUCP
----------------------------------------------------------------------------
Next week we will be discussing the Canadian High Tech industry. We will be
visiting both companies and talking with all eight people involved. -- C.R.