OSDN Git Service

Perform more C warning fixup on all C source files and headers.
authorcgf <cgf>
Fri, 24 Jan 2003 01:09:38 +0000 (01:09 +0000)
committercgf <cgf>
Fri, 24 Jan 2003 01:09:38 +0000 (01:09 +0000)
203 files changed:
winsup/testsuite/ChangeLog
winsup/testsuite/Makefile.in
winsup/testsuite/libltp/include/search_path.h
winsup/testsuite/libltp/include/test.h
winsup/testsuite/libltp/include/usctest.h
winsup/testsuite/libltp/lib/libtestsuite.c
winsup/testsuite/libltp/lib/parse_opts.c
winsup/testsuite/libltp/lib/search_path.c
winsup/testsuite/libltp/lib/tst_res.c
winsup/testsuite/libltp/lib/tst_tmpdir.c
winsup/testsuite/winsup.api/checksignal.c
winsup/testsuite/winsup.api/ltp/access01.c
winsup/testsuite/winsup.api/ltp/access03.c
winsup/testsuite/winsup.api/ltp/access04.c
winsup/testsuite/winsup.api/ltp/access05.c
winsup/testsuite/winsup.api/ltp/alarm01.c
winsup/testsuite/winsup.api/ltp/alarm02.c
winsup/testsuite/winsup.api/ltp/alarm03.c
winsup/testsuite/winsup.api/ltp/alarm07.c
winsup/testsuite/winsup.api/ltp/asyncio02.c
winsup/testsuite/winsup.api/ltp/chdir02.c
winsup/testsuite/winsup.api/ltp/chdir04.c
winsup/testsuite/winsup.api/ltp/chmod01.c
winsup/testsuite/winsup.api/ltp/chmod02.c
winsup/testsuite/winsup.api/ltp/chown01.c
winsup/testsuite/winsup.api/ltp/close01.c
winsup/testsuite/winsup.api/ltp/close02.c
winsup/testsuite/winsup.api/ltp/close08.c
winsup/testsuite/winsup.api/ltp/creat01.c
winsup/testsuite/winsup.api/ltp/creat03.c
winsup/testsuite/winsup.api/ltp/creat09.c
winsup/testsuite/winsup.api/ltp/dup01.c
winsup/testsuite/winsup.api/ltp/dup02.c
winsup/testsuite/winsup.api/ltp/dup03.c
winsup/testsuite/winsup.api/ltp/dup04.c
winsup/testsuite/winsup.api/ltp/dup05.c
winsup/testsuite/winsup.api/ltp/execl01.c
winsup/testsuite/winsup.api/ltp/execle01.c
winsup/testsuite/winsup.api/ltp/execlp01.c
winsup/testsuite/winsup.api/ltp/execv01.c
winsup/testsuite/winsup.api/ltp/execve01.c
winsup/testsuite/winsup.api/ltp/execvp01.c
winsup/testsuite/winsup.api/ltp/exit01.c
winsup/testsuite/winsup.api/ltp/exit02.c
winsup/testsuite/winsup.api/ltp/fchdir01.c
winsup/testsuite/winsup.api/ltp/fchdir02.c
winsup/testsuite/winsup.api/ltp/fchmod01.c
winsup/testsuite/winsup.api/ltp/fchown01.c
winsup/testsuite/winsup.api/ltp/fcntl02.c
winsup/testsuite/winsup.api/ltp/fcntl03.c
winsup/testsuite/winsup.api/ltp/fcntl04.c
winsup/testsuite/winsup.api/ltp/fcntl05.c
winsup/testsuite/winsup.api/ltp/fcntl07.c
winsup/testsuite/winsup.api/ltp/fcntl07B.c
winsup/testsuite/winsup.api/ltp/fcntl08.c
winsup/testsuite/winsup.api/ltp/fcntl09.c
winsup/testsuite/winsup.api/ltp/fcntl10.c
winsup/testsuite/winsup.api/ltp/fork01.c
winsup/testsuite/winsup.api/ltp/fork02.c
winsup/testsuite/winsup.api/ltp/fork03.c
winsup/testsuite/winsup.api/ltp/fork04.c
winsup/testsuite/winsup.api/ltp/fork06.c
winsup/testsuite/winsup.api/ltp/fork07.c
winsup/testsuite/winsup.api/ltp/fork09.c
winsup/testsuite/winsup.api/ltp/fork10.c
winsup/testsuite/winsup.api/ltp/fork11.c
winsup/testsuite/winsup.api/ltp/fpathconf01.c
winsup/testsuite/winsup.api/ltp/fstat01.c
winsup/testsuite/winsup.api/ltp/fstat02.c
winsup/testsuite/winsup.api/ltp/fstat03.c
winsup/testsuite/winsup.api/ltp/fstat04.c
winsup/testsuite/winsup.api/ltp/fsync01.c
winsup/testsuite/winsup.api/ltp/ftruncate01.c
winsup/testsuite/winsup.api/ltp/ftruncate02.c
winsup/testsuite/winsup.api/ltp/ftruncate03.c
winsup/testsuite/winsup.api/ltp/getegid01.c
winsup/testsuite/winsup.api/ltp/geteuid01.c
winsup/testsuite/winsup.api/ltp/getgid01.c
winsup/testsuite/winsup.api/ltp/getgid02.c
winsup/testsuite/winsup.api/ltp/getgid03.c
winsup/testsuite/winsup.api/ltp/getgroups01.c
winsup/testsuite/winsup.api/ltp/getgroups02.c
winsup/testsuite/winsup.api/ltp/gethostid01.c
winsup/testsuite/winsup.api/ltp/gethostname01.c
winsup/testsuite/winsup.api/ltp/getpgid01.c
winsup/testsuite/winsup.api/ltp/getpgid02.c
winsup/testsuite/winsup.api/ltp/getpgrp01.c
winsup/testsuite/winsup.api/ltp/getpid01.c
winsup/testsuite/winsup.api/ltp/getpid02.c
winsup/testsuite/winsup.api/ltp/getppid01.c
winsup/testsuite/winsup.api/ltp/getppid02.c
winsup/testsuite/winsup.api/ltp/getuid01.c
winsup/testsuite/winsup.api/ltp/getuid02.c
winsup/testsuite/winsup.api/ltp/getuid03.c
winsup/testsuite/winsup.api/ltp/kill01.c
winsup/testsuite/winsup.api/ltp/kill02.c
winsup/testsuite/winsup.api/ltp/kill03.c
winsup/testsuite/winsup.api/ltp/kill04.c
winsup/testsuite/winsup.api/ltp/kill09.c
winsup/testsuite/winsup.api/ltp/link02.c
winsup/testsuite/winsup.api/ltp/link03.c
winsup/testsuite/winsup.api/ltp/link04.c
winsup/testsuite/winsup.api/ltp/link05.c
winsup/testsuite/winsup.api/ltp/lseek01.c
winsup/testsuite/winsup.api/ltp/lseek02.c
winsup/testsuite/winsup.api/ltp/lseek03.c
winsup/testsuite/winsup.api/ltp/lseek04.c
winsup/testsuite/winsup.api/ltp/lseek05.c
winsup/testsuite/winsup.api/ltp/lseek06.c
winsup/testsuite/winsup.api/ltp/lseek07.c
winsup/testsuite/winsup.api/ltp/lseek08.c
winsup/testsuite/winsup.api/ltp/lseek09.c
winsup/testsuite/winsup.api/ltp/lseek10.c
winsup/testsuite/winsup.api/ltp/lstat02.c
winsup/testsuite/winsup.api/ltp/mkdir01.c
winsup/testsuite/winsup.api/ltp/mkdir08.c
winsup/testsuite/winsup.api/ltp/mknod01.c
winsup/testsuite/winsup.api/ltp/mmap001.c
winsup/testsuite/winsup.api/ltp/mmap02.c
winsup/testsuite/winsup.api/ltp/mmap03.c
winsup/testsuite/winsup.api/ltp/mmap04.c
winsup/testsuite/winsup.api/ltp/mmap05.c
winsup/testsuite/winsup.api/ltp/mmap06.c
winsup/testsuite/winsup.api/ltp/mmap07.c
winsup/testsuite/winsup.api/ltp/mmap08.c
winsup/testsuite/winsup.api/ltp/munmap01.c
winsup/testsuite/winsup.api/ltp/munmap02.c
winsup/testsuite/winsup.api/ltp/nice05.c
winsup/testsuite/winsup.api/ltp/open02.c
winsup/testsuite/winsup.api/ltp/open03.c
winsup/testsuite/winsup.api/ltp/pathconf01.c
winsup/testsuite/winsup.api/ltp/pause01.c
winsup/testsuite/winsup.api/ltp/pipe01.c
winsup/testsuite/winsup.api/ltp/pipe08.c
winsup/testsuite/winsup.api/ltp/pipe09.c
winsup/testsuite/winsup.api/ltp/pipe10.c
winsup/testsuite/winsup.api/ltp/pipe11.c
winsup/testsuite/winsup.api/ltp/poll01.c
winsup/testsuite/winsup.api/ltp/read01.c
winsup/testsuite/winsup.api/ltp/read04.c
winsup/testsuite/winsup.api/ltp/readdir01.c
winsup/testsuite/winsup.api/ltp/readlink01.c
winsup/testsuite/winsup.api/ltp/readlink02.c
winsup/testsuite/winsup.api/ltp/readlink03.c
winsup/testsuite/winsup.api/ltp/rename01.c
winsup/testsuite/winsup.api/ltp/rename02.c
winsup/testsuite/winsup.api/ltp/rename08.c
winsup/testsuite/winsup.api/ltp/rename10.c
winsup/testsuite/winsup.api/ltp/rmdir01.c
winsup/testsuite/winsup.api/ltp/rmdir04.c
winsup/testsuite/winsup.api/ltp/rmdir05.c
winsup/testsuite/winsup.api/ltp/sbrk01.c
winsup/testsuite/winsup.api/ltp/select01.c
winsup/testsuite/winsup.api/ltp/select02.c
winsup/testsuite/winsup.api/ltp/select03.c
winsup/testsuite/winsup.api/ltp/setgid01.c
winsup/testsuite/winsup.api/ltp/setgroups01.c
winsup/testsuite/winsup.api/ltp/setpgid01.c
winsup/testsuite/winsup.api/ltp/setregid01.c
winsup/testsuite/winsup.api/ltp/setreuid01.c
winsup/testsuite/winsup.api/ltp/setuid01.c
winsup/testsuite/winsup.api/ltp/setuid02.c
winsup/testsuite/winsup.api/ltp/signal03.c
winsup/testsuite/winsup.api/ltp/stat01.c
winsup/testsuite/winsup.api/ltp/stat02.c
winsup/testsuite/winsup.api/ltp/stat03.c
winsup/testsuite/winsup.api/ltp/stat05.c
winsup/testsuite/winsup.api/ltp/stat06.c
winsup/testsuite/winsup.api/ltp/symlink01.c
winsup/testsuite/winsup.api/ltp/symlink02.c
winsup/testsuite/winsup.api/ltp/symlink03.c
winsup/testsuite/winsup.api/ltp/symlink04.c
winsup/testsuite/winsup.api/ltp/symlink05.c
winsup/testsuite/winsup.api/ltp/sync01.c
winsup/testsuite/winsup.api/ltp/sync02.c
winsup/testsuite/winsup.api/ltp/time01.c
winsup/testsuite/winsup.api/ltp/time02.c
winsup/testsuite/winsup.api/ltp/times01.c
winsup/testsuite/winsup.api/ltp/times02.c
winsup/testsuite/winsup.api/ltp/times03.c
winsup/testsuite/winsup.api/ltp/truncate01.c
winsup/testsuite/winsup.api/ltp/truncate02.c
winsup/testsuite/winsup.api/ltp/ulimit01.c
winsup/testsuite/winsup.api/ltp/umask01.c
winsup/testsuite/winsup.api/ltp/umask02.c
winsup/testsuite/winsup.api/ltp/umask03.c
winsup/testsuite/winsup.api/ltp/uname01.c
winsup/testsuite/winsup.api/ltp/unlink05.c
winsup/testsuite/winsup.api/ltp/unlink06.c
winsup/testsuite/winsup.api/ltp/unlink07.c
winsup/testsuite/winsup.api/ltp/unlink08.c
winsup/testsuite/winsup.api/ltp/vfork01.c
winsup/testsuite/winsup.api/ltp/wait02.c
winsup/testsuite/winsup.api/ltp/wait401.c
winsup/testsuite/winsup.api/ltp/wait402.c
winsup/testsuite/winsup.api/ltp/write01.c
winsup/testsuite/winsup.api/ltp/write02.c
winsup/testsuite/winsup.api/ltp/write03.c
winsup/testsuite/winsup.api/mmaptest01.c
winsup/testsuite/winsup.api/pthread/cancel9.c
winsup/testsuite/winsup.api/pthread/test.h
winsup/testsuite/winsup.api/samples/sample-fail.c
winsup/testsuite/winsup.api/samples/sample-pass.c

