CVS: cvs.openbsd.org: src

2022-10-26 Thread Theo de Raadt
CVSROOT:/cvs
Module name:src
Changes by: dera...@cvs.openbsd.org 2022/10/26 22:12:09

Modified files:
distrib/sets/lists/base: mi 

Log message:
sync



CVS: cvs.openbsd.org: src

2022-10-26 Thread Mark Kettenis
CVSROOT:/cvs
Module name:src
Changes by: kette...@cvs.openbsd.org2022/10/26 17:18:02

Modified files:
regress/lib/libc/sys: Makefile t_wait_noproc.c 
Added files:
regress/lib/libc/sys: t_waitid.c 

Log message:
Enable waitid(2) regress tests and a new test derived from NetBSD's
wait6(2) tests.

ok millert@, deraadt@



CVS: cvs.openbsd.org: src

2022-10-26 Thread Mark Kettenis
CVSROOT:/cvs
Module name:src
Changes by: kette...@cvs.openbsd.org2022/10/26 17:16:24

Modified files:
lib/libc   : Symbols.list shlib_version 
lib/libc/hidden/sys: wait.h 
lib/libc/sys   : Makefile.inc 
lib/librthread : shlib_version 
Added files:
lib/libc/sys   : w_waitid.c 

Log message:
Add waitid(2) syscall stub.

Minor bump to both libc and libpthread: make sure you install a new kernel!

ok millert@, deraadt@



CVS: cvs.openbsd.org: www

2022-10-26 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:www
Changes by: bl...@cvs.openbsd.org   2022/10/26 16:12:22

Modified files:
.  : errata72.html 

Log message:
Release ukbd errata.



CVS: cvs.openbsd.org: src

2022-10-26 Thread Alexander Bluhm
CVSROOT:/cvs
Module name:src
Changes by: bl...@cvs.openbsd.org   2022/10/26 15:05:42

Modified files:
sys/dev/usb: Tag: OPENBSD_7_2 ukbd.c 

Log message:
Repair Apple-specific translation support broken by mistake in 1.88; reported
by Leonardo Moreno
from miod@

this is errata/7.2/003_ukbd.patch.sig



CVS: cvs.openbsd.org: src

2022-10-26 Thread Theo Buehler
CVSROOT:/cvs
Module name:src
Changes by: t...@cvs.openbsd.org2022/10/26 14:31:38

Modified files:
regress/lib/libssl/dtls: dtlstest.c 

Log message:
dtlstest: Ensure the timeouts are at least 10 ms. This makes these tests
a bit less flaky if the machine is otherwise under load.

from jsing



CVS: cvs.openbsd.org: src

2022-10-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2022/10/26 14:19:09

Modified files:
sys/arch/hppa/gsc: harmony.c 
sys/arch/macppc/dev: aoa.c awacs.c daca.c i2s.c i2svar.h onyx.c 
 snapper.c tumbler.c 
sys/arch/sparc64/dev: ce4231.c 
sys/dev: audio.c 
sys/dev/ic : am7930.c am7930var.h 
sys/dev/pci: auacer.c auglx.c auich.c auixp.c autri.c 
 auvia.c azalia.c cmpci.c cs4280.c cs4281.c 
 eap.c emuxki.c envy.c esa.c eso.c fms.c neo.c 
 sv.c yds.c 
sys/dev/sbus   : cs4231.c 
sys/dev/tc : bba.c 
sys/dev/usb: uaudio.c 

Log message:
Make audio(9) get_props() optional, remove it from duplex drivers

The property bits of audio(9) are obsolete and ought to be removed
completely.

sys/dev/audio.c:audio_open() currently uses get_props() to bail out if
read *and* write was requested on a non-duplex driver.

Drivers that currently support playing but not recording need adjustment
before the API can be cleaned up.

Drivers that advertise themselves as full duplex, i.e. those that always
return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently
always succeed this check.

As this is the only property, losen audio_open()'s DIAGNOSTIC check and only
do the duplex check if the driver provides get_props().

This allows for simple removal of get_props() from full-duplex drivers
without adding any other code or without changing functionality.

This includes all audio drivers under sys/dev/pci/ (maestro(4) being the
only unfinished exception here).

Other drivers as well as the API change can then follow in smaller diffs.

This builds on amd64, arm64, i386, macppc and sparc64.
amd64 with azalia(4) still plays, records as well as plays and records
at the same time on my X230 as tested with

