return r;
}
+ *ret = TAKE_PTR(v);
+
return 0;
}
+
+ int cpuset_build_json(sd_json_variant **ret, const char *name, void *userdata) {
+ _cleanup_free_ uint8_t *array = NULL;
+ CPUSet *cpuset = ASSERT_PTR(userdata);
+ size_t allocated;
+ int r;
+
+ assert(ret);
+
+ if (!cpuset->set)
+ goto empty;
+
+ r = cpu_set_to_dbus(cpuset, &array, &allocated);
+ if (r < 0)
+ return log_debug_errno(r, "Failed to serialize cpu set to dbus: %m");
+
+ if (allocated == 0)
+ goto empty;
+
+ return sd_json_variant_new_array_bytes(ret, array, allocated);
+
+ empty:
+ *ret = NULL;
+ return 0;
+ }
#include <linux/securebits.h>
-#include "forward.h"
+#include "shared-forward.h"
- int secure_bits_to_string_alloc(int i, char **s);
+ int secure_bits_to_strv(int i, char ***ret);
+ int secure_bits_to_string_alloc(int i, char **ret);
int secure_bits_from_string(const char *s);
static inline bool secure_bits_is_valid(int i) {