]>
git.saurik.com Git - apple/xnu.git/blob - tools/tests/perf_index/ramdisk.c
9 setup_ram_volume(const char* name
, char* path
)
14 retval
= asprintf(&cmd
, "diskutil erasevolume HFS+ '%s' `hdiutil attach -nomount ram://1500000` >/dev/null", name
);
15 VERIFY(retval
> 0, "asprintf failed");
18 VERIFY(retval
== 0, "diskutil command failed");
20 snprintf(path
, MAXPATHLEN
, "/Volumes/%s", name
);
24 return PERFINDEX_SUCCESS
;
28 cleanup_ram_volume(char* path
)
33 retval
= asprintf(&cmd
, "umount -f '%s' >/dev/null", path
);
34 VERIFY(retval
> 0, "asprintf failed");
37 VERIFY(retval
== 0, "diskutil command failed");
41 return PERFINDEX_SUCCESS
;