Created
January 31, 2013 04:23
-
-
Save khibino/4680166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
int | |
main (int argc, char *argv[]) { | |
char buf[1048576]; | |
char obuf[1048576]; | |
int i; | |
#define N 0x1000 | |
if(argc > 1) { | |
printf("rv(mlock) = %d\n", mlockall (MCL_CURRENT)); | |
} | |
unsigned long long rp = (unsigned long long)obuf; | |
for (i = 0; i < N; i++) { | |
void *p = memcpy (buf, obuf, sizeof (obuf)); | |
rp = rp & (unsigned long long)p; | |
} | |
printf("%llx\n", rp); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment