Standalone Single Instance in Linux

Gallery

Given code will help to create standalone single instance of application in Linux operating system. #include <stdio.h>#include <semaphore.h>#include <fcntl.h> int main(){    const char sem_name[] = “tmp”;    sem_t * mutex;     printf(“semaphore application started!\n”);    mutex = sem_open(sem_name, O_CREAT | O_EXCL, 0600, … Continue reading