From: tedu Date: Sun, 13 Jul 2014 15:52:38 +0000 (+0000) Subject: bzero -> memset. for the speeds. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b67858fa5d37842a712fa90a444d517277ac4695;p=openbsd bzero -> memset. for the speeds. --- diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 0e2f78af63c..df1c92719b2 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_socket.c,v 1.18 2014/03/30 21:54:48 guenther Exp $ */ +/* $OpenBSD: sys_socket.c,v 1.19 2014/07/13 15:52:38 tedu Exp $ */ /* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */ /* @@ -169,7 +169,7 @@ soo_stat(struct file *fp, struct stat *ub, struct proc *p) { struct socket *so = fp->f_data; - bzero(ub, sizeof (*ub)); + memset(ub, 0, sizeof (*ub)); ub->st_mode = S_IFSOCK; if ((so->so_state & SS_CANTRCVMORE) == 0 || so->so_rcv.sb_cc != 0) diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index 34e0329431b..ca4ac125f02 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.28 2014/07/12 18:43:32 tedu Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.29 2014/07/13 15:52:38 tedu Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -132,7 +132,7 @@ q_to_b(struct clist *clp, u_char *cp, int count) if (cc > count) cc = count; bcopy(clp->c_cf, p, cc); - bzero(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); count -= cc; diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index c985968e29e..5d217ad15a3 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.191 2014/07/13 09:52:48 dlg Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.192 2014/07/13 15:52:38 tedu Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -246,7 +246,7 @@ m_gethdr(int nowait, int type) m->m_nextpkt = NULL; m->m_data = m->m_pktdat; m->m_flags = M_PKTHDR; - bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); + memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr)); m->m_pkthdr.pf.prio = IFQ_DEFPRIO; } return (m); @@ -260,7 +260,7 @@ m_inithdr(struct mbuf *m) m->m_nextpkt = NULL; m->m_data = m->m_pktdat; m->m_flags = M_PKTHDR; - bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); + memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr)); m->m_pkthdr.pf.prio = IFQ_DEFPRIO; return (m); @@ -655,7 +655,7 @@ m_copyback(struct mbuf *m0, int off, int len, const void *_cp, int wait) goto out; } } - bzero(mtod(n, caddr_t), off); + memset(mtod(n, caddr_t), 0, off); n->m_len = len + off; m->m_next = n; } diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 04a2d82aeaa..9e8670d082f 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.129 2014/07/09 15:43:33 tedu Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.130 2014/07/13 15:52:38 tedu Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -1012,8 +1012,8 @@ sorflush(struct socket *so) socantrcvmore(so); sbunlock(sb); asb = *sb; - bzero(sb, sizeof (*sb)); - /* XXX - the bzero stomps all over so_rcv */ + memset(sb, 0, sizeof (*sb)); + /* XXX - the memset stomps all over so_rcv */ if (asb.sb_flags & SB_KNOTE) { sb->sb_sel.si_note = asb.sb_sel.si_note; sb->sb_flags = SB_KNOTE; @@ -1312,7 +1312,7 @@ somove(struct socket *so, int wait) m->m_nextpkt = NULL; if (m->m_flags & M_PKTHDR) { m_tag_delete_chain(m); - bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); + memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr)); m->m_pkthdr.len = len; m->m_pkthdr.pf.prio = IFQ_DEFPRIO; } diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 0b9a5945ba5..8d81a4a7a7c 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.75 2014/07/13 15:29:04 tedu Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.76 2014/07/13 15:52:38 tedu Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -429,7 +429,7 @@ unp_bind(struct unpcb *unp, struct mbuf *nam, struct proc *p) nam2->m_len = sizeof(struct sockaddr_un); memcpy(mtod(nam2, struct sockaddr_un *), soun, offsetof(struct sockaddr_un, sun_path) + pathlen); - /* No need to NUL terminate: m_getclr() returns bzero'd mbufs. */ + /* No need to NUL terminate: m_getclr() returns zero'd mbufs. */ soun = mtod(nam2, struct sockaddr_un *);