$ aucat -i play.wav [-o rec.wav]

alpha and hppa tests by miod
OK ratchov miod



CVS: cvs.openbsd.org: src

2022-10-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2022/10/26 11:06:31

Modified files:
sbin/ifconfig  : ifconfig.8 ifconfig.c 

Log message:
Limit wireguard peers listing to -A or wg-interface

ifconfig(8) output can get too long when always printing `wgpeers' for all
wg(4) interfaces, so omit it output is requested and/or output is limited
to the interface group "wg" or a specific interface "wgX".

No install media size change as wireguard code is under #ifndef SMALL.

Diff from Mikolaj Kucharski 
makes Hrvoje Popovski happy
manual bits from jmc
OK sthen



CVS: cvs.openbsd.org: src

2022-10-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2022/10/26 10:07:28

Modified files:
sys/dev/usb: ubcmtp.c 

Log message:
Constify device table

OK jcs



CVS: cvs.openbsd.org: src

2022-10-26 Thread Klemens Nanni
CVSROOT:/cvs
Module name:src
Changes by: k...@cvs.openbsd.org2022/10/26 10:06:42

Modified files:
sys/dev/acpi   : acpisbs.c 

Log message:
Constify battery check table

OK jcs



CVS: cvs.openbsd.org: src

2022-10-26 Thread Mark Kettenis
CVSROOT:/cvs
Module name:src
Changes by: kette...@cvs.openbsd.org2022/10/26 07:31:06

Modified files:
sys/kern   : kern_exit.c 

Log message:
Fix handling of PGIDs in wait4(2) that I broke with the previous commit.

ok anton@, millert@



Re: CVS: cvs.openbsd.org: src

2022-10-26 Thread Anton Lindqvist
On Wed, Oct 26, 2022 at 07:20:20AM +0200, Anton Lindqvist wrote:
> On Tue, Oct 25, 2022 at 10:08:26AM -0600, Mark Kettenis wrote:
> > CVSROOT:/cvs
> > Module name:src
> > Changes by: kette...@cvs.openbsd.org2022/10/25 10:08:26
> > 
> > Modified files:
> > sys/sys: siginfo.h wait.h 
> > sys/kern   : kern_exit.c 
> > 
> > Log message:
> > Implement waitid(2) which is now part of POSIX and used by mozilla.
> > This includes a change of siginfo_r which is technically an ABI break but
> > this should have no real-world impact since the members involved are
> > never touched by the kernel.
> > 
> > ok millert@, deraadt@
> 
> My snapshot build failed today, smells related to this as I have never
> seen this before. Will try to gather more info later today.
> 
>   robsd-exec: waitpid: No child processes

This program used to exit zero:

#include 

#include 
#include 
#include 
#include 
#include 

static int  exitstatus(int);
static int  waiteof(int, int);

int
main(void)
{
pid_t pid;
int pip[2];
int error, status;

if (pipe2(pip, O_NONBLOCK) == -1)
err(1, "pipe2");

pid = fork();
if (pid == -1)
err(1, "fork");
if (pid == 0) {
close(pip[0]);
if (setsid() == -1)
err(1, "setsid");

/* Signal to the parent that the process group is present. */
close(pip[1]);
_exit(0);
}

/* Wait for the process group to become present. */
close(pip[1]);
if (waiteof(pip[0], 1000)) {
warnx("process group failure");
if (waitpid(pid, &status, 0) == -1)
return 1;
return exitstatus(status);
}
close(pip[0]);

if (waitpid(-pid, &status, 0) == -1)
err(1, "waitpid");
error = exitstatus(status);
if (error)
warnx("process group exited %d", error);
return error;
}

static int
exitstatus(int status)
{
if (WIFEXITED(status))
return WEXITSTATUS(status);
if (WIFSIGNALED(status))
return 128 + WTERMSIG(status);
return 1;
}

static int
waiteof(int fd, int timoms)
{
int slpms = 100;

for (;;) {
char buf[1];
ssize_t n;

n = read(fd, buf, sizeof(buf));
if (n == -1) {
if (errno == EAGAIN) {
usleep(slpms * 1000);
timoms -= slpms;
if (timoms <= 0)
return 1;
} else {
warn("read");
return 1;
}
}
if (n == 0)
break;
}
return 0;
}