diff --git a/contrib/netbsd-tests/kernel/t_sysv.c b/contrib/netbsd-tests/kernel/t_sysv.c index 0860d4b35c68..0b7bc38a0a80 100644 --- a/contrib/netbsd-tests/kernel/t_sysv.c +++ b/contrib/netbsd-tests/kernel/t_sysv.c @@ -72,7 +72,7 @@ void sharer(void); #define MESSAGE_TEXT_LEN 256 -struct mymsg { +struct testmsg { long mtype; char mtext[MESSAGE_TEXT_LEN]; }; @@ -94,11 +94,13 @@ key_t msgkey, semkey, shmkey; int maxloop = 1; +#ifndef __FreeBSD__ union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */ u_short *array; /* array for GETALL & SETALL */ }; +#endif /* Writes an integer to a file. To be used from the body of the test @@ -174,7 +176,7 @@ key_t get_ftok(int id) /* Create the file, since ftok() requires it to exist! */ - fd = open(token_key, O_RDWR | O_CREAT | O_EXCL); + fd = open(token_key, O_RDWR | O_CREAT | O_EXCL, 0600); if (fd == -1) { rmdir(tmpdir); atf_tc_fail("open() of temp file failed: %d", errno); @@ -202,7 +204,7 @@ ATF_TC_BODY(msg, tc) { struct sigaction sa; struct msqid_ds m_ds; - struct mymsg m; + struct testmsg m; sigset_t sigmask; int sender_msqid; int loop; @@ -347,9 +349,7 @@ ATF_TC_CLEANUP(msg, tc) } void -print_msqid_ds(mp, mode) - struct msqid_ds *mp; - mode_t mode; +print_msqid_ds(struct msqid_ds *mp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -381,9 +381,9 @@ print_msqid_ds(mp, mode) } void -receiver() +receiver(void) { - struct mymsg m; + struct testmsg m; int msqid, loop; if ((msqid = msgget(msgkey, 0)) == -1) @@ -588,9 +588,7 @@ ATF_TC_CLEANUP(sem, tc) } void -print_semid_ds(sp, mode) - struct semid_ds *sp; - mode_t mode; +print_semid_ds(struct semid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -620,7 +618,7 @@ print_semid_ds(sp, mode) } void -waiter() +waiter(void) { struct sembuf s; int semid; @@ -789,9 +787,7 @@ ATF_TC_CLEANUP(shm, tc) } void -print_shmid_ds(sp, mode) - struct shmid_ds *sp; - mode_t mode; +print_shmid_ds(struct shmid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -823,7 +819,7 @@ print_shmid_ds(sp, mode) } void -sharer() +sharer(void) { int shmid; void *shm_buf; diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index 4b05d31c7778..d053ecccd940 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -26,6 +26,7 @@ LIBADD.unix_seqpacket_test+= pthread NETBSD_ATF_TESTS_C+= lockf_test NETBSD_ATF_TESTS_C+= mqueue_test +NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt