+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.
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
/* $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);
/*
* 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 */
* 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, ...);
* 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;
* 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>
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#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__
*/
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 */
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#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 */
* 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 */
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",
* 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() */
* 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"
-#include <stdio.h>
#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
#include <signal.h>
#include "test.h"
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#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 */
#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 */
*
*/
-#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)
*
*/
-#include <stdio.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
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[] = {
{ 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 */
-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 */
#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 */
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;
#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 */
* 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
#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 */
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;
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)
* 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;
#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){
*
*/
-#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)
#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};
-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 */
char fname[255];
int fd, uid, gid;
-char *buf = "davef";
+const char *buf = "davef";
int
main(int ac, char **av)
* 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;
struct test_case_t {
int *fd;
- char *type;
+ const char *type;
} TC[] = {
/* file descriptor for a regular file */
{&newfd, "file"},
{&pipefildes[0], "pipe"}
};
+int
main(int ac, char **av)
{
* 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 */
-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 */
* 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;
{filename, MODE2, functest2}
};
+int
main(int ac, char **av)
{
int i;
*/
#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 */
#define FMODE 0444
void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
+int
main(int ac, char **av)
{
struct stat statbuf;
-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 */
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 */
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 */
#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 */
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 */
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 */
-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 */
-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 */
-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 */
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#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 */
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)
-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 */
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
-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 */
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)
* 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;
* 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;
char filen[40];
+int
main(int ac, char **av)
{
int pid, npid, sig, nsig, exno, nexno, status;
#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;
#define MODES S_IRWXU
+int
main(int ac, char **av)
{
int lc; /* loop counter */
#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;
-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 */
char fname[255];
int fd;
-char *buf = "davef";
+const char *buf = "davef";
int
main(int ac, char **av)
-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 */
-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 */
-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 */
-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 */
-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 */
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#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 */
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
&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)
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
*/
int
-do_exec(char *prog, int fd, char *tcd)
+do_exec(const char *prog, int fd, const char *tcd)
{
int pid;
char pidname[STRSIZE];
* 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;
#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 */
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"
&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)
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
*/
int
-do_exec(char *prog, int fd, char *tcd)
+do_exec(const char *prog, int fd, const char *tcd)
{
int pid;
char pidname[STRSIZE];
int fd, rc;
int status;
- extern char *optarg;
- extern int optind;
-
fd = atoi(arg);
rc = fcntl(fd, F_GETFD, &status);
#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 */
-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 */
-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 */
#include <string.h>
#include <signal.h>
#include <fcntl.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "test.h"
-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 */
* 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;
* 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;
*
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#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 */
#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. */
* 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;
* 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 */
* 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 */
void
cleanup()
{
- int nf;
-
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.
* 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;
* 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;
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#include <fcntl.h>
-#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
-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"
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,
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 */
* 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>
#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 */
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)
*
*/
-#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)
* 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>
#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 */
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)
-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 */
char fname[255];
int fd;
-char *buf = "davef";
+const char *buf = "davef";
int
main(int ac, char **av)
#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)
*
*/
-#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)
* 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>
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)();
{ 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;
-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 */
-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 */
-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 */
#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 */
#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 */
************************************************************/
-#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#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 */
-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 */
-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 */
-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 */
#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 */
}
/* child */
-block1:
tst_resm(TINFO, "Enter block 1");
fail = 0;
if ((pgid_0 = getpgid(0)) < 0) {
}
tst_resm(TINFO, "Exit block 1");
-block2:
tst_resm(TINFO, "Enter block 2");
fail = 0;
}
tst_resm(TINFO, "Exit block 2");
-block3:
tst_resm(TINFO, "Enter block 3");
fail = 0;
}
tst_resm(TINFO, "Exit block 3");
-block4:
tst_resm(TINFO, "Enter block 4");
fail = 0;
#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;
{&pgid_1, ESRCH}
};
+int
main(int ac, char **av)
{
int lc; /* loop counter */
-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 */
-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 */
* None.
*/
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
#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 */
-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 */
#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;
-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 */
#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 */
#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 */
#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 */
#include <errno.h>
#include <fcntl.h>
#include <string.h>
-#include <stdlib.h>
#include "test.h"
#include "usctest.h"
/*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 */
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. */
#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;
#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){
#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;
#define TEST_SIG SIGKILL
+int
main(int ac, char **av)
{
int lc; /* loop counter */
#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 */
#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 */
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;
#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 */
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)();
{
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;
/***************************************************************
#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
#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 */
#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 */
#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 */
#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 */
#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 */
* 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)
* 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="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 */
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)
* 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)
* 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 */
* 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>
#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};
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[] = {
};
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)
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. */
-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 */
#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 */
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <unistd.h>
#include "test.h"
#include "usctest.h"
-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 */
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#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 */
#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;
* 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>
#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 */
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)
* 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>
#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 */
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);
* 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>
#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 */
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);
* 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>
#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 */
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
* 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>
#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};
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)
* 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>
#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};
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)
* 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>
#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};
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)
* None.
*/
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#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 */
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
* None.
*/
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#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 */
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
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#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 */
* RESTRICTIONS
* None
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <test.h>
#include <usctest.h>
-char *TCID = "open02";
+const char *TCID = "open02";
int TST_TOTAL = 1;
extern int Tst_count;
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
*/
-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 */
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
-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},
-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 */
* 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 */
* 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;
* 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 */
* 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 */
* 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
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 */
* RESTRICTIONS:
* None.
*/
-#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/wait.h>
#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 */
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)
-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;
* 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;
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];
#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;
* 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)
-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 */
* This test should be executed by 'non-super-user' only.
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
#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};
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)();
};
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)
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 */
#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 */
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[] = {
-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 */
*/
#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 */
*/
#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 */
#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 */
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <unistd.h>
#include <errno.h>
#include <string.h>
-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 */
#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. */
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#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 */
#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 */
#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 */
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 */
-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 */
#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 */
#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 */
-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 */
* Dont change either real or effective gid
*/
gid=getgid();
-egid=getegid();
+ egid=getegid();
/* Call setregid(2) */
-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 */
* 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) */
#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 */
-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 */
#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();
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 */
* Restrictions:
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#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};
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)
* Restrictions:
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#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};
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)
*
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
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[] = {
{ 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)
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. */
-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 */
#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 */
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[] = {
{
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;
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#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();
*/
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}},
*/
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],
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];
struct tcses *get_tcs_info(ptr)
char *ptr;
{
- int ctr;
+ unsigned ctr;
struct tcses *tcs_ptr;
#if ALL
*/
void help()
{
- int ind;
+ unsigned ind;
printf(" -T id Determines which tests cases to execute:\n");
-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 */
* This test should be executed by 'non-super-user' only.
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
#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};
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[] = {
};
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. */
*
*/
-#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)
*
*/
-#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)
-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 */
* 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)
-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 */
*
*/
-#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#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};
-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 */
#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 */
#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)) !=
#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)
#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 */
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)
#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 */
-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 */
* 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 */
* 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;
-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 */
-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 */
#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 */
#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 */
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[] = {
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *fname;
- char *desc;
+ const char *fname;
+ const char *desc;
int ind;
/***************************************************************
#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 */
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;
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *fname;
- char *desc;
+ const char *fname;
+ const char *desc;
int ind;
/***************************************************************
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
#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};
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)
-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 */
#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 */
#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 */
-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 */
*/
#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 */
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*/
}
/* 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");
* 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 */
/* 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");
#include <sys/mman.h>
#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "test.h"
*/
#include "test.h"
+#include <assert.h>
+#include <sys/wait.h>
static pid_t pid;
#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) */