]>
git.saurik.com Git - apple/xnu.git/blob - tools/tests/perf_index/stress_file_create.c
2 #include "perf_index.h"
5 void stress_file_create(const char *fs_path
, int thread_id
, int num_threads
, long long length
) {
8 char filepath
[MAXPATHLEN
];
9 for(i
=0; i
<length
; i
++) {
10 snprintf(filepath
, MAXPATHLEN
, "%s/file_create-%d-%lld", fs_path
, thread_id
, i
);
11 fd
= open(filepath
, O_CREAT
| O_EXCL
| O_WRONLY
, 0644);
15 for(i
=0; i
<length
; i
++) {
16 snprintf(filepath
, MAXPATHLEN
, "%s/file_create-%d-%lld", fs_path
, thread_id
, i
);
17 assert(unlink(filepath
)>=0);