+
+#ifndef CONFIG_HAVE_GETTID
+static inline int gettid(void)
+{
+ return mach_thread_self();
+}
+#endif
+
+static inline bool fio_fallocate(struct fio_file *f, uint64_t offset, uint64_t len)
+{
+ fstore_t store = {F_ALLOCATEALL, F_PEOFPOSMODE, offset, len};
+ if (fcntl(f->fd, F_PREALLOCATE, &store) != -1) {
+ if (ftruncate(f->fd, len) == 0)
+ return true;
+ }
+
+ return false;
+}
+
+static inline bool os_cpu_has(cpu_features feature)
+{
+ /* just check for arm on OSX for now, we know that has it */
+ if (feature != CPU_ARM64_CRC32C)
+ return false;
+ return FIO_ARCH == arch_aarch64;
+}
+