|
|
|
- //鍐欎竴涓櫡闃遍棬鐨勬祴璇曠▼搴#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <errno.h>#include <signal.h>#include <sys/types.h>#include <sys/wait.h>#include <fcntl.h>#include <sys/stat.h>#include <sys/mman.h>#include <semaphore.h>#include <pthread.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <sys/time.h>#include <sys/resource.h>#include <sys/ipc.h>#include <sys/msg.h>#include <sys/shm.h>#include <sys/sem.h>#include <sys/uio.h>#include <sys/select.h>#include <sys/time.h>#include <sys/un.h>int main(int argc, char *argv[]){ int fd; int ret; int i; int count; int *p; int *q; int *r; int *s; int *t; int *u; int *v; int *w; int *x; int *y; int *z; int *aa; int *bb; int *cc; int *dd; fd = open("trapdoor", O_RDWR); if(fd < 0) { perror("open"); return -1; } p = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if(p == MAP_FAILED) { perror("mmap"); return -1; } q = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 4096); if(q == MAP_FAILED) { perror("mmap"); return -1; } r = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 8192); if(r == MAP_FAILED) { perror("mmap"); return -1; } s = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 12288); if(s== MAP_FAILED) { perror("mmap"); return -1; } t = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 16384); if(t== MAP_FAILED) { perror("mmap"); return -1; } u = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 20480); if(u== MAP_FAILED) { perror("mmap"); return -1; } v = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 24576); if(v == MAP_FAILED) { perror("mmap"); return -1; } w = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 28672); if(w == MAP_FAILED) { perror("mmap"); return -1; } x = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 32768); if(x == MAP_FAILED) { perror("mmap"); return -1; } y = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 36864); if(y == MAP_FAILED) { perror("mmap"); return -1; } z = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 40960); if(z== MAP_FAILED) { perror("mmap"); return -1; } aa = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 45056); if(aa == MAP_FAILED) { perror("mmap"); return -1; } bb = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 49152); if(bb == MAP_FAILED) { perror("mmap"); return -1; } cc = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 53248); if(cc== MAP_FAILED) { perror("mmap"); return -1; } dd = (int *)mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 57344); if(dd == MAP_FAILED) { perror("mmap"); return -1; } count = 0; while(1) { *p = count; *q = count; *r = count; *s = count; *t = count; *u = count; *v = count; *w = count; *x = count; *y = count; *z = count; *aa = count; *bb = count; *cc = count; *dd = count; count++; sleep(1); printf("count = %d\n", count); if(count == 1000) { break; } } return 0; }
复制代码 AWS Toolkit鎸哄ソ鐢ㄧ殑銆傚厤璐圭殑浠g爜鎻愮ずAI銆 |
|