Skip to content
Open
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
34 changes: 17 additions & 17 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ fi

# check for bcopy (optionally set the SYS5 flag)
echo "#include <string.h>" > ${BASE}$$.c
echo "main() { char a[256], b[256]; bcopy(a, b, 256); }" >> ${BASE}$$.c
echo "int main() { char a[256], b[256]; bcopy(a, b, 256); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
|| CFLAGS="${CFLAGS} -DSYS5"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c

# check for valloc
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "main() { char* buf = valloc(123); }" >> ${BASE}$$.c
echo "int main() { char* buf = valloc(123); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
|| CFLAGS="${CFLAGS} -Dvalloc=malloc"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -70,7 +70,7 @@ echo "#include <sys/resource.h>" >> ${BASE}$$.c
echo "#ifndef RUSAGE_SELF" >> ${BASE}$$.c
echo "#define RUSAGE_SELF 0" >> ${BASE}$$.c
echo "#endif /* RUSAGE_SELF */" >> ${BASE}$$.c
echo "main() { struct rusage ru; getrusage(RUSAGE_SELF, &ru); }" >> ${BASE}$$.c
echo "int main() { struct rusage ru; getrusage(RUSAGE_SELF, &ru); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DRUSAGE"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand Down Expand Up @@ -118,13 +118,13 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c

# check for OSs that have S_IFFIFO instead of S_IFIFO
echo "#include <sys/stat.h>" > ${BASE}$$.c
echo "main() { return (S_IFIFO); }" >> ${BASE}$$.c
echo "int main() { return (S_IFIFO); }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL}; then
true;
else
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
echo "#include <sys/stat.h>" > ${BASE}$$.c
echo "main() { return (S_IFFIFO); }" >> ${BASE}$$.c
echo "int main() { return (S_IFFIFO); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
|| CFLAGS="${CFLAGS} -DS_IFIFO=S_IFFIFO"
fi
Expand All @@ -133,7 +133,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
# check that we have uint
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "main() { uint i = 0; return (i); }" >> ${BASE}$$.c
echo "int main() { uint i = 0; return (i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_uint=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -143,7 +143,7 @@ HAVE_uint64=0
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <rpc/types.h>" >> ${BASE}$$.c
echo "main() { uint64 i = 0; return (int)(i); }" >> ${BASE}$$.c
echo "int main() { uint64 i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_uint64=1" && HAVE_uint64=1;
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -152,7 +152,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
if [ ${HAVE_uint64} = 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "main() { uint64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
echo "int main() { uint64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_uint64_t=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -163,7 +163,7 @@ HAVE_int64=0
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <rpc/types.h>" >> ${BASE}$$.c
echo "main() { int64 i = 0; return (int)(i); }" >> ${BASE}$$.c
echo "int main() { int64 i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_int64=1" && HAVE_int64=1;
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -172,7 +172,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
if [ ${HAVE_int64} = 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "main() { int64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
echo "int main() { int64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_int64_t=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -181,7 +181,7 @@ fi
# check that we have drand48 and srand48
HAVE_RANDOM=0
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "main() { srand48(973); return (int)(1.0E9 * drand48()); }" >> ${BASE}$$.c
echo "int main() { srand48(973); return (int)(1.0E9 * drand48()); }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL}; then
CFLAGS="${CFLAGS} -DHAVE_DRAND48"
HAVE_RANDOM=1
Expand All @@ -190,7 +190,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c

if [ ${HAVE_RANDOM} -eq 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "main() { srand(973); return (10 * rand()) / RAND_MAX; }" >> ${BASE}$$.c
echo "int main() { srand(973); return (10 * rand()) / RAND_MAX; }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL}; then
CFLAGS="${CFLAGS} -DHAVE_RAND"
HAVE_RANDOM=1
Expand All @@ -200,7 +200,7 @@ fi

if [ ${HAVE_RANDOM} -eq 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "main() { srandom(973); return (10 * random()) / RAND_MAX; }" >> ${BASE}$$.c
echo "int main() { srandom(973); return (10 * random()) / RAND_MAX; }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL}; then
CFLAGS="${CFLAGS} -DHAVE_RANDOM"
HAVE_RANDOM=1
Expand All @@ -211,7 +211,7 @@ fi
# check that we have sysmp
echo "#include <sys/types.h>" > ${BASE}$$.c
echo "#include <sys/sysmp.h>" >> ${BASE}$$.c
echo "main() { return (int)sysmp(MP_NPROCS); }" >> ${BASE}$$.c
echo "int main() { return (int)sysmp(MP_NPROCS); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_SYSMP=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -221,7 +221,7 @@ echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <unistd.h>" >> ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <sys/processor.h>" >> ${BASE}$$.c
echo "main() { return bindprocessor(BINDPROCESS, getpid(), 0); }" >> ${BASE}$$.c
echo "int main() { return bindprocessor(BINDPROCESS, getpid(), 0); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_BINDPROCESSOR=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -231,7 +231,7 @@ echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <sys/processor.h>" >> ${BASE}$$.c
echo "#include <sys/procset.h>" >> ${BASE}$$.c
echo "main() { return processor(P_PID, P_MYPID, 0, NULL); }" >> ${BASE}$$.c
echo "int main() { return processor(P_PID, P_MYPID, 0, NULL); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_BINDPROCESSOR=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand All @@ -240,7 +240,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <unistd.h>" >> ${BASE}$$.c
echo "#include <sched.h>" >> ${BASE}$$.c
echo "main() { unsigned long mask = 1; return sched_setaffinity(0, sizeof(unsigned long), &mask); }" >> ${BASE}$$.c
echo "int main() { unsigned long mask = 1; return sched_setaffinity(0, sizeof(unsigned long), &mask); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_SCHED_SETAFFINITY=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
Expand Down
4 changes: 2 additions & 2 deletions src/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ extern int handle_scheduler(int childno, int benchproc, int nbenchprocs);
#define XACT_VERS ((u_long)1)
#define RPC_XACT ((u_long)1)
#define RPC_EXIT ((u_long)2)
extern char *rpc_xact_1();
extern char *client_rpc_xact_1();
extern char *rpc_xact_1(char *msg, register SVCXPRT *transp);
extern char *client_rpc_xact_1(char *argp, CLIENT *clnt);

void lmbench_usage(int argc, char *argv[], char* usage);

Expand Down
18 changes: 7 additions & 11 deletions src/lat_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,14 @@ client_rpc_xact_1(char *argp, CLIENT *clnt)
*/
/* ARGSUSED */
char *
rpc_xact_1(msg, transp)
char *msg;
register SVCXPRT *transp;
rpc_xact_1(char *msg, register SVCXPRT *transp)
{
static char r = 123;

return &r;
}

static void xact_prog_1();
static void xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp);

void
server_main()
Expand Down Expand Up @@ -237,16 +235,14 @@ server_main()
}

static void
xact_prog_1(rqstp, transp)
struct svc_req *rqstp;
register SVCXPRT *transp;
xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp)
{
union {
char rpc_xact_1_arg;
} argument;
char *result;
bool_t (*xdr_argument)(), (*xdr_result)();
char *(*local)();
bool_t (*xdr_argument)(XDR *, char *), (*xdr_result)(XDR *, char *);
char *(*local)(char *, struct svc_req *);

switch (rqstp->rq_proc) {
case NULLPROC:
Expand All @@ -256,7 +252,7 @@ xact_prog_1(rqstp, transp)
case RPC_XACT:
xdr_argument = xdr_char;
xdr_result = xdr_char;
local = (char *(*)()) rpc_xact_1;
local = (char *(*)(char *, struct svc_req *)) rpc_xact_1;
break;

case RPC_EXIT:
Expand All @@ -273,7 +269,7 @@ xact_prog_1(rqstp, transp)
svcerr_decode(transp);
return;
}
result = (*local)(&argument, rqstp);
result = (*local)((char *)&argument, rqstp);
if (result != NULL && !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
svcerr_systemerr(transp);
}
Expand Down
4 changes: 2 additions & 2 deletions src/lat_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ char *id = "$Id$\n";

uint64 caught, n;
double adj;
void handler() { }
void handler(int) { }
jmp_buf prot_env;

void
Expand Down Expand Up @@ -69,7 +69,7 @@ struct _state {
};

void
prot() {
prot(int) {
if (++caught == n) {
caught = 0;
n = benchmp_interval(benchmp_getstate());
Expand Down
4 changes: 2 additions & 2 deletions src/lat_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ char *id = "$Id$\n";

void client_main(int ac, char **av);
void server_main();
void timeout();
void timeout(int signum);
void init(iter_t iterations, void* cookie);
void cleanup(iter_t iterations, void* cookie);
void doit(iter_t iterations, void* cookie);
Expand Down Expand Up @@ -164,7 +164,7 @@ cleanup(iter_t iterations, void* cookie)
}

void
timeout()
timeout(int signum)
{
fprintf(stderr, "Recv timed out\n");
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion src/lat_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void
initialize(iter_t iterations, void* cookie)
{
struct _state* pState = (struct _state*)cookie;
void exit();
void exit(int);

if (iterations) return;

Expand Down
2 changes: 1 addition & 1 deletion src/lat_usleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bench_pselect(iter_t iterations, void *cookie)
#endif /* _POSIX_SELECT */

void
interval()
interval(int)
{
if (++caught == n) {
caught = 0;
Expand Down
18 changes: 9 additions & 9 deletions src/lmdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int norepeats = -1;
bds_msg *m1, *m2;
#endif

uint64 getarg();
uint64 getarg(char *s, int ac, char **av);
int been_there(uint64 off);
int getfile(char *s, int ac, char **av);

Expand Down Expand Up @@ -156,7 +156,7 @@ char *cmds[] = {


void error(char *);
void done();
void done(int signum);
#ifdef DBG
extern int dbg;
#endif
Expand All @@ -170,7 +170,7 @@ main(int ac, char **av)
int Fork, misses, mismatch, outpat, inpat, in, timeopen, gotcnt;
int slp;
uint64 skip, size, count;
void chkarg();
void chkarg(char *arg);
int i;
uint64 off = 0;
int touch;
Expand Down Expand Up @@ -340,7 +340,7 @@ main(int ac, char **av)
register int moved;

if (gotcnt && count-- <= 0) {
done();
done(0);
}

/*
Expand Down Expand Up @@ -453,7 +453,7 @@ main(int ac, char **av)
perror("read");
}
if (moved <= 0) {
done();
done(0);
}
if (inpat != -1) {
register int foo, cnt;
Expand All @@ -466,7 +466,7 @@ main(int ac, char **av)
(uint)(off + foo*sizeof(int)),
buf[foo]);
if (mismatch != -1 && --misses == 0) {
done();
done(0);
}
}
}
Expand Down Expand Up @@ -531,7 +531,7 @@ main(int ac, char **av)
if (moved2 != moved) {
fprintf(stderr, "write: wanted=%d got=%d\n",
moved, moved2);
done();
done(0);
}
if ((Wtmax != -1) || (Wtmin != -1)) {
int mics = stop(&start_tv, &stop_tv);
Expand Down Expand Up @@ -568,7 +568,7 @@ main(int ac, char **av)
perror("write");
}
if (moved2 != moved) {
done();
done(0);
}

if (touch) {
Expand Down Expand Up @@ -634,7 +634,7 @@ chkarg(char *arg)
}

void
done(void)
done(int signum)
{
int i;
int step;
Expand Down
4 changes: 2 additions & 2 deletions src/lmhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ char *buf;
char *bufs[3];
int Dflg, dflg, nflg, lflg, fflg, zflg;
int data, logfile;
void die();
void die(int signum);
void worker();
char *http_time(void);
char *date(time_t *tt);
Expand Down Expand Up @@ -387,7 +387,7 @@ logit(int sock, char *name, int size)
nbytes += len;
}

void die()
void die(int signum)
{
if (nbytes) {
write(logfile, logbuf, nbytes);
Expand Down
2 changes: 1 addition & 1 deletion src/memsize.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ test_malloc(size_t size)
}

void
gotalarm()
gotalarm(int)
{
alarm_triggered = 1;
}
Expand Down