Date: Sun, 25 Feb 2001 14:48:21 -0800 (PST) From: Marc W <mwlist@lanfear.com> To: freebsd-questions@freebsd.org Subject: Getting around a broken O_EXCL Message-ID: <200102252248.OAA36102@akira.lanfear.com>
next in thread | raw e-mail | index | archive | help
hello! i want to set up a named pipe (FIFO) to prevent multiple instances of a program i'm writing. what i wanted to have the programs do is: -- check for FIFO -- if !FIFO, int res = mkfifo("unique fifo name", O_EXCL); if (res == -1 && errno == EWOULDBLOCK) recheck for FIFO else if (res == -1) abort or something else spawn thread and wait on FIFO. now, the problem is that, in reading the Linux docs, O_EXCL appears to be busted on NFS, and I'm assuming on other OSes, including FreeBSD as well. So, what are my options to get around this? i'd really rather there not be a potential race condition in my program. marc. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102252248.OAA36102>