diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-12-10 02:44:48 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-12-10 02:44:48 +0000 |
commit | d6bc48fe15da4eeeae3bd8f418c3ddf427a48141 (patch) | |
tree | dddba1757c7433e66458a1f753f070379102c6a0 | |
parent | 6c884b1aea9f49bb410c6f668305ba22d26d27de (diff) |
convert bcopy to memcpy. ok millert
-rw-r--r-- | sys/kern/exec_subr.c | 4 | ||||
-rw-r--r-- | sys/kern/init_main.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_acct.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_exec.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_ktrace.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_malloc.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_proc.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_resource.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_tc.c | 4 | ||||
-rw-r--r-- | sys/kern/subr_log.c | 4 | ||||
-rw-r--r-- | sys/kern/sys_generic.c | 6 | ||||
-rw-r--r-- | sys/kern/sysv_msg.c | 6 | ||||
-rw-r--r-- | sys/kern/sysv_sem.c | 6 | ||||
-rw-r--r-- | sys/kern/sysv_shm.c | 8 | ||||
-rw-r--r-- | sys/kern/tty.c | 8 | ||||
-rw-r--r-- | sys/kern/tty_subr.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_cache.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_lookup.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 12 |
20 files changed, 54 insertions, 54 deletions
diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index a50c94c4e8f..0a9621b7a9e 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_subr.c,v 1.42 2014/11/18 02:37:31 tedu Exp $ */ +/* $OpenBSD: exec_subr.c,v 1.43 2014/12/10 02:44:46 tedu Exp $ */ /* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */ /* @@ -91,7 +91,7 @@ vmcmdset_extend(struct exec_vmcmd_set *evsp) /* reallocate the command set */ nvcp = mallocarray(evsp->evs_cnt, sizeof(*nvcp), M_EXEC, M_WAITOK); - bcopy(evsp->evs_cmds, nvcp, (ocnt * sizeof(*nvcp))); + memcpy(nvcp, evsp->evs_cmds, ocnt * sizeof(*nvcp)); if (evsp->evs_cmds != evsp->evs_start) free(evsp->evs_cmds, M_EXEC, ocnt * sizeof(*nvcp)); evsp->evs_cmds = nvcp; diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index eb6858ce885..d8ac5c6dd08 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.225 2014/11/18 21:11:08 miod Exp $ */ +/* $OpenBSD: init_main.c,v 1.226 2014/12/10 02:44:46 tedu Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -287,7 +287,7 @@ main(void *framep) p->p_stat = SONPROC; pr->ps_nice = NZERO; pr->ps_emul = &emul_native; - bcopy("swapper", p->p_comm, sizeof ("swapper")); + strlcpy(p->p_comm, "swapper", sizeof(p->p_comm)); /* Init timeouts. */ timeout_set(&p->p_sleep_to, endtsleep, p); diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 7f1bcc3ea65..bf166768171 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_acct.c,v 1.28 2014/03/30 21:54:48 guenther Exp $ */ +/* $OpenBSD: kern_acct.c,v 1.29 2014/12/10 02:44:46 tedu Exp $ */ /* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */ /*- @@ -176,7 +176,7 @@ acct_process(struct proc *p) */ /* (1) The name of the command that ran */ - bcopy(p->p_comm, acct.ac_comm, sizeof acct.ac_comm); + memcpy(acct.ac_comm, p->p_comm, sizeof acct.ac_comm); /* (2) The amount of user and system time that was used */ calctsru(&pr->ps_tu, &ut, &st, NULL); diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index cd7bda2bc69..ae79aae943c 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.149 2014/11/18 02:37:31 tedu Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.150 2014/12/10 02:44:46 tedu Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -475,7 +475,7 @@ sys_execve(struct proc *p, void *v, register_t *retval) /* set command name & other accounting info */ memset(p->p_comm, 0, sizeof(p->p_comm)); len = min(nid.ni_cnd.cn_namelen, MAXCOMLEN); - bcopy(nid.ni_cnd.cn_nameptr, p->p_comm, len); + memcpy(p->p_comm, nid.ni_cnd.cn_nameptr, len); pr->ps_acflag &= ~AFORK; /* record proc's vnode, for use by sysctl */ diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index c0865c6562e..32cbd272b9a 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.70 2014/10/26 20:34:37 guenther Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.71 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -132,7 +132,7 @@ ktrinitheader(struct ktr_header *kth, struct proc *p, int type) { ktrinitheaderraw(kth, type, p->p_p->ps_pid, p->p_pid + THREAD_PID_OFFSET); - bcopy(p->p_comm, kth->ktr_comm, MAXCOMLEN); + memcpy(kth->ktr_comm, p->p_comm, MAXCOMLEN); } void @@ -341,7 +341,7 @@ ktrstruct(struct proc *p, const char *name, const void *data, size_t datalen) buflen = strlen(name) + 1 + datalen; buf = malloc(buflen, M_TEMP, M_WAITOK); strlcpy(buf, name, buflen); - bcopy(data, buf + strlen(name) + 1, datalen); + memcpy(buf + strlen(name) + 1, data, datalen); kth.ktr_len = buflen; ktrwrite(p, &kth, buf); diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 286843b0ad2..283afaf1cb8 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.125 2014/11/18 02:37:31 tedu Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.126 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -599,7 +599,7 @@ sysctl_malloc(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, return (sysctl_rdstring(oldp, oldlenp, newp, buckstring)); case KERN_MALLOC_BUCKET: - bcopy(&bucket[BUCKETINDX(name[1])], &kb, sizeof(kb)); + memcpy(&kb, &bucket[BUCKETINDX(name[1])], sizeof(kb)); memset(&kb.kb_freelist, 0, sizeof(kb.kb_freelist)); return (sysctl_rdstruct(oldp, oldlenp, newp, &kb, sizeof(kb))); case KERN_MALLOC_KMEMSTATS: diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 10f2728c482..26a2c1a7116 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_proc.c,v 1.61 2014/11/03 03:08:00 deraadt Exp $ */ +/* $OpenBSD: kern_proc.c,v 1.62 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */ /* @@ -240,7 +240,7 @@ enterpgrp(struct process *pr, pid_t pgid, struct pgrp *newpgrp, newsess->s_count = 1; newsess->s_ttyvp = NULL; newsess->s_ttyp = NULL; - bcopy(pr->ps_session->s_login, newsess->s_login, + memcpy(newsess->s_login, pr->ps_session->s_login, sizeof(newsess->s_login)); atomic_clearbits_int(&pr->ps_flags, PS_CONTROLT); pgrp->pg_session = newsess; diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 813c421e1f4..4765850002b 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_resource.c,v 1.51 2014/11/16 12:31:00 deraadt Exp $ */ +/* $OpenBSD: kern_resource.c,v 1.52 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */ /*- @@ -511,7 +511,7 @@ limcopy(struct plimit *lim) } newlim = pool_get(&plimit_pool, PR_WAITOK); - bcopy(lim->pl_rlimit, newlim->pl_rlimit, + memcpy(newlim->pl_rlimit, lim->pl_rlimit, sizeof(struct rlimit) * RLIM_NLIMITS); newlim->p_refcnt = 1; return (newlim); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index df63db8649c..d6d0946ee96 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.274 2014/12/05 04:35:08 uebayasi Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.275 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -2131,7 +2131,7 @@ sysctl_sysvipc(int *name, u_int namelen, void *where, size_t *sizep) #ifdef SYSVSEM case KERN_SYSVIPC_SEM_INFO: if (sema[i] != NULL) - bcopy(sema[i], &semsi->semids[i], + memcpy(&semsi->semids[i], sema[i], dssize); else memset(&semsi->semids[i], 0, dssize); @@ -2140,7 +2140,7 @@ sysctl_sysvipc(int *name, u_int namelen, void *where, size_t *sizep) #ifdef SYSVSHM case KERN_SYSVIPC_SHM_INFO: if (shmsegs[i] != NULL) - bcopy(shmsegs[i], &shmsi->shmids[i], + memcpy(&shmsi->shmids[i], shmsegs[i], dssize); else memset(&shmsi->shmids[i], 0, dssize); diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 7306c3e73ec..18f8ecbd29d 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_tc.c,v 1.27 2014/11/01 23:58:28 tedu Exp $ */ +/* $OpenBSD: kern_tc.c,v 1.28 2014/12/10 02:44:47 tedu Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org> @@ -393,7 +393,7 @@ tc_windup(void) th = tho->th_next; ogen = th->th_generation; th->th_generation = 0; - bcopy(tho, th, offsetof(struct timehands, th_generation)); + memcpy(th, tho, offsetof(struct timehands, th_generation)); /* * Capture a timecounter delta on the current timecounter and if diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index 36099858a05..6603f7d24a2 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_log.c,v 1.23 2014/11/03 03:08:00 deraadt Exp $ */ +/* $OpenBSD: subr_log.c,v 1.24 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */ /* @@ -372,7 +372,7 @@ sys_sendsyslog(struct proc *p, void *v, register_t *retval) iovlen = auio.uio_iovcnt * sizeof (struct iovec); ktriov = malloc(iovlen, M_TEMP, M_WAITOK); - bcopy(auio.uio_iov, ktriov, iovlen); + memcpy(ktriov, auio.uio_iov, iovlen); } #endif diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index f79c61c772e..cee8edfcbe4 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.94 2014/11/03 03:08:00 deraadt Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.95 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -195,7 +195,7 @@ dofilereadv(struct proc *p, int fd, struct file *fp, const struct iovec *iovp, */ if (KTRPOINT(p, KTR_GENIO)) { ktriov = malloc(iovlen, M_TEMP, M_WAITOK); - bcopy(auio.uio_iov, ktriov, iovlen); + memcpy(ktriov, auio.uio_iov, iovlen); } #endif cnt = auio.uio_resid; @@ -348,7 +348,7 @@ dofilewritev(struct proc *p, int fd, struct file *fp, const struct iovec *iovp, */ if (KTRPOINT(p, KTR_GENIO)) { ktriov = malloc(iovlen, M_TEMP, M_WAITOK); - bcopy(auio.uio_iov, ktriov, iovlen); + memcpy(ktriov, auio.uio_iov, iovlen); } #endif cnt = auio.uio_resid; diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 7a2760b7104..8c1aafcf469 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_msg.c,v 1.28 2014/07/12 18:43:32 tedu Exp $ */ +/* $OpenBSD: sysv_msg.c,v 1.29 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */ /* * Copyright (c) 2009 Bret S. Lambert <blambert@openbsd.org> @@ -703,7 +703,7 @@ sysctl_sysvmsg(int *name, u_int namelen, void *where, size_t *sizep) return (ENOMEM); } - bcopy(&msginfo, &info->msginfo, sizeof(struct msginfo)); + memcpy(&info->msginfo, &msginfo, sizeof(struct msginfo)); /* * Special case #3: the previous array-based implementation @@ -711,7 +711,7 @@ sysctl_sysvmsg(int *name, u_int namelen, void *where, size_t *sizep) * upon these indices, so keep behavior consisitent. */ TAILQ_FOREACH(que, &msg_queues, que_next) - bcopy(&que->msqid_ds, &info->msgids[que->que_ix], + memcpy(&info->msgids[que->que_ix], &que->msqid_ds, sizeof(struct msqid_ds)); error = copyout(info, where, infolen); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index de70c0bd815..1e579776f4f 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_sem.c,v 1.50 2014/09/13 16:06:37 doug Exp $ */ +/* $OpenBSD: sysv_sem.c,v 1.51 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */ /* @@ -877,11 +877,11 @@ sysctl_sysvsem(int *name, u_int namelen, void *oldp, size_t *oldlenp, /* Expand semsegs and semseqs arrays */ sema_new = mallocarray(val, sizeof(struct semid_ds *), M_SEM, M_WAITOK|M_ZERO); - bcopy(sema, sema_new, + memcpy(sema_new, sema, seminfo.semmni * sizeof(struct semid_ds *)); newseqs = mallocarray(val, sizeof(unsigned short), M_SEM, M_WAITOK|M_ZERO); - bcopy(semseqs, newseqs, + memcpy(newseqs, semseqs, seminfo.semmni * sizeof(unsigned short)); free(sema, M_SEM, 0); free(semseqs, M_SEM, 0); diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 10b806b922a..81b4f35cedf 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.60 2014/12/09 07:05:06 doug Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.61 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */ /* @@ -494,7 +494,7 @@ shmfork(struct vmspace *vm1, struct vmspace *vm2) shmmap_h = (struct shmmap_head *)vm1->vm_shm; size = sizeof(int) + shmmap_h->shmseg * sizeof(struct shmmap_state); vm2->vm_shm = malloc(size, M_SHM, M_WAITOK); - bcopy(vm1->vm_shm, vm2->vm_shm, size); + memcpy(vm2->vm_shm, vm1->vm_shm, size); for (i = 0, shmmap_s = shmmap_h->state; i < shmmap_h->shmseg; i++, shmmap_s++) { if (shmmap_s->shmid != -1 && @@ -594,13 +594,13 @@ sysctl_sysvshm(int *name, u_int namelen, void *oldp, size_t *oldlenp, /* Expand shmsegs and shmseqs arrays */ newsegs = mallocarray(val, sizeof(struct shmid_ds *), M_SHM, M_WAITOK|M_ZERO); - bcopy(shmsegs, newsegs, + memcpy(newsegs, shmsegs, shminfo.shmmni * sizeof(struct shmid_ds *)); free(shmsegs, M_SHM, 0); shmsegs = newsegs; newseqs = mallocarray(val, sizeof(unsigned short), M_SHM, M_WAITOK|M_ZERO); - bcopy(shmseqs, newseqs, + memcpy(newseqs, shmseqs, shminfo.shmmni * sizeof(unsigned short)); free(shmseqs, M_SHM, 0); shmseqs = newseqs; diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 1c7ba6bffac..ff0bd0ff113 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.116 2014/12/01 07:51:47 deraadt Exp $ */ +/* $OpenBSD: tty.c,v 1.117 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -814,7 +814,7 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) case TIOCGETA: { /* get termios struct */ struct termios *t = (struct termios *)data; - bcopy(&tp->t_termios, t, sizeof(struct termios)); + memcpy(t, &tp->t_termios, sizeof(struct termios)); break; } case TIOCGETD: /* get line discipline */ @@ -926,7 +926,7 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) else CLR(t->c_lflag, EXTPROC); tp->t_lflag = t->c_lflag | ISSET(tp->t_lflag, PENDIN); - bcopy(t->c_cc, tp->t_cc, sizeof(t->c_cc)); + memcpy(tp->t_cc, t->c_cc, sizeof(t->c_cc)); splx(s); break; } @@ -1284,7 +1284,7 @@ void ttychars(struct tty *tp) { - bcopy(ttydefchars, tp->t_cc, sizeof(ttydefchars)); + memcpy(tp->t_cc, ttydefchars, sizeof(ttydefchars)); } /* diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index cc362f9a28a..d0c263f322c 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.30 2014/11/03 03:08:00 deraadt Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.31 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -131,7 +131,7 @@ q_to_b(struct clist *clp, u_char *cp, int count) cc = clp->c_ce - clp->c_cf; if (cc > count) cc = count; - bcopy(clp->c_cf, p, cc); + memcpy(p, clp->c_cf, cc); memset(clp->c_cf, 0, cc); if (clp->c_cq) clrbits(clp->c_cq, clp->c_cf - clp->c_cs, cc); @@ -340,7 +340,7 @@ b_to_q(u_char *cp, int count, struct clist *clp) cc = clp->c_cf - clp->c_cl; if (cc > count) cc = count; - bcopy(p, clp->c_cl, cc); + memcpy(clp->c_cl, p, cc); if (clp->c_cq) clrbits(clp->c_cq, clp->c_cl - clp->c_cs, cc); p += cc; diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index a1775c27fd3..c1de88f9edf 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_cache.c,v 1.37 2014/09/13 16:06:37 doug Exp $ */ +/* $OpenBSD: vfs_cache.c,v 1.38 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */ /* @@ -367,7 +367,7 @@ cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) ncp->nc_dvp = dvp; ncp->nc_dvpid = dvp->v_id; ncp->nc_nlen = cnp->cn_namelen; - bcopy(cnp->cn_nameptr, ncp->nc_name, (unsigned)ncp->nc_nlen); + memcpy(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen); if (RB_EMPTY(&dvp->v_nc_tree)) { vhold(dvp); } diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 15a7c827ed2..2e0fcd59dac 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_lookup.c,v 1.48 2014/12/03 04:17:15 tedu Exp $ */ +/* $OpenBSD: vfs_lookup.c,v 1.49 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: vfs_lookup.c,v 1.17 1996/02/09 19:00:59 christos Exp $ */ /* @@ -244,7 +244,7 @@ badlink: goto badlink; } if (ndp->ni_pathlen > 1) { - bcopy(ndp->ni_next, cp + linklen, ndp->ni_pathlen); + memcpy(cp + linklen, ndp->ni_next, ndp->ni_pathlen); pool_put(&namei_pool, cnp->cn_pnbuf); cnp->cn_pnbuf = cp; } else diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 03f95266fb0..5b582d535d1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.223 2014/11/21 07:14:17 tedu Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.224 2014/12/10 02:44:47 tedu Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1273,7 +1273,7 @@ vfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, /* Make a copy, clear out kernel pointers */ tmpvfsp = malloc(sizeof(*tmpvfsp), M_TEMP, M_WAITOK); - bcopy(vfsp, tmpvfsp, sizeof(*tmpvfsp)); + memcpy(tmpvfsp, vfsp, sizeof(*tmpvfsp)); tmpvfsp->vfc_vfsops = NULL; tmpvfsp->vfc_next = NULL; @@ -2222,9 +2222,9 @@ copy_statfs_info(struct statfs *sbp, const struct mount *mp) sbp->f_syncreads = mbp->f_syncreads; sbp->f_asyncreads = mbp->f_asyncreads; sbp->f_namemax = mbp->f_namemax; - bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN); - bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN); - bcopy(mp->mnt_stat.f_mntfromspec, sbp->f_mntfromspec, MNAMELEN); - bcopy(&mp->mnt_stat.mount_info.ufs_args, &sbp->mount_info.ufs_args, + memcpy(sbp->f_mntonname, mp->mnt_stat.f_mntonname, MNAMELEN); + memcpy(sbp->f_mntfromname, mp->mnt_stat.f_mntfromname, MNAMELEN); + memcpy(sbp->f_mntfromspec, mp->mnt_stat.f_mntfromspec, MNAMELEN); + memcpy(&sbp->mount_info.ufs_args, &mp->mnt_stat.mount_info.ufs_args, sizeof(struct ufs_args)); } |