o->unit_base = N2S_BYTEPERSEC;
}
-#ifndef FIO_HAVE_ANY_FALLOCATE
- /* Platform doesn't support any fallocate so force it to none */
- o->fallocate_mode = FIO_FALLOCATE_NONE;
-#endif
-
#ifndef CONFIG_FDATASYNC
if (o->fdatasync_blocks) {
log_info("fio: this platform does not support fdatasync()"
static int setup_random_seeds(struct thread_data *td)
{
- unsigned long seed;
+ uint64_t seed;
unsigned int i;
if (!td->o.rand_repeatable && !fio_option_is_set(&td->o, rand_seed)) {
for (f = &fpre_keywords[0]; f->keyword; f++)
f->strlen = strlen(f->keyword);
- buf[buf_size - 1] = '\0';
- strncpy(buf, o->filename_format, buf_size - 1);
+ snprintf(buf, buf_size, "%s", o->filename_format);
memset(copy, 0, sizeof(copy));
for (f = &fpre_keywords[0]; f->keyword; f++) {
if (post_start)
strncpy(dst, buf + post_start, dst_left);
- strncpy(buf, copy, buf_size - 1);
+ snprintf(buf, buf_size, "%s", copy);
} while (1);
}
int recursed, int client_type)
{
unsigned int i;
- char fname[PATH_MAX];
+ char fname[PATH_MAX + 1];
int numjobs, file_alloced;
struct thread_options *o = &td->o;
char logname[PATH_MAX + 32];
}
}
- string = malloc(4096);
+ string = malloc(OPT_LEN_MAX);
/*
* it's really 256 + small bit, 280 should suffice
if (is_buf)
p = strsep(&file, "\n");
else
- p = fgets(string, 4096, f);
+ p = fgets(string, OPT_LEN_MAX, f);
if (!p)
break;
}
if (is_buf)
p = strsep(&file, "\n");
else
- p = fgets(string, 4096, f);
+ p = fgets(string, OPT_LEN_MAX, f);
if (!p)
break;
dprint(FD_PARSE, "%s", p);
*/
if (access(filename, F_OK) &&
(ts = strrchr(file, '/'))) {
- int len = ts - file +
- strlen(filename) + 2;
-
- if (!(full_fn = calloc(1, len))) {
+ if (asprintf(&full_fn, "%.*s%s",
+ (int)(ts - file + 1), file,
+ filename) < 0) {
ret = ENOMEM;
break;
}
-
- strncpy(full_fn,
- file, (ts - file) + 1);
- strncpy(full_fn + (ts - file) + 1,
- filename, strlen(filename));
- full_fn[len - 1] = 0;
filename = full_fn;
}