<commit_before>#include <stdio.h>
#include <signal.h>

void handler(int signo, siginfo_t *info, void *context) {
  printf("signal %d!\n", signo);
}

int main() {
  struct sigaction sa;

  sa.sa_sigaction = handler;
  sigemptyset(&sa.sa_mask);
  sa.sa_flags = SA_SIGINFO;

  if (sigaction(SIGINT, &sa, NULL) == -1) {
    perror("sigaction failed");
  }

  return 0;
}<commit_msg>signal: started allocating memory<commit_after>#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>
#include <string.h>

void handler(int signo, siginfo_t *info, void *context) {
  printf("signal %d!\n", signo);
}

int main() {
  struct sigaction sa;

  sa.sa_sigaction = handler;
  sigemptyset(&sa.sa_mask);
  sa.sa_flags = SA_SIGINFO;

  if (sigaction(SIGINT, &sa, NULL) == -1) {
    perror("sigaction failed");
  }

  long pagesize;

  if ((pagesize = sysconf(_SC_PAGESIZE)) == -1) {
    perror("sysconf(_SC_PAGESIZE) failed");
  }

  printf("pagesize = %ld\n", pagesize);

  void *ptr = mmap(NULL, pagesize, PROT_READ | PROT_WRITE | PROT_EXEC,
    MAP_ANON | MAP_PRIVATE, -1, 0);

  memcpy(ptr, "\xb8\x01\x00\x00\x00\xc3", 6);
  int (*fct)() = ptr;

  int res = fct();
  printf("res = %d\n", res);

  if (munmap(ptr, pagesize) == -1) {
    perror("munmap failed");
  }

  return 0;
}
{'fraction_non_alphanumeric': 0.177107501933488, 'fraction_numerical': 0.014694508894044857, 'mean_word_length': 3.846441947565543, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '6311872', 'n_tokens_mistral': 553, 'n_tokens_neox': 520, 'n_words': 115}