]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-top-half/musl/include/sys/resource.h
Emulate `clock`, `times`, and `getrusage` using the monotonic clock.
[wasi-libc.git] / libc-top-half / musl / include / sys / resource.h
index 8b55331156b0a5d298a221486c392924f7801386..6c3a7ff2aa2f0306fb63996d84365278c5aabac4 100644 (file)
@@ -1,3 +1,8 @@
+#ifndef _WASI_EMULATED_PROCESS_CLOCKS
+#error WASI lacks process-associated clocks; to enable emulation of the `getrusage` function using \
+the wall clock, which isn't sensitive to whether the program is running or suspended, \
+compile with -D_WASI_EMULATED_PROCESS_CLOCKS and link with -lwasi-emulated-process-clocks
+#else
 #ifndef        _SYS_RESOURCE_H
 #define        _SYS_RESOURCE_H
 
@@ -118,3 +123,4 @@ __REDIR(getrusage, __getrusage_time64);
 #endif
 
 #endif
+#endif