From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 14 17:10:53 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4716D16A407 for ; Sun, 14 Jan 2007 17:10:53 +0000 (UTC) (envelope-from fmail_girish@yahoo.com) Received: from web62001.mail.re1.yahoo.com (web62001.mail.re1.yahoo.com [69.147.74.224]) by mx1.freebsd.org (Postfix) with SMTP id DDDD013C441 for ; Sun, 14 Jan 2007 17:10:52 +0000 (UTC) (envelope-from fmail_girish@yahoo.com) Received: (qmail 43479 invoked by uid 60001); 14 Jan 2007 16:44:11 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=2mJrsozuqqtnLE88gvD7iDTzPasevN2jlbRblGzrzsgrnx5tUyV0YlSKxmkuVZd/eDhX27u9xIol3+AouHS9yj77Vu2WOE6xfuCq+htFTqbDsHH1Sfu+9rA+70XVrW3kG2GqxAgqv/xL5LN+GCRwdQJ51OsJDlHgyazHaUkWi+c=; X-YMail-OSG: ruQhPwoVM1ng8hjtCadfjWlfwHiZo4CBAPZIP5vFJ8E.ek5ABjllW_XuI5FJhieI8wtZVBRCnoZClUrbsEu1fkF.SbC5dNCmvYw1R7NkUhfnp5_fCE9UGUbeKbLSI7A- Received: from [125.23.25.233] by web62001.mail.re1.yahoo.com via HTTP; Sun, 14 Jan 2007 08:44:11 PST Date: Sun, 14 Jan 2007 08:44:11 -0800 (PST) From: girish r To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <628825.38045.qm@web62001.mail.re1.yahoo.com> X-Mailman-Approved-At: Mon, 15 Jan 2007 00:58:37 +0000 Subject: semaphore.h does'nt include fcntl.h ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2007 17:10:53 -0000 Hello folks, I am trying to use sem_open(3) but gcc complains that O_CREAT and O_EXCL is undeclared. According to the man page only semaphore.h needs to be included. But including fcntl.h solves the problem. sem_t *lock = sem_open("example_lock", O_CREAT | O_EXCL, 0600, 1); Another thing, a program with the above function call compiles but when I execute it, it spits out "Bad system call (core dump)". Specifically, I am trying to run this program given here: "http://www.informit.com/articles/article.asp?p=679545&seqNum=3&rl=1". Thanks for your time. --girish ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com