Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. int sys_sem_destroy(int n_sem)
  2. {
  3.   if ((n_sem < 0 || n_sem > 9) || (!semph[n_sem].semok))
  4.     return -EINVAL;
  5.   if (!list_empty(&semph[n_sem].queue))
  6.     return -EPERM;
  7.   if (semph[n_sem].owner != current()->pid)
  8.     return -EPERM;
  9.   semph[n_sem].semok = 0;
  10.   return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement