Displaying 1 result from an estimated 1 matches for "one_gb".
Did you mean:
en_gb
2015 Oct 14
2
[PATCH 1/2] lib: info: Move common code for setting child rlimits.
...;
-#endif
+ set_child_rlimits (cmd);
r = guestfs_int_cmd_run (cmd);
if (r == -1)
return -1;
@@ -576,3 +567,15 @@ old_parser_run_qemu_img_info (guestfs_h *g, const char *filename,
return 0;
}
+
+static void
+set_child_rlimits (struct command *cmd)
+{
+#ifdef RLIMIT_AS
+ const long one_gb = 1024L * 1024 * 1024;
+ guestfs_int_cmd_set_child_rlimit (cmd, RLIMIT_AS, one_gb);
+#endif
+#ifdef RLIMIT_CPU
+ guestfs_int_cmd_set_child_rlimit (cmd, RLIMIT_CPU, 10 /* seconds */);
+#endif
+}
--
2.5.0