/* return name and value of symbol */
#define db_find_sym_and_offset(val,namep,offp) \
- db_symbol_values(db_search_symbol(val,DB_STGY_ANY,offp),namep,0)
+ db_symbol_values(db_search_symbol(val,DB_STGY_ANY,offp),namep,NULL)
/* find name&value given approx val */
#define db_find_xtrn_sym_and_offset(val,namep,offp) \
- db_symbol_values(db_search_symbol(val,DB_STGY_XTRN,offp),namep,0)
+ db_symbol_values(db_search_symbol(val,DB_STGY_XTRN,offp),namep,NULL)
/* ditto, but no locals */
void db_printsym(db_expr_t, db_strategy_t, int (*)(const char *, ...));
-/* $OpenBSD: kern_exit.c,v 1.199 2021/03/12 10:13:28 mpi Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.200 2021/10/24 00:02:24 jsg Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
qr = LIST_FIRST(&pr->ps_children);
if (qr) /* only need this if any child is S_ZOMB */
wakeup(initprocess);
- for (; qr != 0; qr = nqr) {
+ for (; qr != NULL; qr = nqr) {
nqr = LIST_NEXT(qr, ps_sibling);
/*
* Traced processes are killed since their
-/* $OpenBSD: kern_proc.c,v 1.90 2021/02/08 10:51:01 mpi Exp $ */
+/* $OpenBSD: kern_proc.c,v 1.91 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */
/*
LIST_REMOVE(pr, ps_pglist);
if (LIST_EMPTY(&pr->ps_pgrp->pg_members))
pgdelete(pr->ps_pgrp);
- pr->ps_pgrp = 0;
+ pr->ps_pgrp = NULL;
}
/*
-/* $OpenBSD: kern_prot.c,v 1.77 2021/01/17 15:28:22 mvs Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.78 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
newpgrp = pool_get(&pgrp_pool, PR_WAITOK);
if (pid != 0 && pid != curpr->ps_pid) {
- if ((targpr = prfind(pid)) == 0 || !inferior(targpr, curpr)) {
+ if ((targpr = prfind(pid)) == NULL ||
+ !inferior(targpr, curpr)) {
error = ESRCH;
goto out;
}
-/* $OpenBSD: kern_sig.c,v 1.286 2021/10/23 14:56:55 claudio Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.287 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
{
ss->ss_flags = SS_DISABLE;
ss->ss_size = 0;
- ss->ss_sp = 0;
+ ss->ss_sp = NULL;
}
/*
atomic_clearbits_int(siglist, mask);
if (action == SIG_CATCH)
goto runfast;
- if (p->p_wchan == 0)
+ if (p->p_wchan == NULL)
goto run;
p->p_stat = SSLEEP;
goto out;
action = ps->ps_sigact[signum];
info = (ps->ps_siginfo & mask) != 0;
onstack = (ps->ps_sigonstack & mask) != 0;
- sigval.sival_ptr = 0;
+ sigval.sival_ptr = NULL;
if (p->p_sisig != signum) {
trapno = 0;
code = SI_USER;
- sigval.sival_ptr = 0;
+ sigval.sival_ptr = NULL;
} else {
trapno = p->p_sitrapno;
code = p->p_sicode;
* it back into some sleep queue
*/
if (q->p_stat == SSTOP && (q->p_flag & flag) == 0) {
- if (q->p_wchan == 0)
+ if (q->p_wchan == NULL)
setrunnable(q);
else
q->p_stat = SSLEEP;
-/* $OpenBSD: kern_sysctl.c,v 1.394 2021/05/04 21:57:15 bluhm Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.395 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
return (EINVAL);
/* Only root can change PS_NOBROADCASTKILL */
- if (newp != 0 && (error = suser(cp)) != 0)
+ if (newp != NULL && (error = suser(cp)) != 0)
return (error);
/* get the PS_NOBROADCASTKILL flag */
-/* $OpenBSD: kern_tc.c,v 1.74 2021/06/19 13:49:39 cheloha Exp $ */
+/* $OpenBSD: kern_tc.c,v 1.75 2021/10/24 00:02:25 jsg Exp $ */
/*
* Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
static struct timecounter dummy_timecounter = {
.tc_get_timecount = dummy_get_timecount,
- .tc_poll_pps = 0,
+ .tc_poll_pps = NULL,
.tc_counter_mask = ~0u,
.tc_frequency = 1000000,
.tc_name = "dummy",
-/* $OpenBSD: subr_disk.c,v 1.245 2021/06/13 13:17:59 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.246 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
if (error == 0) {
dospartoff = DL_GETBSTART(gptlp);
dospartend = DL_GETBEND(gptlp);
- if (partoffp == 0)
+ if (partoffp == NULL)
*lp = *gptlp;
free(gptlp, M_DEVBUF,
sizeof(struct disklabel));
-/* $OpenBSD: subr_userconf.c,v 1.46 2019/09/06 21:30:31 cheloha Exp $ */
+/* $OpenBSD: subr_userconf.c,v 1.47 2021/10/24 00:02:25 jsg Exp $ */
/*
* Copyright (c) 1996-2001 Mats O Jansson <moj@stacken.kth.se>
struct cfdata *cd;
int ln;
- while (cfdata[i].cf_attach != 0) {
+ while (cfdata[i].cf_attach != NULL) {
userconf_maxdev = i;
userconf_totdev = i;
i++;
}
- while (cfdata[i].cf_attach == 0) {
+ while (cfdata[i].cf_attach == NULL) {
userconf_totdev = i;
i++;
}
break;
}
- while (cfdata[i].cf_attach != 0) {
+ while (cfdata[i].cf_attach != NULL) {
if (strlen(cfdata[i].cf_driver->cd_name) == len) {
/*
/* Find max unit number of the device type */
i = 0;
- while (cfdata[i].cf_attach != 0) {
+ while (cfdata[i].cf_attach != NULL) {
if (strlen(cfdata[i].cf_driver->cd_name) == len &&
strncasecmp(dev, cfdata[i].cf_driver->cd_name,
len) == 0) {
star_unit = -1;
i = 0;
- while (cfdata[i].cf_attach != 0) {
+ while (cfdata[i].cf_attach != NULL) {
if (strlen(cfdata[i].cf_driver->cd_name) == len &&
strncasecmp(dev, cfdata[i].cf_driver->cd_name,
len) == 0) {
star_unit++;
i = 0;
- while (cfdata[i].cf_attach != 0) {
+ while (cfdata[i].cf_attach != NULL) {
if (strlen(cfdata[i].cf_driver->cd_name) == len &&
strncasecmp(dev, cfdata[i].cf_driver->cd_name,
len) == 0) {
-/* $OpenBSD: sys_socket.c,v 1.46 2021/06/07 09:10:32 mpi Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.47 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
flags = (fp->f_flag & FNONBLOCK) ? MSG_DONTWAIT : 0;
error = soclose(fp->f_data, flags);
}
- fp->f_data = 0;
+ fp->f_data = NULL;
return (error);
}
-/* $OpenBSD: tty.c,v 1.169 2021/05/19 18:10:45 kettenis Exp $ */
+/* $OpenBSD: tty.c,v 1.170 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
SET(tp->t_state, TS_TYPEN);
tq = tp->t_rawq;
tp->t_rawq.c_cc = 0;
- tp->t_rawq.c_cf = tp->t_rawq.c_cl = 0;
+ tp->t_rawq.c_cf = tp->t_rawq.c_cl = NULL;
while ((c = getc(&tq)) >= 0)
ttyinput(c, tp);
CLR(tp->t_state, TS_TYPEN);
-/* $OpenBSD: tty_pty.c,v 1.109 2021/10/22 15:11:32 mpi Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.110 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
- if (tp->t_oproc == 0)
+ if (tp->t_oproc == NULL)
return (EIO);
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
(void)(*linesw[tp->t_line].l_modem)(tp, 0);
tp->t_state &= ~TS_CARR_ON;
- tp->t_oproc = 0; /* mark closed */
+ tp->t_oproc = NULL; /* mark closed */
return (0);
}
-/* $OpenBSD: uipc_syscalls.c,v 1.193 2021/07/02 12:17:41 bluhm Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.194 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
msg.msg_namelen = SCARG(uap, tolen);
msg.msg_iov = &aiov;
msg.msg_iovlen = 1;
- msg.msg_control = 0;
+ msg.msg_control = NULL;
msg.msg_flags = 0;
aiov.iov_base = (char *)SCARG(uap, buf);
aiov.iov_len = SCARG(uap, len);
msg.msg_iovlen = 1;
aiov.iov_base = SCARG(uap, buf);
aiov.iov_len = SCARG(uap, len);
- msg.msg_control = 0;
+ msg.msg_control = NULL;
msg.msg_flags = SCARG(uap, flags);
return (recvit(p, SCARG(uap, s), &msg,
(caddr_t)SCARG(uap, fromlenaddr), retval));
goto bad;
m = m_getclr(M_WAIT, MT_SONAME);
s = solock(so);
- error = (*so->so_proto->pr_usrreq)(so, PRU_SOCKADDR, 0, m, 0, p);
+ error = (*so->so_proto->pr_usrreq)(so, PRU_SOCKADDR, NULL, m, NULL, p);
sounlock(so, s);
if (error)
goto bad;
goto bad;
m = m_getclr(M_WAIT, MT_SONAME);
s = solock(so);
- error = (*so->so_proto->pr_usrreq)(so, PRU_PEERADDR, 0, m, 0, p);
+ error = (*so->so_proto->pr_usrreq)(so, PRU_PEERADDR, NULL, m, NULL, p);
sounlock(so, s);
if (error)
goto bad;
-/* $OpenBSD: vfs_biomem.c,v 1.50 2021/09/05 11:44:46 mpi Exp $ */
+/* $OpenBSD: vfs_biomem.c,v 1.51 2021/10/24 00:02:25 jsg Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
TAILQ_REMOVE(&buf_valist, bp, b_valist);
bcstats.kvaslots_avail--;
va = (vaddr_t)bp->b_data;
- bp->b_data = 0;
+ bp->b_data = NULL;
pmap_kremove(va, bp->b_bufsize);
pmap_update(pmap_kernel());
-/* $OpenBSD: vfs_lookup.c,v 1.85 2021/07/16 07:59:38 claudio Exp $ */
+/* $OpenBSD: vfs_lookup.c,v 1.86 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: vfs_lookup.c,v 1.17 1996/02/09 19:00:59 christos Exp $ */
/*
vfs_lookup(struct nameidata *ndp)
{
char *cp; /* pointer into pathname argument */
- struct vnode *dp = 0; /* the directory we are searching */
+ struct vnode *dp = NULL; /* the directory we are searching */
struct vnode *tdp; /* saved dp */
struct mount *mp; /* mount table entry */
int docache; /* == 0 do not cache last component */
int
vfs_relookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)
{
- struct vnode *dp = 0; /* the directory we are searching */
+ struct vnode *dp = NULL; /* the directory we are searching */
int wantparent; /* 1 => wantparent or lockparent flag */
int rdonly; /* lookup read-only flag bit */
int error = 0;
-/* $OpenBSD: vfs_subr.c,v 1.311 2021/10/23 14:42:07 mpi Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.312 2021/10/24 00:02:25 jsg Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
mp = vfs_mount_alloc(NULLVP, vfsp);
mp->mnt_flag |= MNT_RDONLY;
mp->mnt_stat.f_mntonname[0] = '/';
- copystr(devname, mp->mnt_stat.f_mntfromname, MNAMELEN, 0);
- copystr(devname, mp->mnt_stat.f_mntfromspec, MNAMELEN, 0);
+ copystr(devname, mp->mnt_stat.f_mntfromname, MNAMELEN, NULL);
+ copystr(devname, mp->mnt_stat.f_mntfromspec, MNAMELEN, NULL);
*mpp = mp;
return (0);
}
if (vp == NULL) {
splx(s);
tablefull("vnode");
- *vpp = 0;
+ *vpp = NULL;
return (ENFILE);
}
insmntque(vp, mp);
*vpp = vp;
vp->v_usecount = 1;
- vp->v_data = 0;
+ vp->v_data = NULL;
return (0);
}
}
vp = nvp;
vp->v_type = type;
- if ((nvp = checkalias(vp, dev, NULL)) != 0) {
+ if ((nvp = checkalias(vp, dev, NULL)) != NULL) {
vput(vp);
vp = nvp;
}
* If special device, remove it from special device alias list
* if it is on one.
*/
- if ((vp->v_type == VBLK || vp->v_type == VCHR) && vp->v_specinfo != 0) {
+ if ((vp->v_type == VBLK || vp->v_type == VCHR) &&
+ vp->v_specinfo != NULL) {
if ((vp->v_flag & VALIASED) == 0 && vp->v_type == VCHR &&
(cdevsw[major(vp->v_rdev)].d_flags & D_CLONE) &&
(minor(vp->v_rdev) >> CLONE_SHIFT == 0)) {
struct radix_node_head *rnh;
int nplen, i;
struct radix_node *rn;
- struct sockaddr *saddr, *smask = 0;
+ struct sockaddr *saddr, *smask = NULL;
int error;
if (argp->ex_addrlen == 0) {
goto out;
}
rn = rn_addroute(saddr, smask, rnh, np->netc_rnodes, 0);
- if (rn == 0 || np != (struct netcred *)rn) { /* already exists */
+ if (rn == NULL || np != (struct netcred *)rn) { /* already exists */
error = EPERM;
goto out;
}
printf("syncing disks...");
- if (panicstr == 0) {
+ if (panicstr == NULL) {
/* Sync before unmount, in case we hang on something. */
sys_sync(p, NULL, NULL);
vfs_unmountall();