# 2.11BSD#431 - /usr/src/lib/libc/string/strerror.c

##### Functions

    strerror          X

##### Macros

    UPREFIX           X

       1: /*
       2:  * Copyright (c) 1988, 1993
       3:  *	The Regents of the University of California.  All rights reserved.
       4:  *
       5:  * Redistribution and use in source and binary forms, with or without
       6:  * modification, are permitted provided that the following conditions
       7:  * are met:
       8:  * 1. Redistributions of source code must retain the above copyright
       9:  *    notice, this list of conditions and the following disclaimer.
      10:  * 2. Redistributions in binary form must reproduce the above copyright
      11:  *    notice, this list of conditions and the following disclaimer in the
      12:  *    documentation and/or other materials provided with the distribution.
      13:  * 3. All advertising materials mentioning features or use of this software
      14:  *    must display the following acknowledgement:
      15:  *	This product includes software developed by the University of
      16:  *	California, Berkeley and its contributors.
      17:  * 4. Neither the name of the University nor the names of its contributors
      18:  *    may be used to endorse or promote products derived from this software
      19:  *    without specific prior written permission.
      20:  *
      21:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
      22:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      23:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      24:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
      25:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      26:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      27:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      28:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      29:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      30:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      31:  * SUCH DAMAGE.
      32:  */
      33:
      34: #if defined(LIBC_SCCS) && !defined(lint)
      35: static char sccsid[] = "@(#)strerror.c	8.1.1 (2.11BSD) 1996/3/15";
      36: #endif /* LIBC_SCCS and not lint */
      37:
      38: #include <string.h>
      39:
      40: char *
      41: strerror(num)
      42:     int num;
      43: {
      44: #define UPREFIX "Unknown error: "
      45:     static char ebuf[30] = UPREFIX;     /* 32-bit number + slop */
      46:     register unsigned int errnum;
      47:     register char *p, *t;
      48:     char tmp[20];
      49:
      50:     errnum = num;               /* convert to unsigned */
      51:     if (p = syserrlst(errnum))
      52:         return(p);
      53:
      54:     /* Do this by hand, so we don't include stdio(3). */
      55:     t = tmp;
      56:     do {
      57:         *t++ = '0' + (errnum % 10);
      58:     } while (errnum /= 10);
      59:     for (p = ebuf + sizeof(UPREFIX) - 1;;) {
      60:         *p++ = *--t;
      61:         if (t <= tmp)
      62:             break;
      63:     }
      64:     return(ebuf);
      65: }

#### Defined functions

strerror defined in line 40; used 253 times