index cd3b62c..9760267 100644 (file)
@@ -1,5 +1,9 @@
 2003-01-23  Christopher Faylor  <cgf@redhat.com>
 
+       Perform more C warning fixup on all C source files and headers.
+
+2003-01-23  Christopher Faylor  <cgf@redhat.com>
+
        * libltp/include/test.h: Fix C warnings.
        * winsup.api/checksignal.c: Ditto.
        * winsup.api/crlf.c: Ditto.
index a55978a..b3ca3e8 100644 (file)
@@ -50,7 +50,6 @@ INSTALL_PROGRAM:=@INSTALL_PROGRAM@
 CC:=@CC@
 # FIXME: Which is it, CC or CC_FOR_TARGET?
 CC_FOR_TARGET:=$(CC)
-#CFLAGS:=@CFLAGS@ -MD -Wno-write-strings $(TESTSUP_INCLUDES)
 ifneq (,$(CFLAGS))
   override CFLAGS+= -MD $(TESTSUP_INCLUDES)
 else
index 131311b..58b7a36 100644 (file)
@@ -33,4 +33,4 @@
 /* $Id$ */
 
 
-int search_path(char *cmd, char *res_path, int access_mode, int fullpath);
+int search_path(const char *cmd, const char *res_path, int access_mode, int fullpath);
index c4978dc..9bad911 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  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.
 #ifndef __TEST_H__
 #define __TEST_H__
 
+#define execve execve_foo
+#define execv execv_foo
+#define execvp execvp_foo
 #include <stdio.h>
 #include <signal.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#undef execvp
+#undef execv
+#undef execve
+
+int execve(const char *, const char * const [], char * const *);
+int execv(const char *, const char * const []);
+int execvp(const char *, const char * const []);
+
+/* CGF: Avoid compilation warnings for undefined functions */
+extern int setregid (gid_t, gid_t);
+int setreuid (uid_t, uid_t);
+int gethostid (void);
 
 #define TPASS    0    /* Test passed flag */
 #define TFAIL    1    /* Test failed flag */
@@ -190,7 +207,7 @@ extern void tst_clear_error();
  * The following prototypes are needed to remove compile errors
  * on IRIX systems when compiled with -n32 and -64.
  */
-extern void tst_res(int ttype, char *fname, const char *arg_fmt, ...);
+extern void tst_res(int ttype, const char *fname, const char *arg_fmt, ...);
 extern void tst_resm(int ttype, const char *arg_fmt, ...);
 extern void tst_brk(int ttype, char *fname, void (*func)(), 
                                                        const char *arg_fmt, ...);
index 232e67a..ef2d032 100644 (file)
  * to indicate valid options and return option arguments
  ***********************************************************************/
 typedef struct {               
-  char *option;        /* Valid option string (one option only) like "a:" */
+  const char *option;  /* Valid option string (one option only) like "a:" */
   int  *flag;          /* pointer to location to set true if option given */
   char **arg;          /* pointer to location to place argument, if needed */
 } option_t;
index e974c87..e741d25 100644 (file)
  *     my_getpwnam(), do_file_setup()
  *
  */
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
 #include <pwd.h>
 #include <errno.h>
 #include <fcntl.h>
index c401813..e4da236 100644 (file)
  * 
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 #include <errno.h>
-#include <stdlib.h>
 #include <string.h>
 #include <sys/param.h>
 #include <sys/signal.h>
 #include <sys/types.h>
-#include <unistd.h>
 #include <sys/time.h>
 
 #ifdef __CYGWIN__
index 6663da5..775c7b1 100644 (file)
@@ -101,7 +101,7 @@ char **argv;
  */
 int
 search_path(cmd, res_path, access_mode, fullpath)
-char *cmd;     /* The requested filename */
+const char *cmd;       /* The requested filename */
 char *res_path; /* The resulting path or error mesg */
 int access_mode; /* the mode used by access(2) */
 int fullpath;  /* if set, cwd will be prepended to all non-full paths */
index 7f0a003..99767ec 100644 (file)
  *
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 #include <errno.h>
-#include <string.h>
-#include <stdio.h>         /* for I/O functions, BUFSIZ */
-#include <stdlib.h>        /* for getenv() */
 #include <stdarg.h>        /* for varargs stuff */
-#include <unistd.h>        /* for access() */
 #include "test.h"          /* for output display mode & result type */
                            /* defines */
 
 static void check_env();
 static void tst_condense(int tnum, int ttype, char *tmesg);
 static void tst_print(char *tcid, int tnum, int trange, int ttype, const char *tmesg);
-static void cat_file(char *filename);
+static void cat_file(const char *filename);
 
 
 /*
  * Define some static/global variables.
  */
 static FILE *T_out = NULL;    /* tst_res() output file descriptor */
-static char *File;            /* file whose contents is part of result */
+static const char *File;      /* file whose contents is part of result */
 static int  T_exitval = 0;    /* exit value used by tst_exit() */
 static int  T_mode = VERBOSE; /* flag indicating print mode: VERBOSE, */
                               /* CONDENSE, NOPASS, DISCARD */
@@ -216,7 +212,7 @@ char *TESTDIR = NULL;
  *             eventually get here to print the results.
  */
 void
