cursor->ring_file_size_bytes = GetFileSize(cursor->ring_file_handle, NULL);
#else
- ring_fd = open(runtime_events_loc, O_RDONLY, 0);
+#if defined(__ARM_ARCH) && __ARM_ARCH <= 5
+ /* Atomic 64-bit load requires RW memory on Debian armel. See:
+ https://github.com/ocaml/ocaml/issues/13234 */
+ const int open_flags = O_RDWR;
+ const int mmap_prot = PROT_READ | PROT_WRITE;
+#else
+ const int open_flags = O_RDONLY;
+ const int mmap_prot = PROT_READ;
+#endif
+ ring_fd = open(runtime_events_loc, open_flags, 0);
if( ring_fd == -1 ) {
caml_stat_free(cursor);
/* This cast is necessary for compatibility with Illumos' non-POSIX
mmap/munmap */
cursor->metadata = (struct runtime_events_metadata_header *)
- mmap(NULL, cursor->ring_file_size_bytes, PROT_READ,
+ mmap(NULL, cursor->ring_file_size_bytes, mmap_prot,
MAP_SHARED, ring_fd, 0);
if( cursor->metadata == MAP_FAILED ) {