From fda352e4945b8124a7df5680bbf6d86fec17b54a Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 6 Jul 2023 07:47:04 +0000 Subject: [PATCH] sysctl(2) is now sysctl(3), in particular it does not access name[0] in userland. This test should have been written with a signal handler to be accurate.. Anyways, stop using syscall() to work around that ok kettenis --- regress/sys/copy/copy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regress/sys/copy/copy.c b/regress/sys/copy/copy.c index 2f04b11e9c3..ab85153086f 100644 --- a/regress/sys/copy/copy.c +++ b/regress/sys/copy/copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: copy.c,v 1.6 2021/12/13 16:56:49 deraadt Exp $ */ +/* $OpenBSD: copy.c,v 1.7 2023/07/06 07:47:04 deraadt Exp $ */ /* Written by Ted Unangst 2004 Public Domain */ @@ -63,9 +63,9 @@ main(int argc, char **argv) /* printf("goodbuf %p badbuf %p\n", goodbuf, badbuf); */ /* copyin */ - if (!syscall(202, 0, 6, &kinfo, &kinfosize, 0, 0)) + if (!sysctl(0, 6, &kinfo, &kinfosize, 0, 0)) fail("copyin did not fail on 0 buf\n"); - if (!syscall(202, badbuf, 6, &kinfo, &kinfosize, 0, 0)) + if (!sysctl(badbuf, 6, &kinfo, &kinfosize, 0, 0)) fail("copyin did not fail on bad buf\n"); /* copyout */ -- 2.20.1