Skip to content
Snippets Groups Projects
Select Git revision
  • 4ff440eaac9aee21bd0a6c7f5ce7927ee4cd9b94
  • master default
2 results

objects-11.c

Blame
  • Forked from Peter Gerwinski / hp
    Source project has a limited visibility.
    shm-3b.c 279 B
    #include <sys/mman.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <stdio.h>
    
    int main (void)
    {
      char buffer[42];
      int file = open ("test.txt", O_RDONLY, 0444);
      lseek (file, 0, SEEK_SET);
      read (file, buffer, 42);
      close (file);
      printf ("%s\n", buffer);
      return 0;
    }