<commit_before>#include <stdio.h>
#include <dlfcn.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <netinet/in.h>

int __interposed_ipc = 3;

int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
  int result, r;

  int socket_type;
  socklen_t socket_type_len = sizeof(socket_type);

  char msg[128];
  int msg_length;
  struct sockaddr_in* in_addr;

  struct sockaddr_in actual;
  socklen_t actual_len = sizeof(actual);

  static const int (*original_bind) (int, const struct sockaddr *, socklen_t) = NULL;

  if (!original_bind) {
    original_bind = dlsym(RTLD_NEXT, "bind");
  }
<commit_msg>[fix] Remove `LD_PRELOAD`/`DYLD_INSERT_LIBRARIES` at startup<commit_after>#include <stdio.h>
#include <dlfcn.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <netinet/in.h>

int __interposed_ipc = 3;

static void __interposed_init() __attribute__((constructor));

#pragma CALL_ON_MODULE_BIND __interposed_init
#pragma CALL_ON_LOAD __interposed_init
#pragma init(__interposed_init)
void __interposed_init() {
#if (__APPLE__ && __MACH__)
  unsetenv("DYLD_INSERT_LIBRARIES");
  unsetenv("DYLD_FORCE_FLAT_NAMESPACE");
#else
  unsetenv("LD_PRELOAD");
#endif
}

int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
  int result, r;

  int socket_type;
  socklen_t socket_type_len = sizeof(socket_type);

  char msg[128];
  int msg_length;
  struct sockaddr_in* in_addr;

  struct sockaddr_in actual;
  socklen_t actual_len = sizeof(actual);

  static const int (*original_bind) (int, const struct sockaddr *, socklen_t) = NULL;

  if (!original_bind) {
    original_bind = dlsym(RTLD_NEXT, "bind");
  }

{'fraction_non_alphanumeric': 0.12415730337078652, 'fraction_numerical': 0.0044943820224719105, 'mean_word_length': 5.452898550724638, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '4102945', 'n_tokens_mistral': 695, 'n_tokens_neox': 671, 'n_words': 156}