# 2.11BSD#431 - /usr/src/lib/libc/pdp/gen/strncat.s

##### Functions

    _strncat          X

       1: /*
       2:  * Copyright (c) 1987 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifdef LIBC_SCCS
       8:         <@(#)strncat.s	1.1 (Berkeley) 1/20/87\0>
       9:         .even
      10: #endif LIBC_SCCS
      11:
      12: /*
      13:  * Concatenate string s2 on the end of s1
      14:  * and return the base of s1.  The parameter
      15:  * n is the maximum length of string s2 to
      16:  * concatenate.
      17:  *
      18:  * char *
      19:  * strncat(s1, s2, n)
      20:  *	char *s1, *s2;
      21:  *	int n;
      22:  */
      23: #include "DEFS.h"
      24:
      25: ENTRY(strncat)
      26:         mov     6(sp),r0        / r0 = n
      27:         beq     4f              / (all done if n == 0)
      28:         mov     2(sp),r1        / r1 = s1
      29: 1:
      30:         tstb    (r1)+           / find end of s1
      31:         bne     1b
      32:         dec     r1              / back up to '\0'
      33:         mov     r2,-(sp)        / need an extra register for s2 ...
      34:         mov     6(sp),r2        / r2 = s2
      35: 2:
      36:         movb    (r2)+,(r1)+     / copy s2 to the end of s1 stopping at the
      37:         beq     3f              /   end of s2 or when n runs out ...
      38:         sob     r0,2b
      39:         clrb    (r1)
      40: 3:
      41:         mov     (sp)+,r2        / restore r2
      42: 4:
      43:         mov     2(sp),r0        / and return s1
      44:         rts     pc

#### Defined functions

_strncat defined in line 25; used 32 times

- in /usr/include/string.h line 15
- in /usr/src/bin/rmail.c line 103
- in /usr/src/bin/tcsh/sh.h line 710
- in /usr/src/include/strings.h line 21
- in /usr/src/libexec/getty/main.c line 135
- in /usr/src/libexec/rexecd/rexecd.c line 32, 188-190(3)
- in /usr/src/libexec/rshd/rshd.c line 374-376(3)
- in /usr/src/local/mtools/mdir.c line 35, 110
- in /usr/src/local/mtools/mlabel.c line 29, 86
- in /usr/src/new/PORT/B/src/bint/b3fil.c line 261
- in /usr/src/old/512dumpdir.c line 244
- in /usr/src/old/dump/dumpdir.c line 156
- in /usr/src/old/dump/dumpitime.c line 188
- in /usr/src/old/shortc/shortc.c line 213
- in /usr/src/sbin/dump/dumpdir.c line 176
- in /usr/src/sbin/shutdown/shutdown.c line 215
- in /usr/src/ucb/ftp/cmds.c line 1623
- in /usr/src/ucb/ftp/ftp_var.h line 112
- in /usr/src/ucb/sccs.c line 232, 1541
- in /usr/src/ucb/w.c line 294, 459
- in /usr/src/usr.sbin/named/named/db_load.c line 391
- in /usr/src/usr.sbin/sendmail/aux/rmail.c line 118
- in /usr/src/usr.sbin/syslogd/syslogd.c line 691

Last modified: 1988-01-11 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1061 |