my problem is that after running a small test program,
the program will not terminate. and every program like
ps, top, w print nothing, and don't terminate...
this program use mmap, msync ...
what is the reason of this ? please, let me know it.
#include <unistd.h>
#include <sys/mman.h>
main()
{
int fd;
char *mem;
int i = 0;
char c = 0;
fd = open("file", 0666);
lseek(fd, 1000000, 0);
mem = mmap(0, 1000000, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (mem <= 0)
exit(1);
printf("%p\n", mem);
for (c = 0; c < 100; c++)
for (i = 0; i < 1000000; i++)
mem[i] = c;
msync(mem, 1000000, MS_SYNC);
close(fd);
}
==================================================
NO. 1 ¿ì¸® ÀÎÅͳÝ, ´ÙÀ½
Æò»ý ¾²´Â ¹«·á E-mail ÁÖ¼Ò ÇѸÞÀϳÝ
http://www.daum.net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/