<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <libct.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/sched.h>
#include <sys/types.h>
#include <sys/wait.h>

#include "test.h"

#define FS_ROOT		"root"
int main(int argc, char *argv[])
{
	libct_session_t s;
	ct_handler_t ct;
	ct_process_desc_t p;
	char *sleep_a[] = { "cat", NULL};
	char *ls_a[] = { "sh", "-c", "echo ok", NULL};
	int fds[] = {STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO};
	int pfd[2], tfd[2], status;
	char buf[10];
	pid_t pid;

	test_init();

	s = libct_session_open_local();
	ct = libct_container_create(s, "1339");
	p = libct_process_desc_create(s);
	libct_fs_set_root(ct, FS_ROOT);

	libct_container_set_nsmask(ct,
			CLONE_NEWNS |
			CLONE_NEWUTS |
			CLONE_NEWIPC |
			CLONE_NEWNET |
			CLONE_NEWPID);

	if (pipe(pfd))
		goto err;

	fds[0] = pfd[0];
	fcntl(pfd[1], F_SETFD, FD_CLOEXEC);
	if (libct_container_spawn_execvfds(ct, p, "/bin/cat", sleep_a, fds) <= 0)
		goto err;
	close(pfd[0]);

	if (pipe(tfd))
		goto err;

	fds[0] = STDIN_FILENO;
	fds[1] = tfd[1];
	fcntl(pfd[0], F_SETFD, FD_CLOEXEC);
	pid = libct_container_enter_execvfds(ct, p, "/bin/sh", ls_a, fds);
	if (pid <= 0)
		goto err;
	close(tfd[1]);

	if (read(tfd[0], buf, sizeof(buf)) != 3)
		goto err;

	waitpid(pid, &status, 0);

	close(pfd[1]);

	libct_container_wait(ct);<commit_msg>test/vz_enter: typo fix<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <libct.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/sched.h>
#include <sys/types.h>
#include <sys/wait.h>

#include "test.h"

#define FS_ROOT		"root"
int main(int argc, char *argv[])
{
	libct_session_t s;
	ct_handler_t ct;
	ct_process_desc_t p;
	char *sleep_a[] = { "cat", NULL};
	char *ls_a[] = { "sh", "-c", "echo ok", NULL};
	int fds[] = {STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO};
	int pfd[2], tfd[2], status;
	char buf[10];
	pid_t pid;

	test_init();

	s = libct_session_open_local();
	ct = libct_container_create(s, "1339");
	p = libct_process_desc_create(s);
	libct_fs_set_root(ct, FS_ROOT);

	libct_container_set_nsmask(ct,
			CLONE_NEWNS |
			CLONE_NEWUTS |
			CLONE_NEWIPC |
			CLONE_NEWNET |
			CLONE_NEWPID);

	if (pipe(pfd))
		goto err;

	fds[0] = pfd[0];
	fcntl(pfd[1], F_SETFD, FD_CLOEXEC);
	if (libct_container_spawn_execvfds(ct, p, "/bin/cat", sleep_a, fds) <= 0)
		goto err;
	close(pfd[0]);

	if (pipe(tfd))
		goto err;

	fds[0] = STDIN_FILENO;
	fds[1] = tfd[1];
	fcntl(tfd[0], F_SETFD, FD_CLOEXEC);
	pid = libct_container_enter_execvfds(ct, p, "/bin/sh", ls_a, fds);
	if (pid <= 0)
		goto err;
	close(tfd[1]);

	if (read(tfd[0], buf, sizeof(buf)) != 3)
		goto err;

	waitpid(pid, &status, 0);

	close(pfd[1]);

	libct_container_wait(ct);
{'fraction_non_alphanumeric': 0.17838638045891933, 'fraction_numerical': 0.017024426350851222, 'mean_word_length': 4.7756410256410255, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2173593', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1281, 'n_words': 253}