summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-07-31 21:48:11 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-07-31 21:48:11 +0000
commit8deaa5cb1bdad9c4505896866607f4272b307e9a (patch)
treef2b66a24b21f1edc23c12fdb15eab63814fc036d /regress/sys
parent1472e2b5666bd9c64d37882b7cfb2596d9352eb3 (diff)
various cleanups; david says results are same
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/arch/i386/ldt/testldt.c23
-rw-r--r--regress/sys/crypto/auth/md5.c8
-rw-r--r--regress/sys/crypto/enc/des3.c10
-rw-r--r--regress/sys/fdescfs/confuse/confuse.c4
-rw-r--r--regress/sys/kern/__syscall/__syscall.c4
-rw-r--r--regress/sys/kern/accept/accept.c6
-rw-r--r--regress/sys/kern/dup2/dup2test.c4
-rw-r--r--regress/sys/kern/dup2_self/dup2_self.c4
-rw-r--r--regress/sys/kern/execve/doexec.c6
-rw-r--r--regress/sys/kern/execve/tests/goodaout.c6
-rw-r--r--regress/sys/kern/exit/exit.c4
-rw-r--r--regress/sys/kern/fcntl_dup/fcntl_dup.c4
-rw-r--r--regress/sys/kern/getrusage/getrusage.c4
-rw-r--r--regress/sys/kern/gettimeofday/gettimeofday.c4
-rw-r--r--regress/sys/kern/kqueue/kqueue-fork.c4
-rw-r--r--regress/sys/kern/kqueue/kqueue-pipe.c4
-rw-r--r--regress/sys/kern/kqueue/kqueue-process.c6
-rw-r--r--regress/sys/kern/kqueue/kqueue-pty.c6
-rw-r--r--regress/sys/kern/kqueue/kqueue-random.c4
-rw-r--r--regress/sys/kern/minherit/minherit.c4
-rw-r--r--regress/sys/kern/mmap2/mmaptest.c4
-rw-r--r--regress/sys/kern/mmap3/mmaptest.c4
-rw-r--r--regress/sys/kern/noexec/noexec.c20
-rw-r--r--regress/sys/kern/pread/pread.c4
-rw-r--r--regress/sys/kern/preadv/preadv.c4
-rw-r--r--regress/sys/kern/pwrite/pwrite.c4
-rw-r--r--regress/sys/kern/pwritev/pwritev.c4
-rw-r--r--regress/sys/kern/rcvtimeo/rcvtimeo.c4
-rw-r--r--regress/sys/kern/rfork/madness/madness.c4
-rw-r--r--regress/sys/kern/rfork/rfcfdg/rfcfdg.c4
-rw-r--r--regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c4
-rw-r--r--regress/sys/kern/rfork/rfmem/rfmem.c4
-rw-r--r--regress/sys/kern/rfork/rfnowait/rfnowait.c4
-rw-r--r--regress/sys/kern/rfork/rfsharefd/rfsharefd.c4
-rw-r--r--regress/sys/kern/rlimit-file/rlim-file.c4
-rw-r--r--regress/sys/kern/signal/siginfo_addr/siginfo_addr.c6
-rw-r--r--regress/sys/kern/syscall/syscall.c4
-rw-r--r--regress/sys/kern/unfdpass/unfdpass.c8
-rw-r--r--regress/sys/sys/tree/rb/rb-test.c4
-rw-r--r--regress/sys/sys/tree/splay/splay-test.c4
40 files changed, 113 insertions, 108 deletions
diff --git a/regress/sys/arch/i386/ldt/testldt.c b/regress/sys/arch/i386/ldt/testldt.c
index 60fea3cc943..6e8da7ed7a9 100644
--- a/regress/sys/arch/i386/ldt/testldt.c
+++ b/regress/sys/arch/i386/ldt/testldt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: testldt.c,v 1.5 2001/11/11 23:26:35 deraadt Exp $ */
+/* $OpenBSD: testldt.c,v 1.6 2003/07/31 21:48:07 deraadt Exp $ */
/* $NetBSD: testldt.c,v 1.4 1995/04/20 22:42:38 cgd Exp $ */
#include <stdio.h>
@@ -13,12 +13,14 @@ extern int i386_set_ldt(int, union descriptor *, int);
int verbose = 0;
struct sigaction segv_act;
-inline void set_fs(unsigned long val)
+static inline void
+set_fs(unsigned long val)
{
__asm__ __volatile__("mov %0,%%fs"::"r" ((unsigned short) val));
}
-inline unsigned char get_fs_byte(const char * addr)
+static inline unsigned char
+get_fs_byte(const char * addr)
{
unsigned register char _v;
@@ -26,7 +28,8 @@ inline unsigned char get_fs_byte(const char * addr)
return _v;
}
-inline unsigned short get_cs(void)
+static inline unsigned short
+get_cs(void)
{
unsigned register short _v;
@@ -34,7 +37,7 @@ inline unsigned short get_cs(void)
return _v;
}
-int
+static int
check_desc(unsigned int desc)
{
desc = LSEL(desc, SEL_UPL);
@@ -42,15 +45,15 @@ check_desc(unsigned int desc)
return(get_fs_byte((char *) 0));
}
-void
-gated_call()
+static void
+gated_call(void)
{
printf("Called from call gate...");
__asm__ __volatile__("popl %ebp");
__asm__ __volatile__(".byte 0xcb");
}
-struct segment_descriptor *
+static struct segment_descriptor *
make_sd(unsigned base, unsigned limit, int type, int dpl, int seg32, int inpgs)
{
static struct segment_descriptor d;
@@ -69,7 +72,7 @@ make_sd(unsigned base, unsigned limit, int type, int dpl, int seg32, int inpgs)
return (&d);
}
-struct gate_descriptor *
+static struct gate_descriptor *
make_gd(unsigned offset, unsigned int sel, unsigned stkcpy, int type, int dpl)
{
static struct gate_descriptor d;
@@ -85,7 +88,7 @@ make_gd(unsigned offset, unsigned int sel, unsigned stkcpy, int type, int dpl)
return(&d);
}
-void
+static void
print_ldt(union descriptor *dp)
{
unsigned long base_addr, limit, offset, selector, stack_copy;
diff --git a/regress/sys/crypto/auth/md5.c b/regress/sys/crypto/auth/md5.c
index 8de6b7f8a77..83207b64d83 100644
--- a/regress/sys/crypto/auth/md5.c
+++ b/regress/sys/crypto/auth/md5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: md5.c,v 1.3 2002/06/23 21:46:10 wcobb Exp $ */
+/* $OpenBSD: md5.c,v 1.4 2003/07/31 21:48:07 deraadt Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserverd.
@@ -37,7 +37,7 @@
#define MD5LEN 16
-char *
+static char *
sysmd5(const char *s, size_t len)
{
static char md[MD5LEN*2 + 1];
@@ -94,7 +94,7 @@ err:
return (NULL);
}
-int
+static int
getallowsoft(void)
{
int mib[2], old;
@@ -110,7 +110,7 @@ getallowsoft(void)
return old;
}
-void
+static void
setallowsoft(int new)
{
int mib[2], old;
diff --git a/regress/sys/crypto/enc/des3.c b/regress/sys/crypto/enc/des3.c
index 49eda4d4113..0d32a56fd48 100644
--- a/regress/sys/crypto/enc/des3.c
+++ b/regress/sys/crypto/enc/des3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: des3.c,v 1.5 2002/06/23 21:46:10 wcobb Exp $ */
+/* $OpenBSD: des3.c,v 1.6 2003/07/31 21:48:07 deraadt Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserverd.
@@ -37,7 +37,7 @@
#include <string.h>
#include <unistd.h>
-int
+static int
syscrypt(const unsigned char *key, size_t klen, const unsigned char *iv,
const unsigned char *in, unsigned char *out, size_t len, int encrypt)
{
@@ -90,7 +90,7 @@ err:
return (-1);
}
-int
+static int
getallowsoft(void)
{
int mib[2], old;
@@ -106,7 +106,7 @@ getallowsoft(void)
return old;
}
-void
+static void
setallowsoft(int new)
{
int mib[2], old;
@@ -121,7 +121,7 @@ setallowsoft(int new)
err(1, "sysctl failed");
}
-int
+static int
match(unsigned char *a, unsigned char *b, size_t len)
{
int i;
diff --git a/regress/sys/fdescfs/confuse/confuse.c b/regress/sys/fdescfs/confuse/confuse.c
index 4fb68d94e32..a46aeced9e3 100644
--- a/regress/sys/fdescfs/confuse/confuse.c
+++ b/regress/sys/fdescfs/confuse/confuse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: confuse.c,v 1.1 2002/02/08 17:33:32 art Exp $ */
+/* $OpenBSD: confuse.c,v 1.2 2003/07/31 21:48:07 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -10,7 +10,7 @@
#include <errno.h>
int
-main()
+main(int argc, char *argv[])
{
char fname[64];
int fd, newfd;
diff --git a/regress/sys/kern/__syscall/__syscall.c b/regress/sys/kern/__syscall/__syscall.c
index c44ea3fb773..62a75db735c 100644
--- a/regress/sys/kern/__syscall/__syscall.c
+++ b/regress/sys/kern/__syscall/__syscall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: __syscall.c,v 1.2 2002/02/13 16:24:25 art Exp $ */
+/* $OpenBSD: __syscall.c,v 1.3 2003/07/31 21:48:07 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -10,7 +10,7 @@
#include <err.h>
int
-main()
+main(int argc, char *argv[])
{
int status;
diff --git a/regress/sys/kern/accept/accept.c b/regress/sys/kern/accept/accept.c
index 354ac8f5a37..b42e6688174 100644
--- a/regress/sys/kern/accept/accept.c
+++ b/regress/sys/kern/accept/accept.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: accept.c,v 1.2 2002/02/14 22:43:03 art Exp $ */
+/* $OpenBSD: accept.c,v 1.3 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -21,9 +21,7 @@
int child(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int listensock, sock;
struct sockaddr_un sun, csun;
diff --git a/regress/sys/kern/dup2/dup2test.c b/regress/sys/kern/dup2/dup2test.c
index b857dadc8a2..1c60ae01623 100644
--- a/regress/sys/kern/dup2/dup2test.c
+++ b/regress/sys/kern/dup2/dup2test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dup2test.c,v 1.2 2002/02/08 16:56:07 art Exp $ */
+/* $OpenBSD: dup2test.c,v 1.3 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2001 Public Domain.
*/
@@ -9,7 +9,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
int orgfd, fd1, fd2;
char temp[] = "/tmp/dup2XXXXXXXXX";
diff --git a/regress/sys/kern/dup2_self/dup2_self.c b/regress/sys/kern/dup2_self/dup2_self.c
index 08a4cd4a94c..5849abe5e86 100644
--- a/regress/sys/kern/dup2_self/dup2_self.c
+++ b/regress/sys/kern/dup2_self/dup2_self.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dup2_self.c,v 1.2 2002/02/18 13:32:08 art Exp $ */
+/* $OpenBSD: dup2_self.c,v 1.3 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -29,7 +29,7 @@
*/
int
-main()
+main(int argc, char *argv[])
{
int orgfd, fd1, fd2;
char temp[] = "/tmp/dup2XXXXXXXXX";
diff --git a/regress/sys/kern/execve/doexec.c b/regress/sys/kern/execve/doexec.c
index cfb7d3b90ea..a331ed52481 100644
--- a/regress/sys/kern/execve/doexec.c
+++ b/regress/sys/kern/execve/doexec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doexec.c,v 1.3 2001/01/29 02:05:55 niklas Exp $ */
+/* $OpenBSD: doexec.c,v 1.4 2003/07/31 21:48:08 deraadt Exp $ */
/* $NetBSD: doexec.c,v 1.3 1995/04/20 22:43:13 cgd Exp $ */
/*
@@ -37,9 +37,7 @@
#include <unistd.h>
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "usage: %s <progname>\n", argv[0]);
diff --git a/regress/sys/kern/execve/tests/goodaout.c b/regress/sys/kern/execve/tests/goodaout.c
index 2cc216c152a..644d8d36777 100644
--- a/regress/sys/kern/execve/tests/goodaout.c
+++ b/regress/sys/kern/execve/tests/goodaout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: goodaout.c,v 1.2 2001/01/29 02:05:56 niklas Exp $ */
+/* $OpenBSD: goodaout.c,v 1.3 2003/07/31 21:48:08 deraadt Exp $ */
/* $NetBSD: goodaout.c,v 1.3 1995/04/20 22:44:20 cgd Exp $ */
/*
@@ -35,9 +35,7 @@
#include <unistd.h>
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv)
{
printf("succeeded\n");
exit(0);
diff --git a/regress/sys/kern/exit/exit.c b/regress/sys/kern/exit/exit.c
index 996ad1cf75c..485a8d6be47 100644
--- a/regress/sys/kern/exit/exit.c
+++ b/regress/sys/kern/exit/exit.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: exit.c,v 1.1 2002/02/08 20:15:14 art Exp $ */
+/* $OpenBSD: exit.c,v 1.2 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
#include <stdlib.h>
int
-main()
+main(int argc, char *argv[])
{
_exit(0);
abort();
diff --git a/regress/sys/kern/fcntl_dup/fcntl_dup.c b/regress/sys/kern/fcntl_dup/fcntl_dup.c
index ddad17ae908..88469c611f9 100644
--- a/regress/sys/kern/fcntl_dup/fcntl_dup.c
+++ b/regress/sys/kern/fcntl_dup/fcntl_dup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fcntl_dup.c,v 1.1 2002/02/08 17:05:55 art Exp $ */
+/* $OpenBSD: fcntl_dup.c,v 1.2 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -9,7 +9,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
int orgfd, fd1, fd2;
char temp[] = "/tmp/dup2XXXXXXXXX";
diff --git a/regress/sys/kern/getrusage/getrusage.c b/regress/sys/kern/getrusage/getrusage.c
index f95dccc7f54..13bd3f08f88 100644
--- a/regress/sys/kern/getrusage/getrusage.c
+++ b/regress/sys/kern/getrusage/getrusage.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getrusage.c,v 1.2 2002/02/16 01:03:35 nordin Exp $ */
+/* $OpenBSD: getrusage.c,v 1.3 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Thomas Nordin <nordin@openbsd.org> 2002 Public Domain.
*/
@@ -13,7 +13,7 @@
#include <sys/types.h>
int
-main()
+main(int argc, char *argv[])
{
struct timeval utime;
struct timeval stime;
diff --git a/regress/sys/kern/gettimeofday/gettimeofday.c b/regress/sys/kern/gettimeofday/gettimeofday.c
index b27d16f9c0a..df6771a3b83 100644
--- a/regress/sys/kern/gettimeofday/gettimeofday.c
+++ b/regress/sys/kern/gettimeofday/gettimeofday.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gettimeofday.c,v 1.1 2002/02/21 09:21:30 nordin Exp $ */
+/* $OpenBSD: gettimeofday.c,v 1.2 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Thomas Nordin <nordin@openbsd.org> 2002 Public Domain.
*/
@@ -8,7 +8,7 @@
#include <sys/time.h>
int
-main()
+main(int argc, char *argv[])
{
struct timeval s;
struct timeval t1;
diff --git a/regress/sys/kern/kqueue/kqueue-fork.c b/regress/sys/kern/kqueue/kqueue-fork.c
index 497ffbd90a5..67ab19350a7 100644
--- a/regress/sys/kern/kqueue/kqueue-fork.c
+++ b/regress/sys/kern/kqueue/kqueue-fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-fork.c,v 1.1 2002/02/27 17:11:51 art Exp $ */
+/* $OpenBSD: kqueue-fork.c,v 1.2 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain
*/
@@ -12,6 +12,8 @@
#include <sys/event.h>
#include <sys/wait.h>
+int check_inheritance(void);
+
int
check_inheritance(void)
{
diff --git a/regress/sys/kern/kqueue/kqueue-pipe.c b/regress/sys/kern/kqueue/kqueue-pipe.c
index 8995904be7c..6ef3ccdb721 100644
--- a/regress/sys/kern/kqueue/kqueue-pipe.c
+++ b/regress/sys/kern/kqueue/kqueue-pipe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-pipe.c,v 1.3 2002/02/27 17:11:51 art Exp $ */
+/* $OpenBSD: kqueue-pipe.c,v 1.4 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -35,6 +35,8 @@
#include <unistd.h>
#include <fcntl.h>
+int do_pipe(void);
+
int
do_pipe(void)
{
diff --git a/regress/sys/kern/kqueue/kqueue-process.c b/regress/sys/kern/kqueue/kqueue-process.c
index 3fc9b016edf..9fda608870c 100644
--- a/regress/sys/kern/kqueue/kqueue-process.c
+++ b/regress/sys/kern/kqueue/kqueue-process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-process.c,v 1.3 2003/06/12 04:52:40 mickey Exp $ */
+/* $OpenBSD: kqueue-process.c,v 1.4 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain
*/
@@ -19,12 +19,14 @@ static int process_child(void);
#define ASSX(cond) ASS(cond, warnx("assertion " #cond " failed on line %d", __LINE__))
-void
+static void
usr1handler(int signum)
{
/* nada */
}
+int do_process(void);
+
int
do_process(void)
{
diff --git a/regress/sys/kern/kqueue/kqueue-pty.c b/regress/sys/kern/kqueue/kqueue-pty.c
index e171fc96a67..e6f1e5ad8b4 100644
--- a/regress/sys/kern/kqueue/kqueue-pty.c
+++ b/regress/sys/kern/kqueue/kqueue-pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-pty.c,v 1.4 2003/07/31 03:23:41 mickey Exp $ */
+/* $OpenBSD: kqueue-pty.c,v 1.5 2003/07/31 21:48:08 deraadt Exp $ */
/* Written by Michael Shalayeff, 2003, Public Domain */
@@ -12,7 +12,7 @@
#include <fcntl.h>
#include <err.h>
-int
+static int
pty_check(int kq, struct kevent *ev, int n, int rm, int rs, int wm, int ws)
{
struct timespec ts;
@@ -44,6 +44,8 @@ pty_check(int kq, struct kevent *ev, int n, int rm, int rs, int wm, int ws)
return (0);
}
+int do_pty(void);
+
int
do_pty(void)
{
diff --git a/regress/sys/kern/kqueue/kqueue-random.c b/regress/sys/kern/kqueue/kqueue-random.c
index 22ca4db6cfa..681e8c49a0a 100644
--- a/regress/sys/kern/kqueue/kqueue-random.c
+++ b/regress/sys/kern/kqueue/kqueue-random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kqueue-random.c,v 1.3 2003/07/31 03:23:41 mickey Exp $ */
+/* $OpenBSD: kqueue-random.c,v 1.4 2003/07/31 21:48:08 deraadt Exp $ */
/* Written by Michael Shalayeff, 2002, Public Domain */
#include <stdlib.h>
@@ -13,6 +13,8 @@
#include <dev/rndvar.h>
+int do_random(void);
+
int
do_random(void)
{
diff --git a/regress/sys/kern/minherit/minherit.c b/regress/sys/kern/minherit/minherit.c
index 2b5ed236db2..644a99988bc 100644
--- a/regress/sys/kern/minherit/minherit.c
+++ b/regress/sys/kern/minherit/minherit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: minherit.c,v 1.1 2002/01/31 15:53:12 art Exp $ */
+/* $OpenBSD: minherit.c,v 1.2 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> Public Domain.
*/
@@ -14,7 +14,7 @@
#define MAGIC "inherited"
int
-main()
+main(int argc, char *argv[])
{
void *map1, *map2;
int page_size;
diff --git a/regress/sys/kern/mmap2/mmaptest.c b/regress/sys/kern/mmap2/mmaptest.c
index 12e08b65a29..6d7ecff7dcf 100644
--- a/regress/sys/kern/mmap2/mmaptest.c
+++ b/regress/sys/kern/mmap2/mmaptest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mmaptest.c,v 1.5 2002/09/12 04:09:31 mickey Exp $ */
+/* $OpenBSD: mmaptest.c,v 1.6 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2001 Public Domain
*/
@@ -20,7 +20,7 @@
#define MAGIC "The voices in my head are trying to ignore me."
int
-main()
+main(int argc, char *argv[])
{
char fname[25] = "/tmp/mmaptestXXXXXXXXXX";
int page_size;
diff --git a/regress/sys/kern/mmap3/mmaptest.c b/regress/sys/kern/mmap3/mmaptest.c
index 83452b8ba0e..0a2526e8004 100644
--- a/regress/sys/kern/mmap3/mmaptest.c
+++ b/regress/sys/kern/mmap3/mmaptest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mmaptest.c,v 1.2 2002/08/21 14:45:17 espie Exp $ */
+/* $OpenBSD: mmaptest.c,v 1.3 2003/07/31 21:48:08 deraadt Exp $ */
/*
* Copyright (c) 2002 Marc Espie.
*
@@ -36,7 +36,7 @@
* a short file may lose modifications made through an mmapped area.
*/
int
-main()
+main(int argc, char *argv[])
{
int i;
int fd;
diff --git a/regress/sys/kern/noexec/noexec.c b/regress/sys/kern/noexec/noexec.c
index a08fbe0bb78..f9b84cc9a95 100644
--- a/regress/sys/kern/noexec/noexec.c
+++ b/regress/sys/kern/noexec/noexec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: noexec.c,v 1.6 2003/05/05 15:34:46 mickey Exp $ */
+/* $OpenBSD: noexec.c,v 1.7 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Copyright (c) 2002,2003 Michael Shalayeff
@@ -49,9 +49,9 @@ char label[64] = "non-exec ";
u_int64_t data[(PAD + TESTSZ + PAD + MAXPAGESIZE) / 8] = { 0 };
u_int64_t bss[(PAD + TESTSZ + PAD + MAXPAGESIZE) / 8];
-void testfly();
+void testfly(void);
-void
+static void
fdcache(void *p, size_t size)
{
#ifdef __hppa__
@@ -68,13 +68,13 @@ fdcache(void *p, size_t size)
#endif
}
-void
+static void
sigsegv(int sig, siginfo_t *sip, void *scp)
{
_exit(fail);
}
-int
+static int
noexec(void *p, size_t size)
{
fail = 0;
@@ -85,7 +85,7 @@ noexec(void *p, size_t size)
return (1);
}
-int
+static int
noexec_mprotect(void *p, size_t size)
{
@@ -108,7 +108,7 @@ noexec_mprotect(void *p, size_t size)
return (1);
}
-void *
+static void *
getaddr(void *a)
{
void *ret;
@@ -121,7 +121,7 @@ getaddr(void *a)
return (void *)((u_long)ret & ~(page_size - 1));
}
-int
+static int
noexec_mmap(void *p, size_t size)
{
memcpy(p + page_size * 1, p, page_size);
@@ -156,7 +156,7 @@ noexec_mmap(void *p, size_t size)
return (0);
}
-void
+static void
usage(void)
{
extern char *__progname;
@@ -268,7 +268,7 @@ main(int argc, char *argv[])
__asm (".space 8192");
void
-testfly()
+testfly(void)
{
}
diff --git a/regress/sys/kern/pread/pread.c b/regress/sys/kern/pread/pread.c
index 23f28155d3f..c4640dd1a32 100644
--- a/regress/sys/kern/pread/pread.c
+++ b/regress/sys/kern/pread/pread.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pread.c,v 1.1 2002/02/08 19:05:18 art Exp $ */
+/* $OpenBSD: pread.c,v 1.2 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -9,7 +9,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
char temp[] = "/tmp/dup2XXXXXXXXX";
const char magic[10] = "0123456789";
diff --git a/regress/sys/kern/preadv/preadv.c b/regress/sys/kern/preadv/preadv.c
index 0bfeb0c8121..261af959608 100644
--- a/regress/sys/kern/preadv/preadv.c
+++ b/regress/sys/kern/preadv/preadv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: preadv.c,v 1.1 2002/02/08 20:04:03 art Exp $ */
+/* $OpenBSD: preadv.c,v 1.2 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -11,7 +11,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
char temp[] = "/tmp/dup2XXXXXXXXX";
const char magic[10] = "0123456789";
diff --git a/regress/sys/kern/pwrite/pwrite.c b/regress/sys/kern/pwrite/pwrite.c
index 6ee95443a0e..a27d0f75094 100644
--- a/regress/sys/kern/pwrite/pwrite.c
+++ b/regress/sys/kern/pwrite/pwrite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwrite.c,v 1.1 2002/02/08 20:58:02 art Exp $ */
+/* $OpenBSD: pwrite.c,v 1.2 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -9,7 +9,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
char temp[] = "/tmp/pwriteXXXXXXXXX";
const char magic[10] = "0123456789";
diff --git a/regress/sys/kern/pwritev/pwritev.c b/regress/sys/kern/pwritev/pwritev.c
index 11e6f6e8984..31871565a46 100644
--- a/regress/sys/kern/pwritev/pwritev.c
+++ b/regress/sys/kern/pwritev/pwritev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwritev.c,v 1.1 2002/02/08 21:06:05 art Exp $ */
+/* $OpenBSD: pwritev.c,v 1.2 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -11,7 +11,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
char temp[] = "/tmp/pwritevXXXXXXXXX";
char magic[10] = "0123456789";
diff --git a/regress/sys/kern/rcvtimeo/rcvtimeo.c b/regress/sys/kern/rcvtimeo/rcvtimeo.c
index 34a5f297ec9..c8ddab4d4de 100644
--- a/regress/sys/kern/rcvtimeo/rcvtimeo.c
+++ b/regress/sys/kern/rcvtimeo/rcvtimeo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcvtimeo.c,v 1.2 2003/07/31 03:23:41 mickey Exp $ */
+/* $OpenBSD: rcvtimeo.c,v 1.3 2003/07/31 21:48:09 deraadt Exp $ */
/* Written by Michael Shalayeff, 2002, Public Domain */
@@ -15,7 +15,7 @@
volatile int back;
-void
+static void
sigalarm(int sig, siginfo_t *sip, void *scp)
{
if (!back)
diff --git a/regress/sys/kern/rfork/madness/madness.c b/regress/sys/kern/rfork/madness/madness.c
index b5002413eaf..d6add455644 100644
--- a/regress/sys/kern/rfork/madness/madness.c
+++ b/regress/sys/kern/rfork/madness/madness.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: madness.c,v 1.1 2002/02/17 05:58:51 art Exp $ */
+/* $OpenBSD: madness.c,v 1.2 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -11,7 +11,7 @@
volatile int step;
int
-main()
+main(int argc, char *argv[])
{
int fds[2], fd;
pid_t pid1, pid2, pid3;
diff --git a/regress/sys/kern/rfork/rfcfdg/rfcfdg.c b/regress/sys/kern/rfork/rfcfdg/rfcfdg.c
index 069e298c379..95fd6204368 100644
--- a/regress/sys/kern/rfork/rfcfdg/rfcfdg.c
+++ b/regress/sys/kern/rfork/rfcfdg/rfcfdg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfcfdg.c,v 1.2 2002/02/21 23:29:05 deraadt Exp $ */
+/* $OpenBSD: rfcfdg.c,v 1.3 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -11,7 +11,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
int status;
diff --git a/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c b/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c
index 373a98767d2..a40fa871f06 100644
--- a/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c
+++ b/regress/sys/kern/rfork/rfmem-stack/rfmem-stack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfmem-stack.c,v 1.3 2002/02/22 01:06:58 art Exp $ */
+/* $OpenBSD: rfmem-stack.c,v 1.4 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -14,7 +14,7 @@
#define MAGIC "inherited"
int
-main()
+main(int argc, char *argv[])
{
char *map, *map2;
int status;
diff --git a/regress/sys/kern/rfork/rfmem/rfmem.c b/regress/sys/kern/rfork/rfmem/rfmem.c
index 86bc1eee878..b6b38fc2861 100644
--- a/regress/sys/kern/rfork/rfmem/rfmem.c
+++ b/regress/sys/kern/rfork/rfmem/rfmem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfmem.c,v 1.2 2002/02/21 23:29:05 deraadt Exp $ */
+/* $OpenBSD: rfmem.c,v 1.3 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -14,7 +14,7 @@
#define MAGIC "inherited"
int
-main()
+main(int argc, char *argv[])
{
void *map;
int page_size;
diff --git a/regress/sys/kern/rfork/rfnowait/rfnowait.c b/regress/sys/kern/rfork/rfnowait/rfnowait.c
index 0b9dd7aea57..58d2421557d 100644
--- a/regress/sys/kern/rfork/rfnowait/rfnowait.c
+++ b/regress/sys/kern/rfork/rfnowait/rfnowait.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfnowait.c,v 1.2 2002/02/21 23:29:05 deraadt Exp $ */
+/* $OpenBSD: rfnowait.c,v 1.3 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -11,7 +11,7 @@
#include <errno.h>
int
-main()
+main(int argc, char *argv[])
{
int status;
diff --git a/regress/sys/kern/rfork/rfsharefd/rfsharefd.c b/regress/sys/kern/rfork/rfsharefd/rfsharefd.c
index 81ce1725c35..ad7c0a3f331 100644
--- a/regress/sys/kern/rfork/rfsharefd/rfsharefd.c
+++ b/regress/sys/kern/rfork/rfsharefd/rfsharefd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfsharefd.c,v 1.2 2002/02/17 18:32:09 deraadt Exp $ */
+/* $OpenBSD: rfsharefd.c,v 1.3 2003/07/31 21:48:09 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org>, 2002 Public Domain.
*/
@@ -11,7 +11,7 @@
#include <fcntl.h>
int
-main()
+main(int argc, char *argv[])
{
int status;
int fd;
diff --git a/regress/sys/kern/rlimit-file/rlim-file.c b/regress/sys/kern/rlimit-file/rlim-file.c
index 1d817f7050e..b1114550a61 100644
--- a/regress/sys/kern/rlimit-file/rlim-file.c
+++ b/regress/sys/kern/rlimit-file/rlim-file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlim-file.c,v 1.2 2002/02/08 17:09:24 art Exp $ */
+/* $OpenBSD: rlim-file.c,v 1.3 2003/07/31 21:48:10 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> (2002) Public Domain.
*/
@@ -12,7 +12,7 @@
#include <string.h>
int
-main()
+main(int argc, char *argv[])
{
int lim, fd, fds[2];
struct rlimit rl;
diff --git a/regress/sys/kern/signal/siginfo_addr/siginfo_addr.c b/regress/sys/kern/signal/siginfo_addr/siginfo_addr.c
index 668771b7bbd..394e0c1d1c4 100644
--- a/regress/sys/kern/signal/siginfo_addr/siginfo_addr.c
+++ b/regress/sys/kern/signal/siginfo_addr/siginfo_addr.c
@@ -6,7 +6,7 @@
#define FAULTADDR 0x123123
-void
+static void
handler(int sig, siginfo_t *sip, void *scp)
{
char buf[1024];
@@ -23,9 +23,7 @@ handler(int sig, siginfo_t *sip, void *scp)
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct sigaction sa;
diff --git a/regress/sys/kern/syscall/syscall.c b/regress/sys/kern/syscall/syscall.c
index 3f46729515f..9198e5e2ef3 100644
--- a/regress/sys/kern/syscall/syscall.c
+++ b/regress/sys/kern/syscall/syscall.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.c,v 1.1 2002/02/08 21:33:32 art Exp $ */
+/* $OpenBSD: syscall.c,v 1.2 2003/07/31 21:48:10 deraadt Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain.
*/
@@ -10,7 +10,7 @@
#include <err.h>
int
-main()
+main(int argc, char *argv[])
{
int status;
diff --git a/regress/sys/kern/unfdpass/unfdpass.c b/regress/sys/kern/unfdpass/unfdpass.c
index 1a9727c8d2f..1e9d886010b 100644
--- a/regress/sys/kern/unfdpass/unfdpass.c
+++ b/regress/sys/kern/unfdpass/unfdpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unfdpass.c,v 1.7 2002/02/16 21:27:32 millert Exp $ */
+/* $OpenBSD: unfdpass.c,v 1.8 2003/07/31 21:48:10 deraadt Exp $ */
/* $NetBSD: unfdpass.c,v 1.3 1998/06/24 23:51:30 thorpej Exp $ */
/*-
@@ -89,10 +89,10 @@ main(argc, argv)
* Create the test files.
*/
for (i = 0; i < 2; i++) {
- (void) sprintf(fname, "file%d", i + 1);
+ (void) snprintf(fname, sizeof fname, "file%d", i + 1);
if ((fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) == -1)
err(1, "open %s", fname);
- (void) sprintf(buf, "This is file %d.\n", i + 1);
+ (void) snprintf(buf, sizeof buf, "This is file %d.\n", i + 1);
if (write(fd, buf, strlen(buf)) != strlen(buf))
err(1, "write %s", fname);
(void) close(fd);
@@ -280,7 +280,7 @@ child()
* Open the files again, and pass them to the child over the socket.
*/
for (i = 0; i < 2; i++) {
- (void) sprintf(fname, "file%d", i + 1);
+ (void) snprintf(fname, sizeof fname, "file%d", i + 1);
if ((fd = open(fname, O_RDONLY, 0666)) == -1)
err(1, "child open %s", fname);
files[i] = fd;
diff --git a/regress/sys/sys/tree/rb/rb-test.c b/regress/sys/sys/tree/rb/rb-test.c
index 5b05a1db01c..f3be4cc0b68 100644
--- a/regress/sys/sys/tree/rb/rb-test.c
+++ b/regress/sys/sys/tree/rb/rb-test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rb-test.c,v 1.2 2002/10/16 15:30:06 art Exp $ */
+/* $OpenBSD: rb-test.c,v 1.3 2003/07/31 21:48:10 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -39,7 +39,7 @@ struct node {
RB_HEAD(tree, node) root;
-int
+static int
compare(struct node *a, struct node *b)
{
if (a->key < b->key) return (-1);
diff --git a/regress/sys/sys/tree/splay/splay-test.c b/regress/sys/sys/tree/splay/splay-test.c
index a67795a0b71..29718302b49 100644
--- a/regress/sys/sys/tree/splay/splay-test.c
+++ b/regress/sys/sys/tree/splay/splay-test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: splay-test.c,v 1.2 2002/10/16 15:30:06 art Exp $ */
+/* $OpenBSD: splay-test.c,v 1.3 2003/07/31 21:48:10 deraadt Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -39,7 +39,7 @@ struct node {
SPLAY_HEAD(tree, node) root;
-int
+static int
compare(struct node *a, struct node *b)
{
if (a->key < b->key) return (-1);