move to 1.6-beta

This commit is contained in:
purplerain 2024-08-08 20:49:23 +00:00
parent 45c7370e13
commit 509ad7f110
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
81 changed files with 886 additions and 439 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_sysctl.c,v 1.433 2024/08/05 18:47:29 mvs Exp $ */
/* $OpenBSD: kern_sysctl.c,v 1.436 2024/08/08 15:02:36 bluhm Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@ -507,6 +507,8 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (sysctl_rdstring(oldp, oldlenp, newp, version));
case KERN_NUMVNODES: /* XXX numvnodes is a long */
return (sysctl_rdint(oldp, oldlenp, newp, numvnodes));
case KERN_CLOCKRATE:
return (sysctl_clockrate(oldp, oldlenp, newp));
case KERN_BOOTTIME: {
struct timeval bt;
memset(&bt, 0, sizeof bt);
@ -531,6 +533,18 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (sysctl_rdstruct(oldp, oldlenp, newp,
&mbs, sizeof(mbs)));
}
case KERN_MSGBUFSIZE:
case KERN_CONSBUFSIZE: {
struct msgbuf *mp;
mp = (name[0] == KERN_MSGBUFSIZE) ? msgbufp : consbufp;
/*
* deal with cases where the message buffer has
* become corrupted.
*/
if (!mp || mp->msg_magic != MSG_MAGIC)
return (ENXIO);
return (sysctl_rdint(oldp, oldlenp, newp, mp->msg_bufs));
}
case KERN_OSREV:
case KERN_NFILES:
case KERN_TTYCOUNT:
@ -614,20 +628,6 @@ kern_sysctl_locked(int *name, u_int namelen, void *oldp, size_t *oldlenp,
error = sysctl_int(oldp, oldlenp, newp, newlen, &inthostid);
hostid = inthostid;
return (error);
case KERN_CLOCKRATE:
return (sysctl_clockrate(oldp, oldlenp, newp));
case KERN_MSGBUFSIZE:
case KERN_CONSBUFSIZE: {
struct msgbuf *mp;
mp = (name[0] == KERN_MSGBUFSIZE) ? msgbufp : consbufp;
/*
* deal with cases where the message buffer has
* become corrupted.
*/
if (!mp || mp->msg_magic != MSG_MAGIC)
return (ENXIO);
return (sysctl_rdint(oldp, oldlenp, newp, mp->msg_bufs));
}
case KERN_CONSBUF:
if ((error = suser(p)))
return (error);
@ -635,7 +635,10 @@ kern_sysctl_locked(int *name, u_int namelen, void *oldp, size_t *oldlenp,
case KERN_MSGBUF: {
struct msgbuf *mp;
mp = (name[0] == KERN_MSGBUF) ? msgbufp : consbufp;
/* see note above */
/*
* deal with cases where the message buffer has
* become corrupted.
*/
if (!mp || mp->msg_magic != MSG_MAGIC)
return (ENXIO);
return (sysctl_rdstruct(oldp, oldlenp, newp, mp,
@ -1679,7 +1682,7 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep,
*/
if (pr->ps_flags & (PS_SYSTEM | PS_EMBRYO | PS_EXITING))
continue;
if (arg > 0 && pr->ps_pid != (pid_t)arg) {
if (arg >= 0 && pr->ps_pid != (pid_t)arg) {
/* not the pid we are looking for */
continue;
}
@ -1699,6 +1702,9 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep,
FILLIT(fp, fdp, i, NULL, pr);
FRELE(fp, p);
}
/* pid is unique, stop searching */
if (arg >= 0)
break;
}
if (!matched)
error = ESRCH;