strstr on huge mmapped file
<p>I open huge (11Gb) file, mmap it to memmory, and fail to search the string in the file</p>

<p>my code is</p>

<pre><code> if ( (fd  = open("l", O_RDONLY)) &lt; 0 )     err_sys("Cant open file");
 if ( fstat(fd, &amp;statbuf) &lt; 0 )             err_sys("Cant get file size");
 printf("size is %ld\n", statbuf.st_size);

 if ( (src = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED )  err_sys("Cant mmap");
 printf("src pointer is at %ld\n", src);

 char * index = strstr(src, "bin/bash");
 printf("needle is at %ld\n", index);
</code></pre>

<p>It works on small files, but on huge sources returns 0. What function should I use to search in huge mmapped files?</p>

<p>The output is:</p>

<pre><code>size is 11111745740
src pointer is at 140357526544384
needle is at 0
</code></pre>