Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <errno.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/wait.h>
- #include <sys/stat.h>
- #include <sys/ipc.h>
- #include <sys/shm.h>
- #include <pwd.h>
- #include <stdlib.h>
- #include <string.h>
- #include <time.h>
- #include <sys/shm.h>
- #include <sys/sem.h>
- #include <sys/msg.h>
- #include <stdio.h>
- #include <sys/shm.h>
- #include <sys/sem.h>
- int main()
- {
- int semid;
- struct sembuf op;
- semid = semget(0x234, 1, 0700);
- if (semid == -1)
- {
- perror("semget");
- exit(1);
- }
- puts("Wystartowal program B");
- op.sem_flg = SEM_UNDO;
- op.sem_num = 0;
- op.sem_op = -1;
- if (semop(semid, &op, 1) == -1)
- {
- perror("semop");
- exit(1);
- };
- puts("KONIEC B");
- //if (semctl(semid,IPC_RMID,0) == -1)
- // {
- // perror("semctl");
- // exit(1);
- // }
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement