From owner-freebsd-questions Sun Feb 25 14:48:23 2001 Delivered-To: freebsd-questions@freebsd.org Received: from akira.lanfear.com (akira.lanfear.com [208.12.11.174]) by hub.freebsd.org (Postfix) with ESMTP id D73E137B401 for ; Sun, 25 Feb 2001 14:48:21 -0800 (PST) (envelope-from mwlist@lanfear.com) Received: from sapporo.lanfear.com (h-64-105-36-216.snvacaid.covad.net [64.105.36.216]) by akira.lanfear.com (8.9.3/8.9.3) with SMTP id OAA36102 for freebsd-questions@freebsd.org; Sun, 25 Feb 2001 14:48:21 -0800 (PST) (envelope-from mwlist@lanfear.com) Date: Sun, 25 Feb 2001 14:48:21 -0800 (PST) From: Marc W Message-Id: <200102252248.OAA36102@akira.lanfear.com> To: freebsd-questions@freebsd.org Subject: Getting around a broken O_EXCL MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Mailer: Kiltdown 0.7 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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