-tst_res(int ttype, char *fname, const char *arg_fmt, ...)
+tst_res(int ttype, const char *fname, const char *arg_fmt, ...)
 {
    int  i;
    char tmesg[USERMESG];     /* expanded message */
@@ -329,7 +325,7 @@ tst_res(int ttype, char *fname, const char *arg_fmt, ...)
 static void
 tst_condense(int tnum, int ttype, char *tmesg)
 {
-   char *file;
+   const char *file;
 
 #if DEBUG
    printf("IN tst_condense: tcid = %s, tnum = %d, ttype = %d, tmesg = %s\n",
@@ -802,7 +798,7 @@ tst_brkloopm(int ttype, void (*func)(), const char *arg_fmt, ...)
  * cat_file() - Print the contents of a file to standard out.
  */
 static void
-cat_file(char *filename)
+cat_file(const char *filename)
 {
    FILE *fp;                  /* file pointer */
    int  b_read;               /* number of bytes read with read() */
index ef1e2cd..cd9d9c8 100644 (file)
  *      Neither tst_tmpdir() or tst_rmdir() has a return value.
  *
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <stdio.h>
 #include <errno.h>
-#include <stdlib.h>        /* for getenv() */
-#include <string.h>        /* for string functions */
-#include <unistd.h>        /* for sysconf(), getcwd(), rmdir() */
 #include <sys/types.h>     /* for mkdir() */
 #include <sys/stat.h>      /* for mkdir() */
 #include "test.h"
index 0481d83..edf720c 100644 (file)
@@ -1,7 +1,4 @@
-#include <stdio.h>
 #include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
 #include <signal.h>
 
 #include "test.h"
index e003805..ae9be94 100644 (file)
  * 
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <string.h>
-#include <sys/unistd.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <errno.h>
 #include "test.h"
 #include "usctest.h"
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="access01";         /* Test program identifier.    */
+const char *TCID="access01";   /* Test program identifier.    */
 int TST_TOTAL=4;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index dc7dc5e..f0870a6 100644 (file)
 #include <signal.h>
 
  
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 char *get_high_address();
 
-char *TCID="access03";         /* Test program identifier.    */
+const char *TCID="access03";           /* Test program identifier.    */
 int TST_TOTAL=8;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 20fa811..0694588 100644 (file)
@@ -66,8 +66,6 @@
  *
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <fcntl.h>
 #define DIR_MODE       S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP
 #define FILE_MODE      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-char *TCID="access01";         /* Test program identifier.    */
+const char *TCID="access01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 935b19b..757c64f 100644 (file)
@@ -76,9 +76,7 @@
  * 
  */
 
-#include <stdio.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -107,9 +105,9 @@ char Longpathname[PATH_MAX+2];
 char High_address_node[64];
 
 struct test_case_t {           /* test case structure */
-       char *pathname;
+       const char *pathname;
        int a_mode;
-       char *desc;
+       const char *desc;
        int exp_errno;
        int (*setupfunc)();
 } Test_cases[] = {
@@ -124,21 +122,22 @@ struct test_case_t {              /* test case structure */
        { NULL, 0, NULL, 0, no_setup }
 };
 
-char *TCID="access03";         /* Test program identifier.    */
+const char *TCID="access03";           /* Test program identifier.    */
 int TST_TOTAL=8;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={EACCES, EFAULT, EINVAL, ENOENT, ENAMETOOLONG, 0};
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
+char *get_high_address (void);
 
 int
 main(int ac, char **av)
 {
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
-       char *file_name;        /* name of the testfile */
-       char *test_desc;        /* test specific message */
+       const char *file_name;  /* name of the testfile */
+       const char *test_desc;  /* test specific message */
        int access_mode;        /* specified access mode for testfile */
        int ind;                /* counter for testcase looping */
 
index ac754e3..187e488 100644 (file)
@@ -120,7 +120,7 @@ extern void cleanup();
 
 
 
-char *TCID="alarm01";          /* Test program identifier.    */
+const char *TCID="alarm01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 7c608da..03a41b4 100644 (file)
 #include "usctest.h"             /* required for usctest   */
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void alarm_received();
 
 
 
-char *TCID="alarm02";          /* Test program identifier.    */
+const char *TCID="alarm02";          /* Test program identifier.    */
 int TST_TOTAL=3;                /* Total number of test cases. */
 extern int Tst_count;      /* Test Case counter for tst_ * routines */
 
@@ -122,7 +122,7 @@ main(int ac, char **av)
     const char *msg;          /* message returned from parse_opts */
 
     /* Parameters for alarm test */
-    char *buf[] = { "-1", "ULONG_MAX", "ULONG_MAX+1"};
+    const char *buf[] = { "-1", "ULONG_MAX", "ULONG_MAX+1"};
     unsigned long int sec[] = {-1, ULONG_MAX, ULONG_MAX+1};
     int exp[]                   = {0,0,0};
     int i;   
index 2753013..871f6fa 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
-char *TCID="alarm03";          /* Test program identifier.    */
+const char *TCID="alarm03";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 7661ba9..a9f2695 100644 (file)
@@ -62,8 +62,6 @@
  *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <string.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID="alarm03";          /* Test program identifier.    */
+const char *TCID="alarm03";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int almreceived = 0;           /* flag to indicate SIGALRM received or not */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 void sigproc(int sig);         /* signal catching function */
 
 int
index b7ccb62..36c03b4 100644 (file)
@@ -95,7 +95,6 @@
 #include <sys/stat.h>
 #include <sys/signal.h>
 #include <errno.h>
-#include <stdlib.h>
 #include "test.h"
 #include "usctest.h"
 
 char   *dp;    /* pointer to area of memory */
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 int testrun(int flag, int bytes, int ti);
 
-char *TCID="asyncio02";         /* Test program identifier.    */
+const char *TCID="asyncio02";         /* Test program identifier.    */
 int TST_TOTAL=6;                /* Total number of test cases. */
 extern int Tst_count;           /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;           /* variable used to turn off tst_res buffering */
@@ -128,7 +127,7 @@ extern int errno;
 
 int exp_enos[]={0};             /* Array of expected errnos */
 char mesg[150];
-char *filename;                        /* name of the temporary file */
+const char *filename;          /* name of the temporary file */
 
 char *Progname;
 int Open_flags;
index b59fd93..552f912 100644 (file)
@@ -119,14 +119,13 @@ extern void setup();
 extern void cleanup();
 
 
-
-char *TCID="chdir02";          /* Test program identifier.    */
+const char *TCID="chdir02";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 int exp_enos[]={0, 0};
 
-char *dirs[2] = { "/", "/tmp" };
+const char *dirs[2] = { "/", "/tmp" };
 
 int
 main(int ac, char **av)
index d220bb1..da2b0ac 100644 (file)
  *     NONE
  */
 
-#include <stdio.h>
 #include <errno.h>
 #include <sys/stat.h>
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "chdir02";
+const char *TCID = "chdir02";
 int TST_TOTAL = 3;
 extern int Tst_count;
 
@@ -97,14 +96,14 @@ int flag;
 #define        FAILED  1
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        int i;
        const char *msg;                /* message returned from parse_opts */
-       struct stat statbuf;
 
        /* parse standard options */
        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
index 12198fe..1ae8a16 100644 (file)
@@ -67,7 +67,6 @@
  *
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/fcntl.h>
 #define FILE_MODE      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 #define TESTFILE       "testfile"
 
-char *TCID="chmod01";          /* Test program identifier.    */
+const char *TCID="chmod01";            /* Test program identifier.    */
 int TST_TOTAL=8;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 int Modes[] = {0, 07, 070, 0700, 0777, 02777, 04777, 06777};
 
 void setup();                  /* setup function for the test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup() __attribute__ ((noreturn));/* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 41c3485..8026768 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="chmod02";          /* Test program identifier.    */
+const char *TCID="chmod02";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 char fname[255];
-char *buf = "file contents\n";
+const char *buf = "file contents\n";
 
 int Modes[] = {0, 07, 070, 0700, 0777, 02777, 04777, 06777};
 
index 1060637..b3cd088 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="chown01";          /* Test program identifier.    */
+const char *TCID="chown01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -130,7 +130,7 @@ int exp_enos[]={0, 0};
 
 char fname[255];
 int fd, uid, gid;
-char *buf = "davef";
+const char *buf = "davef";
 
 int
 main(int ac, char **av)
index 1637c90..4d40598 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
 #include "test.h"
 #include "usctest.h"
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID = "close01()";
+const char *TCID = "close01()";
 int TST_TOTAL = 2;
 extern int Tst_count;
 
@@ -76,7 +77,7 @@ int pipefildes[2];
 
 struct test_case_t {
         int *fd;
-       char *type;
+       const char *type;
 } TC[] = {
        /* file descriptor for a regular file */
         {&newfd, "file"},
@@ -85,6 +86,7 @@ struct test_case_t {
         {&pipefildes[0], "pipe"}
 };
 
+int
 main(int ac, char **av)
 {
 
index 44f98b2..72ecf81 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include <errno.h>
+#include <sys/stat.h>
 #include "test.h"
 #include "usctest.h"
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
 int exp_enos[] = {EBADF, 0};
 
-char *TCID = "close02()";
+const char *TCID = "close02()";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index 7c9567f..3fbcc3b 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="close08";          /* Test program identifier.    */
+const char *TCID="close08";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 7dd016f..6f89170 100644 (file)
  *     None
  */
 
-#include <stdio.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void functest1(void);
 void functest2(void);
 
-char *TCID = "creat01";
+const char *TCID = "creat01";
 int TST_TOTAL = 2;
 extern int Tst_count;
 
@@ -79,6 +79,7 @@ struct test_case_t {
        {filename, MODE2, functest2}
 };
 
+int
 main(int ac, char **av)
 {
        int i;
index c5e5242..2ca21f1 100644 (file)
  */
 
 #include <errno.h>
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "creat03";                        /* Test program identifier */
+const char *TCID = "creat03";                  /* Test program identifier */
 int TST_TOTAL = 1;                     /* Total number of test cases */
 extern int Tst_count;                  /* Test case counter */
 
@@ -58,8 +58,9 @@ char pfilname[40] = "";
 #define FMODE  0444
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        struct stat statbuf;
index 0caa879..c3c88a7 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="creat09";          /* Test program identifier.    */
+const char *TCID="creat09";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index d065f9d..521df6a 100644 (file)
@@ -121,7 +121,7 @@ extern void setup();
 extern void cleanup();
 
 
-char *TCID="dup01";            /* Test program identifier.    */
+const char *TCID="dup01";              /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 3aac3e9..ee759b8 100644 (file)
@@ -120,7 +120,7 @@ extern void setup();
 extern void cleanup();
 
 
-char *TCID="dup02";            /* Test program identifier.    */
+const char *TCID="dup02";              /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 4870778..bcc347a 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <stdlib.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="dup03";            /* Test program identifier.    */
+const char *TCID="dup03";              /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 85540db..1c4eaf1 100644 (file)
@@ -121,7 +121,7 @@ extern void setup();
 extern void cleanup();
 
 
-char *TCID="dup04";            /* Test program identifier.    */
+const char *TCID="dup04";              /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 4f889cd..0976883 100644 (file)
 extern void setup();
 extern void cleanup();
 
-char *TCID="dup05";            /* Test program identifier.    */
+const char *TCID="dup05";              /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index b23716a..f91b0a8 100644 (file)
@@ -124,7 +124,7 @@ extern void cleanup();
 
 
 
-char *TCID="execl01";          /* Test program identifier.    */
+const char *TCID="execl01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;          /* used to turn off buffering in tst_ routines */
index f29d34f..f7fcc82 100644 (file)
@@ -124,7 +124,7 @@ extern void cleanup();
 
 
 
-char *TCID="execle01";         /* Test program identifier.    */
+const char *TCID="execle01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;          /* used to turn off buffering in tst_ routines */
index 6bf97d4..383223c 100644 (file)
@@ -124,7 +124,7 @@ extern void cleanup();
 
 
 
-char *TCID="execlp01";         /* Test program identifier.    */
+const char *TCID="execlp01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;          /* used to turn off buffering in tst_ routines */
index b833e1c..f59f297 100644 (file)
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
 #include <errno.h>
-#include <string.h>
 #include <signal.h>
 
 #include <sys/types.h>
 #include "usctest.h"
 
 extern void setup();
-extern void cleanup();
+void cleanup();
 
-
-
-char *TCID="execv01";          /* Test program identifier.    */
+const char *TCID="execv01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;          /* used to turn off buffering in tst_ routines */
@@ -133,7 +130,7 @@ int exp_enos[]={0, 0};              /* Zero terminated list of expected errnos */
 
 int pid;               /* process id from fork */
 int status;            /* status returned from waitpid */
-char *args[2]={"/usr/bin/test", 0};    /* argument list for execv call */
+const char * const args[2]={"/usr/bin/test", 0};       /* argument list for execv call */
 
 int
 main(int ac, char **av)
index 1abe72f..2584bdf 100644 (file)
@@ -124,7 +124,7 @@ extern void cleanup();
 
 
 
-char *TCID="execve01";         /* Test program identifier.    */
+const char *TCID="execve01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;          /* used to turn off buffering in tst_ routines */
@@ -133,7 +133,7 @@ int exp_enos[]={0, 0};              /* Zero terminated list of expected errnos */
 
 int pid;                       /* process id from fork */
 int status;                    /* status returned from waitpid */
-char *args[2]={"/usr/bin/test", 0};    /* argument list for execve call */
+const char *const args[2]={"/usr/bin/test", 0};        /* argument list for execve call */
 extern char **environ;         /* pointer to this processes env, to pass along */
 
 int
index 6f645d6..8a1726a 100644 (file)
@@ -124,7 +124,7 @@ extern void cleanup();
 
 
 
-char *TCID="execvp01";         /* Test program identifier.    */
+const char *TCID="execvp01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;          /* used to turn off buffering in tst_ routines */
@@ -133,7 +133,7 @@ int exp_enos[]={0, 0};              /* Zero terminated list of expected errnos */
 
 int pid;               /* process id from fork */
 int status;            /* status returned from waitpid */
-char *args[2]={"/usr/bin/test", 0};    /* argument list for execvp call */
+const char *const args[2]={"/usr/bin/test", 0};        /* argument list for execvp call */
 
 int
 main(int ac, char **av)
index 729f49a..74e6c09 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include <signal.h>
 #include <errno.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID = "exit01";
+const char *TCID = "exit01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
+int
 main(int ac, char **av)
 {
        int pid, npid, sig, nsig, exno, nexno, status;
index b81ecbc..1503106 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include <errno.h>
 #include <signal.h>
 #include <fcntl.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID = "exit02";
+const char *TCID = "exit02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
@@ -61,6 +61,7 @@ extern int Tst_count;
 
 char filen[40];
 
+int
 main(int ac, char **av)
 {
        int pid, npid, sig, nsig, exno, nexno, status;
index 83685d3..bd70c01 100644 (file)
 #include <fcntl.h>
 #include <string.h>
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID = "fchdir01";
+const char *TCID = "fchdir01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
@@ -77,6 +77,7 @@ const char *TEST_DIR = "alpha";
 
 #define MODES  S_IRWXU
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index c09d905..4e1d9e7 100644 (file)
 #include <sys/stat.h>
 #include <fcntl.h>
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID = "fchdir02";
+const char *TCID = "fchdir02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 int exp_enos[] = {9, 0};       /* 0 terminated list of expected errnos */
 
+int
 main(int ac, char **av)
 {
        const int bad_fd = -5;
index ffcf37f..e2db716 100644 (file)
@@ -119,7 +119,7 @@ extern void cleanup();
 
 
 
-char *TCID="fchmod01";                 /* Test program identifier.    */
+const char *TCID="fchmod01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -127,7 +127,7 @@ int exp_enos[]={0, 0};
 
 char fname[255];
 int fd;
-char *buf = "davef";
+const char *buf = "davef";
 
 int
 main(int ac, char **av)
index 045f848..d692bfc 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fchown01";         /* Test program identifier.    */
+const char *TCID="fchown01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 14fc1b6..cbdd085 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fcntl02";          /* Test program identifier.    */
+const char *TCID="fcntl02";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 93a9b9b..8199469 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fcntl03";          /* Test program identifier.    */
+const char *TCID="fcntl03";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index d708430..7af7789 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fcntl04";          /* Test program identifier.    */
+const char *TCID="fcntl04";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 86f492a..80cfe8c 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fcntl05";          /* Test program identifier.    */
+const char *TCID="fcntl05";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index c48e475..d62eb79 100644 (file)
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
 #include <errno.h>
-#include <string.h>
 #include <signal.h>
 #include <sys/types.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include <fcntl.h>
 #include <sys/wait.h>
 #include <limits.h>
 #include "search_path.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void help();
 
-char *TCID="fcntl07";          /* Test program identifier.    */
+const char *TCID="fcntl07";            /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -170,10 +167,10 @@ int stat_loc;                     /* for waitpid() */
 int file_fd, pipe_fds[2];
        /* file descriptors for a file and a system pipe */
 #define DEFAULT_FILE "DefaultFileName"
-char *File1 = DEFAULT_FILE;
+const char *File1 = DEFAULT_FILE;
 
 #define DEFAULT_SUBPROG "test_open"
-char *openck = DEFAULT_SUBPROG;                /* support program name to check for open FD */
+const char *openck = DEFAULT_SUBPROG;  /* support program name to check for open FD */
 char subprog_path[_POSIX_PATH_MAX];    /* path to exec "openck" with */
 #define STRSIZE 255
 
@@ -181,13 +178,13 @@ int *testfds[] = {
     &file_fd,  &pipe_fds[1],   0
     };
 
-char *testfdtypes[] = {
+const char *testfdtypes[] = {
     "regular file",
     "write side of system pipe",
     };
 
-int test_open(char *arg);
-int do_exec(char *prog, int fd, char *tcd);
+int test_open(const char *arg);
+int do_exec(const char *prog, int fd, const char *tcd);
 
 int
 main(int ac, char **av)
@@ -197,7 +194,7 @@ main(int ac, char **av)
     
     int exec_return;   /* return from do_exec */
     int **tcp;         /* testcase pointer (pointer to FD) */
-    char **tcd;                /* testcase description pointer */
+    const char **tcd;          /* testcase description pointer */
     
     /***************************************************************
      * parse standard options, and exit if there is an error
@@ -358,7 +355,7 @@ help()
  */
 
 int
-do_exec(char *prog, int fd, char *tcd)
+do_exec(const char *prog, int fd, const char *tcd)
 {
     int pid;
     char pidname[STRSIZE];
@@ -400,7 +397,7 @@ do_exec(char *prog, int fd, char *tcd)
  *    It tests if a file descriptor is open and exits accordingly.
  */
 int
-test_open(char *arg)
+test_open(const char *arg)
 {
     int fd, rc;
     int status;
index 51b88c2..405bf61 100644 (file)
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include <fcntl.h>
 #include <sys/wait.h>
 #include <limits.h>
 #include "search_path.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void help();
 
-char *TCID="fcntl07B";         /* Test program identifier.    */
+const char *TCID="fcntl07B";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -168,11 +166,11 @@ int stat_loc;                     /* for waitpid() */
 int npipe_fd;
        /* file descriptors for a named pipe */
 #define DEFAULT_FILE "DefaultFileName"
-char *File1 = DEFAULT_FILE;
+const char *File1 = DEFAULT_FILE;
 
 #define DEFAULT_SUBPROG "test_open"
-char *openck = DEFAULT_SUBPROG;                /* support program name to check for open FD */
-char subprog_path[_POSIX_PATH_MAX];    /* path to exec "openck" with */
+const char *openck = DEFAULT_SUBPROG;  /* support program name to check for open FD */
+const char subprog_path[_POSIX_PATH_MAX];/* path to exec "openck" with */
 #define STRSIZE 255
 #define FIFONAME "FiFo"
 
@@ -180,12 +178,12 @@ int *testfds[] = {
     &npipe_fd, 0
     };
 
-char *testfdtypes[] = {
+const char *testfdtypes[] = {
     "named pipe"
     };
 
 int test_open(char *arg);
-int do_exec(char *prog, int fd, char *tcd);
+int do_exec(const char *prog, int fd, const char *tcd);
 
 int
 main(int ac, char **av)
@@ -195,7 +193,7 @@ main(int ac, char **av)
     
     int exec_return;   /* return from do_exec */
     int **tcp;         /* testcase pointer (pointer to FD) */
-    char **tcd;                /* testcase description pointer */
+    const char **tcd;  /* testcase description pointer */
     
     /***************************************************************
      * parse standard options, and exit if there is an error
@@ -356,7 +354,7 @@ help()
  */
 
 int
-do_exec(char *prog, int fd, char *tcd)
+do_exec(const char *prog, int fd, const char *tcd)
 {
     int pid;
     char pidname[STRSIZE];
@@ -403,9 +401,6 @@ test_open(char *arg)
     int fd, rc;
     int status;
     
-    extern char *optarg;
-    extern int optind;
-
     fd = atoi(arg);
 
     rc = fcntl(fd, F_GETFD, &status);
index c4cbad4..eaf2243 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 #ifndef O_NDELAY
 #define O_NDELAY 0
 #endif
 
-char *TCID="fcntl08";          /* Test program identifier.    */
+const char *TCID="fcntl08";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index f10df71..523bd09 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fcntl09";          /* Test program identifier.    */
+const char *TCID="fcntl09";            /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 8b23575..661f696 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fcntl10";          /* Test program identifier.    */
+const char *TCID="fcntl10";            /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index dfd412a..2aac2d4 100644 (file)
 #include <string.h>
 #include <signal.h>
 #include <fcntl.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include "test.h"
@@ -134,7 +133,7 @@ extern void cleanup();
 
 
 
-char *TCID="fork01";           /* Test program identifier.    */
+const char *TCID="fork01";             /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index eaf3b64..eeec828 100644 (file)
  *     None
  */
 
-#include <stdio.h>
-#include <unistd.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID = "fork02";
+const char *TCID = "fork02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
-void setup(void);
-void cleanup(void);
-
+int
 main(int ac, char **av)
 {
        int pid1, pid2, status;
index cda9132..fbc23bb 100644 (file)
  *     None
  */
 
-#include <stdio.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID = "fork03";
+const char *TCID = "fork03";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        float fl1, fl2;
index 3725d9f..901d88a 100644 (file)
  * 
  * 
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <sys/param.h>
 #include "test.h"    
 #include "usctest.h"
 
-char *TCID="fork04";           /* Test program identifier.    */
+const char *TCID="fork04";             /* Test program identifier.    */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 
@@ -130,7 +128,7 @@ extern int Tst_count;               /* Test Case counter for tst_* routines */
 #define ENV_NOT_SET  "getenv() does not find variable set"
 
 /* list of environment variables to test */
-char *environ_list[] = {"TERM","NoTSetzWq","TESTPROG"};
+const char *environ_list[] = {"TERM","NoTSetzWq","TESTPROG"};
 #define NUMBER_OF_ENVIRON sizeof(environ_list)/sizeof(char *)
 int TST_TOTAL=NUMBER_OF_ENVIRON;               /* Total number of test cases. */
 
index c2e5a47..9755e50 100644 (file)
  *     None
  */
 
-#include <stdio.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "fork06";
+const char *TCID = "fork06";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
 #define NUMFORKS 1000
 
+int
 main(int ac, char **av)
 {
        int i, pid, status, childpid, succeed, fail;
index d8487c1..7e06db7 100644 (file)
  *     None
  */
 
-#include <stdio.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "fork07";
+const char *TCID = "fork07";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
 char pbuf[10];
 char fnamebuf[40];
 
+int
 main(int ac, char **av)
 {
        int status, count, forks, pid1;
        int ch_r_stat;
-       FILE *rea, *writ;
+       FILE *rea = NULL, *writ = NULL;
 
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
index 71a3f1d..233acc7 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include <errno.h>
 #include <limits.h>    /* for OPEN_MAX */
+#include <sys/fcntl.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "fork01";
+const char *TCID = "fork01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
 char filname[40], childfile[40];
 int first;
 FILE **fildeses;                       /* file streams */
 int mypid, nfiles;
 
+int
 main(int ac, char **av)
 {
-       int pid, status, dtable, nf;
+       int pid, status, nf;
        
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
@@ -211,8 +214,6 @@ setup()
 void
 cleanup()
 {
-       int nf;
-
        /*
         * print timing stats if that option was specified.
         * print errno log if that option was specified.
index 09de7c0..a3277d1 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "fork04";
+const char *TCID = "fork04";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
 char pidbuf[10];
 char fnamebuf[40];
 
+int
 main(int ac, char **av)
 {
        int status, pid, fildes;
index 1fc200d..2b10352 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include <errno.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "fork05";
+const char *TCID = "fork05";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
 #define NUMFORKS 100
 
+int
 main(int ac, char **av)
 {
        int i, pid, cpid, status;
index bc4f2b2..37fbe96 100644 (file)
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
 #include <fcntl.h>
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
@@ -122,7 +121,7 @@ extern void cleanup();
 
 
 
-char *TCID="fpathconf01";      /* Test program identifier.    */
+const char *TCID="fpathconf01";        /* Test program identifier.    */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 #define FILENAME       "fpafile01"
@@ -133,7 +132,7 @@ int i;
 
 struct pathconf_args
 {
-   char *define_tag;
+   const char *define_tag;
    int value;
    int defined;   /* Some of these are undefined on regular files.
                   * Cancer does a slightly better job with these already,
index 9cb7959..d766841 100644 (file)
 extern void setup();
 extern void cleanup();
 
-
-
-char *TCID="fstat01";          /* Test program identifier.    */
+const char *TCID="fstat01";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index f15e48e..224caf0 100644 (file)
@@ -66,7 +66,6 @@
  *  This test should be run by 'non-super-user' only.
  *
  */
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>
@@ -83,7 +82,7 @@
 #define BUF_SIZE       256
 #define MASK           0777
 
-char *TCID="fstat02";          /* Test program identifier.    */
+const char *TCID="fstat02";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 uid_t User_id;                 /* user id/group id of test process */
@@ -91,7 +90,7 @@ gid_t Group_id;
 int fildes;                    /* File descriptor of testfile */
 
 void setup();                  /* Setup function for the test */
-void cleanup();                        /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
 
 int
 main(int ac, char **av)
index 1f63cf1..47982ed 100644 (file)
@@ -46,9 +46,6 @@
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
 #define FILE_MODE      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 #define TEST_FILE      "testfile"
 
-char *TCID="fstat03";           /* Test program identifier.    */
+const char *TCID="fstat03";    /* Test program identifier.    */
 int TST_TOTAL = 1;             /* Total number of test cases. */
 extern int Tst_count;           /* Test Case counter for tst_* routines */
 int exp_enos[]={EBADF, 0};
 int fildes;                    /* testfile descriptor */
 
 void setup();                  /* Main setup function for the tests */
-void cleanup();                        /* cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 0287fff..1de507e 100644 (file)
@@ -65,7 +65,6 @@
  *  This test should be run by 'non-super-user' only.
  * 
  */
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>
@@ -82,7 +81,7 @@
 #define BUF_SIZE       256
 #define MASK           0777
 
-char *TCID="fstat01";          /* Test program identifier.    */
+const char *TCID="fstat01";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 uid_t User_id;                 /* user id/group id of test process */
@@ -90,7 +89,7 @@ gid_t Group_id;
 int fildes;                    /* File descriptor of testfile */
 
 void setup();                  /* Setup function for the test */
-void cleanup();                        /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
 
 int
 main(int ac, char **av)
index 57ddd5f..261ea0d 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="fsync01";          /* Test program identifier.    */
+const char *TCID="fsync01";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -131,7 +131,7 @@ int exp_enos[]={0, 0};
 
 char fname[255];
 int fd;
-char *buf = "davef";
+const char *buf = "davef";
 
 int
 main(int ac, char **av)
index 2d3d797..a45c167 100644 (file)
 #define FILE_SIZE      1024                    /* test file size */
 #define TRUNC_LEN      256                     /* truncation length */
 
-char *TCID="ftruncate01";      /* Test program identifier.    */
+const char *TCID="ftruncate01";        /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fildes;                    /* file descriptor for test file */
 
 void setup();                  /* setup function for the test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 8044c1d..2b4e723 100644 (file)
@@ -67,7 +67,6 @@
  *     
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/fcntl.h>
 #define TRUNC_LEN1     256                     /* truncation length */
 #define TRUNC_LEN2     512                     /* truncation length */
 
-char *TCID="ftruncate02";      /* Test program identifier.    */
+const char *TCID="ftruncate02";        /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fd;                                /* file descriptor of testfile */
 char tst_buff[BUF_SIZE];       /* buffer to hold testfile contents */
 
 void setup();                  /* setup function for the test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 2e80558..279b4e8 100644 (file)
@@ -67,7 +67,6 @@
  *  This test should be executed by 'non-super-user'  only.
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/fcntl.h>
@@ -93,7 +92,7 @@ int fd2;                      /* File descriptor for testfile2 */
 
 struct test_case_t {           /* test case struct. to hold ref. test cond's*/
        int fd;
-       char *desc;
+       const char *desc;
        int exp_errno;
        int len;
        int (*setupfunc)();
@@ -103,20 +102,20 @@ struct test_case_t {              /* test case struct. to hold ref. test cond's*/
        { 0, NULL, 0, 0, no_setup }
 };
 
-char *TCID="ftruncate03";      /* Test program identifier.    */
+const char *TCID="ftruncate03";        /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={EINVAL, EBADF, 0};
 
 void setup();                  /* Main setup function for the test */
-void cleanup();                        /* Main cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* Main cleanup function for the test */
 
 int
 main(int ac, char **av)
 {
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
-       char *test_desc;        /* test specific error message */
+       const char *test_desc;  /* test specific error message */
        int fildes;             /* File descriptor of testfile */
        off_t trunc_len;        /* truncate length */
        int ind;
index d2c8a52..9422010 100644 (file)
@@ -121,7 +121,7 @@ extern void cleanup();
 
 
 
-char *TCID="getegid01";                /* Test program identifier.    */
+const char *TCID="getegid01";          /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index b4840f5..82a681e 100644 (file)
@@ -121,7 +121,7 @@ extern void cleanup();
 
 
 
-char *TCID="geteuid01";                /* Test program identifier.    */
+const char *TCID="geteuid01";          /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index fcde734..e5b138c 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="getgid01";                 /* Test program identifier.    */
+const char *TCID="getgid01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 290ef10..5efbda5 100644 (file)
 #include "test.h"
 #include "usctest.h"
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID= "getgid02";
+const char *TCID= "getgid02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index 3059b0b..ef0eaea 100644 (file)
 #include "test.h"
 #include "usctest.h"
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID= "getgid01";
+const char *TCID= "getgid01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index 6b935f2..db9f942 100644 (file)
@@ -75,7 +75,6 @@ BUGS:
 
 ************************************************************/
 
-#include <unistd.h>
 #include <signal.h>
 #include <string.h>
 #include <errno.h>
@@ -84,9 +83,9 @@ BUGS:
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="getgroups01";          /* Test program identifier.    */
+const char *TCID="getgroups01";          /* Test program identifier.    */
 int TST_TOTAL=4;                /* Total number of test cases. */
 extern int Tst_count;           /* Test Case counter for tst_* routines */
 
index b517c76..e052589 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="getgroups02";              /* Test program identifier.    */
+const char *TCID="getgroups02";                /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 2d4a187..ebb6d17 100644 (file)
@@ -119,7 +119,7 @@ extern void cleanup();
 
 
 
-char *TCID="gethostid01";              /* Test program identifier.    */
+const char *TCID="gethostid01";                /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 2f94db7..0e765bf 100644 (file)
@@ -121,7 +121,7 @@ extern void cleanup();
 
 
 
-char *TCID="gethostname01";    /* Test program identifier.    */
+const char *TCID="gethostname01";/* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index d1a39a0..70fc854 100644 (file)
 #include <usctest.h>
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID = "getpgid01";
+const char *TCID = "getpgid01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
@@ -98,7 +99,6 @@ main(int ac, char **av)
                }
 
                /* child */
-block1:
                tst_resm(TINFO, "Enter block 1");
                fail = 0;
                if ((pgid_0 = getpgid(0)) < 0) {
@@ -114,7 +114,6 @@ block1:
                }
                tst_resm(TINFO, "Exit block 1");
 
-block2:
                tst_resm(TINFO, "Enter block 2");
                fail = 0;
 
@@ -138,7 +137,6 @@ block2:
                }
                tst_resm(TINFO, "Exit block 2");
 
-block3:
                tst_resm(TINFO, "Enter block 3");
                fail = 0;
 
@@ -164,7 +162,6 @@ block3:
                }
                tst_resm(TINFO, "Exit block 3");
 
-block4:
                tst_resm(TINFO, "Enter block 4");
                fail = 0;
 
index afb80f2..1304a99 100644 (file)
@@ -52,9 +52,9 @@
 #include <usctest.h>
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID = "getpgid01";
+const char *TCID = "getpgid01";
 int TST_TOTAL = 2;
 extern int Tst_count;
 
@@ -74,6 +74,7 @@ struct test_case_t {
         {&pgid_1, ESRCH}
 };
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index bd3a891..6997be2 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="getpgrp01";        /* Test program identifier.    */
+const char *TCID="getpgrp01";  /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 58d6b05..df8197d 100644 (file)
@@ -120,7 +120,7 @@ extern void cleanup();
 
 
 
-char *TCID="getpid01";                 /* Test program identifier.    */
+const char *TCID="getpid01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 8561c1a..06d80b3 100644 (file)
  *  None.
  */
 
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <string.h>
 #include <signal.h>
 #include <sys/wait.h>
@@ -74,9 +72,9 @@
 #include "usctest.h"
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
-char *TCID="getpid01";         /* Test program identifier.    */
+const char *TCID="getpid01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 9eab5df..d0e6032 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="getppid01";                /* Test program identifier.    */
+const char *TCID="getppid01";          /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 9eeead1..50a72e4 100644 (file)
 #include <errno.h>
 #include <test.h>
 #include <usctest.h>
+#include <sys/wait.h>
 
-char *TCID = "getppid01";
+const char *TCID = "getppid01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        int pid, ppid;
index 58920ed..cd3dff7 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="getuid01";                 /* Test program identifier.    */
+const char *TCID="getuid01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index b350725..966b552 100644 (file)
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "getuid02";
+const char *TCID = "getuid02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index 7c1075c..e18c366 100644 (file)
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "getuid01";
+const char *TCID = "getuid01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index d20d3a3..0428991 100644 (file)
 #include <errno.h>
 #include <sys/wait.h>
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID= "kill01()";
+const char *TCID= "kill01()";
 int TST_TOTAL = 1;
 
 extern int Tst_count;
 
 #define TEST_SIG SIGKILL
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index e618c8c..eba47cc 100644 (file)
 #include <errno.h>   
 #include <fcntl.h>
 #include <string.h>
-#include <stdlib.h>
 #include "test.h"    
 #include "usctest.h"
 
@@ -202,9 +201,9 @@ void chld1_kill();          /*This routine is used by child 1 to remove itself and  */
                                /*its children A and B.                                 */
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="kill02";          /* Test program identifier.    */
+const char *TCID="kill02";          /* Test program identifier.    */
 int TST_TOTAL=2;                /* Total number of test cases. */
 extern int Tst_count;           /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;           /* var. used to turn off tst_res buffering */
@@ -657,7 +656,7 @@ void childB_rout()
 void
 setup()
 {
-       int errno_buf;          /*indicates the errno if pipe set up fails.             */
+       int errno_buf = 0;      /*indicates the errno if pipe set up fails.             */
        int err_flag = FALSE;   /*Indicates if an error has occurred in pipe set up.    */
        char mesg[MAXMESG];     /*Used to buffer messages for tst_res.                  */
 
index 528a080..1de727f 100644 (file)
 #include <errno.h>
 #include <sys/wait.h>
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID= "kill03()";
+const char *TCID= "kill03()";
 int TST_TOTAL = 1;
 
 extern int Tst_count;
@@ -74,12 +74,13 @@ int exp_enos[] = {EINVAL, 0};
 
 #define TEST_SIG 2000
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        const char *msg;                /* message returned from parse_opts */
        pid_t pid;                      
-       int exno, status, nsig;
+       int exno, status;
 
        /* parse standard options */
        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
index 2e0ff65..a7b3274 100644 (file)
 #include <errno.h>
 #include <sys/wait.h>
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID= "kill04()";
+const char *TCID= "kill04()";
 int TST_TOTAL = 1;
 
 extern int Tst_count;
@@ -74,6 +74,7 @@ int exp_enos[] = {ESRCH, 0};
 
 #define TEST_SIG SIGKILL
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index 9d6b0a1..3b4c24f 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void alarm_handler(int sig);
 
 
 
 
-char *TCID="kill09";           /* Test program identifier.    */
+const char *TCID="kill09";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 61294f1..84c53c2 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="link02";           /* Test program identifier.    */
+const char *TCID="link02";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 7b43958..38c16af 100644 (file)
 
 void setup(); 
 void help();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="link03";           /* Test program identifier.    */
+const char *TCID="link03";             /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;
index 7f23901..b3453b5 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 extern char *get_high_address();
 
-char *TCID="link04";           /* Test program identifier.    */
+const char *TCID="link04";             /* Test program identifier.    */
 int TST_TOTAL=14;              /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -141,10 +141,10 @@ char High_address[64];
 int dir_setup();
 
 struct test_case_t {
-   char *file1;
-   char *desc1;
-   char *file2;
-   char *desc2;
+   const char *file1;
+   const char *desc1;
+   const char *file2;
+   const char *desc2;
    int exp_errno;
    int (*setupfunc1)();
    int (*setupfunc2)();
@@ -214,8 +214,8 @@ main(int ac, char **av)
 {
     int lc;            /* loop counter */
     const char *msg;           /* message returned from parse_opts */
-    char *fname1, *fname2;
-    char *desc1, *desc2;
+    const char *fname1, *fname2;
+    const char *desc1, *desc2;
     int ind;
     
     /***************************************************************
index 5078a6a..9387c25 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void help();
 
 
 
-char *TCID="link05";   /* Test program identifier.    */
+const char *TCID="link05";     /* Test program identifier.    */
 #ifdef CRAY
 int TST_TOTAL=2;               /* Total number of test cases. */
 #else
index 32756fe..22d0c6c 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="lseek01";          /* Test program identifier.    */
+const char *TCID="lseek01";            /* Test program identifier.    */
 int TST_TOTAL=3;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 9ad906b..04fa3f1 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="lseek02";          /* Test program identifier.    */
+const char *TCID="lseek02";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 03c035c..e1916da 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void rec_sigsys(int);
 
-char *TCID="lseek03";          /* Test program identifier.    */
+const char *TCID="lseek03";            /* Test program identifier.    */
 int TST_TOTAL=3;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index d1c3c36..faba3f1 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="lseek04";          /* Test program identifier.    */
+const char *TCID="lseek04";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 0d51643..8867086 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="lseek05";          /* Test program identifier.    */
+const char *TCID="lseek05";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 0262260..638d876 100644 (file)
@@ -66,8 +66,6 @@
  *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <fcntl.h>
 #define TEMP_FILE      "tmp_file"
 #define FILE_MODE      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-char *TCID="lseek01";          /* Test program identifier.    */
+const char *TCID="lseek01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fildes;                    /* file handle for temp file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 0acc289..47bdf1d 100644 (file)
@@ -66,8 +66,6 @@
  *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -82,7 +80,7 @@
 #define TEMP_FILE      "tmp_file"
 #define FILE_MODE      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-char *TCID="lseek02";          /* Test program identifier.    */
+const char *TCID="lseek02";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fildes;                    /* file handle for temp file */
@@ -91,7 +89,7 @@ char write_buf1[BUFSIZ];      /* buffer to hold data */
 char write_buf2[BUFSIZ];       /* buffer to hold data */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 061ac31..ebef7c0 100644 (file)
@@ -66,8 +66,6 @@
  *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <fcntl.h>
 #define TEMP_FILE      "tmp_file"
 #define FILE_MODE      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-char *TCID="lseek03";          /* Test program identifier.    */
+const char *TCID="lseek03";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fildes;                    /* file handle for temp file */
 size_t file_size;              /* size of the temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index b36df71..36688c6 100644 (file)
@@ -68,8 +68,6 @@
  *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <fcntl.h>
 #define TEMP_FILE      "tmp_file"
 #define FILE_MODE      S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-char *TCID="lseek04";          /* Test program identifier.    */
+const char *TCID="lseek04";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fildes;                    /* file handle for temp file */
 size_t file_size;              /* total size of file after data write */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
 {
        int lc;                 /* loop counter */
-       int rval;
        const char *msg;        /* message returned from parse_opts */
        char read_buf[BUFSIZ];  /* data read from temp. file */
     
index 060f3b2..ab3cc6b 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <utime.h>
 #include <string.h>
@@ -90,7 +87,7 @@
 #define PIPE_MODE      S_IFIFO | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 #define SEEK_TOP       10
 
-char *TCID="lseek05";          /* Test program identifier.    */
+const char *TCID="lseek05";            /* Test program identifier.    */
 int TST_TOTAL=3;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={ESPIPE, EINVAL, EBADF, 0};
@@ -107,7 +104,7 @@ int fd3;                    /* file handle for testfile3  */
 struct test_case_t {           /* test case struct. to hold ref. test cond's*/
        int fd;
        int Whence;
-       char *desc;
+       const char *desc;
        int exp_errno;
        int (*setupfunc)();
 } Test_cases[] = {
@@ -118,7 +115,7 @@ struct test_case_t {                /* test case struct. to hold ref. test cond's*/
 };
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
@@ -127,7 +124,7 @@ main(int ac, char **av)
        const char *msg;        /* message returned from parse_opts */
        int fildes;             /* file handle for testfile */
        int whence;             /* position of file handle in the file */
-       char *test_desc;        /* test specific error message */
+       const char *test_desc;  /* test specific error message */
        int ind;                /* counter to test different test conditions */
     
        /* Parse standard options given to run the test. */
index f6b97d7..eed8f78 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="lstat02";          /* Test program identifier.    */
+const char *TCID="lstat02";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 80f9bb6..5772f06 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 char *get_high_address();
 
-char *TCID="mkdir01";          /* Test program identifier.    */
+const char *TCID="mkdir01";    /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 8378aba..d1cc193 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
@@ -124,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="mkdir08";          /* Test program identifier.    */
+const char *TCID="mkdir08";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 32c7fe1..6cfe488 100644 (file)
  * 
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="mknod01";          /* Test program identifier.    */
+const char *TCID="mknod01";            /* Test program identifier.    */
 int TST_TOTAL;                 /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 8ac1b37..40cca6f 100644 (file)
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/mman.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 
 #include "test.h"
 #include "usctest.h"
 
-char *TCID="mmap001";
+const char *TCID="mmap001";
 int TST_TOTAL=5;
 extern int Tst_count;
 static char *filename=NULL;
index 35e944d..96634ee 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -85,7 +82,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="mmap02";           /* Test program identifier.    */
+const char *TCID="mmap02";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 char *addr;                    /* addr of memory mapped region */
@@ -94,7 +91,7 @@ size_t page_sz;                       /* system page size */
 int fildes = -1;               /* file descriptor for temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 6c66a4c..de873fc 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -88,7 +85,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="mmap03";           /* Test program identifier.    */
+const char *TCID="mmap03";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 size_t page_sz;                        /* system page size */
@@ -97,14 +94,13 @@ char *dummy;                        /* dummy variable to hold temp file contents */
 int fildes = -1;               /* file descriptor for temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
 {
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
-       char file_content;      /* tempfile content */
        
        /* Parse standard options given to run the test. */
        msg = parse_opts(ac, av, (option_t *) NULL, NULL);
index 4f9018f..b82904d 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -88,7 +85,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="mmap04";           /* Test program identifier.    */
+const char *TCID="mmap04";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 size_t page_sz;                        /* system page size */
@@ -97,14 +94,13 @@ char *dummy;                        /* dummy variable to hold temp file contents */
 int fildes = -1;               /* file descriptor for temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
 {
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
-       char file_content;      /* tempfile content */
        
        /* Parse standard options given to run the test. */
        msg = parse_opts(ac, av, (option_t *) NULL, NULL);
index e818689..f42adf0 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -89,7 +86,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="mmap05";           /* Test program identifier.    */
+const char *TCID="mmap05";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 size_t page_sz;                        /* system page size */
@@ -99,7 +96,7 @@ int pass=0;                   /* pass flag perhaps set to 1 in sig_handler */
 sigjmp_buf env;                        /* environment for sigsetjmp/siglongjmp */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 void sig_handler();            /* signal handler to catch SIGSEGV */
 
 int
index bc3f20e..4c9c958 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -84,7 +81,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="mmap06";           /* Test program identifier.    */
+const char *TCID="mmap06";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={EACCES, 0};
@@ -94,7 +91,7 @@ char *addr;                   /* addr of memory mapped region */
 int fildes = -1;               /* file descriptor for temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 3d1f434..5f26abf 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -85,7 +82,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="mmap07";           /* Test program identifier.    */
+const char *TCID="mmap07";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={EACCES, 0};
@@ -95,7 +92,7 @@ char *addr;                   /* addr of memory mapped region */
 int fildes = -1;               /* file descriptor for temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 8b2c050..8af8cb5 100644 (file)
  *  None.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -80,7 +77,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="mmap08";           /* Test program identifier.    */
+const char *TCID="mmap08";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={EBADF, 0};
@@ -90,7 +87,7 @@ char *addr;                   /* addr of memory mapped region */
 int fildes = -1;               /* file descriptor for temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 5de98b6..0527201 100644 (file)
@@ -69,7 +69,6 @@
  *  None.  
  */
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
@@ -79,7 +78,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="munmap01";         /* Test program identifier.    */
+const char *TCID="munmap01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -88,7 +87,7 @@ int fildes;                   /* file descriptor for tempfile */
 unsigned int map_len;          /* length of the region to be mapped */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void);            /* cleanup function for the test */
 void sig_handler();            /* signal catching function */
 
 int
index deadcc2..7345e73 100644 (file)
@@ -70,7 +70,6 @@
  *  None.
  */
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
@@ -80,7 +79,7 @@
 
 #define TEMPFILE       "mmapfile"
 
-char *TCID="munmap02";         /* Test program identifier.    */
+const char *TCID="munmap02";   /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -90,7 +89,7 @@ int fildes;                   /* file descriptor for tempfile */
 unsigned int map_len;          /* length of the region to be mapped */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void);            /* cleanup function for the test */
 void sig_handler();            /* signal catching function */
 
 int
index 602971f..1246e7f 100644 (file)
  * 
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <string.h>
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="nice05";           /* Test program identifier.    */
+const char *TCID="nice05";     /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 84640ce..594ab5b 100644 (file)
@@ -42,7 +42,6 @@
  * RESTRICTIONS
  *     None
  */
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
@@ -50,7 +49,7 @@
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "open02";
+const char *TCID = "open02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
@@ -58,18 +57,15 @@ char pfilname[40] = "";
 
 int exp_enos[] = {ENOENT, 0};
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        const char *msg;                /* message returned from parse_opts */
 
-       struct stat statbuf;
-       int fildes;
-       unsigned short filmode;
-
        /*
         * parse standard command line options
         */
index b8dce9c..6a699ba 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="open03";           /* Test program identifier.    */
+const char *TCID="open03";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index f87c6e2..466875f 100644 (file)
  * 
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
@@ -121,18 +120,18 @@ extern void cleanup();
 
 
 
-char *TCID="pathconf01";       /* Test program identifier.    */
+const char *TCID="pathconf01";         /* Test program identifier.    */
 int TST_TOTAL;                 /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 int exp_enos[]={0, 0};
 
 int i;
-char *path = "/tmp";
+const char *path = "/tmp";
 
 struct pathconf_args
 {
-   char *define_tag;
+   const char *define_tag;
    int value;
 } args[] = {
     {"_PC_LINK_MAX", _PC_LINK_MAX},
index 28187c3..1c3b946 100644 (file)
@@ -119,7 +119,7 @@ extern void cleanup();
 
 
 
-char *TCID="pause01";          /* Test program identifier.    */
+const char *TCID="pause01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 699515d..cc01cc9 100644 (file)
  * RESTRICITONS
  *     NONE
  */
-#include <unistd.h>
 #include <errno.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "pipe01";
+const char *TCID = "pipe01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        const char *msg;                /* message returned from parse_opts */
 
-       int pipe_ret;                   /* exit status of pipe */
        int fildes[2];                  /* fds for pipe read and write */
        char wrbuf[BUFSIZ], rebuf[BUFSIZ];
        int red, written;               /* no. of chars read/written to pipe */
index 9cc935d..70d61da 100644 (file)
  *     None
  */
 #include <errno.h>
-#include <unistd.h>
 #include <signal.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "pipe08";
+const char *TCID = "pipe08";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void sighandler(int);
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        const char *msg;                /* message returned from parse_opts */
 
-       int pipe_ret;                   /* exit status of pipe */
        int pipefd[2];                  /* fds for pipe read/write */
        char wrbuf[BUFSIZ];
        int written, length;
index 2c7d9f4..eb21bb6 100644 (file)
@@ -46,7 +46,6 @@
  * RESTRICTIONS
  *     None
  */
-#include <unistd.h>
 #include <signal.h>
 #include <sys/wait.h>
 #include <errno.h>
 
 #define        PIPEWRTCNT      100             /* must be an even number */
 
-char *TCID = "pipe09";
+const char *TCID = "pipe09";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        const char *msg;                /* message returned from parse_opts */
 
-       int i, red, wtstatus, ret_val;
-       int pipe_ret;                   /* exit stat of pipe */
+       int i, red, wtstatus;
        int pipefd[2];                  /* fds for pipe read/write */
-       char synbuf[BUFSIZ];
        char rebuf[BUFSIZ];
        int Acnt = 0, Bcnt = 0;         /* count 'A' and 'B' */
        int fork_1, fork_2;             /* ret values in parent */
index 410622c..52ac5d9 100644 (file)
  *     None
  */
 #include <errno.h>
-#include <unistd.h>
 #include <sys/wait.h>
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "pipe10";
+const char *TCID = "pipe10";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        const char *msg;                /* message returned from parse_opts */
 
-       int pipe_ret;                   /* exit status of pipe */
        int fd[2];                      /* fds for pipe read/write */
        char wrbuf[BUFSIZ], rebuf[BUFSIZ];
        int red, written;               /* no of chars read and */ 
index df7b241..338f906 100644 (file)
  *     None
  */
 #include <errno.h>
-#include <stdio.h>
 #include <limits.h>
+#include <sys/wait.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "pipe11";
+const char *TCID = "pipe11";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
 #define        NUMCHILD        50
 #define        NCPERCHILD      50
@@ -69,15 +69,15 @@ int szcharbuf;                      /* size of char buf */
 int pipewrcnt;                 /* chars written to pipe */
 char *wrbuf, *rdbuf;
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
        const char *msg;                /* message returned from parse_opts */
 
-       int pipe_ret;                   /* exit status of pipe */
        int fd[2];                      /* fds for pipe read/write */
        int i;
-       int fork_ret, status, cond_numb = 0;
+       int fork_ret, status;
        int nread, written;             /* no of chars read and written */
 
        /* parse standard options */
index 67e1f13..5cb7105 100644 (file)
@@ -62,7 +62,6 @@
  * RESTRICTIONS:
  *  None.
  */
-#include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/wait.h>
@@ -73,7 +72,7 @@
 
 #define BUF_SIZE       512
 
-char *TCID="poll01";           /* Test program identifier.    */
+const char *TCID="poll01";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -81,7 +80,7 @@ int fildes[2];                        /* file descriptors of the pipe. */
 struct pollfd fds[1];          /* struct. for poll() */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 1a54afe..332b939 100644 (file)
@@ -136,12 +136,12 @@ extern void cleanup();
 
 
 
-char *TCID="read01";           /* Test program identifier.    */
+const char *TCID="read01";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 int exp_enos[]={0, 0};
-char fname[255], *malloc();
+char fname[255];
 int fd, i;
 int offset=0;
 char *s;
index 99dcdf6..c976cd6 100644 (file)
  * RESTRICTIONS
  *     None
  */
-#include <stdio.h>
 #include <fcntl.h>
 #include <errno.h>
 #include "test.h"
 #include "usctest.h"
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID = "read01";
+const char *TCID = "read01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
@@ -63,12 +62,12 @@ char    fname[255];
 char    palfa[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
 int fild;
 
+int
 main(int ac, char **av)
 {
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
 
-       int n;
        int rfild;
        char prbuf[BUFSIZ];
 
index e8b5bd5..c77e906 100644 (file)
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <dirent.h>
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
   */
 void setup(); 
 void help();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="readdir01";                /* Test program identifier.    */
+const char *TCID="readdir01";          /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 extern int Tst_nobuf;
index bb5f6e3..744fff0 100644 (file)
@@ -65,7 +65,6 @@
  *  This test should be run by 'non-super-user' only.
  *
  */
-#include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/stat.h>
 #define FILE_MODE       S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 #define MAX_SIZE       256
 
-char *TCID="readlink01";       /* Test program identifier.    */
+const char *TCID="readlink01"; /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 int exp_val;                   /* strlen of testfile */
 
 void setup();                  /* Setup function for the test */
-void cleanup();                        /* Cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* Cleanup function for the test */
 
 int
 main(int ac, char **av)
index c0ed6f1..4ef6ffa 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="readlink02";       /* Test program identifier.    */
+const char *TCID="readlink02";         /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 3279b90..41cf4bb 100644 (file)
@@ -74,7 +74,6 @@
  *  This test should be executed by 'non-super-user'  only.
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <errno.h>
@@ -95,7 +94,7 @@
 #define SYM_FILE2      "sfile_2"
 #define MAX_SIZE       256
 
-char *TCID="readlink03";       /* Test program identifier.    */
+const char *TCID="readlink03"; /* Test program identifier.    */
 int TST_TOTAL=5;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={EACCES, EINVAL, ENAMETOOLONG, ENOENT, 0};
@@ -108,8 +107,8 @@ int lpath_setup();     /* setup function to test chmod for ENAMETOOLONG */
 char Longpathname[PATH_MAX+2];
 
 struct test_case_t {           /* test case struct. to hold ref. test cond's*/
-       char *link;
-       char *desc;
+       const char *link;
+       const char *desc;
        int exp_errno;
        size_t buf_siz;
        int (*setupfunc)();
@@ -127,7 +126,7 @@ struct test_case_t {                /* test case struct. to hold ref. test cond's*/
 };
 
 extern void setup();           /* Setup function for the test */
-extern void cleanup();         /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
 
 int
 main(int ac, char **av)
@@ -135,8 +134,8 @@ main(int ac, char **av)
        char buffer[MAX_SIZE];  /* temporary buffer to hold symlink contents*/
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
-       char *sym_file;         /* symbolic link file name */
-       char *test_desc;        /* test specific error message */
+       const char *sym_file;           /* symbolic link file name */
+       const char *test_desc;  /* test specific error message */
        int i;                  /* counter to test different test conditions */
        size_t buf_size;        /* size of buffer for readlink */
 
index 551efe7..14ae1f2 100644 (file)
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #include <errno.h>
 
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 extern void do_file_setup(char *);
 
-char *TCID="rename01";         /* Test program identifier.    */
+const char *TCID="rename01";           /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -89,9 +88,9 @@ dev_t f_olddev, d_olddev;
 ino_t f_oldino, d_oldino;
 
 struct test_case_t {
-       char *name1;
-       char *name2;
-       char *desc;
+       const char *name1;
+       const char *name2;
+       const char *desc;
        dev_t *olddev;
        ino_t *oldino;
 } TC[] = {
index 1ad0fb0..d34cd10 100644 (file)
@@ -123,7 +123,7 @@ void do_file_setup();
 
 
 
-char *TCID="rename02";                 /* Test program identifier.    */
+const char *TCID="rename02";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index e839239..0788ddc 100644 (file)
  */
 #include <sys/types.h>
 #include <sys/fcntl.h>
-#include <unistd.h>
 #include <errno.h>
 
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 extern void do_file_setup(char *);
 
-char *TCID="rename08";         /* Test program identifier.    */
+const char *TCID="rename08";           /* Test program identifier.    */
 int TST_TOTAL=3;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index c1aae92..438ef37 100644 (file)
  */
 #include <sys/types.h>
 #include <sys/fcntl.h>
-#include <unistd.h>
 #include <errno.h>
 
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 extern void do_file_setup(char *);
 
-char *TCID="rename10";         /* Test program identifier.    */
+const char *TCID="rename10";           /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 5b16a51..1d41f1c 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include "test.h" 
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup() __attribute__((noreturn));
 
 #define PERMS          0777
 
-char *TCID="rmdir01";           /* Test program identifier.    */
+const char *TCID="rmdir01";    /* Test program identifier.    */
 int TST_TOTAL=1;                /* Total number of test cases. */
 extern int Tst_count;           /* Test Case counter for tst_* routines */
 
index 5cf84f7..ece6a9f 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#include <unistd.h>
 
 #include <errno.h>
 #include <string.h>
@@ -125,7 +124,7 @@ extern void cleanup();
 
 
 
-char *TCID="rmdir04";          /* Test program identifier.    */
+const char *TCID="rmdir04";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index b363735..ff19b3a 100644 (file)
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <stdlib.h>
 #include <string.h>
 #include "test.h"
 #include "usctest.h"
 
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 extern char *get_high_address();
 
-char *TCID="rmdir05";          /* Test program identifier.    */
+const char *TCID="rmdir05";    /* Test program identifier.    */
 int TST_TOTAL=6;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines. */
 struct stat stat_buf;          /* Stat buffer used for verification. */
index 08fb0a1..700fb6b 100644 (file)
  * 
  *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <unistd.h>
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="sbrk01";           /* Test program identifier.    */
+const char *TCID="sbrk01";             /* Test program identifier.    */
 int TST_TOTAL=2;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 6ff0fe8..3b81f93 100644 (file)
 #define FILENAME       "select01"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="select01";         /* Test program identifier.    */
+const char *TCID="select01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 8b26695..935f4b2 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="select02";         /* Test program identifier.    */
+const char *TCID="select02";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index d0959cb..225ef19 100644 (file)
 extern void setup();
 extern void cleanup();
 
-char *TCID="select03";         /* Test program identifier.    */
+const char *TCID="select03";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 50b339d..a75e88a 100644 (file)
@@ -120,7 +120,7 @@ extern void cleanup();
 
 
 
-char *TCID="setgid01";                 /* Test program identifier.    */
+const char *TCID="setgid01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index dc7bd1d..ee1c54b 100644 (file)
 #include <string.h>
 #include <signal.h>
 #include <sys/param.h>
-#include <unistd.h>
 #include <grp.h>
 
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="setgroups01";      /* Test program identifier.    */
+const char *TCID="setgroups01";        /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index e580a34..0835c66 100644 (file)
 #include "usctest.h"
 
 extern void setup();
-extern void cleanup();
+extern void cleanup() __attribute__ ((noreturn));
 
-
-
-char *TCID="setpgid01";                /* Test program identifier.    */
+const char *TCID="setpgid01";  /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index e247f6c..e4251f0 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="setregid01";       /* Test program identifier.    */
+const char *TCID="setregid01"; /* Test program identifier.    */
 int TST_TOTAL=5;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -166,7 +166,7 @@ main(int ac, char **av)
         *  Dont change either real or effective gid
         */
        gid=getgid();
-egid=getegid();
+       egid=getegid();
 
 
        /* Call setregid(2) */
index 67f3bae..05467c8 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="setreuid01";       /* Test program identifier.    */
+const char *TCID="setreuid01"; /* Test program identifier.    */
 int TST_TOTAL=5;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -166,7 +166,7 @@ main(int ac, char **av)
         *  Don't change either real or effective uid
         */
        ruid=getuid();  /* get real uid */
-euid=geteuid();                /* get effective uid */
+       euid=geteuid();         /* get effective uid */
 
 
        /* Call setreuid(2) */
index 4437108..37e18fd 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="setuid01";         /* Test program identifier.    */
+const char *TCID="setuid01";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 65576af..ee55ae1 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="setuid02";         /* Test program identifier.    */
+const char *TCID="setuid02";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 38ba72b..2a0923c 100644 (file)
 
 #include <signal.h>
 #include <errno.h>  
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
-#include <stdlib.h>
 #include <sys/wait.h>
 
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void do_test();
 void sigdfl_test();
 void update_timings();
@@ -212,7 +210,7 @@ struct ipc_t {
     struct tblock timings;
 } Ipc_info;
 
-char *TCID = "signal03";
+const char *TCID = "signal03";
 int TST_TOTAL = 5;
 extern int Tst_count;           /* count of test items completed */
 
index 46b8262..da3596e 100644 (file)
@@ -66,7 +66,6 @@
  * Restrictions:
  *
  */
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>
@@ -84,7 +83,7 @@
 #define BUF_SIZE       256
 #define MASK           0777
 
-char *TCID="stat01";           /* Test program identifier.    */
+const char *TCID="stat01";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
@@ -94,7 +93,7 @@ char nobody_uid[] = "nobody";
 struct passwd *ltpuser;
 
 void setup();                  /* Setup function for the test */
-void cleanup();                        /* Cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* Cleanup function for the test */
 
 int
 main(int ac, char **av)
index 06bf73a..745476f 100644 (file)
@@ -67,7 +67,6 @@
  * Restrictions:
  *
  */
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <sys/stat.h>
@@ -86,7 +85,7 @@
 #define NEW_MODE       0222
 #define MASK           0777
 
-char *TCID="stat02";           /* Test program identifier.    */
+const char *TCID="stat02";             /* Test program identifier.    */
 int TST_TOTAL=1;                       /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
@@ -96,7 +95,7 @@ char nobody_uid[] = "nobody";
 struct passwd *ltpuser;
 
 void setup();                  /* Setup function for the test */
-void cleanup();                        /* Cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* Cleanup function for the test */
 
 int
 main(int ac, char **av)
index 2d04ec4..dcddfd2 100644 (file)
@@ -74,9 +74,6 @@
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
@@ -106,8 +103,8 @@ char Longpathname[PATH_MAX+2];
 char High_address_node[64];
 
 struct test_case_t {           /* test case struct. to hold ref. test cond's*/
-       char *pathname;
-       char *desc;
+       const char *pathname;
+       const char *desc;
        int exp_errno;
        int (*setupfunc)();
 } Test_cases[] = {
@@ -124,13 +121,14 @@ struct test_case_t {              /* test case struct. to hold ref. test cond's*/
        { NULL, NULL, 0, no_setup }
 };
 
-char *TCID="stat03";           /* Test program identifier.    */
+const char *TCID="stat03";           /* Test program identifier.    */
 int TST_TOTAL = 6;             /* Total number of test cases. */
 extern int Tst_count;           /* Test Case counter for tst_* routines */
 int exp_enos[]={EACCES, EFAULT, ENAMETOOLONG, ENOENT, ENOTDIR, 0};
 
 void setup();                  /* Main setup function for the tests */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
+char *get_high_address(void);
 
 int
 main(int ac, char **av)
@@ -138,8 +136,8 @@ main(int ac, char **av)
        struct stat stat_buf;   /* stat structure buffer */
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
-       char *file_name;        /* ptr. for file name whose mode is modified*/
-       char *test_desc;        /* test specific error message */
+       const char *file_name;  /* ptr. for file name whose mode is modified*/
+       const char *test_desc;  /* test specific error message */
        int ind;                /* counter to test different test conditions */
 
        /* Parse standard options given to run the test. */
index ba102e3..5c0964a 100644 (file)
@@ -123,7 +123,7 @@ extern void cleanup();
 
 
 
-char *TCID="stat05";           /* Test program identifier.    */
+const char *TCID="stat05";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 90ee05a..c5fae6f 100644 (file)
 #include <string.h>
 #include <signal.h>
 #include <setjmp.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
-char *TCID="stat06";           /* Test program identifier.    */
+const char *TCID="stat06";             /* Test program identifier.    */
 int TST_TOTAL=8;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -144,9 +143,9 @@ jmp_buf sig11_recover;
 void sig11_handler(int sig);
 
 struct test_case_t {
-   char *pathname;
+   const char *pathname;
    struct stat *stbuf;
-   char *desc;
+   const char *desc;
    int exp_errno;
    int (*setupfunc)();
 } Test_cases[] = {
@@ -173,8 +172,8 @@ main(int ac, char **av)
 {
     int lc;            /* loop counter */
     const char *msg;   /* message returned from parse_opts */
-    char *fname;
-    char *desc;
+    const char *fname;
+    const char *desc;
     int ind;
     struct stat *stbuf;
     struct sigaction sa, osa;
index dcd6a74..660a6d2 100644 (file)
 *
 *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <stdio.h>
 #include <signal.h>
 #include <string.h>
 #include <fcntl.h>             /* open(2) system call */
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 void help();
 void delete_files();
 void do_EEXIST();
@@ -388,13 +387,13 @@ int creat_both(), creat_symlink(), creat_path_max(), ck_symlink(),
  */
 struct all_test_cases
 {
-    char *tcid;
+    const char *tcid;
     int test_fail;
     int errno_val;
     int pass_msg;
     int (*test_setup)();
     int (*ck_test)();
-    char *fn_arg[3];
+    const char *fn_arg[3];
     
 } test_objects[] = {
     {SYMLINK, 0, 0, 0, creat_symlink, ck_symlink, {"%bc+eFhi!k", S_FILE, NULL}},
@@ -444,11 +443,11 @@ struct all_test_cases
  */
 struct tcses
 {
-    char *tcid;
-    char *syscall;
+    const char *tcid;
+    const char *syscall;
     int test_cases;            /* number of entries in test_objects array */
     struct all_test_cases *tc_ptr;
-    char *desc;
+    const char *desc;
 } all_tcses[] = {
 
    { SYMLINK,  "symlink",  5, &test_objects[0],
@@ -486,7 +485,7 @@ struct tcses
 int TST_TOTAL;
 int TEST_RESULT;
 time_t a_time_value = 100;
-char  *TCID = NULL;
+const char  *TCID = NULL;
 char  *Selectedtests = NULL;           /* Name (tcid) of selected test cases */
 char test_msg[BUFMAX];
 char full_path[PATH_MAX+1];
@@ -593,7 +592,7 @@ main(int argc, char *argv[])
 struct tcses *get_tcs_info(ptr)
 char *ptr;
 {
-    int ctr;
+    unsigned ctr;
     struct tcses *tcs_ptr;
 
 #if ALL
@@ -2022,7 +2021,7 @@ cleanup()
  */
 void help()
 {
-    int ind;
+    unsigned ind;
 
     printf("   -T id  Determines which tests cases to execute:\n");
 
index 9fbecf2..4157cea 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="symlink02";        /* Test program identifier.    */
+const char *TCID="symlink02";  /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 9cdb74b..4d05427 100644 (file)
@@ -77,7 +77,6 @@
  *  This test should be executed by 'non-super-user' only.
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <errno.h>
@@ -99,7 +98,7 @@
 #define TEST_FILE3      "tfile_3"
 #define SYM_FILE3      "t_file/sfile_3"
 
-char *TCID="symlink03";                /* Test program identifier.    */
+const char *TCID="symlink03";          /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={ENOTDIR, ENOENT, ENAMETOOLONG, EFAULT,  EEXIST, EACCES, 0};
@@ -114,9 +113,9 @@ char Longpathname[PATH_MAX+2];
 char High_address_node[64];
 
 struct test_case_t {           /* test case struct. to hold ref. test cond's*/
-       char *file;
-       char *link;
-       char *desc;
+       const char *file;
+       const char *link;
+       const char *desc;
        int exp_errno;
        int (*setupfunc)();
 } Test_cases[] = {
@@ -133,16 +132,17 @@ struct test_case_t {              /* test case struct. to hold ref. test cond's*/
 };
 
 extern void setup();           /* Setup function for the test */
-extern void cleanup();         /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
+char *get_high_address (void);
 
 int
 main(int ac, char **av)
 {
        int lc;                 /* loop counter */
        const char *msg;        /* message returned from parse_opts */
-       char *test_file;        /* testfile name */
-       char *sym_file;         /* symbolic link file name */
-       char *test_desc;        /* test specific error message */
+       const char *test_file;  /* testfile name */
+       const char *sym_file;           /* symbolic link file name */
+       const char *test_desc;  /* test specific error message */
        int ind;                /* counter to test different test conditions */
 
        /* Parse standard options given to run the test. */
index 8272d36..c6ddd06 100644 (file)
@@ -68,7 +68,6 @@
  *
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <errno.h>
 #define  SYMFILE       "slink_file"
 #define FILE_MODE       S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-char *TCID="symlink01";                /* Test program identifier.    */
+const char *TCID="symlink01";          /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
 
 extern void setup();           /* Setup function for the test */
-extern void cleanup();         /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
 
 int
 main(int ac, char **av)
index 36aff55..3b2bbcb 100644 (file)
@@ -68,7 +68,6 @@
  *
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <sys/fcntl.h>
 #include <errno.h>
 #define  TESTFILE      "testfile"
 #define  SYMFILE       "slink_file"
 
-char *TCID="symlink02";                /* Test program identifier.    */
+const char *TCID="symlink02";          /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
 
 extern void setup();           /* Setup function for the test */
-extern void cleanup();         /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
 
 int
 main(int ac, char **av)
index a32b24b..c7df322 100644 (file)
@@ -120,7 +120,7 @@ extern void cleanup();
 
 
 
-char *TCID="sync01";           /* Test program identifier.    */
+const char *TCID="sync01";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 443df02..2173fd7 100644 (file)
@@ -66,8 +66,6 @@
  *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <fcntl.h>
 #define TEMP_FILE      "temp_file"
 #define FILE_MODE       S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
 
-char *TCID="sync01";           /* Test program identifier.    */
+const char *TCID="sync01";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 char write_buffer[BUFSIZ];     /* buffer used to write data to file*/
 int fildes;                    /* file descriptor for temporary file */
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 570dedc..c5658e2 100644 (file)
@@ -121,7 +121,7 @@ extern void cleanup();
 
 
 
-char *TCID="time01";           /* Test program identifier.    */
+const char *TCID="time01";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 827ed32..011546e 100644 (file)
@@ -67,7 +67,6 @@
  *
  */ 
 
-#include <stdio.h>
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
@@ -78,9 +77,9 @@
 #include "usctest.h"
 
 extern void setup();           /* setup function for the test */
-extern void cleanup();         /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));/* cleanup function for the test */
 
-char *TCID="time01";           /* Test program identifier.    */
+const char *TCID="time01";             /* Test program identifier.    */
 int TST_TOTAL = 1;             /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
index 0d8d1d0..a1bd1d8 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="times01";          /* Test program identifier.    */
+const char *TCID="times01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 8250464..1dae36c 100644 (file)
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "times02";
+const char *TCID = "times02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 int exp_enos[]={EFAULT, 0};
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int argc, char **argv)
 {
        int lc;                         /* loop counter */
index a388c77..4e3fb56 100644 (file)
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "times01";
+const char *TCID = "times01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 int exp_enos[]={0};
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int argc, char **argv)
 {
        const char *msg;                /* message returned from parse_opts */
 
        struct tms buf1, buf2;
        time_t start_time, end_time;
-       int i, pid1, pid2, status, fail=0;
+       int i, pid2, status, fail=0;
 
        /* parse standard options */
        if ((msg = parse_opts(argc, argv, (option_t *)NULL, NULL)) !=
index d8dc1b6..1e29316 100644 (file)
 #define FILE_SIZE      1024                    /* test file size */
 #define TRUNC_LEN      256                     /* truncation length */
 
-char *TCID="truncate01";       /* Test program identifier.    */
+const char *TCID="truncate01"; /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
 
 void setup();                  /* setup function for the test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index b6e535c..4ba8029 100644 (file)
@@ -86,7 +86,7 @@
 #define TRUNC_LEN1     256                     /* truncation length */
 #define TRUNC_LEN2     512                     /* truncation length */
 
-char *TCID="truncate02";       /* Test program identifier.    */
+const char *TCID="truncate02"; /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fd;                                /* file descriptor of testfile */
@@ -94,7 +94,7 @@ char tst_buff[BUF_SIZE];      /* buffer to hold testfile contents */
 int exp_enos[]={0};
 
 void setup();                  /* setup function for the test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));                  /* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 655c9e3..c3f09fb 100644 (file)
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="ulimit01";         /* Test program identifier.    */
+const char *TCID="ulimit01";   /* Test program identifier.    */
 int TST_TOTAL=6;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 04b3851..fb86f0d 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="umask01";          /* Test program identifier.    */
+const char *TCID="umask01";            /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index f7d7c3b..9a1c61c 100644 (file)
  *     None
  */
 
-#include <stdio.h>
+#include <sys/stat.h>
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "umask02";
+const char *TCID = "umask02";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int argc, char **argv)
 {
        int lc;                         /* loop counter */
index 8d032ca..fbe2d5c 100644 (file)
  *     None
  */
 
-#include <stdio.h>
 #include "test.h"
 #include "usctest.h"
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 
-char *TCID = "umask01";
+const char *TCID = "umask01";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 char filname[40];
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
+int
 main(int argc, char **argv)
 {
        int lc;
index e2f8f8b..36b1667 100644 (file)
@@ -121,7 +121,7 @@ extern void cleanup();
 
 
 
-char *TCID="uname01";          /* Test program identifier.    */
+const char *TCID="uname01";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 63e97df..3aae0cf 100644 (file)
@@ -123,7 +123,7 @@ void create_file();
 
 
 
-char *TCID="unlink05";                 /* Test program identifier.    */
+const char *TCID="unlink05";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 3d06903..a62a268 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <unistd.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
 void create_file();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
-char *TCID="unlink06";                 /* Test program identifier.    */
+const char *TCID="unlink06";           /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 889b609..1331096 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
-#include <unistd.h>
 #include <sys/param.h>         /* for PATH_MAX */
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 extern char *get_high_address();
 
-char *TCID="unlink07";         /* Test program identifier.    */
+const char *TCID="unlink07";           /* Test program identifier.    */
 int TST_TOTAL=6;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -139,8 +138,8 @@ char Longpathname[PATH_MAX+2];
 char High_address[64];
 
 struct test_case_t {
-   char *pathname;
-   char *desc;
+   const char *pathname;
+   const char *desc;
    int exp_errno;
    int (*setupfunc)();
 } Test_cases[] = {
@@ -167,8 +166,8 @@ main(int ac, char **av)
 {
     int lc;            /* loop counter */
     const char *msg;           /* message returned from parse_opts */
-    char *fname;
-    char *desc;
+    const char *fname;
+    const char *desc;
     int ind;
     
     /***************************************************************
index a426aa0..e793b46 100644 (file)
 #include <sys/stat.h>
 #include <errno.h>
 #include <signal.h>
-#include <unistd.h>
 #include <string.h>
 #include "test.h"
 #include "usctest.h"
 
 void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
 
 
 
-char *TCID="unlink08";         /* Test program identifier.    */
+const char *TCID="unlink08";           /* Test program identifier.    */
 int TST_TOTAL=3;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
@@ -136,8 +135,8 @@ int dir_setup();
 int no_setup();
 
 struct test_case_t {
-   char *pathname;
-   char *desc;
+   const char *pathname;
+   const char *desc;
    int (*setupfunc)();
    int exp_ret;                /* -1 means error, 0 means != -1 */
    int exp_errno;
@@ -163,8 +162,8 @@ main(int ac, char **av)
 {
     int lc;            /* loop counter */
     const char *msg;   /* message returned from parse_opts */
-    char *fname;
-    char *desc;
+    const char *fname;
+    const char *desc;
     int ind;
     
     /***************************************************************
index 41e48c4..2792ce0 100644 (file)
  *
  */
 
-#include <stdio.h>
 #include <sys/types.h>
 #include <errno.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <signal.h>
@@ -82,7 +80,7 @@
 #include "test.h"
 #include "usctest.h"
 
-char *TCID="vfork01";          /* Test program identifier.    */
+const char *TCID="vfork01";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
@@ -104,7 +102,7 @@ struct stat Stat_cwd_Pbuf;
 struct stat Stat_cwd_Cbuf;
 
 void setup();                  /* Main setup function of test */
-void cleanup();                        /* cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* cleanup function for the test */
 
 int
 main(int ac, char **av)
index 8b4f41b..a7de67a 100644 (file)
@@ -122,7 +122,7 @@ extern void cleanup();
 
 
 
-char *TCID="wait02";           /* Test program identifier.    */
+const char *TCID="wait02";             /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 0d307e2..51f71da 100644 (file)
 #include <sys/resource.h>
 #include <sys/wait.h>
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID= "wait401()";
+const char *TCID= "wait401()";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index 43a5c22..30f7500 100644 (file)
 #endif
 #endif
 
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 void setup(void);
 
-char *TCID= "wait402()";
+const char *TCID= "wait402()";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 int exp_enos[] = {10, 0};
 
+int
 main(int ac, char **av)
 {
        int lc;                         /* loop counter */
index 0fae9ae..355190a 100644 (file)
@@ -127,7 +127,7 @@ extern void cleanup();
 
 
 
-char *TCID="write01";          /* Test program identifier.    */
+const char *TCID="write01";    /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test cases. */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
index 1ee10fd..a5675bd 100644 (file)
  */
 
 #include <errno.h>
-#include <stdio.h>
 #include "test.h"
 #include "usctest.h"
+#include <fcntl.h>
 
-char *TCID = "write02()";
+const char *TCID = "write02()";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
-void cleanup(void);
+void cleanup(void) __attribute__ ((noreturn));
 void setup(void);
 
 char pfiln[40] = "";
 
+int
 main(int argc, char **argv)
 {
        int lc;                         /* loop counter */
@@ -73,7 +74,7 @@ main(int argc, char **argv)
        char pwbuf[BUFSIZ + 1];
 
        /* parse standard options */
-       if (msg = parse_opts(argc, argv, (option_t *) NULL, NULL)) {
+       if ((msg = parse_opts(argc, argv, (option_t *) NULL, NULL))) {
                tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
                /*NOTREACHED*/
        }
@@ -86,7 +87,6 @@ main(int argc, char **argv)
                /* reset Tst_count in case we are looping */
                Tst_count = 0;
 
-block1:
                tst_resm(TINFO, "Block 1: test to see write() returns proper "
                         "write count");
 
index 5343c64..7d6f1f9 100644 (file)
@@ -47,7 +47,6 @@
  *     NONE
  */
 
-#include <unistd.h>
 #include <string.h>
 #include <fcntl.h>
 #include <errno.h>
 /* 0 terminated list of expected errnos */
 int exp_enos[] = {14,0};
 
-char *TCID = "write03";
+const char *TCID = "write03";
 int TST_TOTAL = 1;
 extern int Tst_count;
 
 void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
 
 int fd = -1;
 char filename[100];
 
+int
 main(int argc, char **argv)
 {
        int lc;                         /* loop counter */
@@ -90,7 +90,6 @@ main(int argc, char **argv)
                /* reset Tst_count in case we are looping */
                Tst_count = 0;
 
-block1:
                tst_resm(TINFO, "Enter Block 1: test to check if write "
                         "corrupts the file when write fails");
 
index 4add280..3354558 100644 (file)
@@ -50,8 +50,6 @@
 
 #include <sys/mman.h>
 #include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 
 #include "test.h"
index f9f05cc..1cbf62d 100644 (file)
@@ -40,6 +40,8 @@
  */
 
 #include "test.h"
+#include <assert.h>
+#include <sys/wait.h>
 
 static pid_t pid;
 
index 3e662a3..0e72464 100644 (file)
@@ -7,12 +7,15 @@
 #ifndef _PTHREAD_TEST_H_
 #define _PTHREAD_TEST_H_
 
-#include "pthread.h"
-#include "sched.h"
-#include "semaphore.h"
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
 #include <stdio.h>
-#include <windows.h>
+#include <unistd.h>
+#include <stdlib.h>
 #include <errno.h>
+#include <assert.h>
+#include <windows.h>
 
 /* #define assert(x) do { fprint (stderr, "assertion failed\n"); exit(1) } while (0) */