Path: utzoo!censor!geac!torsqnt!david From: david@torsqnt.UUCP (David Haynes) Newsgroups: comp.sys.sequent Subject: Re: strtok and strerror Message-ID: <1428@torsqnt.UUCP> Date: 17 Jan 91 13:36:49 GMT References: <278d7266.2e32@petunia.CalPoly.EDU> <118732@uunet.UU.NET> Organization: Sequent Computers (Canada) Ltd., Toronto, CANADA Lines: 57 rbj@uunet.UU.NET (Root Boy Jim) writes: >In article 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 > 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 /* * 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.