- in /usr/include/string.h line 24
- in /usr/ingres/source/support/ingres.c line 345
- in /usr/src/bin/ar/append.c line 77
- in /usr/src/bin/ar/ar.c line 88
- in /usr/src/bin/ar/extract.c line 93, 107, 113
- in /usr/src/bin/ar/misc.c line 140
- in /usr/src/bin/ar/replace.c line 107, 157
- in /usr/src/bin/chflags/chflags.c line 184
- in /usr/src/bin/chpass/chpass.c line 91, 121, 148
- in /usr/src/bin/df.c line 282
- in /usr/src/bin/kill.c line 67
- in /usr/src/bin/login/login.c line 435, 441
- in /usr/src/bin/mkdir.c line 76, 96, 106
- in /usr/src/bin/passwd/passwd.c line 68, 95, 221
- in /usr/src/bin/ping/ping.c line 176
- in /usr/src/bin/rcp.c line 356, 429, 493, 507, 737-742(2), 764, 784, 791-794(2), 813
- in /usr/src/bin/tcsh/sh.c line 581, 601, 625, 760, 1540
- in /usr/src/bin/tcsh/sh.dir.c line 382, 451, 510-514(2), 559, 577, 657
- in /usr/src/bin/tcsh/sh.dol.c line 702, 709
- in /usr/src/bin/tcsh/sh.exec.c line 335, 382, 392
- in /usr/src/bin/tcsh/sh.proc.c line 1433, 1446, 1665, 1745, 1767
- in /usr/src/bin/tcsh/sh.sem.c line 653, 706-710(2)
- in /usr/src/bin/tcsh/tc.func.c line 277, 1176
- in /usr/src/bin/tcsh/tc.os.c line 200, 217, 294, 358, 388, 394, 402, 466, 755, 766, 787, 796
- in /usr/src/bin/write.c line 57
- in /usr/src/games/mille/save.c line 80
- in /usr/src/include/strings.h line 30
- in /usr/src/lib/libc/gen/disklabel.c line 458
- in /usr/src/lib/libc/gen/err.c line 84, 154
- in /usr/src/lib/libc/gen/perror.c line 61
- in /usr/src/lib/libc/gen/syslog.c line 142
- in /usr/src/libexec/fingerd/fingerd.c line 96, 138, 148-155(3)
- in /usr/src/libexec/ftpd/ftpd.c line 707, 1275
- in /usr/src/libexec/popper/pop_dropcopy.c line 61, 91, 105, 119
- in /usr/src/libexec/popper/pop_updt.c line 76
- in /usr/src/libexec/rlogind/rlogind.c line 512
- in /usr/src/libexec/tcpd/percent_m.c line 26
- in /usr/src/libexec/tcpd/tli-sequent.c line 160
- in /usr/src/libexec/tcpd/tli.c line 306
- in /usr/src/libexec/telnetd/telnetd.c line 345
- in /usr/src/libexec/tftpd/tftpd.c line 478
- in /usr/src/local/afio/afio.c line 2516
- in /usr/src/new/PORT/hexdump/display.c line 235, 278, 309, 320, 343
- in /usr/src/new/kermit5.188/ckcfn3.c line 1230-1233(2)
- in /usr/src/new/nntp/server/fakesyslog.c line 61
- in /usr/src/new/nntp/xmit/nntpxmit.c line 519
- in /usr/src/new/nntp/xmit/shlock.c line 102
- in /usr/src/new/notes/src/misc.c line 232, 292, 364
- in /usr/src/sbin/init/init.c line 242, 269
- in /usr/src/sbin/mkpasswd/mkpasswd.c line 99, 110
- in /usr/src/sbin/mount/mount_ufs.c line 103
- in /usr/src/sbin/newfs/newfs.c line 130-134(2)
- in /usr/src/sbin/quotacheck/quotacheck.c line 271-276(2), 448
- in /usr/src/ucb/ex/ex_subr.c line 652
- in /usr/src/ucb/ex/exrecover.c line 762
- in /usr/src/ucb/finger/util.c line 45
- in /usr/src/ucb/lock/lock.c line 104
- in /usr/src/ucb/rdist/docmd.c line 313, 325, 384, 418, 469-473(2)
- in /usr/src/ucb/rdist/expand.c line 292
- in /usr/src/ucb/rdist/server.c line 281, 316, 429, 635, 755, 850, 862, 894, 903, 956-961(2), 1058, 1167, 1189, 1267, 1277, 1299
- in /usr/src/ucb/talk/io.c line 95
- in /usr/src/ucb/tcopy.c line 75
- in /usr/src/ucb/tftp/tftp.c line 320, 329
- in /usr/src/ucb/tset/tset.c line 686
- in /usr/src/ucb/w.c line 377, 393
- in /usr/src/ucb/window/wwerror.c line 22
- in /usr/src/usr.bin/file.c line 89, 124
- in /usr/src/usr.bin/m4/eval.c line 188, 199
- in /usr/src/usr.bin/m4/main.c line 198
- in /usr/src/usr.bin/m4/misc.c line 182, 192
- in /usr/src/usr.bin/printf/printf.c line 342, 369-373(2)
- in /usr/src/usr.bin/ranlib/misc.c line 101
- in /usr/src/usr.bin/uucp/acucntrl.c line 185, 211, 244, 251-261(3), 289, 308, 320-325(2), 352-355(2), 371, 386-389(2), 412, 419, 438, 459, 501, 507, 542, 575, 581, 589, 650-655(2)
- in /usr/src/usr.bin/uucp/aculib/bsdtcp.c line 80
- in /usr/src/usr.bin/uucp/condevs.c line 436-444(3), 452-459(3), 465
- in /usr/src/usr.bin/uucp/conn.c line 273, 809
- in /usr/src/usr.bin/uucp/pk1.c line 295, 312, 422
- in /usr/src/usr.bin/xargs/xargs.c line 133, 169, 281-285(2), 291
- in /usr/src/usr.bin/xinstall/xinstall.c line 141-143(2), 179-181(2), 207-211(2), 226-231(2), 242-247(2), 269-274(2), 293-296(2)
- in /usr/src/usr.lib/libI77/err.c line 64
- in /usr/src/usr.lib/libU77/gerror_.c line 36
- in /usr/src/usr.lib/libU77/perror_.c line 38
- in /usr/src/usr.sbin/chroot/chroot.c line 36, 62
- in /usr/src/usr.sbin/cron/misc.c line 258, 269
- in /usr/src/usr.sbin/inetd/inetd.c line 613, 631
- in /usr/src/usr.sbin/lpr/startdaemon.c line 89
- in /usr/src/usr.sbin/rmt/rmt.c line 201-202(2)
- in /usr/src/usr.sbin/sendmail.MX/src/err.c line 333, 365
- in /usr/src/usr.sbin/sendmail/src/err.c line 324, 356
- in /usr/src/usr.sbin/syslogd/syslogd.c line 779
- in /usr/src/usr.sbin/vipw/vipw.c line 66, 72, 81-86(2), 248

#### Defined variables

sccsid defined in line 35; never used

#### Defined macros

UPREFIX defined in line 44; used 2 times

- in line 45, 59

Last modified: 1996-03-21 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1592 |