From: Mike F. <va...@us...> - 2006-02-11 07:24:15
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/fdatasync In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3780/fdatasync Modified Files: fdatasync02.c fdatasync01.c Log Message: ugh, dos CRLFs, how i hate you so Index: fdatasync02.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fdatasync/fdatasync02.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fdatasync02.c 20 Dec 2002 17:10:38 -0000 1.1 --- fdatasync02.c 11 Feb 2006 07:24:01 -0000 1.2 *************** *** 1,227 **** ! /* ! * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of version 2 of the GNU General Public License as ! * published by the Free Software Foundation. ! * ! * This program is distributed in the hope that it would be useful, but ! * WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! * ! * You should have received a copy of the GNU General Public License along ! * with this program; if not, write the Free Software Foundation, Inc., 59 ! * Temple Place - Suite 330, Boston MA 02111-1307, USA. ! * ! */ ! /********************************************************** ! * ! * TEST IDENTIFIER : fdatasync02 ! * ! * EXECUTED BY : Any user ! * ! * TEST TITLE : Checking error conditions for fdatasync(2) ! * ! * TEST CASE TOTAL : 2 ! * ! * AUTHOR : Madhu T L <mad...@wi...> ! * ! * SIGNALS ! * Uses SIGUSR1 to pause before test if option set. ! * (See the parse_opts(3) man page). ! * ! * DESCRIPTION ! * Verify that, ! * 1. fdatasync(2) returns -1 and sets errno to EBADF for invalid ! * file descriptor. ! * 2. fdatasync(2) returns -1 and sets errno to EINVAL for file ! * descriptor to a special file. ! * ! * Setup: ! * Setup signal handling. ! * Set expected errnos for logging ! * Pause for SIGUSR1 if option specified. ! * ! * Test: ! * Loop if the proper options are given. ! * Perform testcase specific setup (if needed) ! * Execute system call ! * Check return code and error number, if matching, ! * Issue PASS message ! * Otherwise, ! * Issue FAIL message ! * Perform testcase specific cleanup (if needed) ! * ! * Cleanup: ! * Print errno log and/or timing stats if options given ! * ! * USAGE: <for command-line> ! * fdatasync02 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] ! * where, -c n : Run n copies concurrently. ! * -e : Turn on errno logging. ! * -f : Turn off functional testing ! * -h : Show help screen ! * -i n : Execute test n times. ! * -I x : Execute test for x seconds. ! * -p : Pause for SIGUSR1 before starting ! * -P x : Pause for x seconds between iterations. ! * -t : Turn on syscall timing. ! * ! ****************************************************************/ ! ! #include <errno.h> ! #include <pwd.h> ! #include <sys/types.h> ! #include <sys/stat.h> ! #include <fcntl.h> ! #include <unistd.h> ! #include "test.h" ! #include "usctest.h" ! ! extern int Tst_count; ! ! #define EXP_RET_VAL -1 ! #define SPL_FILE "/dev/null" ! ! struct test_case_t { /* test case structure */ ! int experrno; /* expected errno */ ! char *desc; ! int (*setup)(void); /* Individual setup routine */ ! void (*cleanup)(void); /* Individual cleanup routine */ ! }; ! ! char *TCID = "fdatasync02"; ! static int exp_enos[] = {EBADF, EINVAL, 0}; ! static int testno; ! static int fd; ! ! static void setup(void); ! static void cleanup(void); ! static int setup1(void); ! static int setup2(void); ! static void cleanup2(void); ! ! static struct test_case_t tdat[] = { ! { EBADF, "invalid file descriptor", setup1, NULL}, ! { EINVAL, "file descriptor to a special file", setup2, cleanup2}, ! }; ! ! int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); ! ! int ! main(int argc, char **argv) ! { ! int lc; /* loop counter */ ! char *msg; /* message returned from parse_opts */ ! ! /* parse standard options */ ! if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != ! (char *)NULL) { ! tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); ! } ! ! setup(); ! ! /* check looping state if -i option is given */ ! for (lc = 0; TEST_LOOPING(lc); lc++) { ! /* reset Tst_count in case we are looping */ ! Tst_count = 0; ! ! for (testno = 0; testno < TST_TOTAL; ++testno) { ! if( (tdat[testno].setup) && (tdat[testno].setup()) ) { ! /* setup() failed, skip this test */ ! continue; ! } ! ! /* Test the system call */ ! TEST(fdatasync(fd)); ! TEST_ERROR_LOG(TEST_ERRNO); ! if ( (TEST_RETURN == EXP_RET_VAL) && ! (TEST_ERRNO == tdat[testno].experrno) ) { ! tst_resm(TPASS, "Expected failure for %s, " ! "errno: %d", tdat[testno].desc, ! TEST_ERRNO); ! } else { ! tst_resm(TFAIL, "Unexpected results for %s ; " ! "returned %d (expected %d), errno %d " ! "(expected %d)", tdat[testno].desc, ! TEST_RETURN, EXP_RET_VAL, ! TEST_ERRNO, tdat[testno].experrno); ! } ! if(tdat[testno].cleanup) { ! tdat[testno].cleanup(); ! } ! } ! } ! cleanup(); ! ! /*NOTREACHED*/ ! return 0; ! } ! ! int ! setup1(void) ! { ! fd = -1; ! return 0; ! } ! ! int ! setup2(void) ! { ! /* Open special file */ ! if ((fd = open(SPL_FILE, O_RDONLY)) == -1) { ! tst_resm(TBROK, "Failed to open %s", SPL_FILE); ! return 1; ! } ! return 0; ! } ! ! void ! cleanup2(void) ! { ! /* close special file */ ! if (close(fd) == -1) { ! tst_brkm(TBROK, tst_exit, "Failed to close fd of %s", SPL_FILE); ! } ! } ! ! ! /* ! * setup() ! * performs all ONE TIME setup for this test ! */ ! void ! setup(void) ! { ! /* capture signals */ ! tst_sig(NOFORK, DEF_HANDLER, cleanup); ! ! /* set the expected errnos... */ ! TEST_EXP_ENOS(exp_enos); ! ! /* Pause if that option was specified ! * TEST_PAUSE contains the code to fork the test with the -c option. ! */ ! TEST_PAUSE; ! ! } ! ! /* ! * cleanup() ! * performs all ONE TIME cleanup for this test at ! * completion or premature exit ! */ ! void ! cleanup(void) ! { ! /* ! * print timing stats if that option was specified. ! * print errno log if that option was specified. ! */ ! TEST_CLEANUP; ! ! /* exit with return code appropriate for results */ ! tst_exit(); ! /*NOTREACHED*/ ! } --- 1,227 ---- ! /* ! * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of version 2 of the GNU General Public License as ! * published by the Free Software Foundation. ! * ! * This program is distributed in the hope that it would be useful, but ! * WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! * ! * You should have received a copy of the GNU General Public License along ! * with this program; if not, write the Free Software Foundation, Inc., 59 ! * Temple Place - Suite 330, Boston MA 02111-1307, USA. ! * ! */ ! /********************************************************** ! * ! * TEST IDENTIFIER : fdatasync02 ! * ! * EXECUTED BY : Any user ! * ! * TEST TITLE : Checking error conditions for fdatasync(2) ! * ! * TEST CASE TOTAL : 2 ! * ! * AUTHOR : Madhu T L <mad...@wi...> ! * ! * SIGNALS ! * Uses SIGUSR1 to pause before test if option set. ! * (See the parse_opts(3) man page). ! * ! * DESCRIPTION ! * Verify that, ! * 1. fdatasync(2) returns -1 and sets errno to EBADF for invalid ! * file descriptor. ! * 2. fdatasync(2) returns -1 and sets errno to EINVAL for file ! * descriptor to a special file. ! * ! * Setup: ! * Setup signal handling. ! * Set expected errnos for logging ! * Pause for SIGUSR1 if option specified. ! * ! * Test: ! * Loop if the proper options are given. ! * Perform testcase specific setup (if needed) ! * Execute system call ! * Check return code and error number, if matching, ! * Issue PASS message ! * Otherwise, ! * Issue FAIL message ! * Perform testcase specific cleanup (if needed) ! * ! * Cleanup: ! * Print errno log and/or timing stats if options given ! * ! * USAGE: <for command-line> ! * fdatasync02 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] ! * where, -c n : Run n copies concurrently. ! * -e : Turn on errno logging. ! * -f : Turn off functional testing ! * -h : Show help screen ! * -i n : Execute test n times. ! * -I x : Execute test for x seconds. ! * -p : Pause for SIGUSR1 before starting ! * -P x : Pause for x seconds between iterations. ! * -t : Turn on syscall timing. ! * ! ****************************************************************/ ! ! #include <errno.h> ! #include <pwd.h> ! #include <sys/types.h> ! #include <sys/stat.h> ! #include <fcntl.h> ! #include <unistd.h> ! #include "test.h" ! #include "usctest.h" ! ! extern int Tst_count; ! ! #define EXP_RET_VAL -1 ! #define SPL_FILE "/dev/null" ! ! struct test_case_t { /* test case structure */ ! int experrno; /* expected errno */ ! char *desc; ! int (*setup)(void); /* Individual setup routine */ ! void (*cleanup)(void); /* Individual cleanup routine */ ! }; ! ! char *TCID = "fdatasync02"; ! static int exp_enos[] = {EBADF, EINVAL, 0}; ! static int testno; ! static int fd; ! ! static void setup(void); ! static void cleanup(void); ! static int setup1(void); ! static int setup2(void); ! static void cleanup2(void); ! ! static struct test_case_t tdat[] = { ! { EBADF, "invalid file descriptor", setup1, NULL}, ! { EINVAL, "file descriptor to a special file", setup2, cleanup2}, ! }; ! ! int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); ! ! int ! main(int argc, char **argv) ! { ! int lc; /* loop counter */ ! char *msg; /* message returned from parse_opts */ ! ! /* parse standard options */ ! if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != ! (char *)NULL) { ! tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); ! } ! ! setup(); ! ! /* check looping state if -i option is given */ ! for (lc = 0; TEST_LOOPING(lc); lc++) { ! /* reset Tst_count in case we are looping */ ! Tst_count = 0; ! ! for (testno = 0; testno < TST_TOTAL; ++testno) { ! if( (tdat[testno].setup) && (tdat[testno].setup()) ) { ! /* setup() failed, skip this test */ ! continue; ! } ! ! /* Test the system call */ ! TEST(fdatasync(fd)); ! TEST_ERROR_LOG(TEST_ERRNO); ! if ( (TEST_RETURN == EXP_RET_VAL) && ! (TEST_ERRNO == tdat[testno].experrno) ) { ! tst_resm(TPASS, "Expected failure for %s, " ! "errno: %d", tdat[testno].desc, ! TEST_ERRNO); ! } else { ! tst_resm(TFAIL, "Unexpected results for %s ; " ! "returned %d (expected %d), errno %d " ! "(expected %d)", tdat[testno].desc, ! TEST_RETURN, EXP_RET_VAL, ! TEST_ERRNO, tdat[testno].experrno); ! } ! if(tdat[testno].cleanup) { ! tdat[testno].cleanup(); ! } ! } ! } ! cleanup(); ! ! /*NOTREACHED*/ ! return 0; ! } ! ! int ! setup1(void) ! { ! fd = -1; ! return 0; ! } ! ! int ! setup2(void) ! { ! /* Open special file */ ! if ((fd = open(SPL_FILE, O_RDONLY)) == -1) { ! tst_resm(TBROK, "Failed to open %s", SPL_FILE); ! return 1; ! } ! return 0; ! } ! ! void ! cleanup2(void) ! { ! /* close special file */ ! if (close(fd) == -1) { ! tst_brkm(TBROK, tst_exit, "Failed to close fd of %s", SPL_FILE); ! } ! } ! ! ! /* ! * setup() ! * performs all ONE TIME setup for this test ! */ ! void ! setup(void) ! { ! /* capture signals */ ! tst_sig(NOFORK, DEF_HANDLER, cleanup); ! ! /* set the expected errnos... */ ! TEST_EXP_ENOS(exp_enos); ! ! /* Pause if that option was specified ! * TEST_PAUSE contains the code to fork the test with the -c option. ! */ ! TEST_PAUSE; ! ! } ! ! /* ! * cleanup() ! * performs all ONE TIME cleanup for this test at ! * completion or premature exit ! */ ! void ! cleanup(void) ! { ! /* ! * print timing stats if that option was specified. ! * print errno log if that option was specified. ! */ ! TEST_CLEANUP; ! ! /* exit with return code appropriate for results */ ! tst_exit(); ! /*NOTREACHED*/ ! } Index: fdatasync01.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fdatasync/fdatasync01.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fdatasync01.c 25 Aug 2004 15:27:36 -0000 1.2 --- fdatasync01.c 11 Feb 2006 07:24:01 -0000 1.3 *************** *** 1,180 **** ! /* ! * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of version 2 of the GNU General Public License as ! * published by the Free Software Foundation. ! * ! * This program is distributed in the hope that it would be useful, but ! * WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! * ! * You should have received a copy of the GNU General Public License along ! * with this program; if not, write the Free Software Foundation, Inc., 59 ! * Temple Place - Suite 330, Boston MA 02111-1307, USA. ! * ! */ ! /********************************************************** ! * ! * TEST IDENTIFIER : fdatasync01 ! * ! * EXECUTED BY : Any user ! * ! * TEST TITLE : Basic test for fdatasync(2) ! * ! * TEST CASE TOTAL : 1 ! * ! * AUTHOR : Madhu T L <mad...@wi...> ! * ! * SIGNALS ! * Uses SIGUSR1 to pause before test if option set. ! * (See the parse_opts(3) man page). ! * ! * DESCRIPTION ! * This is a Phase I test for the fdatasync(2) system call. ! * It is intended to provide a limited exposure of the system call. ! * ! * Setup: ! * Setup signal handling. ! * Pause for SIGUSR1 if option specified. ! * Create a temp directory and cd to it ! * Initialize filename and open it in write mode for each child process. ! * ! * Test: ! * Loop if the proper options are given. ! * Execute system call ! * Check return code, if system call failed (return=-1) ! * Issue FAIL message with errno. ! * Otherwise, Issue PASS message. ! * ! * Cleanup: ! * Print errno log and/or timing stats if options given ! * Remove temporary directory and all files in it. ! * ! * USAGE: <for command-line> ! * fdatasync01 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] ! * where, -c n : Run n copies concurrently. ! * -e : Turn on errno logging. ! * -f : Turn off functional testing ! * -h : Show help screen ! * -i n : Execute test n times. ! * -I x : Execute test for x seconds. ! * -p : Pause for SIGUSR1 before starting ! * -P x : Pause for x seconds between iterations. ! * -t : Turn on syscall timing. ! * ! ****************************************************************/ ! #include <errno.h> ! #include <sys/types.h> ! #include <sys/stat.h> ! #include <fcntl.h> ! #include <unistd.h> ! #include "test.h" ! #include "usctest.h" ! ! extern int Tst_count; /* Test Case counter for tst_* routines */ ! ! static int fd; ! static char filename[30]; ! static void setup(void); ! static void cleanup(void); ! ! char *TCID = "fdatasync01"; /* Test program identifier. */ ! int TST_TOTAL = 1; /* Total number of test cases. */ ! ! int ! main(int argc, char **argv) ! { ! int lc; /* loop counter */ ! char *msg; /* message returned from parse_opts */ ! ! /* parse standard options */ ! if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != ! (char *)NULL) { ! tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); ! } ! ! /* perform global setup for test */ ! setup(); ! ! /* check looping state if -i option is given */ ! for (lc = 0; TEST_LOOPING(lc); lc++) { ! ! /* reset Tst_count in case we are looping */ ! Tst_count = 0; ! ! /* Test the system call */ ! TEST(fdatasync(fd)); ! ! /* check return code */ ! if (TEST_RETURN == -1) { ! tst_resm(TFAIL, "fdatasync() failed, errno=%d : %s", ! TEST_ERRNO, strerror(TEST_ERRNO)); ! } else { ! /* No Functional verification yet */ ! tst_resm(TPASS, "fdatasync() successful"); ! } ! } ! ! /* perform global cleanup and exit */ ! cleanup(); ! ! /*NOTREACHED*/ ! return 0; ! ! } /* End main */ ! ! /* setup() - performs all ONE TIME setup for this test */ ! void ! setup(void) ! { ! /* capture signals */ ! tst_sig(NOFORK, DEF_HANDLER, cleanup); ! ! /* Pause if that option was specified ! * TEST_PAUSE contains the code to fork the test with the -c option. ! */ ! TEST_PAUSE; ! ! /* make a temp directory and cd to it */ ! tst_tmpdir(); ! ! /* Initialize unique filename for each child process */ ! if( sprintf(filename, "fdatasync_%d", getpid()) <= 0) { ! tst_brkm(TBROK, tst_exit, "Failed to initialize filename"); ! /*NOTREACHED*/ ! } ! if((fd = open(filename, O_CREAT|O_WRONLY)) == -1) { ! tst_brkm(TBROK, tst_exit, "open() failed"); ! /*NOTREACHED*/ ! } ! if((write(fd, filename, strlen(filename) + 1)) == -1) { ! tst_brkm(TBROK, tst_exit, "write() failed"); ! /*NOTREACHED*/ ! } ! } ! ! /* ! * cleanup() ! * performs all ONE TIME cleanup for this test at ! * completion or premature exit ! */ ! void ! cleanup(void) ! { ! /* ! * print timing stats if that option was specified. ! * print errno log if that option was specified. ! */ ! close(fd); ! ! TEST_CLEANUP; ! ! /* Remove tmp dir and all files in it */ ! tst_rmdir(); ! ! /* exit with return code appropriate for results */ ! tst_exit(); ! /*NOTREACHED*/ ! } ! --- 1,180 ---- ! /* ! * Copyright (c) Wipro Technologies Ltd, 2002. All Rights Reserved. ! * ! * This program is free software; you can redistribute it and/or modify it ! * under the terms of version 2 of the GNU General Public License as ! * published by the Free Software Foundation. ! * ! * This program is distributed in the hope that it would be useful, but ! * WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! * ! * You should have received a copy of the GNU General Public License along ! * with this program; if not, write the Free Software Foundation, Inc., 59 ! * Temple Place - Suite 330, Boston MA 02111-1307, USA. ! * ! */ ! /********************************************************** ! * ! * TEST IDENTIFIER : fdatasync01 ! * ! * EXECUTED BY : Any user ! * ! * TEST TITLE : Basic test for fdatasync(2) ! * ! * TEST CASE TOTAL : 1 ! * ! * AUTHOR : Madhu T L <mad...@wi...> ! * ! * SIGNALS ! * Uses SIGUSR1 to pause before test if option set. ! * (See the parse_opts(3) man page). ! * ! * DESCRIPTION ! * This is a Phase I test for the fdatasync(2) system call. ! * It is intended to provide a limited exposure of the system call. ! * ! * Setup: ! * Setup signal handling. ! * Pause for SIGUSR1 if option specified. ! * Create a temp directory and cd to it ! * Initialize filename and open it in write mode for each child process. ! * ! * Test: ! * Loop if the proper options are given. ! * Execute system call ! * Check return code, if system call failed (return=-1) ! * Issue FAIL message with errno. ! * Otherwise, Issue PASS message. ! * ! * Cleanup: ! * Print errno log and/or timing stats if options given ! * Remove temporary directory and all files in it. ! * ! * USAGE: <for command-line> ! * fdatasync01 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t] ! * where, -c n : Run n copies concurrently. ! * -e : Turn on errno logging. ! * -f : Turn off functional testing ! * -h : Show help screen ! * -i n : Execute test n times. ! * -I x : Execute test for x seconds. ! * -p : Pause for SIGUSR1 before starting ! * -P x : Pause for x seconds between iterations. ! * -t : Turn on syscall timing. ! * ! ****************************************************************/ ! #include <errno.h> ! #include <sys/types.h> ! #include <sys/stat.h> ! #include <fcntl.h> ! #include <unistd.h> ! #include "test.h" ! #include "usctest.h" ! ! extern int Tst_count; /* Test Case counter for tst_* routines */ ! ! static int fd; ! static char filename[30]; ! static void setup(void); ! static void cleanup(void); ! ! char *TCID = "fdatasync01"; /* Test program identifier. */ ! int TST_TOTAL = 1; /* Total number of test cases. */ ! ! int ! main(int argc, char **argv) ! { ! int lc; /* loop counter */ ! char *msg; /* message returned from parse_opts */ ! ! /* parse standard options */ ! if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) != ! (char *)NULL) { ! tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); ! } ! ! /* perform global setup for test */ ! setup(); ! ! /* check looping state if -i option is given */ ! for (lc = 0; TEST_LOOPING(lc); lc++) { ! ! /* reset Tst_count in case we are looping */ ! Tst_count = 0; ! ! /* Test the system call */ ! TEST(fdatasync(fd)); ! ! /* check return code */ ! if (TEST_RETURN == -1) { ! tst_resm(TFAIL, "fdatasync() failed, errno=%d : %s", ! TEST_ERRNO, strerror(TEST_ERRNO)); ! } else { ! /* No Functional verification yet */ ! tst_resm(TPASS, "fdatasync() successful"); ! } ! } ! ! /* perform global cleanup and exit */ ! cleanup(); ! ! /*NOTREACHED*/ ! return 0; ! ! } /* End main */ ! ! /* setup() - performs all ONE TIME setup for this test */ ! void ! setup(void) ! { ! /* capture signals */ ! tst_sig(NOFORK, DEF_HANDLER, cleanup); ! ! /* Pause if that option was specified ! * TEST_PAUSE contains the code to fork the test with the -c option. ! */ ! TEST_PAUSE; ! ! /* make a temp directory and cd to it */ ! tst_tmpdir(); ! ! /* Initialize unique filename for each child process */ ! if( sprintf(filename, "fdatasync_%d", getpid()) <= 0) { ! tst_brkm(TBROK, tst_exit, "Failed to initialize filename"); ! /*NOTREACHED*/ ! } ! if((fd = open(filename, O_CREAT|O_WRONLY)) == -1) { ! tst_brkm(TBROK, tst_exit, "open() failed"); ! /*NOTREACHED*/ ! } ! if((write(fd, filename, strlen(filename) + 1)) == -1) { ! tst_brkm(TBROK, tst_exit, "write() failed"); ! /*NOTREACHED*/ ! } ! } ! ! /* ! * cleanup() ! * performs all ONE TIME cleanup for this test at ! * completion or premature exit ! */ ! void ! cleanup(void) ! { ! /* ! * print timing stats if that option was specified. ! * print errno log if that option was specified. ! */ ! close(fd); ! ! TEST_CLEANUP; ! ! /* Remove tmp dir and all files in it */ ! tst_rmdir(); ! ! /* exit with return code appropriate for results */ ! tst_exit(); ! /*NOTREACHED*/ ! } ! |