Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-01-24 04:09:40 +0300
committerChristopher Faylor <me@cgf.cx>2003-01-24 04:09:40 +0300
commit31d7abadfee7da27924f7130e470ea701b39bc3e (patch)
tree71dff30bdf30a42e0ad50a3b2eef3b00e8c95d56 /winsup/testsuite/winsup.api
parent1905b7393cf9555bfbebd2f6b345877609760dff (diff)
Perform more C warning fixup on all C source files and headers.
Diffstat (limited to 'winsup/testsuite/winsup.api')
-rw-r--r--winsup/testsuite/winsup.api/checksignal.c3
-rw-r--r--winsup/testsuite/winsup.api/ltp/access01.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/access03.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/access04.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/access05.c15
-rw-r--r--winsup/testsuite/winsup.api/ltp/alarm01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/alarm02.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/alarm03.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/alarm07.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/asyncio02.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/chdir02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/chdir04.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/chmod01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/chmod02.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/chown01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/close01.c10
-rw-r--r--winsup/testsuite/winsup.api/ltp/close02.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/close08.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/creat01.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/creat03.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/creat09.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/dup01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/dup02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/dup03.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/dup04.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/dup05.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/execl01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/execle01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/execlp01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/execv01.c9
-rw-r--r--winsup/testsuite/winsup.api/ltp/execve01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/execvp01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/exit01.c8
-rw-r--r--winsup/testsuite/winsup.api/ltp/exit02.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/fchdir01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/fchdir02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/fchmod01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/fchown01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl03.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl04.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl05.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl07.c23
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl07B.c23
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl08.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl09.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/fcntl10.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork01.c3
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork02.c11
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork03.c9
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork04.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork06.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork07.c10
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork09.c13
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork10.c8
-rw-r--r--winsup/testsuite/winsup.api/ltp/fork11.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/fpathconf01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/fstat01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/fstat02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/fstat03.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/fstat04.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/fsync01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/ftruncate01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/ftruncate02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/ftruncate03.c9
-rw-r--r--winsup/testsuite/winsup.api/ltp/getegid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/geteuid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/getgid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/getgid02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/getgid03.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/getgroups01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/getgroups02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/gethostid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/gethostname01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/getpgid01.c9
-rw-r--r--winsup/testsuite/winsup.api/ltp/getpgid02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/getpgrp01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/getpid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/getpid02.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/getppid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/getppid02.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/getuid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/getuid02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/getuid03.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/kill01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/kill02.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/kill03.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/kill04.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/kill09.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/link02.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/link03.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/link04.c16
-rw-r--r--winsup/testsuite/winsup.api/ltp/link05.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek03.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek04.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek05.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek06.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek07.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek08.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek09.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/lseek10.c11
-rw-r--r--winsup/testsuite/winsup.api/ltp/lstat02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/mkdir01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/mkdir08.c3
-rw-r--r--winsup/testsuite/winsup.api/ltp/mknod01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap001.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap02.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap03.c8
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap04.c8
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap05.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap06.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap07.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/mmap08.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/munmap01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/munmap02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/nice05.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/open02.c10
-rw-r--r--winsup/testsuite/winsup.api/ltp/open03.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/pathconf01.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/pause01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/pipe01.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/pipe08.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/pipe09.c10
-rw-r--r--winsup/testsuite/winsup.api/ltp/pipe10.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/pipe11.c10
-rw-r--r--winsup/testsuite/winsup.api/ltp/poll01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/read01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/read04.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/readdir01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/readlink01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/readlink02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/readlink03.c13
-rw-r--r--winsup/testsuite/winsup.api/ltp/rename01.c11
-rw-r--r--winsup/testsuite/winsup.api/ltp/rename02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/rename08.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/rename10.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/rmdir01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/rmdir04.c3
-rw-r--r--winsup/testsuite/winsup.api/ltp/rmdir05.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/sbrk01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/select01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/select02.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/select03.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/setgid01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/setgroups01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/setpgid01.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/setregid01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/setreuid01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/setuid01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/setuid02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/signal03.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/stat01.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/stat02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/stat03.c16
-rw-r--r--winsup/testsuite/winsup.api/ltp/stat05.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/stat06.c13
-rw-r--r--winsup/testsuite/winsup.api/ltp/symlink01.c19
-rw-r--r--winsup/testsuite/winsup.api/ltp/symlink02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/symlink03.c18
-rw-r--r--winsup/testsuite/winsup.api/ltp/symlink04.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/symlink05.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/sync01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/sync02.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/time01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/time02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/times01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/times02.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/times03.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/truncate01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/truncate02.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/ulimit01.c4
-rw-r--r--winsup/testsuite/winsup.api/ltp/umask01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/umask02.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/umask03.c7
-rw-r--r--winsup/testsuite/winsup.api/ltp/uname01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/unlink05.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/unlink06.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/unlink07.c13
-rw-r--r--winsup/testsuite/winsup.api/ltp/unlink08.c13
-rw-r--r--winsup/testsuite/winsup.api/ltp/vfork01.c6
-rw-r--r--winsup/testsuite/winsup.api/ltp/wait02.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/wait401.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/wait402.c5
-rw-r--r--winsup/testsuite/winsup.api/ltp/write01.c2
-rw-r--r--winsup/testsuite/winsup.api/ltp/write02.c10
-rw-r--r--winsup/testsuite/winsup.api/ltp/write03.c7
-rw-r--r--winsup/testsuite/winsup.api/mmaptest01.c2
-rw-r--r--winsup/testsuite/winsup.api/pthread/cancel9.c2
-rw-r--r--winsup/testsuite/winsup.api/pthread/test.h11
-rw-r--r--winsup/testsuite/winsup.api/samples/sample-fail.c1
-rw-r--r--winsup/testsuite/winsup.api/samples/sample-pass.c1
193 files changed, 483 insertions, 587 deletions
diff --git a/winsup/testsuite/winsup.api/checksignal.c b/winsup/testsuite/winsup.api/checksignal.c
index 0481d8347..edf720c87 100644
--- a/winsup/testsuite/winsup.api/checksignal.c
+++ b/winsup/testsuite/winsup.api/checksignal.c
@@ -1,7 +1,4 @@
-#include <stdio.h>
#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
#include <signal.h>
#include "test.h"
diff --git a/winsup/testsuite/winsup.api/ltp/access01.c b/winsup/testsuite/winsup.api/ltp/access01.c
index e003805a0..ae9be948a 100644
--- a/winsup/testsuite/winsup.api/ltp/access01.c
+++ b/winsup/testsuite/winsup.api/ltp/access01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/access03.c b/winsup/testsuite/winsup.api/ltp/access03.c
index dc7dc5ee4..f0870a6fa 100644
--- a/winsup/testsuite/winsup.api/ltp/access03.c
+++ b/winsup/testsuite/winsup.api/ltp/access03.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/access04.c b/winsup/testsuite/winsup.api/ltp/access04.c
index 20fa81187..069458886 100644
--- a/winsup/testsuite/winsup.api/ltp/access04.c
+++ b/winsup/testsuite/winsup.api/ltp/access04.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/access05.c b/winsup/testsuite/winsup.api/ltp/access05.c
index 935b19bd3..757c64f33 100644
--- a/winsup/testsuite/winsup.api/ltp/access05.c
+++ b/winsup/testsuite/winsup.api/ltp/access05.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/alarm01.c b/winsup/testsuite/winsup.api/ltp/alarm01.c
index ac754e326..187e488c9 100644
--- a/winsup/testsuite/winsup.api/ltp/alarm01.c
+++ b/winsup/testsuite/winsup.api/ltp/alarm01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/alarm02.c b/winsup/testsuite/winsup.api/ltp/alarm02.c
index 7c608da66..03a41b4f7 100644
--- a/winsup/testsuite/winsup.api/ltp/alarm02.c
+++ b/winsup/testsuite/winsup.api/ltp/alarm02.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/alarm03.c b/winsup/testsuite/winsup.api/ltp/alarm03.c
index 275301374..871f6fabf 100644
--- a/winsup/testsuite/winsup.api/ltp/alarm03.c
+++ b/winsup/testsuite/winsup.api/ltp/alarm03.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/alarm07.c b/winsup/testsuite/winsup.api/ltp/alarm07.c
index 7661ba978..a9f269522 100644
--- a/winsup/testsuite/winsup.api/ltp/alarm07.c
+++ b/winsup/testsuite/winsup.api/ltp/alarm07.c
@@ -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
diff --git a/winsup/testsuite/winsup.api/ltp/asyncio02.c b/winsup/testsuite/winsup.api/ltp/asyncio02.c
index b7ccb62f5..36c03b449 100644
--- a/winsup/testsuite/winsup.api/ltp/asyncio02.c
+++ b/winsup/testsuite/winsup.api/ltp/asyncio02.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/chdir02.c b/winsup/testsuite/winsup.api/ltp/chdir02.c
index b59fd9338..552f912ac 100644
--- a/winsup/testsuite/winsup.api/ltp/chdir02.c
+++ b/winsup/testsuite/winsup.api/ltp/chdir02.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/chdir04.c b/winsup/testsuite/winsup.api/ltp/chdir04.c
index d220bb17f..da2b0ace9 100644
--- a/winsup/testsuite/winsup.api/ltp/chdir04.c
+++ b/winsup/testsuite/winsup.api/ltp/chdir04.c
@@ -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){
diff --git a/winsup/testsuite/winsup.api/ltp/chmod01.c b/winsup/testsuite/winsup.api/ltp/chmod01.c
index 12198fe9e..1ae8a1665 100644
--- a/winsup/testsuite/winsup.api/ltp/chmod01.c
+++ b/winsup/testsuite/winsup.api/ltp/chmod01.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/chmod02.c b/winsup/testsuite/winsup.api/ltp/chmod02.c
index 41c3485e8..8026768ae 100644
--- a/winsup/testsuite/winsup.api/ltp/chmod02.c
+++ b/winsup/testsuite/winsup.api/ltp/chmod02.c
@@ -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};
diff --git a/winsup/testsuite/winsup.api/ltp/chown01.c b/winsup/testsuite/winsup.api/ltp/chown01.c
index 1060637e2..b3cd08811 100644
--- a/winsup/testsuite/winsup.api/ltp/chown01.c
+++ b/winsup/testsuite/winsup.api/ltp/chown01.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/close01.c b/winsup/testsuite/winsup.api/ltp/close01.c
index 1637c90eb..4d4059823 100644
--- a/winsup/testsuite/winsup.api/ltp/close01.c
+++ b/winsup/testsuite/winsup.api/ltp/close01.c
@@ -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)
{
diff --git a/winsup/testsuite/winsup.api/ltp/close02.c b/winsup/testsuite/winsup.api/ltp/close02.c
index 44f98b250..72ecf8181 100644
--- a/winsup/testsuite/winsup.api/ltp/close02.c
+++ b/winsup/testsuite/winsup.api/ltp/close02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/close08.c b/winsup/testsuite/winsup.api/ltp/close08.c
index 7c9567fdb..3fbcc3be8 100644
--- a/winsup/testsuite/winsup.api/ltp/close08.c
+++ b/winsup/testsuite/winsup.api/ltp/close08.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/creat01.c b/winsup/testsuite/winsup.api/ltp/creat01.c
index 7dd016f22..6f891701e 100644
--- a/winsup/testsuite/winsup.api/ltp/creat01.c
+++ b/winsup/testsuite/winsup.api/ltp/creat01.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/creat03.c b/winsup/testsuite/winsup.api/ltp/creat03.c
index c5e5242bf..2ca21f1e0 100644
--- a/winsup/testsuite/winsup.api/ltp/creat03.c
+++ b/winsup/testsuite/winsup.api/ltp/creat03.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/creat09.c b/winsup/testsuite/winsup.api/ltp/creat09.c
index 0caa87973..c3c88a7c6 100644
--- a/winsup/testsuite/winsup.api/ltp/creat09.c
+++ b/winsup/testsuite/winsup.api/ltp/creat09.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/dup01.c b/winsup/testsuite/winsup.api/ltp/dup01.c
index d065f9dc1..521df6a78 100644
--- a/winsup/testsuite/winsup.api/ltp/dup01.c
+++ b/winsup/testsuite/winsup.api/ltp/dup01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/dup02.c b/winsup/testsuite/winsup.api/ltp/dup02.c
index 3aac3e9f8..ee759b89b 100644
--- a/winsup/testsuite/winsup.api/ltp/dup02.c
+++ b/winsup/testsuite/winsup.api/ltp/dup02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/dup03.c b/winsup/testsuite/winsup.api/ltp/dup03.c
index 4870778a7..bcc347aac 100644
--- a/winsup/testsuite/winsup.api/ltp/dup03.c
+++ b/winsup/testsuite/winsup.api/ltp/dup03.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/dup04.c b/winsup/testsuite/winsup.api/ltp/dup04.c
index 85540db35..1c4eaf188 100644
--- a/winsup/testsuite/winsup.api/ltp/dup04.c
+++ b/winsup/testsuite/winsup.api/ltp/dup04.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/dup05.c b/winsup/testsuite/winsup.api/ltp/dup05.c
index 4f889cdcd..097688353 100644
--- a/winsup/testsuite/winsup.api/ltp/dup05.c
+++ b/winsup/testsuite/winsup.api/ltp/dup05.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/execl01.c b/winsup/testsuite/winsup.api/ltp/execl01.c
index b23716a0f..f91b0a820 100644
--- a/winsup/testsuite/winsup.api/ltp/execl01.c
+++ b/winsup/testsuite/winsup.api/ltp/execl01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/execle01.c b/winsup/testsuite/winsup.api/ltp/execle01.c
index f29d34f6a..f7fcc8237 100644
--- a/winsup/testsuite/winsup.api/ltp/execle01.c
+++ b/winsup/testsuite/winsup.api/ltp/execle01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/execlp01.c b/winsup/testsuite/winsup.api/ltp/execlp01.c
index 6bf97d4e1..383223c07 100644
--- a/winsup/testsuite/winsup.api/ltp/execlp01.c
+++ b/winsup/testsuite/winsup.api/ltp/execlp01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/execv01.c b/winsup/testsuite/winsup.api/ltp/execv01.c
index b833e1c4f..f59f29702 100644
--- a/winsup/testsuite/winsup.api/ltp/execv01.c
+++ b/winsup/testsuite/winsup.api/ltp/execv01.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/execve01.c b/winsup/testsuite/winsup.api/ltp/execve01.c
index 1abe72f23..2584bdf05 100644
--- a/winsup/testsuite/winsup.api/ltp/execve01.c
+++ b/winsup/testsuite/winsup.api/ltp/execve01.c
@@ -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
diff --git a/winsup/testsuite/winsup.api/ltp/execvp01.c b/winsup/testsuite/winsup.api/ltp/execvp01.c
index 6f645d68d..8a1726a21 100644
--- a/winsup/testsuite/winsup.api/ltp/execvp01.c
+++ b/winsup/testsuite/winsup.api/ltp/execvp01.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/exit01.c b/winsup/testsuite/winsup.api/ltp/exit01.c
index 729f49ac6..74e6c093b 100644
--- a/winsup/testsuite/winsup.api/ltp/exit01.c
+++ b/winsup/testsuite/winsup.api/ltp/exit01.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/exit02.c b/winsup/testsuite/winsup.api/ltp/exit02.c
index b81ecbcb9..1503106e9 100644
--- a/winsup/testsuite/winsup.api/ltp/exit02.c
+++ b/winsup/testsuite/winsup.api/ltp/exit02.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fchdir01.c b/winsup/testsuite/winsup.api/ltp/fchdir01.c
index 83685d34d..bd70c01b3 100644
--- a/winsup/testsuite/winsup.api/ltp/fchdir01.c
+++ b/winsup/testsuite/winsup.api/ltp/fchdir01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fchdir02.c b/winsup/testsuite/winsup.api/ltp/fchdir02.c
index c09d905b5..4e1d9e74a 100644
--- a/winsup/testsuite/winsup.api/ltp/fchdir02.c
+++ b/winsup/testsuite/winsup.api/ltp/fchdir02.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fchmod01.c b/winsup/testsuite/winsup.api/ltp/fchmod01.c
index ffcf37f66..e2db7162a 100644
--- a/winsup/testsuite/winsup.api/ltp/fchmod01.c
+++ b/winsup/testsuite/winsup.api/ltp/fchmod01.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/fchown01.c b/winsup/testsuite/winsup.api/ltp/fchown01.c
index 045f84892..d692bfc74 100644
--- a/winsup/testsuite/winsup.api/ltp/fchown01.c
+++ b/winsup/testsuite/winsup.api/ltp/fchown01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl02.c b/winsup/testsuite/winsup.api/ltp/fcntl02.c
index 14fc1b61d..cbdd08545 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl02.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl03.c b/winsup/testsuite/winsup.api/ltp/fcntl03.c
index 93a9b9b1f..8199469c3 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl03.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl03.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl04.c b/winsup/testsuite/winsup.api/ltp/fcntl04.c
index d70843071..7af778936 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl04.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl04.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl05.c b/winsup/testsuite/winsup.api/ltp/fcntl05.c
index 86f492aa7..80cfe8c89 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl05.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl05.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl07.c b/winsup/testsuite/winsup.api/ltp/fcntl07.c
index c48e475ba..d62eb7967 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl07.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl07.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl07B.c b/winsup/testsuite/winsup.api/ltp/fcntl07B.c
index 51b88c278..405bf6127 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl07B.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl07B.c
@@ -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);
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl08.c b/winsup/testsuite/winsup.api/ltp/fcntl08.c
index c4cbad461..eaf22436b 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl08.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl08.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl09.c b/winsup/testsuite/winsup.api/ltp/fcntl09.c
index f10df71fe..523bd094b 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl09.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl09.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fcntl10.c b/winsup/testsuite/winsup.api/ltp/fcntl10.c
index 8b23575b3..661f69691 100644
--- a/winsup/testsuite/winsup.api/ltp/fcntl10.c
+++ b/winsup/testsuite/winsup.api/ltp/fcntl10.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fork01.c b/winsup/testsuite/winsup.api/ltp/fork01.c
index dfd412a5f..2aac2d427 100644
--- a/winsup/testsuite/winsup.api/ltp/fork01.c
+++ b/winsup/testsuite/winsup.api/ltp/fork01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fork02.c b/winsup/testsuite/winsup.api/ltp/fork02.c
index eaf3b6404..eeec828ec 100644
--- a/winsup/testsuite/winsup.api/ltp/fork02.c
+++ b/winsup/testsuite/winsup.api/ltp/fork02.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fork03.c b/winsup/testsuite/winsup.api/ltp/fork03.c
index cda913273..fbc23bb37 100644
--- a/winsup/testsuite/winsup.api/ltp/fork03.c
+++ b/winsup/testsuite/winsup.api/ltp/fork03.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fork04.c b/winsup/testsuite/winsup.api/ltp/fork04.c
index 3725d9f0f..901d88ae8 100644
--- a/winsup/testsuite/winsup.api/ltp/fork04.c
+++ b/winsup/testsuite/winsup.api/ltp/fork04.c
@@ -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. */
diff --git a/winsup/testsuite/winsup.api/ltp/fork06.c b/winsup/testsuite/winsup.api/ltp/fork06.c
index c2e5a471a..9755e503b 100644
--- a/winsup/testsuite/winsup.api/ltp/fork06.c
+++ b/winsup/testsuite/winsup.api/ltp/fork06.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fork07.c b/winsup/testsuite/winsup.api/ltp/fork07.c
index d8487c13a..7e06db7a1 100644
--- a/winsup/testsuite/winsup.api/ltp/fork07.c
+++ b/winsup/testsuite/winsup.api/ltp/fork07.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fork09.c b/winsup/testsuite/winsup.api/ltp/fork09.c
index 71a3f1d0b..233acc76e 100644
--- a/winsup/testsuite/winsup.api/ltp/fork09.c
+++ b/winsup/testsuite/winsup.api/ltp/fork09.c
@@ -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.
diff --git a/winsup/testsuite/winsup.api/ltp/fork10.c b/winsup/testsuite/winsup.api/ltp/fork10.c
index 09de7c06f..a3277d125 100644
--- a/winsup/testsuite/winsup.api/ltp/fork10.c
+++ b/winsup/testsuite/winsup.api/ltp/fork10.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fork11.c b/winsup/testsuite/winsup.api/ltp/fork11.c
index 1fc200dd1..2b1035230 100644
--- a/winsup/testsuite/winsup.api/ltp/fork11.c
+++ b/winsup/testsuite/winsup.api/ltp/fork11.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/fpathconf01.c b/winsup/testsuite/winsup.api/ltp/fpathconf01.c
index bc4f2b2ad..37fbe9689 100644
--- a/winsup/testsuite/winsup.api/ltp/fpathconf01.c
+++ b/winsup/testsuite/winsup.api/ltp/fpathconf01.c
@@ -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,
diff --git a/winsup/testsuite/winsup.api/ltp/fstat01.c b/winsup/testsuite/winsup.api/ltp/fstat01.c
index 9cb7959e4..d76684104 100644
--- a/winsup/testsuite/winsup.api/ltp/fstat01.c
+++ b/winsup/testsuite/winsup.api/ltp/fstat01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/fstat02.c b/winsup/testsuite/winsup.api/ltp/fstat02.c
index f15e48e78..224caf0d7 100644
--- a/winsup/testsuite/winsup.api/ltp/fstat02.c
+++ b/winsup/testsuite/winsup.api/ltp/fstat02.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/fstat03.c b/winsup/testsuite/winsup.api/ltp/fstat03.c
index 1f63cf106..47982ed47 100644
--- a/winsup/testsuite/winsup.api/ltp/fstat03.c
+++ b/winsup/testsuite/winsup.api/ltp/fstat03.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/fstat04.c b/winsup/testsuite/winsup.api/ltp/fstat04.c
index 0287fff36..1de507e62 100644
--- a/winsup/testsuite/winsup.api/ltp/fstat04.c
+++ b/winsup/testsuite/winsup.api/ltp/fstat04.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/fsync01.c b/winsup/testsuite/winsup.api/ltp/fsync01.c
index 57ddd5f98..261ea0dbb 100644
--- a/winsup/testsuite/winsup.api/ltp/fsync01.c
+++ b/winsup/testsuite/winsup.api/ltp/fsync01.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/ftruncate01.c b/winsup/testsuite/winsup.api/ltp/ftruncate01.c
index 2d3d797ec..a45c167aa 100644
--- a/winsup/testsuite/winsup.api/ltp/ftruncate01.c
+++ b/winsup/testsuite/winsup.api/ltp/ftruncate01.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/ftruncate02.c b/winsup/testsuite/winsup.api/ltp/ftruncate02.c
index 8044c1de5..2b4e72326 100644
--- a/winsup/testsuite/winsup.api/ltp/ftruncate02.c
+++ b/winsup/testsuite/winsup.api/ltp/ftruncate02.c
@@ -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)
diff --git a/winsup/testsuite/winsup.api/ltp/ftruncate03.c b/winsup/testsuite/winsup.api/ltp/ftruncate03.c
index 2e80558e7..279b4e88f 100644
--- a/winsup/testsuite/winsup.api/ltp/ftruncate03.c
+++ b/winsup/testsuite/winsup.api/ltp/ftruncate03.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/getegid01.c b/winsup/testsuite/winsup.api/ltp/getegid01.c
index d2c8a5240..942201067 100644
--- a/winsup/testsuite/winsup.api/ltp/getegid01.c
+++ b/winsup/testsuite/winsup.api/ltp/getegid01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/geteuid01.c b/winsup/testsuite/winsup.api/ltp/geteuid01.c
index b4840f52c..82a681ec5 100644
--- a/winsup/testsuite/winsup.api/ltp/geteuid01.c
+++ b/winsup/testsuite/winsup.api/ltp/geteuid01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getgid01.c b/winsup/testsuite/winsup.api/ltp/getgid01.c
index fcde734a0..e5b138c8a 100644
--- a/winsup/testsuite/winsup.api/ltp/getgid01.c
+++ b/winsup/testsuite/winsup.api/ltp/getgid01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getgid02.c b/winsup/testsuite/winsup.api/ltp/getgid02.c
index 290ef10c5..5efbda521 100644
--- a/winsup/testsuite/winsup.api/ltp/getgid02.c
+++ b/winsup/testsuite/winsup.api/ltp/getgid02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getgid03.c b/winsup/testsuite/winsup.api/ltp/getgid03.c
index 3059b0b36..ef0eaea14 100644
--- a/winsup/testsuite/winsup.api/ltp/getgid03.c
+++ b/winsup/testsuite/winsup.api/ltp/getgid03.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getgroups01.c b/winsup/testsuite/winsup.api/ltp/getgroups01.c
index 6b935f293..db9f942f6 100644
--- a/winsup/testsuite/winsup.api/ltp/getgroups01.c
+++ b/winsup/testsuite/winsup.api/ltp/getgroups01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getgroups02.c b/winsup/testsuite/winsup.api/ltp/getgroups02.c
index b517c7617..e05258935 100644
--- a/winsup/testsuite/winsup.api/ltp/getgroups02.c
+++ b/winsup/testsuite/winsup.api/ltp/getgroups02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/gethostid01.c b/winsup/testsuite/winsup.api/ltp/gethostid01.c
index 2d4a18755..ebb6d1724 100644
--- a/winsup/testsuite/winsup.api/ltp/gethostid01.c
+++ b/winsup/testsuite/winsup.api/ltp/gethostid01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/gethostname01.c b/winsup/testsuite/winsup.api/ltp/gethostname01.c
index 2f94db725..0e765bfad 100644
--- a/winsup/testsuite/winsup.api/ltp/gethostname01.c
+++ b/winsup/testsuite/winsup.api/ltp/gethostname01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getpgid01.c b/winsup/testsuite/winsup.api/ltp/getpgid01.c
index d1a39a087..70fc854c2 100644
--- a/winsup/testsuite/winsup.api/ltp/getpgid01.c
+++ b/winsup/testsuite/winsup.api/ltp/getpgid01.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/getpgid02.c b/winsup/testsuite/winsup.api/ltp/getpgid02.c
index afb80f261..1304a9946 100644
--- a/winsup/testsuite/winsup.api/ltp/getpgid02.c
+++ b/winsup/testsuite/winsup.api/ltp/getpgid02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getpgrp01.c b/winsup/testsuite/winsup.api/ltp/getpgrp01.c
index bd3a89117..6997be264 100644
--- a/winsup/testsuite/winsup.api/ltp/getpgrp01.c
+++ b/winsup/testsuite/winsup.api/ltp/getpgrp01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getpid01.c b/winsup/testsuite/winsup.api/ltp/getpid01.c
index 58d6b0579..df8197d28 100644
--- a/winsup/testsuite/winsup.api/ltp/getpid01.c
+++ b/winsup/testsuite/winsup.api/ltp/getpid01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getpid02.c b/winsup/testsuite/winsup.api/ltp/getpid02.c
index 8561c1a09..06d80b38d 100644
--- a/winsup/testsuite/winsup.api/ltp/getpid02.c
+++ b/winsup/testsuite/winsup.api/ltp/getpid02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getppid01.c b/winsup/testsuite/winsup.api/ltp/getppid01.c
index 9eab5dfc2..d0e6032c0 100644
--- a/winsup/testsuite/winsup.api/ltp/getppid01.c
+++ b/winsup/testsuite/winsup.api/ltp/getppid01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getppid02.c b/winsup/testsuite/winsup.api/ltp/getppid02.c
index 9eeead13f..50a72e470 100644
--- a/winsup/testsuite/winsup.api/ltp/getppid02.c
+++ b/winsup/testsuite/winsup.api/ltp/getppid02.c
@@ -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;
diff --git a/winsup/testsuite/winsup.api/ltp/getuid01.c b/winsup/testsuite/winsup.api/ltp/getuid01.c
index 58920ed34..cd3dff769 100644
--- a/winsup/testsuite/winsup.api/ltp/getuid01.c
+++ b/winsup/testsuite/winsup.api/ltp/getuid01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getuid02.c b/winsup/testsuite/winsup.api/ltp/getuid02.c
index b35072518..966b55290 100644
--- a/winsup/testsuite/winsup.api/ltp/getuid02.c
+++ b/winsup/testsuite/winsup.api/ltp/getuid02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/getuid03.c b/winsup/testsuite/winsup.api/ltp/getuid03.c
index 7c1075ca4..e18c366f4 100644
--- a/winsup/testsuite/winsup.api/ltp/getuid03.c
+++ b/winsup/testsuite/winsup.api/ltp/getuid03.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/kill01.c b/winsup/testsuite/winsup.api/ltp/kill01.c
index d20d3a347..042899173 100644
--- a/winsup/testsuite/winsup.api/ltp/kill01.c
+++ b/winsup/testsuite/winsup.api/ltp/kill01.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/kill02.c b/winsup/testsuite/winsup.api/ltp/kill02.c
index e618c8c71..eba47cc6a 100644
--- a/winsup/testsuite/winsup.api/ltp/kill02.c
+++ b/winsup/testsuite/winsup.api/ltp/kill02.c
@@ -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. */
diff --git a/winsup/testsuite/winsup.api/ltp/kill03.c b/winsup/testsuite/winsup.api/ltp/kill03.c
index 528a080b4..1de727fd7 100644
--- a/winsup/testsuite/winsup.api/ltp/kill03.c
+++ b/winsup/testsuite/winsup.api/ltp/kill03.c
@@ -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){
diff --git a/winsup/testsuite/winsup.api/ltp/kill04.c b/winsup/testsuite/winsup.api/ltp/kill04.c
index 2e0ff6593..a7b3274c3 100644
--- a/winsup/testsuite/winsup.api/ltp/kill04.c
+++ b/winsup/testsuite/winsup.api/ltp/kill04.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/kill09.c b/winsup/testsuite/winsup.api/ltp/kill09.c
index 9d6b0a181..3b4c24fb5 100644
--- a/winsup/testsuite/winsup.api/ltp/kill09.c
+++ b/winsup/testsuite/winsup.api/ltp/kill09.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/link02.c b/winsup/testsuite/winsup.api/ltp/link02.c
index 61294f16f..84c53c23c 100644
--- a/winsup/testsuite/winsup.api/ltp/link02.c
+++ b/winsup/testsuite/winsup.api/ltp/link02.c
@@ -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 */
diff --git a/winsup/testsuite/winsup.api/ltp/link03.c b/winsup/testsuite/winsup.api/ltp/link03.c
index 7b4395853..38c16af72 100644
--- a/winsup/testsuite/winsup.api/ltp/link03.c
+++ b/winsup/testsuite/winsup.api/ltp/link03.c
@@ -121,11 +121,11 @@
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;
diff --git a/winsup/testsuite/winsup.api/ltp/link04.c b/winsup/testsuite/winsup.api/ltp/link04.c
index 7f2390139..b3453b5d0 100644
--- a/winsup/testsuite/winsup.api/ltp/link04.c
+++ b/winsup/testsuite/winsup.api/ltp/link04.c
@@ -121,12 +121,12 @@
#include "usctest.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
extern char *get_high_address();
-char *TCID="link04"; /* Test program identifier. */
+const char *TCID="link04"; /* Test program identifier. */
int TST_TOTAL=14; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -141,10 +141,10 @@ char High_address[64];
int dir_setup();
struct test_case_t {
- char *file1;
- char *desc1;
- char *file2;
- char *desc2;
+ const char *file1;
+ const char *desc1;
+ const char *file2;
+ const char *desc2;
int exp_errno;
int (*setupfunc1)();
int (*setupfunc2)();
@@ -214,8 +214,8 @@ main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *fname1, *fname2;
- char *desc1, *desc2;
+ const char *fname1, *fname2;
+ const char *desc1, *desc2;
int ind;
/***************************************************************
diff --git a/winsup/testsuite/winsup.api/ltp/link05.c b/winsup/testsuite/winsup.api/ltp/link05.c
index 5078a6a3f..9387c25a8 100644
--- a/winsup/testsuite/winsup.api/ltp/link05.c
+++ b/winsup/testsuite/winsup.api/ltp/link05.c
@@ -119,12 +119,12 @@
#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
diff --git a/winsup/testsuite/winsup.api/ltp/lseek01.c b/winsup/testsuite/winsup.api/ltp/lseek01.c
index 32756fedd..22d0c6c39 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek01.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek01.c
@@ -114,16 +114,15 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/lseek02.c b/winsup/testsuite/winsup.api/ltp/lseek02.c
index 9ad906b5b..04fa3f10f 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek02.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek02.c
@@ -114,16 +114,15 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/lseek03.c b/winsup/testsuite/winsup.api/ltp/lseek03.c
index 03c035cb9..e1916da50 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek03.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek03.c
@@ -114,15 +114,14 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/lseek04.c b/winsup/testsuite/winsup.api/ltp/lseek04.c
index d1c3c36a1..faba3f1bf 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek04.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek04.c
@@ -115,16 +115,15 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/lseek05.c b/winsup/testsuite/winsup.api/ltp/lseek05.c
index 0d51643f0..8867086bd 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek05.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek05.c
@@ -114,16 +114,15 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/lseek06.c b/winsup/testsuite/winsup.api/ltp/lseek06.c
index 0262260fc..638d876d8 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek06.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek06.c
@@ -66,8 +66,6 @@
* None.
*/
-#include <stdio.h>
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
@@ -83,13 +81,13 @@
#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)
diff --git a/winsup/testsuite/winsup.api/ltp/lseek07.c b/winsup/testsuite/winsup.api/ltp/lseek07.c
index 0acc28949..47bdf1d6b 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek07.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek07.c
@@ -66,8 +66,6 @@
* None.
*/
-#include <stdio.h>
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
@@ -82,7 +80,7 @@
#define TEMP_FILE "tmp_file"
#define FILE_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-char *TCID="lseek02"; /* Test program identifier. */
+const char *TCID="lseek02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int fildes; /* file handle for temp file */
@@ -91,7 +89,7 @@ char write_buf1[BUFSIZ]; /* buffer to hold data */
char write_buf2[BUFSIZ]; /* buffer to hold data */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/lseek08.c b/winsup/testsuite/winsup.api/ltp/lseek08.c
index 061ac3152..ebef7c0bf 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek08.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek08.c
@@ -66,8 +66,6 @@
* None.
*/
-#include <stdio.h>
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
@@ -82,14 +80,14 @@
#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)
diff --git a/winsup/testsuite/winsup.api/ltp/lseek09.c b/winsup/testsuite/winsup.api/ltp/lseek09.c
index b36df715d..36688c656 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek09.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek09.c
@@ -68,8 +68,6 @@
* None.
*/
-#include <stdio.h>
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
@@ -84,20 +82,19 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/lseek10.c b/winsup/testsuite/winsup.api/ltp/lseek10.c
index 060f3b290..ab3cc6ba3 100644
--- a/winsup/testsuite/winsup.api/ltp/lseek10.c
+++ b/winsup/testsuite/winsup.api/ltp/lseek10.c
@@ -69,11 +69,8 @@
* None.
*/
-#include <stdio.h>
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <utime.h>
#include <string.h>
@@ -90,7 +87,7 @@
#define PIPE_MODE S_IFIFO | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
#define SEEK_TOP 10
-char *TCID="lseek05"; /* Test program identifier. */
+const char *TCID="lseek05"; /* Test program identifier. */
int TST_TOTAL=3; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={ESPIPE, EINVAL, EBADF, 0};
@@ -107,7 +104,7 @@ int fd3; /* file handle for testfile3 */
struct test_case_t { /* test case struct. to hold ref. test cond's*/
int fd;
int Whence;
- char *desc;
+ const char *desc;
int exp_errno;
int (*setupfunc)();
} Test_cases[] = {
@@ -118,7 +115,7 @@ struct test_case_t { /* test case struct. to hold ref. test cond's*/
};
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
@@ -127,7 +124,7 @@ main(int ac, char **av)
const char *msg; /* message returned from parse_opts */
int fildes; /* file handle for testfile */
int whence; /* position of file handle in the file */
- char *test_desc; /* test specific error message */
+ const char *test_desc; /* test specific error message */
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
diff --git a/winsup/testsuite/winsup.api/ltp/lstat02.c b/winsup/testsuite/winsup.api/ltp/lstat02.c
index f6b97d78a..eed8f78c7 100644
--- a/winsup/testsuite/winsup.api/ltp/lstat02.c
+++ b/winsup/testsuite/winsup.api/ltp/lstat02.c
@@ -123,7 +123,7 @@ extern void cleanup();
-char *TCID="lstat02"; /* Test program identifier. */
+const char *TCID="lstat02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/mkdir01.c b/winsup/testsuite/winsup.api/ltp/mkdir01.c
index 80f9bb6cc..5772f0683 100644
--- a/winsup/testsuite/winsup.api/ltp/mkdir01.c
+++ b/winsup/testsuite/winsup.api/ltp/mkdir01.c
@@ -108,17 +108,16 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/mkdir08.c b/winsup/testsuite/winsup.api/ltp/mkdir08.c
index 8378aba34..d1cc19344 100644
--- a/winsup/testsuite/winsup.api/ltp/mkdir08.c
+++ b/winsup/testsuite/winsup.api/ltp/mkdir08.c
@@ -115,7 +115,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <unistd.h>
#include "test.h"
#include "usctest.h"
@@ -124,7 +123,7 @@ extern void cleanup();
-char *TCID="mkdir08"; /* Test program identifier. */
+const char *TCID="mkdir08"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/mknod01.c b/winsup/testsuite/winsup.api/ltp/mknod01.c
index 32c7fe1e2..6cfe4885a 100644
--- a/winsup/testsuite/winsup.api/ltp/mknod01.c
+++ b/winsup/testsuite/winsup.api/ltp/mknod01.c
@@ -109,7 +109,6 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -120,11 +119,11 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/mmap001.c b/winsup/testsuite/winsup.api/ltp/mmap001.c
index 8ac1b3716..40cca6f3e 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap001.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap001.c
@@ -22,16 +22,13 @@
#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;
diff --git a/winsup/testsuite/winsup.api/ltp/mmap02.c b/winsup/testsuite/winsup.api/ltp/mmap02.c
index 35e944d74..96634ee4e 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap02.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap02.c
@@ -69,11 +69,8 @@
* None.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -85,7 +82,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="mmap02"; /* Test program identifier. */
+const char *TCID="mmap02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
char *addr; /* addr of memory mapped region */
@@ -94,7 +91,7 @@ size_t page_sz; /* system page size */
int fildes = -1; /* file descriptor for temporary file */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/mmap03.c b/winsup/testsuite/winsup.api/ltp/mmap03.c
index 6c66a4c45..de873fcb0 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap03.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap03.c
@@ -72,11 +72,8 @@
* None.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -88,7 +85,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="mmap03"; /* Test program identifier. */
+const char *TCID="mmap03"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
size_t page_sz; /* system page size */
@@ -97,14 +94,13 @@ char *dummy; /* dummy variable to hold temp file contents */
int fildes = -1; /* file descriptor for temporary file */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char file_content; /* tempfile content */
/* Parse standard options given to run the test. */
msg = parse_opts(ac, av, (option_t *) NULL, NULL);
diff --git a/winsup/testsuite/winsup.api/ltp/mmap04.c b/winsup/testsuite/winsup.api/ltp/mmap04.c
index 4f9018f92..b82904dec 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap04.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap04.c
@@ -72,11 +72,8 @@
* None.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -88,7 +85,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="mmap04"; /* Test program identifier. */
+const char *TCID="mmap04"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
size_t page_sz; /* system page size */
@@ -97,14 +94,13 @@ char *dummy; /* dummy variable to hold temp file contents */
int fildes = -1; /* file descriptor for temporary file */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char file_content; /* tempfile content */
/* Parse standard options given to run the test. */
msg = parse_opts(ac, av, (option_t *) NULL, NULL);
diff --git a/winsup/testsuite/winsup.api/ltp/mmap05.c b/winsup/testsuite/winsup.api/ltp/mmap05.c
index e8186899f..f42adf0b7 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap05.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap05.c
@@ -72,11 +72,8 @@
* None.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -89,7 +86,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="mmap05"; /* Test program identifier. */
+const char *TCID="mmap05"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
size_t page_sz; /* system page size */
@@ -99,7 +96,7 @@ int pass=0; /* pass flag perhaps set to 1 in sig_handler */
sigjmp_buf env; /* environment for sigsetjmp/siglongjmp */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
void sig_handler(); /* signal handler to catch SIGSEGV */
int
diff --git a/winsup/testsuite/winsup.api/ltp/mmap06.c b/winsup/testsuite/winsup.api/ltp/mmap06.c
index bc3f20eb1..4c9c95880 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap06.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap06.c
@@ -68,11 +68,8 @@
* None.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -84,7 +81,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="mmap06"; /* Test program identifier. */
+const char *TCID="mmap06"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={EACCES, 0};
@@ -94,7 +91,7 @@ char *addr; /* addr of memory mapped region */
int fildes = -1; /* file descriptor for temporary file */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/mmap07.c b/winsup/testsuite/winsup.api/ltp/mmap07.c
index 3d1f4341d..5f26abf91 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap07.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap07.c
@@ -69,11 +69,8 @@
* None.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -85,7 +82,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="mmap07"; /* Test program identifier. */
+const char *TCID="mmap07"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={EACCES, 0};
@@ -95,7 +92,7 @@ char *addr; /* addr of memory mapped region */
int fildes = -1; /* file descriptor for temporary file */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/mmap08.c b/winsup/testsuite/winsup.api/ltp/mmap08.c
index 8b2c05091..8af8cb51b 100644
--- a/winsup/testsuite/winsup.api/ltp/mmap08.c
+++ b/winsup/testsuite/winsup.api/ltp/mmap08.c
@@ -64,11 +64,8 @@
* None.
*/
-#include <stdio.h>
-#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -80,7 +77,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="mmap08"; /* Test program identifier. */
+const char *TCID="mmap08"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={EBADF, 0};
@@ -90,7 +87,7 @@ char *addr; /* addr of memory mapped region */
int fildes = -1; /* file descriptor for temporary file */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/munmap01.c b/winsup/testsuite/winsup.api/ltp/munmap01.c
index 5de98b6ff..0527201be 100644
--- a/winsup/testsuite/winsup.api/ltp/munmap01.c
+++ b/winsup/testsuite/winsup.api/ltp/munmap01.c
@@ -69,7 +69,6 @@
* None.
*/
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
@@ -79,7 +78,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="munmap01"; /* Test program identifier. */
+const char *TCID="munmap01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -88,7 +87,7 @@ int fildes; /* file descriptor for tempfile */
unsigned int map_len; /* length of the region to be mapped */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void); /* cleanup function for the test */
void sig_handler(); /* signal catching function */
int
diff --git a/winsup/testsuite/winsup.api/ltp/munmap02.c b/winsup/testsuite/winsup.api/ltp/munmap02.c
index deadcc2f6..7345e73e0 100644
--- a/winsup/testsuite/winsup.api/ltp/munmap02.c
+++ b/winsup/testsuite/winsup.api/ltp/munmap02.c
@@ -70,7 +70,6 @@
* None.
*/
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
@@ -80,7 +79,7 @@
#define TEMPFILE "mmapfile"
-char *TCID="munmap02"; /* Test program identifier. */
+const char *TCID="munmap02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -90,7 +89,7 @@ int fildes; /* file descriptor for tempfile */
unsigned int map_len; /* length of the region to be mapped */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void); /* cleanup function for the test */
void sig_handler(); /* signal catching function */
int
diff --git a/winsup/testsuite/winsup.api/ltp/nice05.c b/winsup/testsuite/winsup.api/ltp/nice05.c
index 602971f8a..1246e7fbd 100644
--- a/winsup/testsuite/winsup.api/ltp/nice05.c
+++ b/winsup/testsuite/winsup.api/ltp/nice05.c
@@ -109,7 +109,6 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
@@ -118,11 +117,11 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/open02.c b/winsup/testsuite/winsup.api/ltp/open02.c
index 84640ce97..594ab5b1c 100644
--- a/winsup/testsuite/winsup.api/ltp/open02.c
+++ b/winsup/testsuite/winsup.api/ltp/open02.c
@@ -42,7 +42,6 @@
* RESTRICTIONS
* None
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
@@ -50,7 +49,7 @@
#include <test.h>
#include <usctest.h>
-char *TCID = "open02";
+const char *TCID = "open02";
int TST_TOTAL = 1;
extern int Tst_count;
@@ -58,18 +57,15 @@ char pfilname[40] = "";
int exp_enos[] = {ENOENT, 0};
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
void setup(void);
+int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- struct stat statbuf;
- int fildes;
- unsigned short filmode;
-
/*
* parse standard command line options
*/
diff --git a/winsup/testsuite/winsup.api/ltp/open03.c b/winsup/testsuite/winsup.api/ltp/open03.c
index b8dce9cee..6a699bad1 100644
--- a/winsup/testsuite/winsup.api/ltp/open03.c
+++ b/winsup/testsuite/winsup.api/ltp/open03.c
@@ -122,7 +122,7 @@ extern void cleanup();
-char *TCID="open03"; /* Test program identifier. */
+const char *TCID="open03"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/pathconf01.c b/winsup/testsuite/winsup.api/ltp/pathconf01.c
index f87c6e239..466875f21 100644
--- a/winsup/testsuite/winsup.api/ltp/pathconf01.c
+++ b/winsup/testsuite/winsup.api/ltp/pathconf01.c
@@ -109,7 +109,6 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -121,18 +120,18 @@ extern void cleanup();
-char *TCID="pathconf01"; /* Test program identifier. */
+const char *TCID="pathconf01"; /* Test program identifier. */
int TST_TOTAL; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={0, 0};
int i;
-char *path = "/tmp";
+const char *path = "/tmp";
struct pathconf_args
{
- char *define_tag;
+ const char *define_tag;
int value;
} args[] = {
{"_PC_LINK_MAX", _PC_LINK_MAX},
diff --git a/winsup/testsuite/winsup.api/ltp/pause01.c b/winsup/testsuite/winsup.api/ltp/pause01.c
index 28187c39f..1c3b94607 100644
--- a/winsup/testsuite/winsup.api/ltp/pause01.c
+++ b/winsup/testsuite/winsup.api/ltp/pause01.c
@@ -119,7 +119,7 @@ extern void cleanup();
-char *TCID="pause01"; /* Test program identifier. */
+const char *TCID="pause01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/pipe01.c b/winsup/testsuite/winsup.api/ltp/pipe01.c
index 699515da3..cc01cc988 100644
--- a/winsup/testsuite/winsup.api/ltp/pipe01.c
+++ b/winsup/testsuite/winsup.api/ltp/pipe01.c
@@ -43,24 +43,23 @@
* 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 */
diff --git a/winsup/testsuite/winsup.api/ltp/pipe08.c b/winsup/testsuite/winsup.api/ltp/pipe08.c
index 9cc935d39..70d61dab8 100644
--- a/winsup/testsuite/winsup.api/ltp/pipe08.c
+++ b/winsup/testsuite/winsup.api/ltp/pipe08.c
@@ -48,25 +48,24 @@
* 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;
diff --git a/winsup/testsuite/winsup.api/ltp/pipe09.c b/winsup/testsuite/winsup.api/ltp/pipe09.c
index 2c7d9f4c2..eb21bb601 100644
--- a/winsup/testsuite/winsup.api/ltp/pipe09.c
+++ b/winsup/testsuite/winsup.api/ltp/pipe09.c
@@ -46,7 +46,6 @@
* RESTRICTIONS
* None
*/
-#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include <errno.h>
@@ -55,22 +54,21 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/pipe10.c b/winsup/testsuite/winsup.api/ltp/pipe10.c
index 410622c37..52ac5d94e 100644
--- a/winsup/testsuite/winsup.api/ltp/pipe10.c
+++ b/winsup/testsuite/winsup.api/ltp/pipe10.c
@@ -44,24 +44,23 @@
* 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 */
diff --git a/winsup/testsuite/winsup.api/ltp/pipe11.c b/winsup/testsuite/winsup.api/ltp/pipe11.c
index df7b24166..338f90602 100644
--- a/winsup/testsuite/winsup.api/ltp/pipe11.c
+++ b/winsup/testsuite/winsup.api/ltp/pipe11.c
@@ -47,17 +47,17 @@
* None
*/
#include <errno.h>
-#include <stdio.h>
#include <limits.h>
+#include <sys/wait.h>
#include "test.h"
#include "usctest.h"
-char *TCID = "pipe11";
+const char *TCID = "pipe11";
int TST_TOTAL = 1;
extern int Tst_count;
void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
#define NUMCHILD 50
#define NCPERCHILD 50
@@ -69,15 +69,15 @@ int szcharbuf; /* size of char buf */
int pipewrcnt; /* chars written to pipe */
char *wrbuf, *rdbuf;
+int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- int pipe_ret; /* exit status of pipe */
int fd[2]; /* fds for pipe read/write */
int i;
- int fork_ret, status, cond_numb = 0;
+ int fork_ret, status;
int nread, written; /* no of chars read and written */
/* parse standard options */
diff --git a/winsup/testsuite/winsup.api/ltp/poll01.c b/winsup/testsuite/winsup.api/ltp/poll01.c
index 67e1f139a..5cb71057b 100644
--- a/winsup/testsuite/winsup.api/ltp/poll01.c
+++ b/winsup/testsuite/winsup.api/ltp/poll01.c
@@ -62,7 +62,6 @@
* RESTRICTIONS:
* None.
*/
-#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/wait.h>
@@ -73,7 +72,7 @@
#define BUF_SIZE 512
-char *TCID="poll01"; /* Test program identifier. */
+const char *TCID="poll01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -81,7 +80,7 @@ int fildes[2]; /* file descriptors of the pipe. */
struct pollfd fds[1]; /* struct. for poll() */
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/read01.c b/winsup/testsuite/winsup.api/ltp/read01.c
index 1a54afeb0..332b939a7 100644
--- a/winsup/testsuite/winsup.api/ltp/read01.c
+++ b/winsup/testsuite/winsup.api/ltp/read01.c
@@ -136,12 +136,12 @@ extern void cleanup();
-char *TCID="read01"; /* Test program identifier. */
+const char *TCID="read01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={0, 0};
-char fname[255], *malloc();
+char fname[255];
int fd, i;
int offset=0;
char *s;
diff --git a/winsup/testsuite/winsup.api/ltp/read04.c b/winsup/testsuite/winsup.api/ltp/read04.c
index 99dcdf68d..c976cd6a4 100644
--- a/winsup/testsuite/winsup.api/ltp/read04.c
+++ b/winsup/testsuite/winsup.api/ltp/read04.c
@@ -45,16 +45,15 @@
* RESTRICTIONS
* None
*/
-#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include "test.h"
#include "usctest.h"
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
void setup(void);
-char *TCID = "read01";
+const char *TCID = "read01";
int TST_TOTAL = 1;
extern int Tst_count;
@@ -63,12 +62,12 @@ char fname[255];
char palfa[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;
int fild;
+int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- int n;
int rfild;
char prbuf[BUFSIZ];
diff --git a/winsup/testsuite/winsup.api/ltp/readdir01.c b/winsup/testsuite/winsup.api/ltp/readdir01.c
index e8b5bd5a5..c77e90680 100644
--- a/winsup/testsuite/winsup.api/ltp/readdir01.c
+++ b/winsup/testsuite/winsup.api/ltp/readdir01.c
@@ -111,7 +111,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
-#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -128,9 +127,9 @@
*/
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;
diff --git a/winsup/testsuite/winsup.api/ltp/readlink01.c b/winsup/testsuite/winsup.api/ltp/readlink01.c
index bb5f6e388..744fff02a 100644
--- a/winsup/testsuite/winsup.api/ltp/readlink01.c
+++ b/winsup/testsuite/winsup.api/ltp/readlink01.c
@@ -65,7 +65,6 @@
* This test should be run by 'non-super-user' only.
*
*/
-#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
@@ -78,14 +77,14 @@
#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)
diff --git a/winsup/testsuite/winsup.api/ltp/readlink02.c b/winsup/testsuite/winsup.api/ltp/readlink02.c
index c0ed6f154..4ef6ffa11 100644
--- a/winsup/testsuite/winsup.api/ltp/readlink02.c
+++ b/winsup/testsuite/winsup.api/ltp/readlink02.c
@@ -122,7 +122,7 @@ extern void cleanup();
-char *TCID="readlink02"; /* Test program identifier. */
+const char *TCID="readlink02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/readlink03.c b/winsup/testsuite/winsup.api/ltp/readlink03.c
index 3279b903b..41cf4bbe9 100644
--- a/winsup/testsuite/winsup.api/ltp/readlink03.c
+++ b/winsup/testsuite/winsup.api/ltp/readlink03.c
@@ -74,7 +74,6 @@
* This test should be executed by 'non-super-user' only.
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
@@ -95,7 +94,7 @@
#define SYM_FILE2 "sfile_2"
#define MAX_SIZE 256
-char *TCID="readlink03"; /* Test program identifier. */
+const char *TCID="readlink03"; /* Test program identifier. */
int TST_TOTAL=5; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={EACCES, EINVAL, ENAMETOOLONG, ENOENT, 0};
@@ -108,8 +107,8 @@ int lpath_setup(); /* setup function to test chmod for ENAMETOOLONG */
char Longpathname[PATH_MAX+2];
struct test_case_t { /* test case struct. to hold ref. test cond's*/
- char *link;
- char *desc;
+ const char *link;
+ const char *desc;
int exp_errno;
size_t buf_siz;
int (*setupfunc)();
@@ -127,7 +126,7 @@ struct test_case_t { /* test case struct. to hold ref. test cond's*/
};
extern void setup(); /* Setup function for the test */
-extern void cleanup(); /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
int
main(int ac, char **av)
@@ -135,8 +134,8 @@ main(int ac, char **av)
char buffer[MAX_SIZE]; /* temporary buffer to hold symlink contents*/
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *sym_file; /* symbolic link file name */
- char *test_desc; /* test specific error message */
+ const char *sym_file; /* symbolic link file name */
+ const char *test_desc; /* test specific error message */
int i; /* counter to test different test conditions */
size_t buf_size; /* size of buffer for readlink */
diff --git a/winsup/testsuite/winsup.api/ltp/rename01.c b/winsup/testsuite/winsup.api/ltp/rename01.c
index 551efe722..14ae1f245 100644
--- a/winsup/testsuite/winsup.api/ltp/rename01.c
+++ b/winsup/testsuite/winsup.api/ltp/rename01.c
@@ -68,17 +68,16 @@
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <errno.h>
#include "test.h"
#include "usctest.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
extern void do_file_setup(char *);
-char *TCID="rename01"; /* Test program identifier. */
+const char *TCID="rename01"; /* Test program identifier. */
int TST_TOTAL=2; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -89,9 +88,9 @@ dev_t f_olddev, d_olddev;
ino_t f_oldino, d_oldino;
struct test_case_t {
- char *name1;
- char *name2;
- char *desc;
+ const char *name1;
+ const char *name2;
+ const char *desc;
dev_t *olddev;
ino_t *oldino;
} TC[] = {
diff --git a/winsup/testsuite/winsup.api/ltp/rename02.c b/winsup/testsuite/winsup.api/ltp/rename02.c
index 1ad0fb01e..d34cd104a 100644
--- a/winsup/testsuite/winsup.api/ltp/rename02.c
+++ b/winsup/testsuite/winsup.api/ltp/rename02.c
@@ -123,7 +123,7 @@ void do_file_setup();
-char *TCID="rename02"; /* Test program identifier. */
+const char *TCID="rename02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/rename08.c b/winsup/testsuite/winsup.api/ltp/rename08.c
index e83923901..0788ddc98 100644
--- a/winsup/testsuite/winsup.api/ltp/rename08.c
+++ b/winsup/testsuite/winsup.api/ltp/rename08.c
@@ -66,17 +66,16 @@
*/
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/rename10.c b/winsup/testsuite/winsup.api/ltp/rename10.c
index c1aae92b5..438ef3725 100644
--- a/winsup/testsuite/winsup.api/ltp/rename10.c
+++ b/winsup/testsuite/winsup.api/ltp/rename10.c
@@ -61,17 +61,16 @@
*/
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/rmdir01.c b/winsup/testsuite/winsup.api/ltp/rmdir01.c
index 5b16a518b..1d41f1c13 100644
--- a/winsup/testsuite/winsup.api/ltp/rmdir01.c
+++ b/winsup/testsuite/winsup.api/ltp/rmdir01.c
@@ -61,16 +61,15 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/rmdir04.c b/winsup/testsuite/winsup.api/ltp/rmdir04.c
index 5cf84f770..ece6a9ff4 100644
--- a/winsup/testsuite/winsup.api/ltp/rmdir04.c
+++ b/winsup/testsuite/winsup.api/ltp/rmdir04.c
@@ -112,7 +112,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <unistd.h>
#include <errno.h>
#include <string.h>
@@ -125,7 +124,7 @@ extern void cleanup();
-char *TCID="rmdir04"; /* Test program identifier. */
+const char *TCID="rmdir04"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/rmdir05.c b/winsup/testsuite/winsup.api/ltp/rmdir05.c
index b363735c0..ff19b3a81 100644
--- a/winsup/testsuite/winsup.api/ltp/rmdir05.c
+++ b/winsup/testsuite/winsup.api/ltp/rmdir05.c
@@ -96,19 +96,18 @@
#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. */
diff --git a/winsup/testsuite/winsup.api/ltp/sbrk01.c b/winsup/testsuite/winsup.api/ltp/sbrk01.c
index 08fb0a184..700fb6b17 100644
--- a/winsup/testsuite/winsup.api/ltp/sbrk01.c
+++ b/winsup/testsuite/winsup.api/ltp/sbrk01.c
@@ -109,7 +109,6 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -119,11 +118,11 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/select01.c b/winsup/testsuite/winsup.api/ltp/select01.c
index 6ff0fe87b..3b81f93db 100644
--- a/winsup/testsuite/winsup.api/ltp/select01.c
+++ b/winsup/testsuite/winsup.api/ltp/select01.c
@@ -131,9 +131,9 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/select02.c b/winsup/testsuite/winsup.api/ltp/select02.c
index 8b2669564..935f4b273 100644
--- a/winsup/testsuite/winsup.api/ltp/select02.c
+++ b/winsup/testsuite/winsup.api/ltp/select02.c
@@ -118,9 +118,9 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/select03.c b/winsup/testsuite/winsup.api/ltp/select03.c
index d0959cb35..225ef19a7 100644
--- a/winsup/testsuite/winsup.api/ltp/select03.c
+++ b/winsup/testsuite/winsup.api/ltp/select03.c
@@ -125,7 +125,7 @@
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 */
diff --git a/winsup/testsuite/winsup.api/ltp/setgid01.c b/winsup/testsuite/winsup.api/ltp/setgid01.c
index 50b339d03..a75e88a1d 100644
--- a/winsup/testsuite/winsup.api/ltp/setgid01.c
+++ b/winsup/testsuite/winsup.api/ltp/setgid01.c
@@ -120,7 +120,7 @@ extern void cleanup();
-char *TCID="setgid01"; /* Test program identifier. */
+const char *TCID="setgid01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/setgroups01.c b/winsup/testsuite/winsup.api/ltp/setgroups01.c
index dc7bd1d47..ee1c54b63 100644
--- a/winsup/testsuite/winsup.api/ltp/setgroups01.c
+++ b/winsup/testsuite/winsup.api/ltp/setgroups01.c
@@ -113,18 +113,17 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/setpgid01.c b/winsup/testsuite/winsup.api/ltp/setpgid01.c
index e580a34f7..0835c66a3 100644
--- a/winsup/testsuite/winsup.api/ltp/setpgid01.c
+++ b/winsup/testsuite/winsup.api/ltp/setpgid01.c
@@ -117,11 +117,9 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/setregid01.c b/winsup/testsuite/winsup.api/ltp/setregid01.c
index e247f6c61..e4251f04e 100644
--- a/winsup/testsuite/winsup.api/ltp/setregid01.c
+++ b/winsup/testsuite/winsup.api/ltp/setregid01.c
@@ -123,7 +123,7 @@ extern void cleanup();
-char *TCID="setregid01"; /* Test program identifier. */
+const char *TCID="setregid01"; /* Test program identifier. */
int TST_TOTAL=5; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -166,7 +166,7 @@ main(int ac, char **av)
* Dont change either real or effective gid
*/
gid=getgid();
-egid=getegid();
+ egid=getegid();
/* Call setregid(2) */
diff --git a/winsup/testsuite/winsup.api/ltp/setreuid01.c b/winsup/testsuite/winsup.api/ltp/setreuid01.c
index 67f3bae4a..05467c80f 100644
--- a/winsup/testsuite/winsup.api/ltp/setreuid01.c
+++ b/winsup/testsuite/winsup.api/ltp/setreuid01.c
@@ -123,7 +123,7 @@ extern void cleanup();
-char *TCID="setreuid01"; /* Test program identifier. */
+const char *TCID="setreuid01"; /* Test program identifier. */
int TST_TOTAL=5; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -166,7 +166,7 @@ main(int ac, char **av)
* Don't change either real or effective uid
*/
ruid=getuid(); /* get real uid */
-euid=geteuid(); /* get effective uid */
+ euid=geteuid(); /* get effective uid */
/* Call setreuid(2) */
diff --git a/winsup/testsuite/winsup.api/ltp/setuid01.c b/winsup/testsuite/winsup.api/ltp/setuid01.c
index 4437108c8..37e18fd51 100644
--- a/winsup/testsuite/winsup.api/ltp/setuid01.c
+++ b/winsup/testsuite/winsup.api/ltp/setuid01.c
@@ -119,11 +119,11 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/setuid02.c b/winsup/testsuite/winsup.api/ltp/setuid02.c
index 65576af62..ee55ae19b 100644
--- a/winsup/testsuite/winsup.api/ltp/setuid02.c
+++ b/winsup/testsuite/winsup.api/ltp/setuid02.c
@@ -123,7 +123,7 @@ extern void cleanup();
-char *TCID="setuid02"; /* Test program identifier. */
+const char *TCID="setuid02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/signal03.c b/winsup/testsuite/winsup.api/ltp/signal03.c
index 38ba72b3c..2a0923ca2 100644
--- a/winsup/testsuite/winsup.api/ltp/signal03.c
+++ b/winsup/testsuite/winsup.api/ltp/signal03.c
@@ -161,17 +161,15 @@
#include <signal.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
-#include <stdlib.h>
#include <sys/wait.h>
#include "test.h"
#include "usctest.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
void do_test();
void sigdfl_test();
void update_timings();
@@ -212,7 +210,7 @@ struct ipc_t {
struct tblock timings;
} Ipc_info;
-char *TCID = "signal03";
+const char *TCID = "signal03";
int TST_TOTAL = 5;
extern int Tst_count; /* count of test items completed */
diff --git a/winsup/testsuite/winsup.api/ltp/stat01.c b/winsup/testsuite/winsup.api/ltp/stat01.c
index 46b8262d5..da3596e17 100644
--- a/winsup/testsuite/winsup.api/ltp/stat01.c
+++ b/winsup/testsuite/winsup.api/ltp/stat01.c
@@ -66,7 +66,6 @@
* Restrictions:
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
@@ -84,7 +83,7 @@
#define BUF_SIZE 256
#define MASK 0777
-char *TCID="stat01"; /* Test program identifier. */
+const char *TCID="stat01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={0};
@@ -94,7 +93,7 @@ char nobody_uid[] = "nobody";
struct passwd *ltpuser;
void setup(); /* Setup function for the test */
-void cleanup(); /* Cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* Cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/stat02.c b/winsup/testsuite/winsup.api/ltp/stat02.c
index 06bf73a35..745476fa0 100644
--- a/winsup/testsuite/winsup.api/ltp/stat02.c
+++ b/winsup/testsuite/winsup.api/ltp/stat02.c
@@ -67,7 +67,6 @@
* Restrictions:
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
@@ -86,7 +85,7 @@
#define NEW_MODE 0222
#define MASK 0777
-char *TCID="stat02"; /* Test program identifier. */
+const char *TCID="stat02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={0};
@@ -96,7 +95,7 @@ char nobody_uid[] = "nobody";
struct passwd *ltpuser;
void setup(); /* Setup function for the test */
-void cleanup(); /* Cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* Cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/stat03.c b/winsup/testsuite/winsup.api/ltp/stat03.c
index 2d04ec4fc..dcddfd2a0 100644
--- a/winsup/testsuite/winsup.api/ltp/stat03.c
+++ b/winsup/testsuite/winsup.api/ltp/stat03.c
@@ -74,9 +74,6 @@
*
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
@@ -106,8 +103,8 @@ char Longpathname[PATH_MAX+2];
char High_address_node[64];
struct test_case_t { /* test case struct. to hold ref. test cond's*/
- char *pathname;
- char *desc;
+ const char *pathname;
+ const char *desc;
int exp_errno;
int (*setupfunc)();
} Test_cases[] = {
@@ -124,13 +121,14 @@ struct test_case_t { /* test case struct. to hold ref. test cond's*/
{ NULL, NULL, 0, no_setup }
};
-char *TCID="stat03"; /* Test program identifier. */
+const char *TCID="stat03"; /* Test program identifier. */
int TST_TOTAL = 6; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={EACCES, EFAULT, ENAMETOOLONG, ENOENT, ENOTDIR, 0};
void setup(); /* Main setup function for the tests */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
+char *get_high_address(void);
int
main(int ac, char **av)
@@ -138,8 +136,8 @@ main(int ac, char **av)
struct stat stat_buf; /* stat structure buffer */
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *file_name; /* ptr. for file name whose mode is modified*/
- char *test_desc; /* test specific error message */
+ const char *file_name; /* ptr. for file name whose mode is modified*/
+ const char *test_desc; /* test specific error message */
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
diff --git a/winsup/testsuite/winsup.api/ltp/stat05.c b/winsup/testsuite/winsup.api/ltp/stat05.c
index ba102e3cb..5c0964a93 100644
--- a/winsup/testsuite/winsup.api/ltp/stat05.c
+++ b/winsup/testsuite/winsup.api/ltp/stat05.c
@@ -123,7 +123,7 @@ extern void cleanup();
-char *TCID="stat05"; /* Test program identifier. */
+const char *TCID="stat05"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/stat06.c b/winsup/testsuite/winsup.api/ltp/stat06.c
index 90ee05a4c..c5fae6fe5 100644
--- a/winsup/testsuite/winsup.api/ltp/stat06.c
+++ b/winsup/testsuite/winsup.api/ltp/stat06.c
@@ -118,14 +118,13 @@
#include <string.h>
#include <signal.h>
#include <setjmp.h>
-#include <unistd.h>
#include "test.h"
#include "usctest.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
-char *TCID="stat06"; /* Test program identifier. */
+const char *TCID="stat06"; /* Test program identifier. */
int TST_TOTAL=8; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -144,9 +143,9 @@ jmp_buf sig11_recover;
void sig11_handler(int sig);
struct test_case_t {
- char *pathname;
+ const char *pathname;
struct stat *stbuf;
- char *desc;
+ const char *desc;
int exp_errno;
int (*setupfunc)();
} Test_cases[] = {
@@ -173,8 +172,8 @@ main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *fname;
- char *desc;
+ const char *fname;
+ const char *desc;
int ind;
struct stat *stbuf;
struct sigaction sa, osa;
diff --git a/winsup/testsuite/winsup.api/ltp/symlink01.c b/winsup/testsuite/winsup.api/ltp/symlink01.c
index dcd6a749b..660a6d2e6 100644
--- a/winsup/testsuite/winsup.api/ltp/symlink01.c
+++ b/winsup/testsuite/winsup.api/ltp/symlink01.c
@@ -276,7 +276,6 @@
*
*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h> /* open(2) system call */
@@ -290,7 +289,7 @@
#include "usctest.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
void help();
void delete_files();
void do_EEXIST();
@@ -388,13 +387,13 @@ int creat_both(), creat_symlink(), creat_path_max(), ck_symlink(),
*/
struct all_test_cases
{
- char *tcid;
+ const char *tcid;
int test_fail;
int errno_val;
int pass_msg;
int (*test_setup)();
int (*ck_test)();
- char *fn_arg[3];
+ const char *fn_arg[3];
} test_objects[] = {
{SYMLINK, 0, 0, 0, creat_symlink, ck_symlink, {"%bc+eFhi!k", S_FILE, NULL}},
@@ -444,11 +443,11 @@ struct all_test_cases
*/
struct tcses
{
- char *tcid;
- char *syscall;
+ const char *tcid;
+ const char *syscall;
int test_cases; /* number of entries in test_objects array */
struct all_test_cases *tc_ptr;
- char *desc;
+ const char *desc;
} all_tcses[] = {
{ SYMLINK, "symlink", 5, &test_objects[0],
@@ -486,7 +485,7 @@ struct tcses
int TST_TOTAL;
int TEST_RESULT;
time_t a_time_value = 100;
-char *TCID = NULL;
+const char *TCID = NULL;
char *Selectedtests = NULL; /* Name (tcid) of selected test cases */
char test_msg[BUFMAX];
char full_path[PATH_MAX+1];
@@ -593,7 +592,7 @@ main(int argc, char *argv[])
struct tcses *get_tcs_info(ptr)
char *ptr;
{
- int ctr;
+ unsigned ctr;
struct tcses *tcs_ptr;
#if ALL
@@ -2022,7 +2021,7 @@ cleanup()
*/
void help()
{
- int ind;
+ unsigned ind;
printf(" -T id Determines which tests cases to execute:\n");
diff --git a/winsup/testsuite/winsup.api/ltp/symlink02.c b/winsup/testsuite/winsup.api/ltp/symlink02.c
index 9fbecf202..4157cea8a 100644
--- a/winsup/testsuite/winsup.api/ltp/symlink02.c
+++ b/winsup/testsuite/winsup.api/ltp/symlink02.c
@@ -122,7 +122,7 @@ extern void cleanup();
-char *TCID="symlink02"; /* Test program identifier. */
+const char *TCID="symlink02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/symlink03.c b/winsup/testsuite/winsup.api/ltp/symlink03.c
index 9cdb74b18..4d0542768 100644
--- a/winsup/testsuite/winsup.api/ltp/symlink03.c
+++ b/winsup/testsuite/winsup.api/ltp/symlink03.c
@@ -77,7 +77,6 @@
* This test should be executed by 'non-super-user' only.
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
@@ -99,7 +98,7 @@
#define TEST_FILE3 "tfile_3"
#define SYM_FILE3 "t_file/sfile_3"
-char *TCID="symlink03"; /* Test program identifier. */
+const char *TCID="symlink03"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={ENOTDIR, ENOENT, ENAMETOOLONG, EFAULT, EEXIST, EACCES, 0};
@@ -114,9 +113,9 @@ char Longpathname[PATH_MAX+2];
char High_address_node[64];
struct test_case_t { /* test case struct. to hold ref. test cond's*/
- char *file;
- char *link;
- char *desc;
+ const char *file;
+ const char *link;
+ const char *desc;
int exp_errno;
int (*setupfunc)();
} Test_cases[] = {
@@ -133,16 +132,17 @@ struct test_case_t { /* test case struct. to hold ref. test cond's*/
};
extern void setup(); /* Setup function for the test */
-extern void cleanup(); /* Cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* Cleanup function for the test */
+char *get_high_address (void);
int
main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *test_file; /* testfile name */
- char *sym_file; /* symbolic link file name */
- char *test_desc; /* test specific error message */
+ const char *test_file; /* testfile name */
+ const char *sym_file; /* symbolic link file name */
+ const char *test_desc; /* test specific error message */
int ind; /* counter to test different test conditions */
/* Parse standard options given to run the test. */
diff --git a/winsup/testsuite/winsup.api/ltp/symlink04.c b/winsup/testsuite/winsup.api/ltp/symlink04.c
index 8272d368c..c6ddd0630 100644
--- a/winsup/testsuite/winsup.api/ltp/symlink04.c
+++ b/winsup/testsuite/winsup.api/ltp/symlink04.c
@@ -68,7 +68,6 @@
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
@@ -82,13 +81,13 @@
#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)
diff --git a/winsup/testsuite/winsup.api/ltp/symlink05.c b/winsup/testsuite/winsup.api/ltp/symlink05.c
index 36aff558f..3b2bbcb8c 100644
--- a/winsup/testsuite/winsup.api/ltp/symlink05.c
+++ b/winsup/testsuite/winsup.api/ltp/symlink05.c
@@ -68,7 +68,6 @@
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <sys/fcntl.h>
#include <errno.h>
@@ -82,13 +81,13 @@
#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)
diff --git a/winsup/testsuite/winsup.api/ltp/sync01.c b/winsup/testsuite/winsup.api/ltp/sync01.c
index a32b24ba8..c7df322ea 100644
--- a/winsup/testsuite/winsup.api/ltp/sync01.c
+++ b/winsup/testsuite/winsup.api/ltp/sync01.c
@@ -120,7 +120,7 @@ extern void cleanup();
-char *TCID="sync01"; /* Test program identifier. */
+const char *TCID="sync01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/sync02.c b/winsup/testsuite/winsup.api/ltp/sync02.c
index 443df02bf..2173fd788 100644
--- a/winsup/testsuite/winsup.api/ltp/sync02.c
+++ b/winsup/testsuite/winsup.api/ltp/sync02.c
@@ -66,8 +66,6 @@
* None.
*/
-#include <stdio.h>
-#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
@@ -81,14 +79,14 @@
#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)
diff --git a/winsup/testsuite/winsup.api/ltp/time01.c b/winsup/testsuite/winsup.api/ltp/time01.c
index 570dedc6b..c5658e260 100644
--- a/winsup/testsuite/winsup.api/ltp/time01.c
+++ b/winsup/testsuite/winsup.api/ltp/time01.c
@@ -121,7 +121,7 @@ extern void cleanup();
-char *TCID="time01"; /* Test program identifier. */
+const char *TCID="time01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/time02.c b/winsup/testsuite/winsup.api/ltp/time02.c
index 827ed3201..011546e8f 100644
--- a/winsup/testsuite/winsup.api/ltp/time02.c
+++ b/winsup/testsuite/winsup.api/ltp/time02.c
@@ -67,7 +67,6 @@
*
*/
-#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -78,9 +77,9 @@
#include "usctest.h"
extern void setup(); /* setup function for the test */
-extern void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn));/* cleanup function for the test */
-char *TCID="time01"; /* Test program identifier. */
+const char *TCID="time01"; /* Test program identifier. */
int TST_TOTAL = 1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={0};
diff --git a/winsup/testsuite/winsup.api/ltp/times01.c b/winsup/testsuite/winsup.api/ltp/times01.c
index 0d8d1d0ca..a1bd1d838 100644
--- a/winsup/testsuite/winsup.api/ltp/times01.c
+++ b/winsup/testsuite/winsup.api/ltp/times01.c
@@ -122,7 +122,7 @@ extern void cleanup();
-char *TCID="times01"; /* Test program identifier. */
+const char *TCID="times01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/times02.c b/winsup/testsuite/winsup.api/ltp/times02.c
index 825046430..1dae36c5a 100644
--- a/winsup/testsuite/winsup.api/ltp/times02.c
+++ b/winsup/testsuite/winsup.api/ltp/times02.c
@@ -50,14 +50,15 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/times03.c b/winsup/testsuite/winsup.api/ltp/times03.c
index a388c77f7..4e3fb56f8 100644
--- a/winsup/testsuite/winsup.api/ltp/times03.c
+++ b/winsup/testsuite/winsup.api/ltp/times03.c
@@ -52,21 +52,22 @@
#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)) !=
diff --git a/winsup/testsuite/winsup.api/ltp/truncate01.c b/winsup/testsuite/winsup.api/ltp/truncate01.c
index d8dc1b68e..1e2931605 100644
--- a/winsup/testsuite/winsup.api/ltp/truncate01.c
+++ b/winsup/testsuite/winsup.api/ltp/truncate01.c
@@ -84,13 +84,13 @@
#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)
diff --git a/winsup/testsuite/winsup.api/ltp/truncate02.c b/winsup/testsuite/winsup.api/ltp/truncate02.c
index b6e535cca..4ba802949 100644
--- a/winsup/testsuite/winsup.api/ltp/truncate02.c
+++ b/winsup/testsuite/winsup.api/ltp/truncate02.c
@@ -86,7 +86,7 @@
#define TRUNC_LEN1 256 /* truncation length */
#define TRUNC_LEN2 512 /* truncation length */
-char *TCID="truncate02"; /* Test program identifier. */
+const char *TCID="truncate02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test conditions */
extern int Tst_count; /* Test Case counter for tst_* routines */
int fd; /* file descriptor of testfile */
@@ -94,7 +94,7 @@ char tst_buff[BUF_SIZE]; /* buffer to hold testfile contents */
int exp_enos[]={0};
void setup(); /* setup function for the test */
-void cleanup(); /* cleanup function for the test */
+void cleanup(void) __attribute__((noreturn)); /* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/ulimit01.c b/winsup/testsuite/winsup.api/ltp/ulimit01.c
index 655c9e32e..c3f09fba3 100644
--- a/winsup/testsuite/winsup.api/ltp/ulimit01.c
+++ b/winsup/testsuite/winsup.api/ltp/ulimit01.c
@@ -117,11 +117,11 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/umask01.c b/winsup/testsuite/winsup.api/ltp/umask01.c
index 04b385145..fb86f0d31 100644
--- a/winsup/testsuite/winsup.api/ltp/umask01.c
+++ b/winsup/testsuite/winsup.api/ltp/umask01.c
@@ -122,7 +122,7 @@ extern void cleanup();
-char *TCID="umask01"; /* Test program identifier. */
+const char *TCID="umask01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/umask02.c b/winsup/testsuite/winsup.api/ltp/umask02.c
index f7d7c3bc8..9a1c61c53 100644
--- a/winsup/testsuite/winsup.api/ltp/umask02.c
+++ b/winsup/testsuite/winsup.api/ltp/umask02.c
@@ -46,17 +46,18 @@
* 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 */
diff --git a/winsup/testsuite/winsup.api/ltp/umask03.c b/winsup/testsuite/winsup.api/ltp/umask03.c
index 8d032ca5c..fbe2d5caa 100644
--- a/winsup/testsuite/winsup.api/ltp/umask03.c
+++ b/winsup/testsuite/winsup.api/ltp/umask03.c
@@ -45,21 +45,22 @@
* 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;
diff --git a/winsup/testsuite/winsup.api/ltp/uname01.c b/winsup/testsuite/winsup.api/ltp/uname01.c
index e2f8f8b0c..36b166786 100644
--- a/winsup/testsuite/winsup.api/ltp/uname01.c
+++ b/winsup/testsuite/winsup.api/ltp/uname01.c
@@ -121,7 +121,7 @@ extern void cleanup();
-char *TCID="uname01"; /* Test program identifier. */
+const char *TCID="uname01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/unlink05.c b/winsup/testsuite/winsup.api/ltp/unlink05.c
index 63e97df89..3aae0cf0d 100644
--- a/winsup/testsuite/winsup.api/ltp/unlink05.c
+++ b/winsup/testsuite/winsup.api/ltp/unlink05.c
@@ -123,7 +123,7 @@ void create_file();
-char *TCID="unlink05"; /* Test program identifier. */
+const char *TCID="unlink05"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/unlink06.c b/winsup/testsuite/winsup.api/ltp/unlink06.c
index 3d0690383..a62a268c0 100644
--- a/winsup/testsuite/winsup.api/ltp/unlink06.c
+++ b/winsup/testsuite/winsup.api/ltp/unlink06.c
@@ -115,16 +115,15 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/unlink07.c b/winsup/testsuite/winsup.api/ltp/unlink07.c
index 889b60959..133109621 100644
--- a/winsup/testsuite/winsup.api/ltp/unlink07.c
+++ b/winsup/testsuite/winsup.api/ltp/unlink07.c
@@ -115,18 +115,17 @@
#include <errno.h>
#include <string.h>
#include <signal.h>
-#include <unistd.h>
#include <sys/param.h> /* for PATH_MAX */
#include "test.h"
#include "usctest.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
extern char *get_high_address();
-char *TCID="unlink07"; /* Test program identifier. */
+const char *TCID="unlink07"; /* Test program identifier. */
int TST_TOTAL=6; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -139,8 +138,8 @@ char Longpathname[PATH_MAX+2];
char High_address[64];
struct test_case_t {
- char *pathname;
- char *desc;
+ const char *pathname;
+ const char *desc;
int exp_errno;
int (*setupfunc)();
} Test_cases[] = {
@@ -167,8 +166,8 @@ main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *fname;
- char *desc;
+ const char *fname;
+ const char *desc;
int ind;
/***************************************************************
diff --git a/winsup/testsuite/winsup.api/ltp/unlink08.c b/winsup/testsuite/winsup.api/ltp/unlink08.c
index a426aa03f..e793b46f2 100644
--- a/winsup/testsuite/winsup.api/ltp/unlink08.c
+++ b/winsup/testsuite/winsup.api/ltp/unlink08.c
@@ -114,17 +114,16 @@
#include <sys/stat.h>
#include <errno.h>
#include <signal.h>
-#include <unistd.h>
#include <string.h>
#include "test.h"
#include "usctest.h"
void setup();
-void cleanup();
+void cleanup(void) __attribute__((noreturn));
-char *TCID="unlink08"; /* Test program identifier. */
+const char *TCID="unlink08"; /* Test program identifier. */
int TST_TOTAL=3; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
@@ -136,8 +135,8 @@ int dir_setup();
int no_setup();
struct test_case_t {
- char *pathname;
- char *desc;
+ const char *pathname;
+ const char *desc;
int (*setupfunc)();
int exp_ret; /* -1 means error, 0 means != -1 */
int exp_errno;
@@ -163,8 +162,8 @@ main(int ac, char **av)
{
int lc; /* loop counter */
const char *msg; /* message returned from parse_opts */
- char *fname;
- char *desc;
+ const char *fname;
+ const char *desc;
int ind;
/***************************************************************
diff --git a/winsup/testsuite/winsup.api/ltp/vfork01.c b/winsup/testsuite/winsup.api/ltp/vfork01.c
index 41e48c461..2792ce08b 100644
--- a/winsup/testsuite/winsup.api/ltp/vfork01.c
+++ b/winsup/testsuite/winsup.api/ltp/vfork01.c
@@ -69,10 +69,8 @@
*
*/
-#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <signal.h>
@@ -82,7 +80,7 @@
#include "test.h"
#include "usctest.h"
-char *TCID="vfork01"; /* Test program identifier. */
+const char *TCID="vfork01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
int exp_enos[]={0};
@@ -104,7 +102,7 @@ struct stat Stat_cwd_Pbuf;
struct stat Stat_cwd_Cbuf;
void setup(); /* Main setup function of test */
-void cleanup(); /* cleanup function for the test */
+void cleanup() __attribute__((noreturn));/* cleanup function for the test */
int
main(int ac, char **av)
diff --git a/winsup/testsuite/winsup.api/ltp/wait02.c b/winsup/testsuite/winsup.api/ltp/wait02.c
index 8b4f41b09..a7de67a28 100644
--- a/winsup/testsuite/winsup.api/ltp/wait02.c
+++ b/winsup/testsuite/winsup.api/ltp/wait02.c
@@ -122,7 +122,7 @@ extern void cleanup();
-char *TCID="wait02"; /* Test program identifier. */
+const char *TCID="wait02"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/wait401.c b/winsup/testsuite/winsup.api/ltp/wait401.c
index 0d307e247..51f71da55 100644
--- a/winsup/testsuite/winsup.api/ltp/wait401.c
+++ b/winsup/testsuite/winsup.api/ltp/wait401.c
@@ -64,13 +64,14 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/wait402.c b/winsup/testsuite/winsup.api/ltp/wait402.c
index 43a5c22d3..30f7500ac 100644
--- a/winsup/testsuite/winsup.api/ltp/wait402.c
+++ b/winsup/testsuite/winsup.api/ltp/wait402.c
@@ -73,15 +73,16 @@
#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 */
diff --git a/winsup/testsuite/winsup.api/ltp/write01.c b/winsup/testsuite/winsup.api/ltp/write01.c
index 0fae9aea1..355190af6 100644
--- a/winsup/testsuite/winsup.api/ltp/write01.c
+++ b/winsup/testsuite/winsup.api/ltp/write01.c
@@ -127,7 +127,7 @@ extern void cleanup();
-char *TCID="write01"; /* Test program identifier. */
+const char *TCID="write01"; /* Test program identifier. */
int TST_TOTAL=1; /* Total number of test cases. */
extern int Tst_count; /* Test Case counter for tst_* routines */
diff --git a/winsup/testsuite/winsup.api/ltp/write02.c b/winsup/testsuite/winsup.api/ltp/write02.c
index 1ee10fd9a..a5675bd6d 100644
--- a/winsup/testsuite/winsup.api/ltp/write02.c
+++ b/winsup/testsuite/winsup.api/ltp/write02.c
@@ -48,19 +48,20 @@
*/
#include <errno.h>
-#include <stdio.h>
#include "test.h"
#include "usctest.h"
+#include <fcntl.h>
-char *TCID = "write02()";
+const char *TCID = "write02()";
int TST_TOTAL = 1;
extern int Tst_count;
-void cleanup(void);
+void cleanup(void) __attribute__ ((noreturn));
void setup(void);
char pfiln[40] = "";
+int
main(int argc, char **argv)
{
int lc; /* loop counter */
@@ -73,7 +74,7 @@ main(int argc, char **argv)
char pwbuf[BUFSIZ + 1];
/* parse standard options */
- if (msg = parse_opts(argc, argv, (option_t *) NULL, NULL)) {
+ if ((msg = parse_opts(argc, argv, (option_t *) NULL, NULL))) {
tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
/*NOTREACHED*/
}
@@ -86,7 +87,6 @@ main(int argc, char **argv)
/* reset Tst_count in case we are looping */
Tst_count = 0;
-block1:
tst_resm(TINFO, "Block 1: test to see write() returns proper "
"write count");
diff --git a/winsup/testsuite/winsup.api/ltp/write03.c b/winsup/testsuite/winsup.api/ltp/write03.c
index 5343c6484..7d6f1f945 100644
--- a/winsup/testsuite/winsup.api/ltp/write03.c
+++ b/winsup/testsuite/winsup.api/ltp/write03.c
@@ -47,7 +47,6 @@
* NONE
*/
-#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
@@ -57,16 +56,17 @@
/* 0 terminated list of expected errnos */
int exp_enos[] = {14,0};
-char *TCID = "write03";
+const char *TCID = "write03";
int TST_TOTAL = 1;
extern int Tst_count;
void setup(void);
-void cleanup(void);
+void cleanup(void) __attribute__((noreturn));
int fd = -1;
char filename[100];
+int
main(int argc, char **argv)
{
int lc; /* loop counter */
@@ -90,7 +90,6 @@ main(int argc, char **argv)
/* reset Tst_count in case we are looping */
Tst_count = 0;
-block1:
tst_resm(TINFO, "Enter Block 1: test to check if write "
"corrupts the file when write fails");
diff --git a/winsup/testsuite/winsup.api/mmaptest01.c b/winsup/testsuite/winsup.api/mmaptest01.c
index 4add28001..33545587c 100644
--- a/winsup/testsuite/winsup.api/mmaptest01.c
+++ b/winsup/testsuite/winsup.api/mmaptest01.c
@@ -50,8 +50,6 @@
#include <sys/mman.h>
#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "test.h"
diff --git a/winsup/testsuite/winsup.api/pthread/cancel9.c b/winsup/testsuite/winsup.api/pthread/cancel9.c
index f9f05cc65..1cbf62d2c 100644
--- a/winsup/testsuite/winsup.api/pthread/cancel9.c
+++ b/winsup/testsuite/winsup.api/pthread/cancel9.c
@@ -40,6 +40,8 @@
*/
#include "test.h"
+#include <assert.h>
+#include <sys/wait.h>
static pid_t pid;
diff --git a/winsup/testsuite/winsup.api/pthread/test.h b/winsup/testsuite/winsup.api/pthread/test.h
index 3e662a315..0e7246420 100644
--- a/winsup/testsuite/winsup.api/pthread/test.h
+++ b/winsup/testsuite/winsup.api/pthread/test.h
@@ -7,12 +7,15 @@
#ifndef _PTHREAD_TEST_H_
#define _PTHREAD_TEST_H_
-#include "pthread.h"
-#include "sched.h"
-#include "semaphore.h"
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
#include <stdio.h>
-#include <windows.h>
+#include <unistd.h>
+#include <stdlib.h>
#include <errno.h>
+#include <assert.h>
+#include <windows.h>
/* #define assert(x) do { fprint (stderr, "assertion failed\n"); exit(1) } while (0) */
diff --git a/winsup/testsuite/winsup.api/samples/sample-fail.c b/winsup/testsuite/winsup.api/samples/sample-fail.c
index d8beb90be..d0d3e4a6a 100644
--- a/winsup/testsuite/winsup.api/samples/sample-fail.c
+++ b/winsup/testsuite/winsup.api/samples/sample-fail.c
@@ -1,3 +1,4 @@
+int
main()
{
return 1;
diff --git a/winsup/testsuite/winsup.api/samples/sample-pass.c b/winsup/testsuite/winsup.api/samples/sample-pass.c
index 893a0b605..8e8f518aa 100644
--- a/winsup/testsuite/winsup.api/samples/sample-pass.c
+++ b/winsup/testsuite/winsup.api/samples/sample-pass.c
@@ -1,3 +1,4 @@
+int
main()
{
return 0;