Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <time.h>
- #include <stdlib.h>
- #include <signal.h>
- #include <unistd.h>
- #include <sys/shm.h>
- #include <sys/ipc.h>
- #include <sys/wait.h>
- #include <sys/types.h>
- #include <unistd.h>
- #include <pthread.h>
- using namespace std;
- int variable;
- int ID;
- void *test( void *i){
- variable=*((int*)i);
- printf( "%d \n", variable);
- }
- int main (){
- int a=10;
- int b=20;
- int c=30;
- switch ( fork() ){
- case -1:
- cout << "Greska prilikom stvaranja procesa!" << endl;
- exit(0);
- case 0:
- test(&a);
- exit(0);
- default:
- break;
- }
- wait(NULL);
- sleep(5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement