diff --git a/include/malloc.h b/include/malloc.h
index 3deb90b2a0b..610289f3a6c 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -712,17 +712,6 @@ void malloc_disable_testing(void);
  */
 void malloc_dump(void);
 
-/**
- * malloc_dump_to_file() - Write heap dump to a host file
- *
- * @fname: Path to the output file on the host filesystem
- * Return: 0 on success, negative error code on failure
- *
- * This is only available in sandbox builds. It writes the same information
- * as malloc_dump() but to a file instead of the console.
- */
-int malloc_dump_to_file(const char *fname);
-
 /**
  * malloc_log_start() - Start logging malloc traffic
  *
diff --git a/include/os.h b/include/os.h
index bc556f2195f..41e3022657c 100644
--- a/include/os.h
+++ b/include/os.h
@@ -546,6 +546,17 @@ int os_map_file(const char *pathname, int os_flags, void **bufp, int *sizep);
  */
 int os_unmap(void *buf, int size);
 
+/**
+ * malloc_dump_to_file() - Write heap dump to a host file
+ *
+ * This is only available in sandbox builds. It writes the same information
+ * as malloc_dump() but to a file instead of the console.
+ *
+ * @fname: Path to the output file on the host filesystem
+ * Return: 0 on success, negative error code on failure
+ */
+int malloc_dump_to_file(const char *fname);
+
 /*
  * os_find_text_base() - Find the text section in this running process
  *
