Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123

Sponsored by:	Dell EMC Isilon
This commit is contained in:
ngie 2017-01-14 06:49:17 +00:00
commit df753889a0
154 changed files with 7868 additions and 461 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_cgd_3des.c,v 1.1 2016/11/11 07:39:58 alnsn Exp $ */
/* $NetBSD: t_cgd_3des.c,v 1.2 2017/01/13 21:30:39 christos Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
@ -48,7 +48,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define SECSIZE 512

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_cgd_aes.c,v 1.5 2016/12/11 00:23:44 alnsn Exp $ */
/* $NetBSD: t_cgd_aes.c,v 1.6 2017/01/13 21:30:39 christos Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* Copyright (c) 2007 The Institute of Electrical and Electronics Engineers, Inc
@ -49,7 +49,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define SECSIZE 512

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_cgd_blowfish.c,v 1.1 2016/11/10 23:44:36 alnsn Exp $ */
/* $NetBSD: t_cgd_blowfish.c,v 1.2 2017/01/13 21:30:39 christos Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
@ -48,7 +48,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define SECSIZE 512

View File

@ -0,0 +1,25 @@
#!/bin/ksh
export TZ=Etc/Universal
datesub() {
gdate "$@" '+ FILL(%_11s,%_4Y,%_m,%_d,%w,%_H,%_M,%_S), // %a %b %e %H:%M:%S %Z %Y'
}
(
datesub -d '1970/01/01 00:00:00'
datesub -d '1981/04/12 12:00:03'
datesub -d '2011/07/21 09:57:00'
datesub -d @2147483647
datesub -d @2147483648
datesub -d '2063/04/05 00:00:00'
for year in `seq 1970 1 2030`; do
datesub -d "${year}/01/01 00:00:00"
datesub -d "${year}/07/01 00:00:00"
done
for year in `seq 2000 25 2600`; do
datesub -d "$((${year} - 1))/12/31 23:59:59"
datesub -d "$((${year} + 0))/01/01 00:00:00"
datesub -d "$((${year} + 1))/01/01 00:00:00"
done
)|sort -u

View File

@ -0,0 +1,309 @@
/* $NetBSD: t_clock_subr.c,v 1.3 2017/01/13 21:30:39 christos Exp $ */
/*
* Copyright (c) 2016 Jonathan A. Kollasch
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2016\
Jonathan A. Kollasch. All rights reserved.");
__RCSID("$NetBSD: t_clock_subr.c,v 1.3 2017/01/13 21:30:39 christos Exp $");
#include <sys/types.h>
#include <dev/clock_subr.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <atf-c.h>
#include "h_macros.h"
#define FILL(ti,ye,mo,da,wd,ho,mi,se) \
{ .time = (ti), .clock = { .dt_year = (ye), .dt_mon = (mo), .dt_day = (da), \
.dt_wday = (wd), .dt_hour = (ho), .dt_min = (mi), .dt_sec = (se), } }
static struct clock_test {
time_t time;
struct clock_ymdhms clock;
} const clock_tests[] = {
FILL( 0,1970, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1970
FILL( 15638400,1970, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1970
FILL( 31536000,1971, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1971
FILL( 47174400,1971, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1971
FILL( 63072000,1972, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1972
FILL( 78796800,1972, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1972
FILL( 94694400,1973, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1973
FILL( 110332800,1973, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1973
FILL( 126230400,1974, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1974
FILL( 141868800,1974, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1974
FILL( 157766400,1975, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1975
FILL( 173404800,1975, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1975
FILL( 189302400,1976, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1976
FILL( 205027200,1976, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1976
FILL( 220924800,1977, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1977
FILL( 236563200,1977, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1977
FILL( 252460800,1978, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1978
FILL( 268099200,1978, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1978
FILL( 283996800,1979, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1979
FILL( 299635200,1979, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1979
FILL( 315532800,1980, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1980
FILL( 331257600,1980, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1980
FILL( 347155200,1981, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1981
FILL( 355924803,1981, 4,12,0,12, 0, 3), // Sun Apr 12 12:00:03 UTC 1981
FILL( 362793600,1981, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1981
FILL( 378691200,1982, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1982
FILL( 394329600,1982, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1982
FILL( 410227200,1983, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1983
FILL( 425865600,1983, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1983
FILL( 441763200,1984, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1984
FILL( 457488000,1984, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1984
FILL( 473385600,1985, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1985
FILL( 489024000,1985, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1985
FILL( 504921600,1986, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1986
FILL( 520560000,1986, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1986
FILL( 536457600,1987, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1987
FILL( 552096000,1987, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1987
FILL( 567993600,1988, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1988
FILL( 583718400,1988, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1988
FILL( 599616000,1989, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1989
FILL( 615254400,1989, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1989
FILL( 631152000,1990, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1990
FILL( 646790400,1990, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 1990
FILL( 662688000,1991, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 1991
FILL( 678326400,1991, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1991
FILL( 694224000,1992, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1992
FILL( 709948800,1992, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1992
FILL( 725846400,1993, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1993
FILL( 741484800,1993, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1993
FILL( 757382400,1994, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 1994
FILL( 773020800,1994, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 1994
FILL( 788918400,1995, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 1995
FILL( 804556800,1995, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 1995
FILL( 820454400,1996, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 1996
FILL( 836179200,1996, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 1996
FILL( 852076800,1997, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 1997
FILL( 867715200,1997, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 1997
FILL( 883612800,1998, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 1998
FILL( 899251200,1998, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 1998
FILL( 915148800,1999, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 1999
FILL( 930787200,1999, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 1999
FILL( 946684799,1999,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 1999
FILL( 946684800,2000, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2000
FILL( 962409600,2000, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2000
FILL( 978307200,2001, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2001
FILL( 993945600,2001, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2001
FILL( 1009843200,2002, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2002
FILL( 1025481600,2002, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2002
FILL( 1041379200,2003, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2003
FILL( 1057017600,2003, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2003
FILL( 1072915200,2004, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2004
FILL( 1088640000,2004, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2004
FILL( 1104537600,2005, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2005
FILL( 1120176000,2005, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2005
FILL( 1136073600,2006, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2006
FILL( 1151712000,2006, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2006
FILL( 1167609600,2007, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2007
FILL( 1183248000,2007, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2007
FILL( 1199145600,2008, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2008
FILL( 1214870400,2008, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2008
FILL( 1230768000,2009, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2009
FILL( 1246406400,2009, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2009
FILL( 1262304000,2010, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2010
FILL( 1277942400,2010, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2010
FILL( 1293840000,2011, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2011
FILL( 1309478400,2011, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2011
FILL( 1311242220,2011, 7,21,4, 9,57, 0), // Thu Jul 21 09:57:00 UTC 2011
FILL( 1325376000,2012, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2012
FILL( 1341100800,2012, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2012
FILL( 1356998400,2013, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2013
FILL( 1372636800,2013, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2013
FILL( 1388534400,2014, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2014
FILL( 1404172800,2014, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2014
FILL( 1420070400,2015, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2015
FILL( 1435708800,2015, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2015
FILL( 1451606400,2016, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2016
FILL( 1467331200,2016, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2016
FILL( 1483228800,2017, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2017
FILL( 1498867200,2017, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2017
FILL( 1514764800,2018, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2018
FILL( 1530403200,2018, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2018
FILL( 1546300800,2019, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2019
FILL( 1561939200,2019, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2019
FILL( 1577836800,2020, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2020
FILL( 1593561600,2020, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2020
FILL( 1609459200,2021, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2021
FILL( 1625097600,2021, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2021
FILL( 1640995200,2022, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2022
FILL( 1656633600,2022, 7, 1,5, 0, 0, 0), // Fri Jul 1 00:00:00 UTC 2022
FILL( 1672531200,2023, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2023
FILL( 1688169600,2023, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2023
FILL( 1704067200,2024, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2024
FILL( 1719792000,2024, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2024
FILL( 1735689599,2024,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2024
FILL( 1735689600,2025, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2025
FILL( 1751328000,2025, 7, 1,2, 0, 0, 0), // Tue Jul 1 00:00:00 UTC 2025
FILL( 1767225600,2026, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2026
FILL( 1782864000,2026, 7, 1,3, 0, 0, 0), // Wed Jul 1 00:00:00 UTC 2026
FILL( 1798761600,2027, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2027
FILL( 1814400000,2027, 7, 1,4, 0, 0, 0), // Thu Jul 1 00:00:00 UTC 2027
FILL( 1830297600,2028, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2028
FILL( 1846022400,2028, 7, 1,6, 0, 0, 0), // Sat Jul 1 00:00:00 UTC 2028
FILL( 1861920000,2029, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2029
FILL( 1877558400,2029, 7, 1,0, 0, 0, 0), // Sun Jul 1 00:00:00 UTC 2029
FILL( 1893456000,2030, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2030
FILL( 1909094400,2030, 7, 1,1, 0, 0, 0), // Mon Jul 1 00:00:00 UTC 2030
FILL( 2147483647,2038, 1,19,2, 3,14, 7), // Tue Jan 19 03:14:07 UTC 2038
FILL( 2147483648,2038, 1,19,2, 3,14, 8), // Tue Jan 19 03:14:08 UTC 2038
FILL( 2524607999,2049,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2049
FILL( 2524608000,2050, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2050
FILL( 2556144000,2051, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2051
FILL( 2942956800,2063, 4, 5,4, 0, 0, 0), // Thu Apr 5 00:00:00 UTC 2063
FILL( 3313526399,2074,12,31,1,23,59,59), // Mon Dec 31 23:59:59 UTC 2074
FILL( 3313526400,2075, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2075
FILL( 3345062400,2076, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2076
FILL( 4102444799,2099,12,31,4,23,59,59), // Thu Dec 31 23:59:59 UTC 2099
FILL( 4102444800,2100, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2100
FILL( 4133980800,2101, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2101
FILL( 4891363199,2124,12,31,0,23,59,59), // Sun Dec 31 23:59:59 UTC 2124
FILL( 4891363200,2125, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2125
FILL( 4922899200,2126, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2126
FILL( 5680281599,2149,12,31,3,23,59,59), // Wed Dec 31 23:59:59 UTC 2149
FILL( 5680281600,2150, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2150
FILL( 5711817600,2151, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2151
FILL( 6469199999,2174,12,31,6,23,59,59), // Sat Dec 31 23:59:59 UTC 2174
FILL( 6469200000,2175, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2175
FILL( 6500736000,2176, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2176
FILL( 7258118399,2199,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2199
FILL( 7258118400,2200, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2200
FILL( 7289654400,2201, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2201
FILL( 8047036799,2224,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2224
FILL( 8047036800,2225, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2225
FILL( 8078572800,2226, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2226
FILL( 8835955199,2249,12,31,1,23,59,59), // Mon Dec 31 23:59:59 UTC 2249
FILL( 8835955200,2250, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2250
FILL( 8867491200,2251, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2251
FILL( 9624873599,2274,12,31,4,23,59,59), // Thu Dec 31 23:59:59 UTC 2274
FILL( 9624873600,2275, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2275
FILL( 9656409600,2276, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2276
FILL(10413791999,2299,12,31,0,23,59,59), // Sun Dec 31 23:59:59 UTC 2299
FILL(10413792000,2300, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2300
FILL(10445328000,2301, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2301
FILL(11202710399,2324,12,31,3,23,59,59), // Wed Dec 31 23:59:59 UTC 2324
FILL(11202710400,2325, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2325
FILL(11234246400,2326, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2326
FILL(11991628799,2349,12,31,6,23,59,59), // Sat Dec 31 23:59:59 UTC 2349
FILL(11991628800,2350, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2350
FILL(12023164800,2351, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2351
FILL(12780547199,2374,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2374
FILL(12780547200,2375, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2375
FILL(12812083200,2376, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2376
FILL(13569465599,2399,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2399
FILL(13569465600,2400, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2400
FILL(13601088000,2401, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2401
FILL(14358470399,2424,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2424
FILL(14358470400,2425, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2425
FILL(14390006400,2426, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2426
FILL(15147388799,2449,12,31,5,23,59,59), // Fri Dec 31 23:59:59 UTC 2449
FILL(15147388800,2450, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2450
FILL(15178924800,2451, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2451
FILL(15936307199,2474,12,31,1,23,59,59), // Mon Dec 31 23:59:59 UTC 2474
FILL(15936307200,2475, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2475
FILL(15967843200,2476, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2476
FILL(16725225599,2499,12,31,4,23,59,59), // Thu Dec 31 23:59:59 UTC 2499
FILL(16725225600,2500, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2500
FILL(16756761600,2501, 1, 1,6, 0, 0, 0), // Sat Jan 1 00:00:00 UTC 2501
FILL(17514143999,2524,12,31,0,23,59,59), // Sun Dec 31 23:59:59 UTC 2524
FILL(17514144000,2525, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2525
FILL(17545680000,2526, 1, 1,2, 0, 0, 0), // Tue Jan 1 00:00:00 UTC 2526
FILL(18303062399,2549,12,31,3,23,59,59), // Wed Dec 31 23:59:59 UTC 2549
FILL(18303062400,2550, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2550
FILL(18334598400,2551, 1, 1,5, 0, 0, 0), // Fri Jan 1 00:00:00 UTC 2551
FILL(19091980799,2574,12,31,6,23,59,59), // Sat Dec 31 23:59:59 UTC 2574
FILL(19091980800,2575, 1, 1,0, 0, 0, 0), // Sun Jan 1 00:00:00 UTC 2575
FILL(19123516800,2576, 1, 1,1, 0, 0, 0), // Mon Jan 1 00:00:00 UTC 2576
FILL(19880899199,2599,12,31,2,23,59,59), // Tue Dec 31 23:59:59 UTC 2599
FILL(19880899200,2600, 1, 1,3, 0, 0, 0), // Wed Jan 1 00:00:00 UTC 2600
FILL(19912435200,2601, 1, 1,4, 0, 0, 0), // Thu Jan 1 00:00:00 UTC 2601
};
#undef FILL
ATF_TC(ymdhms_to_secs);
ATF_TC_HEAD(ymdhms_to_secs, tc)
{
atf_tc_set_md_var(tc, "descr", "check clock_ymdhms_to_secs");
}
ATF_TC_BODY(ymdhms_to_secs, tc)
{
time_t secs;
size_t i;
for (i = 0; i < __arraycount(clock_tests); i++) {
secs = clock_ymdhms_to_secs(__UNCONST(&clock_tests[i].clock));
ATF_CHECK_EQ_MSG(clock_tests[i].time, secs, "%jd != %jd",
(intmax_t)clock_tests[i].time, (intmax_t)secs);
}
}
ATF_TC(secs_to_ymdhms);
ATF_TC_HEAD(secs_to_ymdhms, tc)
{
atf_tc_set_md_var(tc, "descr", "check clock_secs_to_ymdhms");
}
ATF_TC_BODY(secs_to_ymdhms, tc)
{
struct clock_ymdhms ymdhms;
size_t i;
#define CHECK_FIELD(f) \
ATF_CHECK_EQ_MSG(ymdhms.dt_##f, clock_tests[i].clock.dt_##f, \
"%jd != %jd for %jd", (intmax_t)ymdhms.dt_##f, \
(intmax_t)clock_tests[i].clock.dt_##f, \
(intmax_t)clock_tests[i].time)
for (i = 0; i < __arraycount(clock_tests); i++) {
clock_secs_to_ymdhms(clock_tests[i].time, &ymdhms);
CHECK_FIELD(year);
CHECK_FIELD(mon);
CHECK_FIELD(day);
CHECK_FIELD(wday);
CHECK_FIELD(hour);
CHECK_FIELD(min);
CHECK_FIELD(sec);
}
#undef CHECK_FIELD
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, ymdhms_to_secs);
ATF_TP_ADD_TC(tp, secs_to_ymdhms);
return atf_no_error();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_cd.c,v 1.7 2014/04/25 00:24:39 pooka Exp $ */
/* $NetBSD: t_cd.c,v 1.8 2017/01/13 21:30:39 christos Exp $ */
/*
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
@ -39,7 +39,7 @@
#include "scsitest.h"
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(noisyeject);
ATF_TC_HEAD(noisyeject, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_swwdog.c,v 1.6 2015/04/23 04:49:37 pgoyette Exp $ */
/* $NetBSD: t_swwdog.c,v 1.7 2017/01/13 21:30:39 christos Exp $ */
/*
* Copyright (c) 2010 Antti Kantee. All Rights Reserved.
@ -43,7 +43,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
static volatile sig_atomic_t tcount;

View File

@ -1,4 +1,4 @@
/* $NetBSD: h_fsmacros.h,v 1.40 2015/08/29 19:19:43 dholland Exp $ */
/* $NetBSD: h_fsmacros.h,v 1.41 2017/01/13 21:30:39 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -40,7 +40,7 @@
#include <rump/rump.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define FSPROTOS(_fs_) \
int _fs_##_fstest_newfs(const atf_tc_t *, void **, const char *, \

View File

@ -1,4 +1,4 @@
/* $NetBSD: h_quota2_tests.c,v 1.4 2012/09/30 21:26:57 bouyer Exp $ */
/* $NetBSD: h_quota2_tests.c,v 1.5 2017/01/13 21:30:39 christos Exp $ */
/*
* rump server for advanced quota tests
@ -22,7 +22,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
int background = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_fifos.c,v 1.5 2010/11/07 17:51:17 jmmv Exp $ */
/* $NetBSD: t_fifos.c,v 1.6 2017/01/13 21:30:39 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -17,7 +17,7 @@
#include <ufs/ufs/ufsmount.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC_WITH_CLEANUP(fifos);
ATF_TC_HEAD(fifos, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_mount.c,v 1.13 2012/11/27 16:01:49 jakllsch Exp $ */
/* $NetBSD: t_mount.c,v 1.14 2017/01/13 21:30:39 christos Exp $ */
/*
* Basic tests for mounting
@ -25,7 +25,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(48Kimage);
ATF_TC_HEAD(48Kimage, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_quota2_1.c,v 1.4 2012/03/15 02:02:22 joerg Exp $ */
/* $NetBSD: t_quota2_1.c,v 1.5 2017/01/13 21:30:39 christos Exp $ */
/*
* Basic tests for quota2
@ -18,7 +18,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
static void
do_quota(const atf_tc_t *tc, int n, const char *newfs_opts, int log)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_quota2_remount.c,v 1.4 2012/03/15 02:02:22 joerg Exp $ */
/* $NetBSD: t_quota2_remount.c,v 1.5 2017/01/13 21:30:39 christos Exp $ */
/*
* Basic tests for quota2
@ -19,7 +19,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
static void
do_quota(const atf_tc_t *tc, int n, const char *newfs_opts, int log)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_snapshot.c,v 1.6 2013/02/06 09:05:01 hannken Exp $ */
/* $NetBSD: t_snapshot.c,v 1.7 2017/01/13 21:30:39 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -15,7 +15,7 @@
#include <string.h>
#include <unistd.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define IMGNAME "ffs.img"
#define NEWFS "newfs -F -s 10000 " IMGNAME

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_snapshot_log.c,v 1.2 2013/02/06 09:05:01 hannken Exp $ */
/* $NetBSD: t_snapshot_log.c,v 1.3 2017/01/13 21:30:39 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -15,7 +15,7 @@
#include <string.h>
#include <unistd.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define IMGNAME "ffs.img"
#define NEWFS "newfs -F -s 10000 " IMGNAME

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_snapshot_v2.c,v 1.2 2013/02/06 09:05:01 hannken Exp $ */
/* $NetBSD: t_snapshot_v2.c,v 1.3 2017/01/13 21:30:39 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -15,7 +15,7 @@
#include <string.h>
#include <unistd.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define IMGNAME "ffs.img"
#define NEWFS "newfs -F -s 10000 -O 2 " IMGNAME

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pathconvert.c,v 1.5 2011/02/25 20:54:18 martin Exp $ */
/* $NetBSD: t_pathconvert.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -18,7 +18,7 @@
#include <fs/hfs/hfs.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(colonslash);
ATF_TC_HEAD(colonslash, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_basic.c,v 1.3 2010/05/31 23:44:54 pooka Exp $ */
/* $NetBSD: t_basic.c,v 1.4 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -20,7 +20,7 @@
#include <miscfs/kernfs/kernfs.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(getdents);
ATF_TC_HEAD(getdents, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pr.c,v 1.6 2011/02/22 18:41:05 pooka Exp $ */
/* $NetBSD: t_pr.c,v 1.7 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -17,7 +17,7 @@
#include <ufs/ufs/ufsmount.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(mknod);
ATF_TC_HEAD(mknod, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_snapshot.c,v 1.3 2014/06/10 13:15:18 martin Exp $ */
/* $NetBSD: t_snapshot.c,v 1.4 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -17,7 +17,7 @@
#include <string.h>
#include <unistd.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define IMGNAME "msdosfs.img"
#define NEWFS "newfs_msdos -C 5M " IMGNAME

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_mountd.c,v 1.5 2012/02/24 13:53:46 joerg Exp $ */
/* $NetBSD: t_mountd.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
#include "../common/h_fsmacros.h"
ATF_TC(mountdhup);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_basic.c,v 1.3 2010/06/09 08:37:16 pooka Exp $ */
/* $NetBSD: t_basic.c,v 1.4 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -18,7 +18,7 @@
#include <miscfs/nullfs/null.h>
#include <fs/tmpfs/tmpfs_args.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(basic);
ATF_TC_HEAD(basic, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_nullpts.c,v 1.5 2011/01/10 11:11:04 hannken Exp $ */
/* $NetBSD: t_nullpts.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -19,7 +19,7 @@
#include <fs/ptyfs/ptyfs.h>
#include <miscfs/nullfs/null.h>
#include "../../h_macros.h"
#include "h_macros.h"
static void
mountptyfs(const char *mp, int flags)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ptyfs.c,v 1.1 2010/06/11 23:52:38 pooka Exp $ */
/* $NetBSD: t_ptyfs.c,v 1.2 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -17,7 +17,7 @@
#include <fs/ptyfs/ptyfs.h>
#include "../../h_macros.h"
#include "h_macros.h"
static void
mountptyfs(const char *mp, int flags)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_basic.c,v 1.13 2016/12/01 14:49:04 hannken Exp $ */
/* $NetBSD: t_basic.c,v 1.14 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -20,7 +20,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
#include "../common/h_fsmacros.h"
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_fuzz.c,v 1.5 2012/04/21 01:03:46 manu Exp $ */
/* $NetBSD: t_fuzz.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -56,7 +56,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define ITERATIONS 100

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_io.c,v 1.1 2010/11/12 17:33:28 pooka Exp $ */
/* $NetBSD: t_io.c,v 1.2 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -20,7 +20,7 @@
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../../h_macros.h"
#include "h_macros.h"
#include "../common/h_fsmacros.h"
#define MAKEOPTS(...) \

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_renamerace.c,v 1.13 2011/08/18 21:44:55 riastradh Exp $ */
/* $NetBSD: t_renamerace.c,v 1.14 2017/01/13 21:30:40 christos Exp $ */
/*
* Modified for rump and atf from a program supplied
@ -23,7 +23,7 @@
#include <fs/tmpfs/tmpfs_args.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(renamerace2);
ATF_TC_HEAD(renamerace2, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_basic.c,v 1.4 2010/07/19 15:35:39 pooka Exp $ */
/* $NetBSD: t_basic.c,v 1.5 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/param.h>
@ -20,7 +20,7 @@
#include <fs/tmpfs/tmpfs_args.h>
#include <miscfs/umapfs/umap.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(basic);
ATF_TC_HEAD(basic, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pr.c,v 1.8 2011/08/10 06:27:02 hannken Exp $ */
/* $NetBSD: t_pr.c,v 1.9 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -17,7 +17,7 @@
#include <miscfs/union/union.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(multilayer);
ATF_TC_HEAD(multilayer, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_full.c,v 1.8 2013/03/16 05:45:37 jmmv Exp $ */
/* $NetBSD: t_full.c,v 1.9 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <rump/rump.h>
#include "../common/h_fsmacros.h"
#include "../../h_macros.h"
#include "h_macros.h"
/*
* Write this much over the image size. This is to force an NFS commit,

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_io.c,v 1.16 2015/04/04 12:34:44 riastradh Exp $ */
/* $NetBSD: t_io.c,v 1.17 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <rump/rump.h>
#include "../common/h_fsmacros.h"
#include "../../h_macros.h"
#include "h_macros.h"
#define TESTSTR "this is a string. collect enough and you'll have Em"
#define TESTSZ sizeof(TESTSTR)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_renamerace.c,v 1.33 2016/05/04 08:30:22 dholland Exp $ */
/* $NetBSD: t_renamerace.c,v 1.34 2017/01/13 21:30:40 christos Exp $ */
/*
* Modified for rump and atf from a program supplied
@ -34,7 +34,7 @@
#define FSTEST_IMGSIZE (50000 * 512)
#include "../common/h_fsmacros.h"
#include "../../h_macros.h"
#include "h_macros.h"
static volatile int quittingtime;
pid_t wrkpid;

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ro.c,v 1.5 2011/02/22 21:23:19 yamt Exp $ */
/* $NetBSD: t_ro.c,v 1.6 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <rump/rump.h>
#include "../common/h_fsmacros.h"
#include "../../h_macros.h"
#include "h_macros.h"
#define AFILE "testfile"
#define ADIR "testdir"

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_union.c,v 1.8 2011/08/07 06:01:51 hannken Exp $ */
/* $NetBSD: t_union.c,v 1.9 2017/01/13 21:30:40 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -17,7 +17,7 @@
#include <miscfs/union/union.h>
#include "../../h_macros.h"
#include "h_macros.h"
#include "../common/h_fsmacros.h"
#define MSTR "magic bus"

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_unpriv.c,v 1.12 2015/04/09 19:51:13 riastradh Exp $ */
/* $NetBSD: t_unpriv.c,v 1.13 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <rump/rump.h>
#include "../common/h_fsmacros.h"
#include "../../h_macros.h"
#include "h_macros.h"
#define USES_OWNER \
if (FSTYPE_MSDOS(tc)) \

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_vfsops.c,v 1.11 2011/04/04 19:16:58 hannken Exp $ */
/* $NetBSD: t_vfsops.c,v 1.12 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <rump/rump.h>
#include "../common/h_fsmacros.h"
#include "../../h_macros.h"
#include "h_macros.h"
static void
tmount(const atf_tc_t *tc, const char *path)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_vnops.c,v 1.58 2016/08/29 02:31:46 kre Exp $ */
/* $NetBSD: t_vnops.c,v 1.59 2017/01/13 21:30:40 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
#include <rump/rump.h>
#include "../common/h_fsmacros.h"
#include "../../h_macros.h"
#include "h_macros.h"
#define TESTFILE "afile"

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_socket.c,v 1.4 2015/02/27 08:30:30 martin Exp $ */
/* $NetBSD: t_socket.c,v 1.5 2017/01/13 21:30:41 christos Exp $ */
#include <sys/types.h>
#include <sys/mount.h>
@ -18,7 +18,7 @@
#include <unistd.h>
#include <util.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(cmsg_sendfd_bounds);
ATF_TC_HEAD(cmsg_sendfd_bounds, tc)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_wait3.c,v 1.1 2016/12/02 05:54:15 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAIT3
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_wait4.c,v 1.1 2016/12/02 05:54:15 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAIT4
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_wait6.c,v 1.1 2016/12/02 05:54:15 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAIT6
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_waitid.c,v 1.1 2016/12/02 05:54:15 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAITID
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_waitpid.c,v 1.1 2016/12/02 05:54:15 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAITPID
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,141 @@
/* $NetBSD: t_ptrace_wait.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_ptrace_wait.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/wait.h>
#include <machine/reg.h>
#include <err.h>
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <atf-c.h>
#include "h_macros.h"
#include "../../t_ptrace_wait.h"
#if defined(HAVE_GPREGS)
ATF_TC(regs1);
ATF_TC_HEAD(regs1, tc)
{
atf_tc_set_md_var(tc, "descr",
"Call PT_GETREGS and iterate over General Purpose registers");
}
ATF_TC_BODY(regs1, tc)
{
const int exitval = 5;
const int sigval = SIGSTOP;
pid_t child, wpid;
#if defined(TWAIT_HAVE_STATUS)
int status;
#endif
struct reg r;
printf("Before forking process PID=%d\n", getpid());
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
printf("Before raising %s from child\n", strsignal(sigval));
FORKEE_ASSERT(raise(sigval) == 0);
printf("Before exiting of the child process\n");
_exit(exitval);
}
printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, sigval);
printf("Call GETREGS for the child process\n");
ATF_REQUIRE(ptrace(PT_GETREGS, child, &r, 0) != -1);
printf("EAX=%#" PRIxREGISTER "\n", r.r_eax);
printf("EBX=%#" PRIxREGISTER "\n", r.r_ebx);
printf("ECX=%#" PRIxREGISTER "\n", r.r_ecx);
printf("EDX=%#" PRIxREGISTER "\n", r.r_edx);
printf("ESP=%#" PRIxREGISTER "\n", r.r_esp);
printf("EBP=%#" PRIxREGISTER "\n", r.r_ebp);
printf("ESI=%#" PRIxREGISTER "\n", r.r_esi);
printf("EDI=%#" PRIxREGISTER "\n", r.r_edi);
printf("EIP=%#" PRIxREGISTER "\n", r.r_eip);
printf("EFLAGS=%#" PRIxREGISTER "\n", r.r_eflags);
printf("CS=%#" PRIxREGISTER "\n", r.r_cs);
printf("SS=%#" PRIxREGISTER "\n", r.r_ss);
printf("DS=%#" PRIxREGISTER "\n", r.r_ds);
printf("ES=%#" PRIxREGISTER "\n", r.r_es);
printf("FS=%#" PRIxREGISTER "\n", r.r_fs);
printf("GS=%#" PRIxREGISTER "\n", r.r_gs);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_exited(status, exitval);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
}
#endif
ATF_TP_ADD_TCS(tp)
{
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
ATF_TP_ADD_TC_HAVE_GPREGS(tp, regs1);
return atf_no_error();
}

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_wait3.c,v 1.1 2016/12/13 18:00:10 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAIT3
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_wait4.c,v 1.1 2016/12/13 18:00:10 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAIT4
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_wait6.c,v 1.1 2016/12/13 18:00:10 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAIT6
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_waitid.c,v 1.1 2016/12/13 18:00:10 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAITID
#include "t_ptrace_wait.c"

View File

@ -0,0 +1,30 @@
/* $NetBSD: t_ptrace_waitpid.c,v 1.1 2016/12/13 18:00:10 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#define TWAIT_WAITPID
#include "t_ptrace_wait.c"

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
/* $NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
__RCSID("$NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
#include <sys/stat.h>
@ -46,7 +46,7 @@ __RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
#define FIFONAME "fifo"

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_file.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
/* $NetBSD: t_file.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_file.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
__RCSID("$NetBSD: t_file.c,v 1.4 2017/01/13 21:30:41 christos Exp $");
#include <sys/param.h>
#include <sys/event.h>
@ -50,7 +50,7 @@ __RCSID("$NetBSD: t_file.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
#define FILENAME "file"
#define NLINES 5

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_file2.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
/* $NetBSD: t_file2.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_file2.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
__RCSID("$NetBSD: t_file2.c,v 1.4 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
@ -41,7 +41,7 @@ __RCSID("$NetBSD: t_file2.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
ATF_TC(file2);
ATF_TC_HEAD(file2, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
/* $NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
__RCSID("$NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
@ -41,7 +41,7 @@ __RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
ATF_TC(pipe);
ATF_TC_HEAD(pipe, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
/* $NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
__RCSID("$NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
#include <sys/wait.h>
@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
static void
h_check(bool check_master)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ioctl.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */
/* $NetBSD: t_ioctl.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_ioctl.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
__RCSID("$NetBSD: t_ioctl.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
#include <sys/ioctl.h>
@ -42,7 +42,7 @@ __RCSID("$NetBSD: t_ioctl.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
#include <atf-c.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(kfilter_byfilter);
ATF_TC_HEAD(kfilter_byfilter, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_proc1.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */
/* $NetBSD: t_proc1.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_proc1.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
__RCSID("$NetBSD: t_proc1.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
/*
* this also used to trigger problem fixed in
@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_proc1.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
#include <atf-c.h>
#include "../../h_macros.h"
#include "h_macros.h"
static int
child(void)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */
/* $NetBSD: t_proc2.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
__RCSID("$NetBSD: t_proc2.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
#ifdef __FreeBSD__
#include <sys/types.h>
@ -50,7 +50,7 @@ __RCSID("$NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
#include <atf-c.h>
#include "../../h_macros.h"
#include "h_macros.h"
static void
child_two(void)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $ */
/* $NetBSD: t_proc3.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
__RCSID("$NetBSD: t_proc3.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
#ifdef __FreeBSD__
#include <sys/types.h>
@ -48,7 +48,7 @@ __RCSID("$NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $");
#include <atf-c.h>
#include "../../h_macros.h"
#include "h_macros.h"
ATF_TC(proc3);
ATF_TC_HEAD(proc3, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $ */
/* $NetBSD: t_sig.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $");
__RCSID("$NetBSD: t_sig.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
#ifdef __FreeBSD__
#include <sys/types.h>
@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $");
#include <atf-c.h>
#include "../../h_macros.h"
#include "h_macros.h"
#define NSIGNALS 5

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $ */
/* $NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
__RCSID("$NetBSD: t_fifo.c,v 1.4 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
#include <sys/stat.h>
@ -46,7 +46,7 @@ __RCSID("$NetBSD: t_fifo.c,v 1.3 2010/11/07 17:51:20 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
#define FIFONAME "fifo"

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
/* $NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
__RCSID("$NetBSD: t_pipe.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
#include <sys/wait.h>
@ -44,7 +44,7 @@ __RCSID("$NetBSD: t_pipe.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
ATF_TC(pipe1);
ATF_TC_HEAD(pipe1, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:58 jmmv Exp $ */
/* $NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:58 jmmv Exp $");
__RCSID("$NetBSD: t_ttypty.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <sys/event.h>
#include <sys/wait.h>
@ -47,7 +47,7 @@ __RCSID("$NetBSD: t_ttypty.c,v 1.1 2009/02/20 21:39:58 jmmv Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
static void
h_check(bool check_master)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $ */
/* $NetBSD: t_extent.c,v 1.5 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $");
__RCSID("$NetBSD: t_extent.c,v 1.5 2017/01/13 21:30:41 christos Exp $");
#include <sys/types.h>
#include <sys/queue.h>
@ -41,7 +41,7 @@ __RCSID("$NetBSD: t_extent.c,v 1.4 2012/01/27 18:53:10 para Exp $");
#include <atf-c.h>
#include "../h_macros.h"
#include "h_macros.h"
static int ret;
static struct extent *ex;

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_filedesc.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $ */
/* $NetBSD: t_filedesc.c,v 1.6 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_filedesc.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $");
__RCSID("$NetBSD: t_filedesc.c,v 1.6 2017/01/13 21:30:41 christos Exp $");
#include <sys/types.h>
@ -40,7 +40,7 @@ __RCSID("$NetBSD: t_filedesc.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $");
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../h_macros.h"
#include "h_macros.h"
ATF_TC(getfilerace);
ATF_TC_HEAD(getfilerace, tc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_lock.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */
/* $NetBSD: t_lock.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_lock.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
__RCSID("$NetBSD: t_lock.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <sys/time.h>
@ -38,7 +38,7 @@ __RCSID("$NetBSD: t_lock.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $");
#include <atf-c.h>
#include "../h_macros.h"
#include "h_macros.h"
__cpu_simple_lock_t lk;
volatile int handled = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ptrace.c,v 1.17 2016/11/13 22:59:31 kamil Exp $ */
/* $NetBSD: t_ptrace.c,v 1.18 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_ptrace.c,v 1.17 2016/11/13 22:59:31 kamil Exp $");
__RCSID("$NetBSD: t_ptrace.c,v 1.18 2017/01/13 21:30:41 christos Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -40,7 +40,7 @@ __RCSID("$NetBSD: t_ptrace.c,v 1.17 2016/11/13 22:59:31 kamil Exp $");
#include <atf-c.h>
#include "../h_macros.h"
#include "h_macros.h"
/*
* A child process cannot call atf functions and expect them to magically

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ptrace_wait.c,v 1.53 2017/01/10 05:08:24 kamil Exp $ */
/* $NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_ptrace_wait.c,v 1.53 2017/01/10 05:08:24 kamil Exp $");
__RCSID("$NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -48,7 +48,7 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.53 2017/01/10 05:08:24 kamil Exp $");
#include <atf-c.h>
#include "../h_macros.h"
#include "h_macros.h"
#include "t_ptrace_wait.h"
#include "msg.h"
@ -65,6 +65,7 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.53 2017/01/10 05:08:24 kamil Exp $");
#define PARENT_FROM_CHILD(info, fds, msg) \
ATF_REQUIRE(msg_read_child(info " from parent " # fds, &fds, &msg, sizeof(msg)) == 0)
ATF_TC(traceme1);
ATF_TC_HEAD(traceme1, tc)
{
@ -1071,6 +1072,118 @@ ATF_TC_BODY(eventmask2, tc)
TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
}
ATF_TC(eventmask3);
ATF_TC_HEAD(eventmask3, tc)
{
atf_tc_set_md_var(tc, "descr",
"Verify that PTRACE_VFORK in EVENT_MASK is preserved");
}
ATF_TC_BODY(eventmask3, tc)
{
const int exitval = 5;
const int sigval = SIGSTOP;
pid_t child, wpid;
#if defined(TWAIT_HAVE_STATUS)
int status;
#endif
ptrace_event_t set_event, get_event;
const int len = sizeof(ptrace_event_t);
atf_tc_expect_fail("PR kern/51630");
printf("Before forking process PID=%d\n", getpid());
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
printf("Before raising %s from child\n", strsignal(sigval));
FORKEE_ASSERT(raise(sigval) == 0);
printf("Before exiting of the child process\n");
_exit(exitval);
}
printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, sigval);
set_event.pe_set_event = PTRACE_VFORK;
ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
ATF_REQUIRE(memcmp(&set_event, &get_event, len) == 0);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_exited(status, exitval);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
}
ATF_TC(eventmask4);
ATF_TC_HEAD(eventmask4, tc)
{
atf_tc_set_md_var(tc, "descr",
"Verify that PTRACE_VFORK_DONE in EVENT_MASK is preserved");
}
ATF_TC_BODY(eventmask4, tc)
{
const int exitval = 5;
const int sigval = SIGSTOP;
pid_t child, wpid;
#if defined(TWAIT_HAVE_STATUS)
int status;
#endif
ptrace_event_t set_event, get_event;
const int len = sizeof(ptrace_event_t);
printf("Before forking process PID=%d\n", getpid());
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
printf("Before raising %s from child\n", strsignal(sigval));
FORKEE_ASSERT(raise(sigval) == 0);
printf("Before exiting of the child process\n");
_exit(exitval);
}
printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, sigval);
set_event.pe_set_event = PTRACE_VFORK_DONE;
ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1);
ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1);
ATF_REQUIRE(memcmp(&set_event, &get_event, len) == 0);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_exited(status, exitval);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
}
#if defined(TWAIT_HAVE_PID)
ATF_TC(fork1);
ATF_TC_HEAD(fork1, tc)
@ -1296,12 +1409,6 @@ ATF_TC_BODY(vfork1, tc)
ptrace_event_t event;
const int elen = sizeof(event);
/*
* ptrace(2) command PT_SET_EVENT_MASK: option PTRACE_VFORK unsupported
*/
#ifndef PTRACE_VFORK
#define PTRACE_VFORK 0
#endif
atf_tc_expect_fail("PR kern/51630");
printf("Before forking process PID=%d\n", getpid());
@ -1483,6 +1590,196 @@ ATF_TC_BODY(vfork2, tc)
TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
}
ATF_TC(vforkdone1);
ATF_TC_HEAD(vforkdone1, tc)
{
atf_tc_set_md_var(tc, "descr",
"Verify that vfork(2) is intercepted by ptrace(2) with EVENT_MASK "
"set to PTRACE_VFORK_DONE");
}
ATF_TC_BODY(vforkdone1, tc)
{
const int exitval = 5;
const int exitval2 = 15;
const int sigval = SIGSTOP;
pid_t child, child2, wpid;
#if defined(TWAIT_HAVE_STATUS)
int status;
#endif
ptrace_state_t state;
const int slen = sizeof(state);
ptrace_event_t event;
const int elen = sizeof(event);
printf("Before forking process PID=%d\n", getpid());
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
printf("Before raising %s from child\n", strsignal(sigval));
FORKEE_ASSERT(raise(sigval) == 0);
FORKEE_ASSERT((child2 = vfork()) != 1);
if (child2 == 0)
_exit(exitval2);
FORKEE_REQUIRE_SUCCESS
(wpid = TWAIT_GENERIC(child2, &status, 0), child2);
forkee_status_exited(status, exitval2);
printf("Before exiting of the child process\n");
_exit(exitval);
}
printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, sigval);
printf("Enable PTRACE_VFORK in EVENT_MASK for the child %d\n", child);
event.pe_set_event = PTRACE_VFORK_DONE;
ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child %d\n", TWAIT_FNAME, child);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, SIGTRAP);
ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_VFORK_DONE);
child2 = state.pe_other_pid;
printf("Reported PTRACE_VFORK_DONE event with forkee %d\n", child2);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child - expected stopped "
"SIGCHLD\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, SIGCHLD);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child - expected exited\n",
TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_exited(status, exitval);
printf("Before calling %s() for the child - expected no process\n",
TWAIT_FNAME);
TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
}
ATF_TC(vforkdone2);
ATF_TC_HEAD(vforkdone2, tc)
{
atf_tc_set_md_var(tc, "descr",
"Verify that vfork(2) is intercepted by ptrace(2) with EVENT_MASK "
"set to PTRACE_FORK | PTRACE_VFORK_DONE");
}
ATF_TC_BODY(vforkdone2, tc)
{
const int exitval = 5;
const int exitval2 = 15;
const int sigval = SIGSTOP;
pid_t child, child2, wpid;
#if defined(TWAIT_HAVE_STATUS)
int status;
#endif
ptrace_state_t state;
const int slen = sizeof(state);
ptrace_event_t event;
const int elen = sizeof(event);
printf("Before forking process PID=%d\n", getpid());
ATF_REQUIRE((child = fork()) != -1);
if (child == 0) {
printf("Before calling PT_TRACE_ME from child %d\n", getpid());
FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
printf("Before raising %s from child\n", strsignal(sigval));
FORKEE_ASSERT(raise(sigval) == 0);
FORKEE_ASSERT((child2 = vfork()) != 1);
if (child2 == 0)
_exit(exitval2);
FORKEE_REQUIRE_SUCCESS
(wpid = TWAIT_GENERIC(child2, &status, 0), child2);
forkee_status_exited(status, exitval2);
printf("Before exiting of the child process\n");
_exit(exitval);
}
printf("Parent process PID=%d, child's PID=%d\n", getpid(), child);
printf("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, sigval);
printf("Enable PTRACE_VFORK in EVENT_MASK for the child %d\n", child);
event.pe_set_event = PTRACE_FORK | PTRACE_VFORK_DONE;
ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child %d\n", TWAIT_FNAME, child);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, SIGTRAP);
ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1);
ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_VFORK_DONE);
child2 = state.pe_other_pid;
printf("Reported PTRACE_VFORK_DONE event with forkee %d\n", child2);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child - expected stopped "
"SIGCHLD\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_stopped(status, SIGCHLD);
printf("Before resuming the child process where it left off and "
"without signal to be sent\n");
ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
printf("Before calling %s() for the child - expected exited\n",
TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child);
validate_status_exited(status, exitval);
printf("Before calling %s() for the child - expected no process\n",
TWAIT_FNAME);
TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0));
}
ATF_TC(io_read_d1);
ATF_TC_HEAD(io_read_d1, tc)
{
@ -5008,6 +5305,8 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, eventmask1);
ATF_TP_ADD_TC(tp, eventmask2);
ATF_TP_ADD_TC(tp, eventmask3);
ATF_TP_ADD_TC(tp, eventmask4);
ATF_TP_ADD_TC_HAVE_PID(tp, fork1);
ATF_TP_ADD_TC(tp, fork2);
@ -5015,6 +5314,9 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC_HAVE_PID(tp, vfork1);
ATF_TP_ADD_TC(tp, vfork2);
ATF_TP_ADD_TC(tp, vforkdone1);
ATF_TP_ADD_TC(tp, vforkdone2);
ATF_TP_ADD_TC(tp, io_read_d1);
ATF_TP_ADD_TC(tp, io_read_d2);
ATF_TP_ADD_TC(tp, io_read_d3);

View File

@ -1,4 +1,4 @@
/* $Id: t_pty.c,v 1.1 2011/09/24 15:53:01 christos Exp $ */
/* $Id: t_pty.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*
* Allocates a pty(4) device, and sends the specified number of packets of the
@ -9,7 +9,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_pty.c,v 1.1 2011/09/24 15:53:01 christos Exp $");
__RCSID("$NetBSD: t_pty.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <errno.h>
#include <err.h>
@ -35,7 +35,7 @@ static __dead void usage(const char *);
static void parse_args(int, char **);
#else
#include <atf-c.h>
#include "../h_macros.h"
#include "h_macros.h"
#endif
static int pty_open(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_rnd.c,v 1.9 2016/05/22 04:34:44 riastradh Exp $ */
/* $NetBSD: t_rnd.c,v 1.10 2017/01/13 21:30:41 christos Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_rnd.c,v 1.9 2016/05/22 04:34:44 riastradh Exp $");
__RCSID("$NetBSD: t_rnd.c,v 1.10 2017/01/13 21:30:41 christos Exp $");
#include <sys/types.h>
#include <sys/fcntl.h>
@ -39,7 +39,7 @@ __RCSID("$NetBSD: t_rnd.c,v 1.9 2016/05/22 04:34:44 riastradh Exp $");
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include "../h_macros.h"
#include "h_macros.h"
ATF_TC(RNDADDDATA);
ATF_TC_HEAD(RNDADDDATA, tc)

View File

@ -0,0 +1,90 @@
/* $NetBSD: t_exect.c,v 1.6 2016/12/12 10:34:55 joerg Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <atf-c.h>
#include <errno.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h>
#include <unistd.h>
ATF_TC(t_exect_null);
ATF_TC_HEAD(t_exect_null, tc)
{
atf_tc_set_md_var(tc, "descr",
"Tests an empty exect(2) executing");
}
static volatile sig_atomic_t caught = 0;
static void
sigtrap_handler(int sig, siginfo_t *info, void *ctx)
{
ATF_REQUIRE_EQ(sig, SIGTRAP);
ATF_REQUIRE_EQ(info->si_code, TRAP_TRACE);
++caught;
}
ATF_TC_BODY(t_exect_null, tc)
{
struct sigaction act;
/*
* Currently exect(3) is misdesigned -- see PR port-amd64/51700 and it
* needs to be redone from scratch.
*
* This test affects amd64 releng machines causing tests to hang or
* fail. As there is little point to test interface that is still not,
* designed and implemented and is breaking tests - skip it
* unconditionally for all ports.
*/
/* Prevent static analysis from requiring t_exec_null to be __dead. */
if (!caught)
atf_tc_skip("exect(3) misdesigned and hangs - PR port-amd64/51700");
ATF_REQUIRE(sigemptyset(&act.sa_mask) == 0);
act.sa_sigaction = sigtrap_handler;
act.sa_flags = SA_SIGINFO;
ATF_REQUIRE(sigaction(SIGTRAP, &act, 0) == 0);
ATF_REQUIRE_ERRNO(EFAULT, exect(NULL, NULL, NULL) == -1);
ATF_REQUIRE_EQ_MSG(caught, 1, "expected caught (1) != received (%d)",
(int)caught);
}
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, t_exect_null);
return atf_no_error();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $ */
/* $NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
* All rights reserved.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $");
__RCSID("$NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $");
#include <atf-c.h>
@ -46,12 +46,11 @@ __RCSID("$NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $");
#include <string.h>
#include <errno.h>
#ifdef __FreeBSD__
#include "h_macros.h"
#ifdef __FreeBSD__
#define __gl_stat_t struct stat
#define _S_IFDIR S_IFDIR
#else
#include "../../../h_macros.h"
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: debug.c,v 1.2 2011/10/10 04:32:41 christos Exp $ */
/* $NetBSD: debug.c,v 1.3 2017/01/14 00:50:56 christos Exp $ */
/*-
* Copyright (c) 1993 The NetBSD Foundation, Inc.
@ -26,18 +26,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/types.h>
#include <ctype.h>
#include <limits.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#ifdef __FreeBSD__
#include <wchar.h>
#include <wctype.h>
#endif
/* Don't sort these! */
#include "utils.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $ */
/* $NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -37,17 +37,15 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_exhaust.c,v 1.7 2011/11/16 18:37:31 christos Exp $");
__RCSID("$NetBSD: t_exhaust.c,v 1.8 2017/01/14 00:50:56 christos Exp $");
#include <stdio.h>
#include <regex.h>
#include <string.h>
#include <stdlib.h>
#include <err.h>
#include <atf-c.h>
#ifdef __FreeBSD__
#include <sys/resource.h>
#endif
#include <atf-c.h>
#include <err.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef REGEX_MAXSIZE
#define REGEX_MAXSIZE 9999
@ -179,25 +177,17 @@ ATF_TC_HEAD(regcomp_too_big, tc)
" crash, but return a proper error code");
// libtre needs it.
atf_tc_set_md_var(tc, "timeout", "600");
#ifdef __FreeBSD__
atf_tc_set_md_var(tc, "require.memory", "64M");
#else
atf_tc_set_md_var(tc, "require.memory", "120M");
#endif
}
ATF_TC_BODY(regcomp_too_big, tc)
{
regex_t re;
#ifdef __FreeBSD__
struct rlimit limit;
#endif
int e;
#ifdef __FreeBSD__
limit.rlim_cur = limit.rlim_max = 64 * 1024 * 1024;
ATF_REQUIRE(setrlimit(RLIMIT_VMEM, &limit) != -1);
#endif
for (size_t i = 0; i < __arraycount(tests); i++) {
char *d = (*tests[i].pattern)(REGEX_MAXSIZE);
e = regcomp(&re, d, tests[i].type);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $ */
/* $NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_regex_att.c,v 1.1 2012/08/24 20:24:40 jmmv Exp $");
__RCSID("$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $");
#include <sys/param.h>
@ -377,11 +377,7 @@ checkmatches(const char *matches, size_t nm, const regmatch_t *pm,
" cur=%d, max=%zu", res, l, len - off);
off += l;
}
#ifdef __FreeBSD__
ATF_CHECK_STREQ_MSG(res, matches, " at line %zu", lineno);
#else
ATF_REQUIRE_STREQ_MSG(res, matches, " at line %zu", lineno);
#endif
free(res);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $ */
/* $NetBSD: t_clock_gettime.c,v 1.3 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -58,30 +58,22 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_clock_gettime.c,v 1.1 2011/10/15 06:42:16 jruoho Exp $");
__RCSID("$NetBSD: t_clock_gettime.c,v 1.3 2017/01/13 21:30:41 christos Exp $");
#include <sys/param.h>
#include <sys/sysctl.h>
#ifdef __NetBSD__
#include <machine/int_limits.h>
#endif
#include <atf-c.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#ifdef __NetBSD__
#include "../../../h_macros.h"
#else
#include <limits.h>
#include <stdint.h>
#include "h_macros.h"
#endif
#define MINPOSDIFF 15000000 /* 15 ms for now */
#define TIMEOUT 5

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_connect.c,v 1.2 2015/04/05 23:17:41 rtr Exp $ */
/* $NetBSD: t_connect.c,v 1.3 2017/01/13 20:09:48 christos Exp $ */
/*
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
* All rights reserved.
@ -26,6 +26,7 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/socket.h>
#include <err.h>
#include <errno.h>
#include <string.h>
@ -56,10 +57,8 @@ ATF_TC_BODY(connect_low_port, tc)
slist = socket(AF_INET, SOCK_STREAM, 0);
sd = socket(AF_INET, SOCK_STREAM, 0);
#ifdef __FreeBSD__
ATF_REQUIRE(sd > 0);
ATF_REQUIRE(slist > 0);
#endif
/* bind listening socket */
memset(&sinlist, 0, sizeof(sinlist));
@ -97,9 +96,7 @@ ATF_TC_BODY(connect_low_port, tc)
ATF_REQUIRE(ntohs(sin.sin_port) <= IPPORT_RESERVEDMAX);
close(sd);
#ifdef __FreeBSD__
close(slist);
#endif
}
ATF_TC(connect_foreign_family);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_dup.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $ */
/* $NetBSD: t_dup.c,v 1.9 2017/01/13 20:31:53 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_dup.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $");
__RCSID("$NetBSD: t_dup.c,v 1.9 2017/01/13 20:31:53 christos Exp $");
#include <sys/resource.h>
#include <sys/stat.h>
@ -39,6 +39,7 @@ __RCSID("$NetBSD: t_dup.c,v 1.8 2012/03/18 07:00:51 jruoho Exp $");
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_getrusage.c,v 1.4 2016/08/05 15:01:39 scole Exp $ */
/* $NetBSD: t_getrusage.c,v 1.5 2017/01/13 20:31:06 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_getrusage.c,v 1.4 2016/08/05 15:01:39 scole Exp $");
__RCSID("$NetBSD: t_getrusage.c,v 1.5 2017/01/13 20:31:06 christos Exp $");
#include <sys/resource.h>
#include <sys/time.h>
@ -47,11 +47,7 @@ static void sighandler(int);
static const size_t maxiter = 2000;
static void
#ifdef __FreeBSD__
sighandler(int signo __unused)
#else
sighandler(int signo)
#endif
{
/* Nothing. */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_link.c,v 1.2 2014/04/21 14:39:36 martin Exp $ */
/* $NetBSD: t_link.c,v 1.3 2017/01/13 20:42:36 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_link.c,v 1.2 2014/04/21 14:39:36 martin Exp $");
__RCSID("$NetBSD: t_link.c,v 1.3 2017/01/13 20:42:36 christos Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@ -37,6 +37,7 @@ __RCSID("$NetBSD: t_link.c,v 1.2 2014/04/21 14:39:36 martin Exp $");
#include <atf-c.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_listen.c,v 1.4 2012/03/18 07:00:52 jruoho Exp $ */
/* $NetBSD: t_listen.c,v 1.5 2017/01/13 20:41:50 christos Exp $ */
/*
* Copyright (c) 2007 The NetBSD Foundation, Inc.
* All rights reserved.
@ -26,6 +26,7 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/socket.h>
#include <atf-c.h>
#include <err.h>
#include <errno.h>
@ -110,9 +111,7 @@ ATF_TC_BODY(listen_low_port, tc)
int sd, val;
sd = socket(AF_INET, SOCK_STREAM, 0);
#ifdef __FreeBSD__
ATF_REQUIRE_MSG(sd != -1, "socket failed: %s", strerror(errno));
#endif
val = IP_PORTRANGE_LOW;
if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE, &val,

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $ */
/* $NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -55,7 +55,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_mmap.c,v 1.10 2017/01/10 22:36:29 christos Exp $");
__RCSID("$NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $");
#include <sys/param.h>
#include <sys/mman.h>
@ -460,9 +460,7 @@ ATF_TC_BODY(mmap_truncate, tc)
ATF_REQUIRE(ftruncate(fd, page / 12) == 0);
ATF_REQUIRE(ftruncate(fd, page / 64) == 0);
#ifdef __FreeBSD__
(void)munmap(map, page);
#endif
ATF_REQUIRE(close(fd) == 0);
}
@ -519,10 +517,8 @@ ATF_TC_BODY(mmap_truncate_signal, tc)
prevent the access to be optimized out */
ATF_REQUIRE(i == 0);
ATF_REQUIRE(sta == 0);
#ifdef __FreeBSD__
(void)munmap(map, page);
(void)close(fd);
#endif
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $ */
/* $NetBSD: t_msgctl.c,v 1.5 2017/01/13 20:44:45 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $");
__RCSID("$NetBSD: t_msgctl.c,v 1.5 2017/01/13 20:44:45 christos Exp $");
#include <sys/msg.h>
#include <sys/stat.h>
@ -38,6 +38,7 @@ __RCSID("$NetBSD: t_msgctl.c,v 1.4 2014/02/27 00:59:50 joerg Exp $");
#include <atf-c.h>
#include <errno.h>
#include <limits.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $ */
/* $NetBSD: t_msgrcv.c,v 1.4 2017/01/13 20:44:45 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $");
__RCSID("$NetBSD: t_msgrcv.c,v 1.4 2017/01/13 20:44:45 christos Exp $");
#include <sys/msg.h>
#include <sys/stat.h>
@ -38,6 +38,7 @@ __RCSID("$NetBSD: t_msgrcv.c,v 1.3 2013/07/24 11:44:10 skrll Exp $");
#include <atf-c.h>
#include <errno.h>
#include <limits.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $ */
/* $NetBSD: t_msgsnd.c,v 1.3 2017/01/13 20:44:45 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $");
__RCSID("$NetBSD: t_msgsnd.c,v 1.3 2017/01/13 20:44:45 christos Exp $");
#include <sys/msg.h>
#include <sys/stat.h>
@ -38,6 +38,7 @@ __RCSID("$NetBSD: t_msgsnd.c,v 1.2 2011/11/05 08:47:54 jruoho Exp $");
#include <atf-c.h>
#include <errno.h>
#include <limits.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $ */
/* $NetBSD: t_nanosleep.c,v 1.4 2017/01/13 21:15:14 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $");
__RCSID("$NetBSD: t_nanosleep.c,v 1.4 2017/01/13 21:15:14 christos Exp $");
#include <sys/time.h>
#include <sys/wait.h>
@ -45,11 +45,7 @@ __RCSID("$NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $");
#include <unistd.h>
static void
#ifdef __FreeBSD__
handler(int signo __unused)
#else
handler(int signo)
#endif
{
/* Nothing. */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pipe.c,v 1.3 2011/10/31 15:41:31 christos Exp $ */
/* $NetBSD: t_pipe.c,v 1.5 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2001, 2008 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_pipe.c,v 1.3 2011/10/31 15:41:31 christos Exp $");
__RCSID("$NetBSD: t_pipe.c,v 1.5 2017/01/13 21:30:41 christos Exp $");
#include <sys/types.h>
#include <sys/wait.h>
@ -45,7 +45,7 @@ __RCSID("$NetBSD: t_pipe.c,v 1.3 2011/10/31 15:41:31 christos Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
static pid_t pid;
static int nsiginfo = 0;
@ -153,9 +153,7 @@ ATF_TC_BODY(pipe_restart, tc)
ATF_REQUIRE_EQ(WEXITSTATUS(st), 0);
}
#ifdef __FreeBSD__
free(f);
#endif
}
ATF_TP_ADD_TCS(tp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $ */
/* $NetBSD: t_pipe2.c,v 1.9 2017/01/13 21:19:45 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $");
__RCSID("$NetBSD: t_pipe2.c,v 1.9 2017/01/13 21:19:45 christos Exp $");
#include <atf-c.h>
#include <fcntl.h>
@ -56,7 +56,8 @@ run(int flags)
#ifdef __FreeBSD__
closefrom(3);
#else
ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
ATF_REQUIRE_MSG(closefrom(3) != -1, "closefrom failed: %s",
strerror(errno));
#endif
ATF_REQUIRE(pipe2(fd, flags) == 0);
@ -116,13 +117,13 @@ ATF_TC_BODY(pipe2_consume, tc)
{
struct rlimit rl;
int err, filedes[2];
#ifdef __FreeBSD__
int old;
#ifdef __FreeBSD__
closefrom(4);
#else
err = fcntl(4, F_CLOSEM);
ATF_REQUIRE(err == 0);
ATF_REQUIRE_MSG(closefrom(4) != -1, "closefrom failed: %s",
strerror(errno));
#endif
err = getrlimit(RLIMIT_NOFILE, &rl);
@ -132,19 +133,15 @@ ATF_TC_BODY(pipe2_consume, tc)
* file descriptor limit in the middle of a pipe2() call - i.e.
* before the call only a single descriptor may be openend.
*/
#ifdef __FreeBSD__
old = rl.rlim_cur;
#endif
rl.rlim_cur = 4;
err = setrlimit(RLIMIT_NOFILE, &rl);
ATF_REQUIRE(err == 0);
err = pipe2(filedes, O_CLOEXEC);
ATF_REQUIRE(err == -1);
#ifdef __FreeBSD__
rl.rlim_cur = old;
err = setrlimit(RLIMIT_NOFILE, &rl);
#endif
}
ATF_TC(pipe2_nonblock);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_posix_fadvise.c,v 1.1 2011/10/15 06:10:26 jruoho Exp $ */
/* $NetBSD: t_posix_fadvise.c,v 1.2 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -58,7 +58,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_posix_fadvise.c,v 1.1 2011/10/15 06:10:26 jruoho Exp $");
__RCSID("$NetBSD: t_posix_fadvise.c,v 1.2 2017/01/13 21:30:41 christos Exp $");
#include <sys/fcntl.h>
@ -68,7 +68,7 @@ __RCSID("$NetBSD: t_posix_fadvise.c,v 1.1 2011/10/15 06:10:26 jruoho Exp $");
#include <atf-c.h>
#include "../../../h_macros.h"
#include "h_macros.h"
#include <rump/rump.h>
#include <rump/rump_syscalls.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_revoke.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
/* $NetBSD: t_revoke.c,v 1.2 2017/01/13 21:15:57 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_revoke.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
__RCSID("$NetBSD: t_revoke.c,v 1.2 2017/01/13 21:15:57 christos Exp $");
#include <sys/resource.h>
#include <sys/wait.h>
@ -176,9 +176,7 @@ ATF_TC_BODY(revoke_perm, tc)
if (WIFEXITED(sta) == 0 || WEXITSTATUS(sta) != EXIT_SUCCESS)
atf_tc_fail("revoke(2) did not obey permissions");
#ifdef __FreeBSD__
(void)close(fd);
#endif
ATF_REQUIRE(unlink(path) == 0);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_select.c,v 1.3 2012/03/18 07:00:52 jruoho Exp $ */
/* $NetBSD: t_select.c,v 1.4 2017/01/13 21:18:33 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -47,21 +47,13 @@
static sig_atomic_t keep_going = 1;
static void
#ifdef __FreeBSD__
sig_handler(int signum __unused)
#else
sig_handler(int signum)
#endif
{
keep_going = 0;
}
static void
#ifdef __FreeBSD__
sigchld(int signum __unused)
#else
sigchld(int signum)
#endif
{
}
@ -90,7 +82,7 @@ prmask(const sigset_t *m, char *buf, size_t len)
return buf;
}
static void
static __dead void
child(const struct timespec *ts)
{
struct sigaction sa;
@ -135,9 +127,7 @@ child(const struct timespec *ts)
"after timeout %s != %s",
prmask(&nset, nbuf, sizeof(nbuf)),
prmask(&oset, obuf, sizeof(obuf)));
#ifdef __FreeBSD__
_exit(0);
#endif
}
ATF_TC(pselect_sigmask);
@ -157,9 +147,7 @@ ATF_TC_BODY(pselect_sigmask, tc)
switch (pid = fork()) {
case 0:
child(NULL);
#ifdef __FreeBSD__
break;
#endif
/*NOTREACHED*/
case -1:
err(1, "fork");
default:

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_setrlimit.c,v 1.5 2016/07/13 09:53:16 njoly Exp $ */
/* $NetBSD: t_setrlimit.c,v 1.6 2017/01/13 21:16:38 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_setrlimit.c,v 1.5 2016/07/13 09:53:16 njoly Exp $");
__RCSID("$NetBSD: t_setrlimit.c,v 1.6 2017/01/13 21:16:38 christos Exp $");
#include <sys/resource.h>
#include <sys/mman.h>
@ -129,9 +129,7 @@ ATF_TC_BODY(setrlimit_basic, tc)
if (lim != 0)
atf_tc_fail("failed to set limit (%d)", lim);
#ifdef __FreeBSD__
free(buf);
#endif
}
ATF_TC(setrlimit_current);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_sigaction.c,v 1.3 2014/11/04 00:20:19 justin Exp $ */
/* $NetBSD: t_sigaction.c,v 1.5 2017/01/13 21:30:41 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2010\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_sigaction.c,v 1.3 2014/11/04 00:20:19 justin Exp $");
__RCSID("$NetBSD: t_sigaction.c,v 1.5 2017/01/13 21:30:41 christos Exp $");
#include <sys/wait.h>
@ -41,20 +41,12 @@ __RCSID("$NetBSD: t_sigaction.c,v 1.3 2014/11/04 00:20:19 justin Exp $");
#include <atf-c.h>
#ifdef __NetBSD__
#include "../../../h_macros.h"
#else
#include "h_macros.h"
#endif
static bool handler_called = false;
static void
#ifdef __FreeBSD__
handler(int signo __unused)
#else
handler(int signo)
#endif
{
handler_called = true;
}
@ -87,11 +79,7 @@ wait_and_check_child(const pid_t pid, const char *fail_message)
}
static void
#ifdef __FreeBSD__
catch(int sig __unused)
#else
catch(int sig)
#endif
{
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_sigqueue.c,v 1.6 2016/08/04 06:43:43 christos Exp $ */
/* $NetBSD: t_sigqueue.c,v 1.7 2017/01/13 20:44:10 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -30,11 +30,13 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_sigqueue.c,v 1.6 2016/08/04 06:43:43 christos Exp $");
__RCSID("$NetBSD: t_sigqueue.c,v 1.7 2017/01/13 20:44:10 christos Exp $");
#include <atf-c.h>
#include <err.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <unistd.h>
@ -50,11 +52,7 @@ static void handler(int, siginfo_t *, void *);
static int value;
static void
#ifdef __FreeBSD__
handler(int signo __unused, siginfo_t *info __unused, void *data __unused)
#else
handler(int signo, siginfo_t *info, void *data)
#endif
handler(int signo __unused, siginfo_t *info, void *data __unused)
{
value = info->si_value.sival_int;
kill(0, SIGINFO);
@ -123,12 +121,10 @@ static sig_atomic_t count = 0;
static int delivered[CNT];
static void
myhandler(int signo, siginfo_t *info, void *context)
myhandler(int signo, siginfo_t *info, void *context __unused)
{
delivered[count++] = signo;
#ifdef __FreeBSD__
printf("Signal #%zu: signo: %d\n", (size_t)count, signo);
#endif
}
static int
@ -213,12 +209,9 @@ ATF_TC_BODY(sigqueue_rt, tc)
sigset_t mask, orig;
sigemptyset(&mask);
for (size_t i = 0; i < CNT; i++)
#ifdef __FreeBSD__
if (sigaddset(&mask, signals[i]) == -1)
warn("sigaddset");
#else
sigaddset(&mask, signals[i]);
#endif
ATF_REQUIRE(sigprocmask(SIG_BLOCK, &mask, &orig) != -1);
@ -227,23 +220,17 @@ ATF_TC_BODY(sigqueue_rt, tc)
ATF_REQUIRE(sigprocmask(SIG_UNBLOCK, &mask, &orig) != -1);
sleep(1);
#ifdef __FreeBSD__
ATF_CHECK_MSG((size_t)count == ndelivered,
"count %zu != ndelivered %zu", (size_t)count, ndelivered);
#else
ATF_REQUIRE_MSG((size_t)count == ndelivered,
"count %zu != ndelivered %zu", (size_t)count, ndelivered);
#endif
for (size_t i = 0; i < ndelivered; i++)
ATF_REQUIRE_MSG(ordered[i] == delivered[i],
"%zu: ordered %d != delivered %d",
i, ordered[i], delivered[i]);
#ifdef __FreeBSD__
if (count > ndelivered)
for (size_t i = ndelivered; i < count; i++)
if ((size_t)count > ndelivered)
for (size_t i = ndelivered; i < (size_t)count; i++)
printf("Undelivered signal #%zu: %d\n", i, ordered[i]);
#endif
for (size_t i = 0; i < ndelivered; i++)
ATF_REQUIRE(sigaction(signals[i], &oact[i], NULL) != -1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_socketpair.c,v 1.1 2011/11/05 18:19:02 jruoho Exp $ */
/* $NetBSD: t_socketpair.c,v 1.2 2017/01/13 20:04:52 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_socketpair.c,v 1.1 2011/11/05 18:19:02 jruoho Exp $");
__RCSID("$NetBSD: t_socketpair.c,v 1.2 2017/01/13 20:04:52 christos Exp $");
#include <atf-c.h>
#include <fcntl.h>
@ -66,7 +66,7 @@ run(int flags)
#ifdef __FreeBSD__
closefrom(3);
#else
ATF_REQUIRE(fcntl(3, F_CLOSEM) != -1);
ATF_REQUIRE(closefrom(3) != -1);
#endif
ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_stat.c,v 1.4 2012/03/17 08:37:08 jruoho Exp $ */
/* $NetBSD: t_stat.c,v 1.5 2017/01/13 20:06:50 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,13 +29,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_stat.c,v 1.4 2012/03/17 08:37:08 jruoho Exp $");
__RCSID("$NetBSD: t_stat.c,v 1.5 2017/01/13 20:06:50 christos Exp $");
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <atf-c.h>
#include <errno.h>
@ -396,6 +397,7 @@ ATF_TC_BODY(stat_symlink, tc)
if (sa.st_mode == sb.st_mode)
atf_tc_fail("inconsistencies between stat(2) and lstat(2)");
(void)close(fd);
ATF_REQUIRE(unlink(path) == 0);
ATF_REQUIRE(unlink(pathlink) == 0);
#ifdef __FreeBSD__

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_truncate.c,v 1.2 2011/08/18 19:48:03 dholland Exp $ */
/* $NetBSD: t_truncate.c,v 1.3 2017/01/13 20:03:51 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,13 +29,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_truncate.c,v 1.2 2011/08/18 19:48:03 dholland Exp $");
__RCSID("$NetBSD: t_truncate.c,v 1.3 2017/01/13 20:03:51 christos Exp $");
#include <sys/stat.h>
#include <atf-c.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@ -153,9 +154,7 @@ ATF_TC_HEAD(truncate_err, tc)
ATF_TC_BODY(truncate_err, tc)
{
#ifndef __NetBSD__
char buf[PATH_MAX];
#endif
errno = 0;
ATF_REQUIRE_ERRNO(EFAULT, truncate((void *)-1, 999) == -1);
@ -167,13 +166,9 @@ ATF_TC_BODY(truncate_err, tc)
ATF_REQUIRE_ERRNO(ENOENT, truncate("/a/b/c/d/e/f/g", 999) == -1);
errno = 0;
#ifdef __NetBSD__
ATF_REQUIRE_ERRNO(EACCES, truncate("/usr/bin/fpr", 999) == -1);
#else
snprintf(buf, sizeof(buf), "%s/truncate_test.root_owned",
atf_tc_get_config_var(tc, "srcdir"));
ATF_REQUIRE_ERRNO(EACCES, truncate(buf, 999) == -1);
#endif
}
ATF_TP_ADD_TCS(tp)

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_umask.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $ */
/* $NetBSD: t_umask.c,v 1.2 2017/01/13 19:34:19 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_umask.c,v 1.1 2011/07/07 06:57:54 jruoho Exp $");
__RCSID("$NetBSD: t_umask.c,v 1.2 2017/01/13 19:34:19 christos Exp $");
#include <sys/stat.h>
#include <sys/wait.h>
@ -129,9 +129,7 @@ ATF_TC_BODY(umask_open, tc)
if (fd < 0)
continue;
#ifdef __FreeBSD__
(void)close(fd);
#endif
(void)memset(&st, 0, sizeof(struct stat));
if (stat(path, &st) != 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_unlink.c,v 1.2 2014/04/21 18:05:17 martin Exp $ */
/* $NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_unlink.c,v 1.2 2014/04/21 18:05:17 martin Exp $");
__RCSID("$NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $");
#include <sys/stat.h>
@ -111,15 +111,11 @@ ATF_TC_HEAD(unlink_fifo, tc)
ATF_TC_BODY(unlink_fifo, tc)
{
#ifdef __FreeBSD__
int fd;
ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0,
"mkfifo failed: %s", strerror(errno));
(void)close(fd);
#else
ATF_REQUIRE(mkfifo(path, 0666) == 0);
#endif
ATF_REQUIRE(unlink(path) == 0);
errno = 0;

Some files were not shown because too many files have changed in this diff Show More