PERROR("ftruncate");
goto error_ftruncate;
}
+ /*
+ * Also ensure the file metadata is synced with the storage by using
+ * fsync(2).
+ */
+ ret = fsync(shmfd);
+ if (ret) {
+ PERROR("fsync");
+ goto error_fsync;
+ }
obj->shm_fd_ownership = 0;
obj->shm_fd = shmfd;
return obj;
error_mmap:
+error_fsync:
error_ftruncate:
error_zero_file:
error_fcntl: