]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/memtrap.h
core: make sure win32 sockets remain blocking
[pulseaudio] / src / pulsecore / memtrap.h
index d93d67201793872b001d0bcc55e2eda48b461ad8..9af30e917b3eacdc436444f8a2cd041fa9c69608 100644 (file)
 
 #include <pulsecore/macro.h>
 
+/* This subsystem will trap SIGBUS on specific memory regions. The
+ * regions will be remapped to anonymous memory (i.e. writable NUL
+ * bytes) on SIGBUS, so that execution of the main program can
+ * continue though with memory having changed beneath its hands. With
+ * pa_memtrap_is_good() it is possible to query if a memory region is
+ * still 'good' i.e. no SIGBUS has happened yet for it.
+ *
+ * Intended usage is to handle memory mapped in which is controlled by
+ * other processes that might execute ftruncate() or when mapping inb
+ * hardware resources that might get invalidated when unplugged. */
+
 typedef struct pa_memtrap pa_memtrap;
 
 pa_memtrap* pa_memtrap_add(const void *start, size_t size);
@@ -33,6 +44,8 @@ pa_memtrap *pa_memtrap_update(pa_memtrap *m, const void *start, size_t size);
 
 void pa_memtrap_remove(pa_memtrap *m);
 
-pa_bool_t pa_memtrap_is_good(pa_memtrap *m);
+bool pa_memtrap_is_good(pa_memtrap *m);
+
+void pa_memtrap_install(void);
 
 #endif