Last change
on this file since 209 was
194,
checked in by nanardon, 15 years ago
|
|
-
Property svn:eol-style set to
native
|
File size:
411 bytes
|
Line | |
---|
1 | #include <unistd.h> |
---|
2 | #define MEMSIZE 1000000000 |
---|
3 | int main(void) { |
---|
4 | pid_t pid = 0; int status = 0; |
---|
5 | char * ptr = malloc(MEMSIZE); |
---|
6 | system("free"); |
---|
7 | memset(ptr, 'X', MEMSIZE); |
---|
8 | system("free"); |
---|
9 | pid = fork(); |
---|
10 | if (pid < -1) exit(1); |
---|
11 | else if (pid == 0) { |
---|
12 | sleep(10); /* child */ |
---|
13 | exit(0); |
---|
14 | } else { |
---|
15 | sleep(1); |
---|
16 | system("free"); |
---|
17 | wait(&status); |
---|
18 | return(0); |
---|
19 | } |
---|
20 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.