'''libcriu''' is a C API for CRIU, which is a simple wrapper around our [[RPC]]. Although you can use [[RPC]] directly, libcriu is a wrapper providing the interface that is much easier to use from C code. Note that [[RPC]] is supported in the first place, and if you want the most recent set of features you should probably use [[RPC]] directly.
+
'''libcriu''' is a C API for CRIU, a simple wrapper around our [[RPC]]. Although you can use [[RPC]] directly, libcriu is a wrapper providing the interface that is much easier to use from C code. Note that [[RPC]] is supported in the first place, and if you want the most recent set of features you should probably use [[RPC]] directly.
== Introduction ==
== Introduction ==
Line 6:
Line 6:
To create a library <code>lib/libcriu.so</code>, run <code>make</code> in the main directory.
To create a library <code>lib/libcriu.so</code>, run <code>make</code> in the main directory.
−
−
{{Warning|The library is not thread- and fork- safe}}
== Preparation ==
== Preparation ==
Line 36:
Line 34:
void criu_set_log_file(char *log_file);
void criu_set_log_file(char *log_file);
</source>
</source>
+
+
{{Note|This set of calls is not thread safe! For thread safety the same calls with _local suffix should be used}}
If no pid is set on dump, CRIU will dump the calling process itself.
If no pid is set on dump, CRIU will dump the calling process itself.
Line 131:
Line 131:
== Examples ==
== Examples ==
−
You could find example of using libcriu at [https://github.com/xemul/criu/tree/master/test/libcriu test/libcriu].
+
You could find example of using libcriu at [https://github.com/xemul/criu/tree/master/test/others/libcriu test/others/ibcriu].