File: clean_msg.c

package info (click to toggle)
fakeroot 0.0-17
  • links: PTS
  • area: main
  • in suites: slink
  • size: 160 kB
  • ctags: 189
  • sloc: ansic: 690; cpp: 543; makefile: 126; sh: 68
file content (25 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <dlfcn.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/stat.h>
#include <sys/sem.h>
#include <unistd.h>
#include <errno.h>

int main(){
  union semun sem_dummy;

  int i;
  int r;    
  for(i=0;i<191943; i++){
    r=msgctl (i, IPC_RMID,NULL);
    if(r==0)
      printf("Successfully removed msg que %i\n",i);
    r=semctl (i,0,IPC_RMID,sem_dummy);
    if(r==0)
      printf("Successfully removed sem id %i\n",i);
  }
  return 0;
}