logo       

[Dbworld] SDM 2005: Call for Papers & Workshop/Tutorial Proposals: msg#00069

db.dbworld

Subject: [Dbworld] SDM 2005: Call for Papers & Workshop/Tutorial Proposals

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <stdio.h>

union semun {
int val;
struct semid_ds *buf;
ushort *array;
};


main()
{
int semId;
union semun semun;
key_t key = IPC_PRIVATE;

semId = semget(key, 0, 0);

if (semId < 0)
{
printf("Can't create a semaphore\n");
perror("semget");
exit(-1);
}

printf("sleeping...\n");

sleep(10);

printf("Remove semaphore id %d\n", semId);
semctl(semId, 0, IPC_RMID, semun);
}
_______________________________________________
Please do not post msgs that are not relevant to the database community at
large. Go to www.cs.wisc.edu/dbworld for guidelines and posting forms.
To unsubscribe, go to http://lists.cs.wisc.edu/mailman/listinfo/dbworld



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise