Perform more C warning fixup on all C source files and headers.

This commit is contained in:
Christopher Faylor 2003-01-24 01:09:40 +00:00
parent 1905b7393c
commit 31d7abadfe
203 changed files with 514 additions and 612 deletions

View File

@ -1,3 +1,7 @@
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.

View File

@ -50,7 +50,6 @@ INSTALL_PROGRAM:=@INSTALL_PROGRAM@
CC:=@CC@
# FIXME: Which is it, CC or CC_FOR_TARGET?
CC_FOR_TARGET:=$(CC)
#CFLAGS:=@CFLAGS@ -MD -Wno-write-strings $(TESTSUP_INCLUDES)
ifneq (,$(CFLAGS))
override CFLAGS+= -MD $(TESTSUP_INCLUDES)
else

View File

@ -33,4 +33,4 @@
/* $Id$ */
int search_path(char *cmd, char *res_path, int access_mode, int fullpath);
int search_path(const char *cmd, const char *res_path, int access_mode, int fullpath);

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
*
*.
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
@ -35,9 +35,26 @@
#ifndef __TEST_H__
#define __TEST_H__
#define execve execve_foo
#define execv execv_foo
#define execvp execvp_foo
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#undef execvp
#undef execv
#undef execve
int execve(const char *, const char * const [], char * const *);
int execv(const char *, const char * const []);
int execvp(const char *, const char * const []);
/* CGF: Avoid compilation warnings for undefined functions */
extern int setregid (gid_t, gid_t);
int setreuid (uid_t, uid_t);
int gethostid (void);
#define TPASS 0 /* Test passed flag */
#define TFAIL 1 /* Test failed flag */
@ -190,7 +207,7 @@ extern void tst_clear_error();
* The following prototypes are needed to remove compile errors
* on IRIX systems when compiled with -n32 and -64.
*/
extern void tst_res(int ttype, char *fname, const char *arg_fmt, ...);
extern void tst_res(int ttype, const char *fname, const char *arg_fmt, ...);
extern void tst_resm(int ttype, const char *arg_fmt, ...);
extern void tst_brk(int ttype, char *fname, void (*func)(),
const char *arg_fmt, ...);

View File

@ -115,7 +115,7 @@
* 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;

View File

@ -29,10 +29,6 @@
* 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>

View File

@ -69,12 +69,10 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#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__

View File

@ -101,7 +101,7 @@ char **argv;
*/
int
search_path(cmd, res_path, access_mode, fullpath)
char *cmd; /* The requested filename */
const char *cmd; /* The requested filename */
char *res_path; /* The resulting path or error mesg */
int access_mode; /* the mode used by access(2) */
int fullpath; /* if set, cwd will be prepended to all non-full paths */

View File

@ -106,11 +106,7 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#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 */
@ -154,14 +150,14 @@
static void check_env();
static void tst_condense(int tnum, int ttype, char *tmesg);
static void tst_print(char *tcid, int tnum, int trange, int ttype, const char *tmesg);
static void cat_file(char *filename);
static void cat_file(const char *filename);
/*
* Define some static/global variables.
*/
static FILE *T_out = NULL; /* tst_res() output file descriptor */
static char *File; /* file whose contents is part of result */
static const char *File; /* file whose contents is part of result */
static int T_exitval = 0; /* exit value used by tst_exit() */
static int T_mode = VERBOSE; /* flag indicating print mode: VERBOSE, */
/* CONDENSE, NOPASS, DISCARD */
@ -216,7 +212,7 @@ char *TESTDIR = NULL;
* eventually get here to print the results.
*/
void
tst_res(int ttype, char *fname, const char *arg_fmt, ...)
tst_res(int ttype, const char *fname, const char *arg_fmt, ...)
{
int i;
char tmesg[USERMESG]; /* expanded message */
@ -329,7 +325,7 @@ tst_res(int ttype, char *fname, const char *arg_fmt, ...)
static void
tst_condense(int tnum, int ttype, char *tmesg)
{
char *file;
const char *file;
#if DEBUG
printf("IN tst_condense: tcid = %s, tnum = %d, ttype = %d, tmesg = %s\n",
@ -802,7 +798,7 @@ tst_brkloopm(int ttype, void (*func)(), const char *arg_fmt, ...)
* cat_file() - Print the contents of a file to standard out.
*/
static void
cat_file(char *filename)
cat_file(const char *filename)
{
FILE *fp; /* file pointer */
int b_read; /* number of bytes read with read() */

View File

@ -63,11 +63,7 @@
* 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"

View File

@ -1,7 +1,4 @@
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include "test.h"

View File

@ -118,8 +118,6 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#include <string.h>
#include <sys/unistd.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
@ -128,9 +126,9 @@
#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 */

View File

@ -102,18 +102,17 @@
#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 */

View File

@ -66,8 +66,6 @@
*
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
@ -83,12 +81,12 @@
#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)

View File

@ -76,9 +76,7 @@
*
*/
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@ -107,9 +105,9 @@ char Longpathname[PATH_MAX+2];
char High_address_node[64];
struct test_case_t { /* test case structure */
char *pathname;
const char *pathname;
int a_mode;
char *desc;
const char *desc;
int exp_errno;
int (*setupfunc)();
} Test_cases[] = {
@ -124,21 +122,22 @@ struct test_case_t { /* test case structure */
{ NULL, 0, NULL, 0, no_setup }
};
char *TCID="access03"; /* Test program identifier. */
const char *TCID="access03"; /* Test program identifier. */
int TST_TOTAL=8; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={EACCES, EFAULT, EINVAL, ENOENT, ENAMETOOLONG, 0};
void setup(); /* Main setup function of test */
void cleanup(); /* cleanup function for the test */
void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
char *get_high_address (void);
int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
char *file_name; /* name of the testfile */
char *test_desc; /* test specific message */
const char *file_name; /* name of the testfile */
const char *test_desc; /* test specific message */
int access_mode; /* specified access mode for testfile */
int ind; /* counter for testcase looping */

View File

@ -120,7 +120,7 @@ extern void cleanup();
char *TCID="alarm01"; /* Test program identifier. */
const char *TCID="alarm01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -98,12 +98,12 @@
#include "usctest.h" /* required for usctest */
void setup();
void cleanup();
void cleanup(void) __attribute__((noreturn));
void alarm_received();
char *TCID="alarm02"; /* Test program identifier. */
const char *TCID="alarm02"; /* Test program identifier. */
int TST_TOTAL=3; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_ * routines */
@ -122,7 +122,7 @@ main(int ac, char **av)
const char *msg; /* message returned from parse_opts */
/* Parameters for alarm test */
char *buf[] = { "-1", "ULONG_MAX", "ULONG_MAX+1"};
const char *buf[] = { "-1", "ULONG_MAX", "ULONG_MAX+1"};
unsigned long int sec[] = {-1, ULONG_MAX, ULONG_MAX+1};
int exp[] = {0,0,0};
int i;

View File

@ -99,10 +99,10 @@
#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 */

View File

@ -62,8 +62,6 @@
* None.
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
@ -73,13 +71,13 @@
#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

View File

@ -95,7 +95,6 @@
#include <sys/stat.h>
#include <sys/signal.h>
#include <errno.h>
#include <stdlib.h>
#include "test.h"
#include "usctest.h"
@ -116,10 +115,10 @@
char *dp; /* pointer to area of memory */
void setup();
void cleanup();
void cleanup(void) __attribute__((noreturn));
int testrun(int flag, int bytes, int ti);
char *TCID="asyncio02"; /* Test program identifier. */
const char *TCID="asyncio02"; /* Test program identifier. */
int TST_TOTAL=6; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* variable used to turn off tst_res buffering */
@ -128,7 +127,7 @@ extern int errno;
int exp_enos[]={0}; /* Array of expected errnos */
char mesg[150];
char *filename; /* name of the temporary file */
const char *filename; /* name of the temporary file */
char *Progname;
int Open_flags;

View File

@ -119,14 +119,13 @@ extern void setup();
extern void cleanup();
char *TCID="chdir02"; /* Test program identifier. */
const char *TCID="chdir02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={0, 0};
char *dirs[2] = { "/", "/tmp" };
const char *dirs[2] = { "/", "/tmp" };
int
main(int ac, char **av)

View File

@ -54,13 +54,12 @@
* NONE
*/
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#include <test.h>
#include <usctest.h>
char *TCID = "chdir02";
const char *TCID = "chdir02";
int TST_TOTAL = 3;
extern int Tst_count;
@ -97,14 +96,14 @@ int flag;
#define FAILED 1
void setup(void);
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
int
main(int ac, char **av)
{
int lc; /* loop counter */
int i;
const char *msg; /* message returned from parse_opts */
struct stat statbuf;
/* parse standard options */
if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){

View File

@ -67,7 +67,6 @@
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
@ -81,14 +80,14 @@
#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)

View File

@ -119,16 +119,16 @@
#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};

View File

@ -122,7 +122,7 @@ extern void cleanup();
char *TCID="chown01"; /* Test program identifier. */
const char *TCID="chown01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@ -130,7 +130,7 @@ int exp_enos[]={0, 0};
char fname[255];
int fd, uid, gid;
char *buf = "davef";
const char *buf = "davef";
int
main(int ac, char **av)

View File

@ -56,15 +56,16 @@
* None
*/
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "test.h"
#include "usctest.h"
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
void setup(void);
char *TCID = "close01()";
const char *TCID = "close01()";
int TST_TOTAL = 2;
extern int Tst_count;
@ -76,7 +77,7 @@ int pipefildes[2];
struct test_case_t {
int *fd;
char *type;
const char *type;
} TC[] = {
/* file descriptor for a regular file */
{&newfd, "file"},
@ -85,6 +86,7 @@ struct test_case_t {
{&pipefildes[0], "pipe"}
};
int
main(int ac, char **av)
{

View File

@ -53,20 +53,21 @@
* 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 */

View File

@ -122,7 +122,7 @@ extern void cleanup();
char *TCID="close08"; /* Test program identifier. */
const char *TCID="close08"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -47,18 +47,18 @@
* None
*/
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include "test.h"
#include "usctest.h"
void setup(void);
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
void functest1(void);
void functest2(void);
char *TCID = "creat01";
const char *TCID = "creat01";
int TST_TOTAL = 2;
extern int Tst_count;
@ -79,6 +79,7 @@ struct test_case_t {
{filename, MODE2, functest2}
};
int
main(int ac, char **av)
{
int i;

View File

@ -44,13 +44,13 @@
*/
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "test.h"
#include "usctest.h"
char *TCID = "creat03"; /* Test program identifier */
const char *TCID = "creat03"; /* Test program identifier */
int TST_TOTAL = 1; /* Total number of test cases */
extern int Tst_count; /* Test case counter */
@ -58,8 +58,9 @@ char pfilname[40] = "";
#define FMODE 0444
void setup(void);
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
int
main(int ac, char **av)
{
struct stat statbuf;

View File

@ -122,7 +122,7 @@ extern void cleanup();
char *TCID="creat09"; /* Test program identifier. */
const char *TCID="creat09"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -121,7 +121,7 @@ extern void setup();
extern void cleanup();
char *TCID="dup01"; /* Test program identifier. */
const char *TCID="dup01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -120,7 +120,7 @@ extern void setup();
extern void cleanup();
char *TCID="dup02"; /* Test program identifier. */
const char *TCID="dup02"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -110,14 +110,13 @@
#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 */

View File

@ -121,7 +121,7 @@ extern void setup();
extern void cleanup();
char *TCID="dup04"; /* Test program identifier. */
const char *TCID="dup04"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -121,7 +121,7 @@
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 */

View File

@ -124,7 +124,7 @@ extern void cleanup();
char *TCID="execl01"; /* Test program identifier. */
const char *TCID="execl01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* used to turn off buffering in tst_ routines */

View File

@ -124,7 +124,7 @@ extern void cleanup();
char *TCID="execle01"; /* Test program identifier. */
const char *TCID="execle01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* used to turn off buffering in tst_ routines */

View File

@ -124,7 +124,7 @@ extern void cleanup();
char *TCID="execlp01"; /* Test program identifier. */
const char *TCID="execlp01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* used to turn off buffering in tst_ routines */

View File

@ -110,7 +110,6 @@
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
@ -120,11 +119,9 @@
#include "usctest.h"
extern void setup();
extern void cleanup();
void cleanup();
char *TCID="execv01"; /* Test program identifier. */
const char *TCID="execv01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* used to turn off buffering in tst_ routines */
@ -133,7 +130,7 @@ int exp_enos[]={0, 0}; /* Zero terminated list of expected errnos */
int pid; /* process id from fork */
int status; /* status returned from waitpid */
char *args[2]={"/usr/bin/test", 0}; /* argument list for execv call */
const char * const args[2]={"/usr/bin/test", 0}; /* argument list for execv call */
int
main(int ac, char **av)

View File

@ -124,7 +124,7 @@ extern void cleanup();
char *TCID="execve01"; /* Test program identifier. */
const char *TCID="execve01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* used to turn off buffering in tst_ routines */
@ -133,7 +133,7 @@ int exp_enos[]={0, 0}; /* Zero terminated list of expected errnos */
int pid; /* process id from fork */
int status; /* status returned from waitpid */
char *args[2]={"/usr/bin/test", 0}; /* argument list for execve call */
const char *const args[2]={"/usr/bin/test", 0}; /* argument list for execve call */
extern char **environ; /* pointer to this processes env, to pass along */
int

View File

@ -124,7 +124,7 @@ extern void cleanup();
char *TCID="execvp01"; /* Test program identifier. */
const char *TCID="execvp01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* used to turn off buffering in tst_ routines */
@ -133,7 +133,7 @@ int exp_enos[]={0, 0}; /* Zero terminated list of expected errnos */
int pid; /* process id from fork */
int status; /* status returned from waitpid */
char *args[2]={"/usr/bin/test", 0}; /* argument list for execvp call */
const char *const args[2]={"/usr/bin/test", 0}; /* argument list for execvp call */
int
main(int ac, char **av)

View File

@ -38,19 +38,21 @@
* 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;

View File

@ -41,17 +41,17 @@
* None
*/
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/wait.h>
#include "test.h"
#include "usctest.h"
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
void setup(void);
char *TCID = "exit02";
const char *TCID = "exit02";
int TST_TOTAL = 1;
extern int Tst_count;
@ -61,6 +61,7 @@ extern int Tst_count;
char filen[40];
int
main(int ac, char **av)
{
int pid, npid, sig, nsig, exno, nexno, status;

View File

@ -63,10 +63,10 @@
#include <fcntl.h>
#include <string.h>
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
void setup(void);
char *TCID = "fchdir01";
const char *TCID = "fchdir01";
int TST_TOTAL = 1;
extern int Tst_count;
@ -77,6 +77,7 @@ const char *TEST_DIR = "alpha";
#define MODES S_IRWXU
int
main(int ac, char **av)
{
int lc; /* loop counter */

View File

@ -60,15 +60,16 @@
#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;

View File

@ -119,7 +119,7 @@ extern void cleanup();
char *TCID="fchmod01"; /* Test program identifier. */
const char *TCID="fchmod01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@ -127,7 +127,7 @@ int exp_enos[]={0, 0};
char fname[255];
int fd;
char *buf = "davef";
const char *buf = "davef";
int
main(int ac, char **av)

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fchown01"; /* Test program identifier. */
const char *TCID="fchown01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fcntl02"; /* Test program identifier. */
const char *TCID="fcntl02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fcntl03"; /* Test program identifier. */
const char *TCID="fcntl03"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fcntl04"; /* Test program identifier. */
const char *TCID="fcntl04"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fcntl05"; /* Test program identifier. */
const char *TCID="fcntl05"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -132,11 +132,8 @@
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#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>
@ -146,10 +143,10 @@
#include "search_path.h"
void setup();
void cleanup();
void cleanup(void) __attribute__((noreturn));
void help();
char *TCID="fcntl07"; /* Test program identifier. */
const char *TCID="fcntl07"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@ -170,10 +167,10 @@ int stat_loc; /* for waitpid() */
int file_fd, pipe_fds[2];
/* file descriptors for a file and a system pipe */
#define DEFAULT_FILE "DefaultFileName"
char *File1 = DEFAULT_FILE;
const char *File1 = DEFAULT_FILE;
#define DEFAULT_SUBPROG "test_open"
char *openck = DEFAULT_SUBPROG; /* support program name to check for open FD */
const char *openck = DEFAULT_SUBPROG; /* support program name to check for open FD */
char subprog_path[_POSIX_PATH_MAX]; /* path to exec "openck" with */
#define STRSIZE 255
@ -181,13 +178,13 @@ int *testfds[] = {
&file_fd, &pipe_fds[1], 0
};
char *testfdtypes[] = {
const char *testfdtypes[] = {
"regular file",
"write side of system pipe",
};
int test_open(char *arg);
int do_exec(char *prog, int fd, char *tcd);
int test_open(const char *arg);
int do_exec(const char *prog, int fd, const char *tcd);
int
main(int ac, char **av)
@ -197,7 +194,7 @@ main(int ac, char **av)
int exec_return; /* return from do_exec */
int **tcp; /* testcase pointer (pointer to FD) */
char **tcd; /* testcase description pointer */
const char **tcd; /* testcase description pointer */
/***************************************************************
* parse standard options, and exit if there is an error
@ -358,7 +355,7 @@ help()
*/
int
do_exec(char *prog, int fd, char *tcd)
do_exec(const char *prog, int fd, const char *tcd)
{
int pid;
char pidname[STRSIZE];
@ -400,7 +397,7 @@ do_exec(char *prog, int fd, char *tcd)
* It tests if a file descriptor is open and exits accordingly.
*/
int
test_open(char *arg)
test_open(const char *arg)
{
int fd, rc;
int status;

View File

@ -134,8 +134,6 @@
#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>
@ -145,10 +143,10 @@
#include "search_path.h"
void setup();
void cleanup();
void cleanup(void) __attribute__((noreturn));
void help();
char *TCID="fcntl07B"; /* Test program identifier. */
const char *TCID="fcntl07B"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@ -168,11 +166,11 @@ int stat_loc; /* for waitpid() */
int npipe_fd;
/* file descriptors for a named pipe */
#define DEFAULT_FILE "DefaultFileName"
char *File1 = DEFAULT_FILE;
const char *File1 = DEFAULT_FILE;
#define DEFAULT_SUBPROG "test_open"
char *openck = DEFAULT_SUBPROG; /* support program name to check for open FD */
char subprog_path[_POSIX_PATH_MAX]; /* path to exec "openck" with */
const char *openck = DEFAULT_SUBPROG; /* support program name to check for open FD */
const char subprog_path[_POSIX_PATH_MAX];/* path to exec "openck" with */
#define STRSIZE 255
#define FIFONAME "FiFo"
@ -180,12 +178,12 @@ int *testfds[] = {
&npipe_fd, 0
};
char *testfdtypes[] = {
const char *testfdtypes[] = {
"named pipe"
};
int test_open(char *arg);
int do_exec(char *prog, int fd, char *tcd);
int do_exec(const char *prog, int fd, const char *tcd);
int
main(int ac, char **av)
@ -195,7 +193,7 @@ main(int ac, char **av)
int exec_return; /* return from do_exec */
int **tcp; /* testcase pointer (pointer to FD) */
char **tcd; /* testcase description pointer */
const char **tcd; /* testcase description pointer */
/***************************************************************
* parse standard options, and exit if there is an error
@ -356,7 +354,7 @@ help()
*/
int
do_exec(char *prog, int fd, char *tcd)
do_exec(const char *prog, int fd, const char *tcd)
{
int pid;
char pidname[STRSIZE];
@ -403,9 +401,6 @@ test_open(char *arg)
int fd, rc;
int status;
extern char *optarg;
extern int optind;
fd = atoi(arg);
rc = fcntl(fd, F_GETFD, &status);

View File

@ -119,13 +119,13 @@
#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 */

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fcntl09"; /* Test program identifier. */
const char *TCID="fcntl09"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fcntl10"; /* Test program identifier. */
const char *TCID="fcntl10"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -119,7 +119,6 @@
#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "test.h"
@ -134,7 +133,7 @@ extern void cleanup();
char *TCID="fork01"; /* Test program identifier. */
const char *TCID="fork01"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -40,21 +40,18 @@
* 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;

View File

@ -39,20 +39,21 @@
* 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;

View File

@ -107,10 +107,8 @@
*
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <sys/param.h>
@ -119,7 +117,7 @@
#include "test.h"
#include "usctest.h"
char *TCID="fork04"; /* Test program identifier. */
const char *TCID="fork04"; /* Test program identifier. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@ -130,7 +128,7 @@ extern int Tst_count; /* Test Case counter for tst_* routines */
#define ENV_NOT_SET "getenv() does not find variable set"
/* list of environment variables to test */
char *environ_list[] = {"TERM","NoTSetzWq","TESTPROG"};
const char *environ_list[] = {"TERM","NoTSetzWq","TESTPROG"};
#define NUMBER_OF_ENVIRON sizeof(environ_list)/sizeof(char *)
int TST_TOTAL=NUMBER_OF_ENVIRON; /* Total number of test cases. */

View File

@ -40,19 +40,20 @@
* 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;

View File

@ -38,25 +38,27 @@
* 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 */

View File

@ -39,27 +39,30 @@
* None
*/
#include <stdio.h>
#include <errno.h>
#include <limits.h> /* for OPEN_MAX */
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include "test.h"
#include "usctest.h"
char *TCID = "fork01";
const char *TCID = "fork01";
int TST_TOTAL = 1;
extern int Tst_count;
void setup(void);
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
char filname[40], childfile[40];
int first;
FILE **fildeses; /* file streams */
int mypid, nfiles;
int
main(int ac, char **av)
{
int pid, status, dtable, nf;
int pid, status, nf;
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
@ -211,8 +214,6 @@ setup()
void
cleanup()
{
int nf;
/*
* print timing stats if that option was specified.
* print errno log if that option was specified.

View File

@ -40,21 +40,23 @@
* 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;

View File

@ -37,20 +37,21 @@
* 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;

View File

@ -110,7 +110,6 @@
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@ -122,7 +121,7 @@ extern void cleanup();
char *TCID="fpathconf01"; /* Test program identifier. */
const char *TCID="fpathconf01"; /* Test program identifier. */
extern int Tst_count; /* Test Case counter for tst_* routines */
#define FILENAME "fpafile01"
@ -133,7 +132,7 @@ int i;
struct pathconf_args
{
char *define_tag;
const char *define_tag;
int value;
int defined; /* Some of these are undefined on regular files.
* Cancer does a slightly better job with these already,

View File

@ -121,9 +121,7 @@
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 */

View File

@ -66,7 +66,6 @@
* This test should be run by 'non-super-user' only.
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
@ -83,7 +82,7 @@
#define BUF_SIZE 256
#define MASK 0777
char *TCID="fstat02"; /* Test program identifier. */
const char *TCID="fstat02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
uid_t User_id; /* user id/group id of test process */
@ -91,7 +90,7 @@ gid_t Group_id;
int fildes; /* File descriptor of testfile */
void setup(); /* Setup function for the test */
void cleanup(); /* Cleanup function for the test */
void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
int
main(int ac, char **av)

View File

@ -46,9 +46,6 @@
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
@ -62,14 +59,14 @@
#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)

View File

@ -65,7 +65,6 @@
* This test should be run by 'non-super-user' only.
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
@ -82,7 +81,7 @@
#define BUF_SIZE 256
#define MASK 0777
char *TCID="fstat01"; /* Test program identifier. */
const char *TCID="fstat01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
uid_t User_id; /* user id/group id of test process */
@ -90,7 +89,7 @@ gid_t Group_id;
int fildes; /* File descriptor of testfile */
void setup(); /* Setup function for the test */
void cleanup(); /* Cleanup function for the test */
void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
int
main(int ac, char **av)

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="fsync01"; /* Test program identifier. */
const char *TCID="fsync01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@ -131,7 +131,7 @@ int exp_enos[]={0, 0};
char fname[255];
int fd;
char *buf = "davef";
const char *buf = "davef";
int
main(int ac, char **av)

View File

@ -82,13 +82,13 @@
#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)

View File

@ -67,7 +67,6 @@
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
@ -85,14 +84,14 @@
#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)

View File

@ -67,7 +67,6 @@
* This test should be executed by 'non-super-user' only.
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
@ -93,7 +92,7 @@ int fd2; /* File descriptor for testfile2 */
struct test_case_t { /* test case struct. to hold ref. test cond's*/
int fd;
char *desc;
const char *desc;
int exp_errno;
int len;
int (*setupfunc)();
@ -103,20 +102,20 @@ struct test_case_t { /* test case struct. to hold ref. test cond's*/
{ 0, NULL, 0, 0, no_setup }
};
char *TCID="ftruncate03"; /* Test program identifier. */
const char *TCID="ftruncate03"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test conditions */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={EINVAL, EBADF, 0};
void setup(); /* Main setup function for the test */
void cleanup(); /* Main cleanup function for the test */
void cleanup(void) __attribute__((noreturn)); /* Main cleanup function for the test */
int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
char *test_desc; /* test specific error message */
const char *test_desc; /* test specific error message */
int fildes; /* File descriptor of testfile */
off_t trunc_len; /* truncate length */
int ind;

View File

@ -121,7 +121,7 @@ extern void cleanup();
char *TCID="getegid01"; /* Test program identifier. */
const char *TCID="getegid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -121,7 +121,7 @@ extern void cleanup();
char *TCID="geteuid01"; /* Test program identifier. */
const char *TCID="geteuid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -122,7 +122,7 @@ extern void cleanup();
char *TCID="getgid01"; /* Test program identifier. */
const char *TCID="getgid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -65,13 +65,14 @@
#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 */

View File

@ -65,13 +65,14 @@
#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 */

View File

@ -75,7 +75,6 @@ BUGS:
************************************************************/
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
@ -84,9 +83,9 @@ BUGS:
#include "usctest.h"
void setup();
void cleanup();
void cleanup(void) __attribute__((noreturn));
char *TCID="getgroups01"; /* Test program identifier. */
const char *TCID="getgroups01"; /* Test program identifier. */
int TST_TOTAL=4; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -123,7 +123,7 @@ extern void cleanup();
char *TCID="getgroups02"; /* Test program identifier. */
const char *TCID="getgroups02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -119,7 +119,7 @@ extern void cleanup();
char *TCID="gethostid01"; /* Test program identifier. */
const char *TCID="gethostid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -121,7 +121,7 @@ extern void cleanup();
char *TCID="gethostname01"; /* Test program identifier. */
const char *TCID="gethostname01";/* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -50,12 +50,13 @@
#include <usctest.h>
void setup(void);
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
char *TCID = "getpgid01";
const char *TCID = "getpgid01";
int TST_TOTAL = 1;
extern int Tst_count;
int
main(int ac, char **av)
{
int lc; /* loop counter */
@ -98,7 +99,6 @@ main(int ac, char **av)
}
/* child */
block1:
tst_resm(TINFO, "Enter block 1");
fail = 0;
if ((pgid_0 = getpgid(0)) < 0) {
@ -114,7 +114,6 @@ block1:
}
tst_resm(TINFO, "Exit block 1");
block2:
tst_resm(TINFO, "Enter block 2");
fail = 0;
@ -138,7 +137,6 @@ block2:
}
tst_resm(TINFO, "Exit block 2");
block3:
tst_resm(TINFO, "Enter block 3");
fail = 0;
@ -164,7 +162,6 @@ block3:
}
tst_resm(TINFO, "Exit block 3");
block4:
tst_resm(TINFO, "Enter block 4");
fail = 0;

View File

@ -52,9 +52,9 @@
#include <usctest.h>
void setup(void);
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
char *TCID = "getpgid01";
const char *TCID = "getpgid01";
int TST_TOTAL = 2;
extern int Tst_count;
@ -74,6 +74,7 @@ struct test_case_t {
{&pgid_1, ESRCH}
};
int
main(int ac, char **av)
{
int lc; /* loop counter */

View File

@ -122,7 +122,7 @@ extern void cleanup();
char *TCID="getpgrp01"; /* Test program identifier. */
const char *TCID="getpgrp01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -120,7 +120,7 @@ extern void cleanup();
char *TCID="getpid01"; /* Test program identifier. */
const char *TCID="getpid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -62,10 +62,8 @@
* None.
*/
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <sys/wait.h>
@ -74,9 +72,9 @@
#include "usctest.h"
void setup(); /* Main setup function of test */
void cleanup(); /* cleanup function for the test */
void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
char *TCID="getpid01"; /* Test program identifier. */
const char *TCID="getpid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -122,7 +122,7 @@ extern void cleanup();
char *TCID="getppid01"; /* Test program identifier. */
const char *TCID="getppid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -43,14 +43,16 @@
#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;

View File

@ -122,7 +122,7 @@ extern void cleanup();
char *TCID="getuid01"; /* Test program identifier. */
const char *TCID="getuid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */

View File

@ -45,13 +45,14 @@
#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 */

View File

@ -45,13 +45,14 @@
#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 */

View File

@ -62,16 +62,17 @@
#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 */

View File

@ -134,7 +134,6 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include "test.h"
#include "usctest.h"
@ -202,9 +201,9 @@ void chld1_kill(); /*This routine is used by child 1 to remove itself and */
/*its children A and B. */
void setup();
void cleanup();
void cleanup(void) __attribute__((noreturn));
char *TCID="kill02"; /* Test program identifier. */
const char *TCID="kill02"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
extern int Tst_nobuf; /* var. used to turn off tst_res buffering */
@ -657,7 +656,7 @@ void childB_rout()
void
setup()
{
int errno_buf; /*indicates the errno if pipe set up fails. */
int errno_buf = 0; /*indicates the errno if pipe set up fails. */
int err_flag = FALSE; /*Indicates if an error has occurred in pipe set up. */
char mesg[MAXMESG]; /*Used to buffer messages for tst_res. */

View File

@ -62,10 +62,10 @@
#include <errno.h>
#include <sys/wait.h>
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
void setup(void);
char *TCID= "kill03()";
const char *TCID= "kill03()";
int TST_TOTAL = 1;
extern int Tst_count;
@ -74,12 +74,13 @@ int exp_enos[] = {EINVAL, 0};
#define TEST_SIG 2000
int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
pid_t pid;
int exno, status, nsig;
int exno, status;
/* parse standard options */
if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){

View File

@ -62,10 +62,10 @@
#include <errno.h>
#include <sys/wait.h>
void cleanup(void);
void cleanup(void) __attribute__((noreturn));
void setup(void);
char *TCID= "kill04()";
const char *TCID= "kill04()";
int TST_TOTAL = 1;
extern int Tst_count;
@ -74,6 +74,7 @@ int exp_enos[] = {ESRCH, 0};
#define TEST_SIG SIGKILL
int
main(int ac, char **av)
{
int lc; /* loop counter */

View File

@ -119,13 +119,13 @@
#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 */

View File

@ -119,11 +119,11 @@
#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 */

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