* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
rc = read(fd, buf, sizeof(buf));
if (rc == -1) {
pos = lseek(fd, 0, SEEK_CUR);
- sprintf(errmsg, "read of file %s at pos %d for %lu bytes "
+ sprintf(errmsg, "read of file %s at pos %d for %zu bytes "
"returned %d: (%d) %s.\n",
- filename, pos, (unsigned long)sizeof(buf), rc, errno, strerror(errno));
+ filename, pos, sizeof(buf), rc, errno, strerror(errno));
FAIL(errmsg);
} else if (rc != sizeof(buf)) {
pos = lseek(fd, 0, SEEK_CUR);
- sprintf(errmsg, "read of file %s at pos %d for %lu bytes "
+ sprintf(errmsg, "read of file %s at pos %d for %zu bytes "
"returned %d.\n",
- filename, pos, (unsigned long) sizeof(buf), rc);
+ filename, pos, sizeof(buf), rc);
FAIL(errmsg);
}
}
lseek(fd, pos, SEEK_SET);
rc = write(fd, buf, sizeof(buf));
if (rc == -1) {
- sprintf(errmsg, "write of file %s at pos %d for %lu bytes "
+ sprintf(errmsg, "write of file %s at pos %d for %zu bytes "
"returned %d: (%d) %s.\n",
- filename, pos, (unsigned long)sizeof(buf), rc, errno, strerror(errno));
+ filename, pos, sizeof(buf), rc, errno, strerror(errno));
FAIL(errmsg);
} else if (rc != sizeof(buf)) {
- sprintf(errmsg, "write of file %s at pos %d for %lu bytes "
+ sprintf(errmsg, "write of file %s at pos %d for %zu bytes "
"returned %d.\n",
- filename, pos, (unsigned long)sizeof(buf), rc);
+ filename, pos, sizeof(buf), rc);
FAIL(errmsg);
}
}
int main(int argc, char *argv[])
{
- char c;
- int i, iterations = 1;
+ int i, iterations = 1, c;
setbuf(stdout, 0);
setbuf(stderr, 0);
if (size < MIN_GLHOST) {
fprintf(stderr, "Error: "
- "should be at least four tasks to run the test!\n");
+ "%d tasks run, but should be at least %d tasks to run "
+ "the test!\n", size, MIN_GLHOST);
MPI_Abort(MPI_COMM_WORLD, 2);
}