<commit_before>#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>

#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>

#include <sched.h>

static void *map;

int main(int argc, char *argv[])
{
	pid_t pid;

	printf("%s pid %d\n", argv[0], getpid());

	map = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
	if (map	== MAP_FAILED) {
		printf("%6d: mmap failed\n", getpid());
		return 0;
	}

	memset(map, '-', 21);
	((char *)map)[21] = 0;

	printf("%6d: Initial  shmem pattern '%s'\n", getpid(), (char *)map);

	pid = fork();
	if (pid == -1) {
		printf("fork failed\n");
		return 1;
	}

	if (pid == 0) {
		int cnt = 0;
		while(1) {
			printf("%6d: Observed shmem pattern '%s'\n", getpid(), (char *)map);
			sprintf(map, "shared-mem-%010d", cnt++);
			sleep(5);
		}
	} else {
		while(1) {
			printf("%6d: Observed shmem pattern '%s'\n", getpid(), (char *)map);
			sleep(3);
		}
	}

	return 0;
}<commit_msg>test: Update shmem more frequently<commit_after>#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>

#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>

#include <sched.h>

static void *map;

int main(int argc, char *argv[])
{
	pid_t pid;

	printf("%s pid %d\n", argv[0], getpid());

	map = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
	if (map	== MAP_FAILED) {
		printf("%6d: mmap failed\n", getpid());
		return 0;
	}

	memset(map, '-', 21);
	((char *)map)[21] = 0;

	printf("%6d: Initial  shmem pattern '%s'\n", getpid(), (char *)map);

	pid = fork();
	if (pid == -1) {
		printf("fork failed\n");
		return 1;
	}

	if (pid == 0) {
		int cnt = 0;
		while(1) {
			printf("%6d: Observed shmem pattern '%s'\n", getpid(), (char *)map);
			sprintf(map, "shared-mem-%010d", cnt++);
			sleep(1);
		}
	} else {
		while(1) {
			printf("%6d: Observed shmem pattern '%s'\n", getpid(), (char *)map);
			sleep(3);
		}
	}

	return 0;
}
{'fraction_non_alphanumeric': 0.22216913521261347, 'fraction_numerical': 0.02771141901576684, 'mean_word_length': 3.748299319727891, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '777902', 'n_tokens_mistral': 987, 'n_tokens_neox': 897, 'n_words': 222}