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

##### Functions

    _strncpy          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:         <@(#)strncpy.s	1.1 (Berkeley) 1/20/87\0>
       9:         .even
      10: #endif LIBC_SCCS
      11:
      12: /*
      13:  * Copy string s2 over top of string s1.
      14:  * Truncate or null-pad to n bytes.
      15:  *
      16:  * char *
      17:  * strncpy(s1, s2, n)
      18:  *	char *s1, *s2;
      19:  */
      20: #include "DEFS.h"
      21:
      22: ENTRY(strncpy)
      23:         mov     6(sp),r0        / r0 = n
      24:         beq     3f              / (all done if n == 0)
      25:         mov     2(sp),r1        / r1 = s1
      26:         mov     r2,-(sp)        / need an extra register for s2 ...
      27:         mov     6(sp),r2        / r2 = s2
      28: 1:
      29:         movb    (r2)+,(r1)+     / copy s2 to the end of s1 stopping at the
      30:         beq     4f              /   end of s2 or when n runs out ...
      31:         sob     r0,1b
      32: 2:
      33:         mov     (sp)+,r2        / restore r2
      34: 3:
      35:         mov     2(sp),r0        / and return s1
      36:         rts     pc
      37: 4:
      38:         dec     r0              / the '\0' may also have run n out ...
      39:         beq     2b
      40: 5:
      41:         clrb    (r1)+           / null pad s1 till n runs out
      42:         sob     r0,5b
      43:         br      2b              / clean up and return

#### Defined functions

_strncpy defined in line 22; used 371 times

- in /usr/include/string.h line 15
- in /usr/src/bin/cc.c line 421
- in /usr/src/bin/date.c line 299
- in /usr/src/bin/disklabel/disklabel.c line 310, 821-825(2)
- in /usr/src/bin/expr.y line 238
- in /usr/src/bin/ld/ld.c line 765, 876, 1305, 1672, 1854, 1881
- in /usr/src/bin/login/login.c line 363-366(3), 401, 547-549(2)
- in /usr/src/bin/ls/ls.c line 652
- in /usr/src/bin/mail.c line 71
- in /usr/src/bin/ping/ping.c line 256
- in /usr/src/bin/ps.c line 452, 465, 600
- in /usr/src/bin/rcp.c line 110
- in /usr/src/bin/tcsh/sh.h line 712
- in /usr/src/bin/tcsh/sh.sem.c line 648, 687
- in /usr/src/bin/tcsh/tc.os.c line 725
- in /usr/src/bin/tcsh/tc.who.c line 284-293(3), 305-314(3), 326
- in /usr/src/bin/wall.c line 69
- in /usr/src/bin/who.c line 48
- in /usr/src/games/boggle/boggle.c line 567
- in /usr/src/games/hack/crypt.c line 790
- in /usr/src/games/hack/hack.end.c line 254-256(2)
- in /usr/src/games/hack/hack.main.c line 89-93(3), 156-160(2), 166
- in /usr/src/games/hack/hack.objnam.c line 20
- in /usr/src/games/hack/hack.options.c line 106
- in /usr/src/games/hack/hack.pager.c line 39
- in /usr/src/games/hack/hack.shk.c line 196
- in /usr/src/games/hack/hack.shknam.c line 186
- in /usr/src/games/hack/hack.topl.c line 157
- in /usr/src/games/hack/hack.u_init.c line 173
- in /usr/src/games/hack/hack.unix.c line 121
- in /usr/src/games/hack/makedefs.c line 131
- in /usr/src/games/hunt/answer.c line 330
- in /usr/src/games/hunt/hunt.h line 299
- in /usr/src/games/phantasia/func0.c line 401, 419
- in /usr/src/games/phantasia/main.c line 204
- in /usr/src/games/phantasia/phant.h line 151
- in /usr/src/games/robots/score.c line 117
- in /usr/src/games/rogue/init.c line 285
- in /usr/src/games/rogue/rogue.h line 397
- in /usr/src/games/rogue/score.c line 512
- in /usr/src/games/sail/dr_1.c line 385
- in /usr/src/games/sail/externs.h line 281
- in /usr/src/games/sail/pl_main.c line 170
- in /usr/src/games/sail/sync.c line 276, 315
- in /usr/src/games/warp/ndir.c line 101
- in /usr/src/include/strings.h line 21
- in /usr/src/lib/libc/gen/syslog.c line 221
- in /usr/src/lib/libc/gen/timezone.c line 42
- in /usr/src/lib/libc/net/res_init.c line 62, 82, 123
- in /usr/src/lib/libc/net/res_query.c line 222, 241
- in /usr/src/lib/libc/net/ruserpass.c line 69
- in /usr/src/lib/libc/ns/ns_addr.c line 31
- in /usr/src/lib/mip/scan.c line 1075
- in /usr/src/libexec/comsat/comsat.c line 167, 183
- in /usr/src/libexec/ftpd/ftpd.c line 1130-1132(2)
- in /usr/src/libexec/ftpd/logwtmp.c line 46-53(4)
- in /usr/src/libexec/getty/subr.c line 220
- in /usr/src/libexec/rlogind/rlogind.c line 169
- in /usr/src/libexec/rshd/rshd.c line 237
- in /usr/src/libexec/tcpd/environ.c line 18, 128
- in /usr/src/libexec/tcpd/tcpd.h line 37
- in /usr/src/libexec/telnetd/telnetd.c line 1234
- in /usr/src/local/afio/afio.c line 306, 695
- in /usr/src/local/less/main.c line 346
- in /usr/src/local/mp/mp.h line 37
- in /usr/src/local/mtools/dir_read.c line 133-141(3)
- in /usr/src/local/mtools/dir_write.c line 147, 154-155(2)
- in /usr/src/local/mtools/init.c line 247, 279
- in /usr/src/local/mtools/mdir.c line 33, 108
- in /usr/src/local/mtools/mformat.c line 32, 194
- in /usr/src/local/mtools/mlabel.c line 29, 84
- in /usr/src/local/mtools/mren.c line 28, 110-111(2)
- in /usr/src/new/PORT/B/src/bed/b.h line 58
- in /usr/src/new/PORT/B/src/bed/deco.c line 482
- in /usr/src/new/PORT/B/src/bed/inse.c line 175
- in /usr/src/new/PORT/B/src/bed/que1.c line 557
- in /usr/src/new/PORT/B/src/bed/que2.c line 841
- in /usr/src/new/PORT/B/src/bed/sugg.c line 258, 303
- in /usr/src/new/PORT/B/src/bint/b1obj.h line 60
- in /usr/src/new/PORT/B/src/bint/b1tex.c line 115, 156, 216, 223, 254, 267
- in /usr/src/new/PORT/B/src/bint/b3fil.c line 221
- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 57
- in /usr/src/new/PORT/B/src/bsmall/b2fil.c line 121
- in /usr/src/new/PORT/perl.1.0.0/x2p/a2py.c line 586
- in /usr/src/new/PORT/perl.1.0.10/x2p/a2py.c line 593
- in /usr/src/new/PORT/perl.1.0.16/x2p/a2py.c line 593
- in /usr/src/new/ansi/ansitape.c line 287
- in /usr/src/new/ansi/vmsprep.c line 95
- in /usr/src/new/jove/io.c line 540
- in /usr/src/new/jove/mac.c line 713, 1669
- in /usr/src/new/jove/util.c line 783
- in /usr/src/new/kermit5.188/ckcfns.c line 1303, 1309
- in /usr/src/new/kermit5.188/ckcnet.c line 386, 466
- in /usr/src/new/kermit5.188/ckucmd.c line 191, 204
- in /usr/src/new/kermit5.188/ckufio.c line 1010, 2563
- in /usr/src/new/kermit5.188/ckutio.c line 1081, 1096, 1129, 1256, 1282
- in /usr/src/new/kermit5.188/ckuus4.c line 2160, 2172, 2180, 2426
- in /usr/src/new/kermit5.188/ckuus5.c line 449, 3292
- in /usr/src/new/kermit5.188/ckuus6.c line 367-368(2), 716, 1298
- in /usr/src/new/kermit5.188/ckuusr.c line 1573, 1947
- in /usr/src/new/kermit5.188/ckuusx.c line 335, 430, 437, 448, 456, 1003, 1014, 1028
- in /usr/src/new/nntp/server/newnews.c line 353
- in /usr/src/new/notes/src/adnote.c line 99
- in /usr/src/new/notes/src/bnewshead.c line 64
- in /usr/src/new/notes/src/buildnf.c line 167
- in /usr/src/new/notes/src/dropt.c line 415, 433
- in /usr/src/new/notes/src/loadem.c line 133, 149, 157, 175, 235, 295-296(2), 302, 310, 326
- in /usr/src/new/notes/src/misc.c line 476-477(2)
- in /usr/src/new/notes/src/newsinput.c line 164, 384, 395, 446, 468-469(2), 618, 650-660(4), 697, 725, 762
- in /usr/src/new/notes/src/nfmail.c line 294, 337-341(3)
- in /usr/src/new/notes/src/note.c line 54
- in /usr/src/new/notes/src/parsepath.c line 98-100(2), 250
- in /usr/src/new/notes/src/readem.c line 367, 528
- in /usr/src/new/notes/src/times.c line 101, 165
- in /usr/src/new/rcs/src/rcsbase.h line 321
- in /usr/src/new/rcs/src/rcsfnms.c line 574
- in /usr/src/new/rn/artsrch.c line 262
- in /usr/src/new/rn/intrp.c line 575
- in /usr/src/new/rn/ndir.c line 96
- in /usr/src/new/rn/util.c line 361
- in /usr/src/old/arcv/arcv.c line 88
- in /usr/src/old/dump/dumpitime.c line 112
- in /usr/src/old/regexp.c line 399
- in /usr/src/old/shortc/shortc.c line 211
- in /usr/src/sbin/dump/dumpdir.c line 198
- in /usr/src/sbin/dump/dumpitime.c line 112
- in /usr/src/sbin/ifconfig/ifconfig.c line 122-123(2), 144, 261, 277, 315, 326, 341, 353, 383, 393
- in /usr/src/sbin/init/init.c line 28
- in /usr/src/sbin/quotacheck/preen.c line 211
- in /usr/src/sbin/reboot/reboot.c line 163
- in /usr/src/sbin/restor/restor.c line 492
- in /usr/src/sys/pdpstand/disklabel.c line 243, 249-253(2), 259
- in /usr/src/sys/pdpstand/displaylab.c line 28-32(2)
- in /usr/src/ucb/Mail/cmd3.c line 135
- in /usr/src/ucb/PORT/pascal/utilities/pc.c line 600
- in /usr/src/ucb/PORT/systat/fetch.c line 50, 83
- in /usr/src/ucb/PORT/systat/pigs.c line 126
- in /usr/src/ucb/PORT/systat/systat.h line 91
- in /usr/src/ucb/checknr.c line 174-176(2), 191, 248
- in /usr/src/ucb/ctags.c line 412, 607
- in /usr/src/ucb/ex/ex_io.c line 877
- in /usr/src/ucb/ftp/cmds.c line 1618, 1745, 1751, 1817-1819(2), 2065
- in /usr/src/ucb/ftp/ftp.c line 106, 118, 1269, 1296-1307(4)
- in /usr/src/ucb/ftp/ftp_var.h line 111
- in /usr/src/ucb/indent/lexi.c line 265
- in /usr/src/ucb/last.c line 132
- in /usr/src/ucb/lastcomm.c line 150
- in /usr/src/ucb/msgs/msgs.c line 779, 810, 823
- in /usr/src/ucb/netstat/route.c line 198, 254
- in /usr/src/ucb/rdist/docmd.c line 188
- in /usr/src/ucb/talk/get_names.c line 81-85(3)
- in /usr/src/ucb/users.c line 53
- in /usr/src/ucb/vgrind/regexp.c line 411
- in /usr/src/ucb/vgrind/vfontedpr.c line 340
- in /usr/src/usr.bin/crypt.c line 29
- in /usr/src/usr.bin/find/find.c line 937
- in /usr/src/usr.bin/lint/lint.c line 1007
- in /usr/src/usr.bin/lint/lpass2.c line 209, 669
- in /usr/src/usr.bin/shar/traverse.c line 33, 39
- in /usr/src/usr.bin/tip/tip.c line 101
- in /usr/src/usr.bin/uucp/acucntrl.c line 348-349(2)
- in /usr/src/usr.bin/uucp/anlwrk.c line 56, 95
- in /usr/src/usr.bin/uucp/cico.c line 140, 285
- in /usr/src/usr.bin/uucp/condevs.c line 311
- in /usr/src/usr.bin/uucp/conn.c line 118, 156
- in /usr/src/usr.bin/uucp/gnamef.c line 37
- in /usr/src/usr.bin/uucp/gnsys.c line 94
- in /usr/src/usr.bin/uucp/uucp.c line 72, 127, 133, 160, 166, 458
- in /usr/src/usr.bin/uucp/uucpd.c line 232, 275-278(2)
- in /usr/src/usr.bin/uucp/uucpname.c line 78, 100, 133, 140, 165, 215
- in /usr/src/usr.bin/uucp/uuq.c line 230, 338, 345-347(2)
- in /usr/src/usr.bin/uucp/uusnap.c line 274
- in /usr/src/usr.bin/uucp/uux.c line 147, 187, 543
- in /usr/src/usr.bin/uucp/versys.c line 47
- in /usr/src/usr.lib/libcurses/cr_tty.c line 135
- in /usr/src/usr.lib/libutil/logwtmp.c line 36-43(4)
- in /usr/src/usr.sbin/inetd/inetd.c line 930
- in /usr/src/usr.sbin/lpr/printjob.c line 287-291(2), 316, 323, 329, 346-350(2)
- in /usr/src/usr.sbin/named/named/db_load.c line 388
- in /usr/src/usr.sbin/named/named/ns_main.c line 1148
- in /usr/src/usr.sbin/named/tools/nslookup/main.c line 947
- in /usr/src/usr.sbin/ntp/ntp.c line 260
- in /usr/src/usr.sbin/ntp/ntpd.c line 903
- in /usr/src/usr.sbin/rwhod/rwhod.c line 120
- in /usr/src/usr.sbin/sa/sa.c line 942
- in /usr/src/usr.sbin/sendmail.MX/src/collect.c line 329
- in /usr/src/usr.sbin/sendmail.MX/src/domain.c line 205, 222
- in /usr/src/usr.sbin/sendmail.MX/src/srvrsmtp.c line 474
- in /usr/src/usr.sbin/sendmail/src/collect.c line 323
- in /usr/src/usr.sbin/sendmail/src/srvrsmtp.c line 464
- in /usr/src/usr.sbin/syslogd/syslogd.c line 241, 485, 1063

Last modified: 1987-01-25 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1473 |