Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UnixBench/src/arith.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int dumb_stuff(int);
volatile unsigned long iter;

/* this function is called when the alarm expires */
void report()
void report(int sig)
{
fprintf(stderr,"COUNT|%ld|1|lps\n", iter);
exit(0);
Expand Down
8 changes: 4 additions & 4 deletions UnixBench/src/big.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

void wrapup(const char *);
void onalarm(int);
void pipeerr();
void grunt();
void pipeerr(int);
void grunt(int);
void getwork(void);
#if debug
void dumpwork(void);
Expand Down Expand Up @@ -405,14 +405,14 @@ void onalarm(int foo)
alarm(GRANULE);
}

void grunt()
void grunt(int sig)
{
/* timeout after label "bepatient" in main */
exit_status = 4;
wrapup("Timed out waiting for jobs to finish ...");
}

void pipeerr()
void pipeerr(int sig)
{
sigpipe++;
}
Expand Down
10 changes: 5 additions & 5 deletions UnixBench/src/context1.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ char SCCSid[] = "@(#) @(#)context1.c:3.3 -- 5/15/91 19:30:18";

unsigned long iter;

void report()
void report(int sig)
{
fprintf(stderr, "COUNT|%lu|1|lps\n", iter);
exit(0);
Expand Down Expand Up @@ -70,7 +70,7 @@ char *argv[];
if ((ret = write(p1[1], (char *)&iter, sizeof(iter))) != sizeof(iter)) {
if ((ret == -1) && (errno == EPIPE)) {
alarm(0);
report(); /* does not return */
report(0); /* does not return */
}
if ((ret == -1) && (errno != 0) && (errno != EINTR))
perror("master write failed");
Expand All @@ -79,7 +79,7 @@ char *argv[];
if ((ret = read(p2[0], (char *)&check, sizeof(check))) != sizeof(check)) {
if ((ret == 0)) { /* end-of-stream */
alarm(0);
report(); /* does not return */
report(0); /* does not return */
}
if ((ret == -1) && (errno != 0) && (errno != EINTR))
perror("master read failed");
Expand All @@ -100,7 +100,7 @@ char *argv[];
if ((ret = read(p1[0], (char *)&check, sizeof(check))) != sizeof(check)) {
if ((ret == 0)) { /* end-of-stream */
alarm(0);
report(); /* does not return */
report(0); /* does not return */
}
if ((ret == -1) && (errno != 0) && (errno != EINTR))
perror("slave read failed");
Expand All @@ -114,7 +114,7 @@ char *argv[];
if ((ret = write(p2[1], (char *)&iter, sizeof(iter))) != sizeof(check)) {
if ((ret == -1) && (errno == EPIPE)) {
alarm(0);
report(); /* does not return */
report(0); /* does not return */
}
if ((ret == -1) && (errno != 0) && (errno != EINTR))
perror("slave write failed");
Expand Down
4 changes: 2 additions & 2 deletions UnixBench/src/dhry_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ char SCCSid[] = "@(#) @(#)dhry_1.c:3.4 -- 5/15/91 19:30:21";

unsigned long Run_Index;

void report()
void report(int sig)
{
fprintf(stderr,"COUNT|%ld|1|lps\n", Run_Index);
exit(0);
Expand All @@ -59,7 +59,7 @@ char Ch_1_Glob,
int Arr_1_Glob [50];
int Arr_2_Glob [50] [50];

Enumeration Func_1 ();
Enumeration Func_1 (char, char);
/* forward declaration necessary since Enumeration may not simply be int */

#ifndef REG
Expand Down
2 changes: 1 addition & 1 deletion UnixBench/src/execl.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ char bss[8*1024]; /* something worthwhile */
#undef main

/* added by BYTE */
char *getenv();
char *getenv(const char *name);


int main(argc, argv) /* the real program */
Expand Down
22 changes: 11 additions & 11 deletions UnixBench/src/fstime.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ char buf[MAX_BUFSIZE];
int f;
int g;
int i;
void stop_count();
void clean_up();
void stop_count(int);
void clean_up(int);
int sigalarm = 0;

/******************** MAIN ****************************/
Expand Down Expand Up @@ -199,7 +199,7 @@ char *argv[];
for (i=0; i < bufsize; ++i)
buf[i] = i & 0xff;

signal(SIGKILL,clean_up);
signal(SIGKILL, clean_up);

/*
* Run the selected test.
Expand Down Expand Up @@ -239,11 +239,11 @@ char *argv[];
exit(6);
}
if (status) {
clean_up();
clean_up(0);
exit(1);
}

clean_up();
clean_up(0);
exit(0);
}

Expand Down Expand Up @@ -288,7 +288,7 @@ int w_test(int timeSecs)
perror("fstime: write");
return(-1);
}
stop_count();
stop_count(0);
counted += ((tmp+HALFCOUNT)/COUNTSIZE);
} else
counted += count_per_buf;
Expand Down Expand Up @@ -348,7 +348,7 @@ int r_test(int timeSecs)
counted += (tmp+HALFCOUNT)/COUNTSIZE;
continue;
case EINTR:
stop_count();
stop_count(0);
counted += (tmp+HALFCOUNT)/COUNTSIZE;
break;
default:
Expand Down Expand Up @@ -415,7 +415,7 @@ int c_test(int timeSecs)
counted += ( (tmp * write_score) /
(read_score + write_score)
+ HALFCOUNT) / COUNTSIZE;
stop_count();
stop_count(0);
break;
default:
perror("fstime: copy read");
Expand All @@ -436,7 +436,7 @@ int c_test(int timeSecs)
( ((bufsize - tmp) * write_score) /
(read_score + write_score) )
+ HALFCOUNT) / COUNTSIZE;
stop_count();
stop_count(0);
} else
counted += count_per_buf;
}
Expand All @@ -457,13 +457,13 @@ int c_test(int timeSecs)
return(0);
}

void stop_count(void)
void stop_count(int sig)
{
extern int sigalarm;
sigalarm = 1;
}

void clean_up(void)
void clean_up(int sig)
{
unlink(FNAME0);
unlink(FNAME1);
Expand Down
2 changes: 1 addition & 1 deletion UnixBench/src/hanoi.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ unsigned long iter = 0;
int num[4];
long cnt;

void report()
void report(int sig)
{
fprintf(stderr,"COUNT|%ld|1|lps\n", iter);
exit(0);
Expand Down
2 changes: 1 addition & 1 deletion UnixBench/src/looper.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ unsigned long iter;
char *cmd_argv[28];
int cmd_argc;

void report(void)
void report(int sig)
{
fprintf(stderr,"COUNT|%lu|60|lpm\n", iter);
exit(0);
Expand Down
2 changes: 1 addition & 1 deletion UnixBench/src/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ char SCCSid[] = "@(#) @(#)pipe.c:3.3 -- 5/15/91 19:30:20";

unsigned long iter;

void report()
void report(int sig)
{
fprintf(stderr,"COUNT|%ld|1|lps\n", iter);
exit(0);
Expand Down
2 changes: 1 addition & 1 deletion UnixBench/src/spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ char SCCSid[] = "@(#) @(#)spawn.c:3.3 -- 5/15/91 19:30:20";

unsigned long iter;

void report()
void report(int sig)
{
fprintf(stderr,"COUNT|%lu|1|lps\n", iter);
exit(0);
Expand Down
2 changes: 1 addition & 1 deletion UnixBench/src/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ char SCCSid[] = "@(#) @(#)syscall.c:3.3 -- 5/15/91 19:30:21";

unsigned long iter;

void report()
void report(int sig)
{
fprintf(stderr,"COUNT|%ld|1|lps\n", iter);
exit(0);
Expand Down
2 changes: 1 addition & 1 deletion UnixBench/src/timeit.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

void wake_me(seconds, func)
int seconds;
void (*func)();
void (*func)(int);
{
/* set up the signal handler */
signal(SIGALRM, func);
Expand Down