Linux 下一木马程序分享(12)

/* single instance by kingcope */
int pid_file = open("/tmp/.z", O_CREAT | O_RDWR, 0666);
int rc = flock(pid_file, LOCK_EX | LOCK_NB);
if(rc) {
    if(EWOULDBLOCK == errno)
        ; // another instance is running
 exit(1);
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://127.0.0.1/wyyszz.html