static TimezoneMode arg_timezone = TIMEZONE_AUTO;
static void help(void) {
-
(void) pager_open(false, false);
printf("%s [OPTIONS...] [PATH] [ARGUMENTS...]\n\n"
}
static int parse_argv(int argc, char *argv[]) {
-
enum {
ARG_VERSION = 0x100,
ARG_PRIVATE_NETWORK,
assert(argv);
while ((c = getopt_long(argc, argv, "+hD:u:abL:M:jS:Z:qi:xp:nUE:", options, NULL)) >= 0)
-
switch (c) {
case 'h':
break;
case ARG_NETWORK_INTERFACE:
-
if (!ifname_valid(optarg)) {
log_error("Network interface name not valid: %s", optarg);
return -EINVAL;
assert(dest);
if (IN_SET(arg_timezone, TIMEZONE_AUTO, TIMEZONE_SYMLINK)) {
-
r = readlink_malloc("/etc/localtime", &p);
if (r == -ENOENT && arg_timezone == TIMEZONE_AUTO)
m = arg_read_only && arg_volatile_mode != VOLATILE_YES ? TIMEZONE_OFF : TIMEZONE_DELETE;
}
static int copy_devnodes(const char *dest) {
-
static const char devnodes[] =
"null\0"
"zero\0"
}
if (!arg_machine) {
-
if (arg_directory && path_equal(arg_directory, "/"))
arg_machine = gethostname_malloc();
else {
}
if (arg_private_network) {
-
if (!arg_network_namespace_path) {
/* Wait until the child has unshared its network namespace. */
if (!barrier_place_and_sync(&barrier)) { /* #3 */
}
if (arg_register) {
-
r = register_machine(
bus,
arg_machine,
return r;
} else if (!arg_keep_unit) {
-
r = allocate_scope(
bus,
arg_machine,
}
static int initialize_rlimits(void) {
-
/* The default resource limits the kernel passes to PID 1, as per kernel 4.16. Let's pass our container payload
* the same values as the kernel originally passed to PID 1, in order to minimize differences between host and
* container execution environments. */
int rl;
for (rl = 0; rl < _RLIMIT_MAX; rl++) {
-
/* Let's only fill in what the user hasn't explicitly configured anyway */
if ((arg_settings_mask & (SETTING_RLIMIT_FIRST << rl)) == 0) {
const struct rlimit *v;
}
int main(int argc, char *argv[]) {
-
_cleanup_free_ char *console = NULL;
_cleanup_close_ int master = -1;
_cleanup_fdset_free_ FDSet *fds = NULL;