Skip to content
Snippets Groups Projects
Select Git revision
  • aca440b467ddd0b38cf2cd8b50eb6eb30ed17e1c
  • 2023ss default protected
  • 2022ss
  • 2021ss
  • 2020ss
  • 2019ss
  • 2018ss
  • 2017ss
  • 2016ss
  • 2015ss
  • 2014ss
11 results

shm-4a.c

Blame
  • Forked from Peter Gerwinski / bs
    79 commits behind the upstream repository.
    shm-4a.c 321 B
    #include <sys/mman.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <string.h>
    
    int main (void)
    {
      int shm = shm_open ("test", O_CREAT | O_RDWR, 0666);
      char *buffer = mmap (NULL, 42, PROT_READ | PROT_WRITE, MAP_SHARED, shm, 0);
      strcpy (buffer, "Hello, world!");
      munmap (buffer, 42);
      close (shm);
      return 0;
    }