From owner-freebsd-hackers@freebsd.org Sun Oct 25 19:43:38 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABAA8835A for ; Sun, 25 Oct 2015 19:43:38 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45DF21FCA for ; Sun, 25 Oct 2015 19:43:38 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by wijp11 with SMTP id p11so138735942wij.0 for ; Sun, 25 Oct 2015 12:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=bzgUBzA20X2Il5ythAtmWXfAxJPAlvww2qNnjeB277A=; b=OfqCFTZAtrddMnCmGf1YOo5V5BaARm8X1DUnyEN0bZm5d1ox2mQSjxs4rrXiUe4Bbj sG2Mz4qSMbzmim0CAzyz1GL1zhseDSkvHUAcg1g+rmaxtDQh2Qz1gl1FjGoJ/pYPPgP3 NMBy67kP4p2zzc5g7vQQkUcAGeTS1AHpcVXcz5k+1ywdSmwUGC3M8xaxO915i94xxxHc fuNdjhLFbQAjXXy5w+kH/lv6C71pyT//NByavrCkoiPFymEfPRYQdpfLcsdJWwCmrIkB v2vTMXzWopilZGxZ3D6ks+ZqSXaoX++Hovy+ep8/UNKSlGTtLnffffGxllGdTgOFBCGI lUjw== X-Received: by 10.180.24.1 with SMTP id q1mr17356759wif.53.1445802216544; Sun, 25 Oct 2015 12:43:36 -0700 (PDT) Received: from zmaj.softwarehood.com (79-101-244-190.dynamic.isp.telekom.rs. [79.101.244.190]) by smtp.googlemail.com with ESMTPSA id ki7sm35025917wjc.28.2015.10.25.12.43.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 25 Oct 2015 12:43:36 -0700 (PDT) Message-ID: <562D30E7.50300@gmail.com> Date: Sun, 25 Oct 2015 20:43:35 +0100 From: Ivan Radovanovic User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130812 Thunderbird/17.0.8 MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org Subject: Opening file to be used with kevent Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2015 19:43:38 -0000 Hi guys, What are recommended flags to use when opening file descriptor to be used later with kevent(2)? I was thinking to specify O_RDONLY but I guess that would prevent any other process from opening file with O_EXCL (and I don't care about file contents anyway, I just want to be notified when file is changed). Apparently Darwing has O_EVTONLY for this purpose, so I am wondering if FreeBSD has something equivalent (or what would be the weakest mode to pass to open(2))? Kind regards, Ivan