From owner-freebsd-hackers@freebsd.org Tue Nov 10 20:01:30 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 425FBA2CE57 for ; Tue, 10 Nov 2015 20:01:30 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (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 CBE621A7D for ; Tue, 10 Nov 2015 20:01:29 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by wmec201 with SMTP id c201so151279867wme.0 for ; Tue, 10 Nov 2015 12:01:28 -0800 (PST) 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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=J+5a0R2d60/HlzFkHec/qwgRq3spynglwrRa5lQ9f1s=; b=M3Ux9KA8SsJ0d2LvRG/UHytGHa00FreOJRzJwKY5Os0QGo3utNpTKr3LVzaggnrtPV 6kFrNmr3cpQ1+xy2456PbTZzqcxUpi//GyWdPphShqLy6LgU4c0GldvtJ2FtSkpDsR5o u9OXzoGfvxbTI1nGBY0y5ddTVy6I6OGwj8h50mDjbVbHgBB99WPeXBd2MfmSuU3gK++7 ogqrRrS+Cciv0HAoaHVRQcl3Rng7h/HbNMAyB2tZyVctvqfmU3OlRo7lZy5aqkDG915C H00OAx8vgIMAJcinZ7Q8VUeQV4nAqHNeSBwN5Fbz4a2X4Tc9lwcqHhe+qGWTq+O5yhRh 0UdQ== X-Received: by 10.194.200.233 with SMTP id jv9mr5910541wjc.133.1447185688310; Tue, 10 Nov 2015 12:01:28 -0800 (PST) Received: from zmaj.softwarehood.com (93-87-243-129.dynamic.isp.telekom.rs. [93.87.243.129]) by smtp.googlemail.com with ESMTPSA id cw3sm1038833wjb.26.2015.11.10.12.01.27 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Nov 2015 12:01:27 -0800 (PST) Message-ID: <56424D17.3060303@gmail.com> Date: Tue, 10 Nov 2015 21:01:27 +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: Konstantin Belousov CC: freebsd-hackers@FreeBSD.org Subject: Re: Detecting new file name after receiving kevent's NOTE_RENAME References: <5641A2A5.7070909@gmail.com> <20151110081421.GL2257@kib.kiev.ua> <5641B6D0.4070207@gmail.com> <20151110121309.GO2257@kib.kiev.ua> <56424A5B.3070208@gmail.com> In-Reply-To: <56424A5B.3070208@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; 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: Tue, 10 Nov 2015 20:01:30 -0000 On 11/10/15 20:49, Ivan Radovanovic napisa: > On 11/10/15 13:13, Konstantin Belousov napisa: >> On Tue, Nov 10, 2015 at 10:20:16AM +0100, Ivan Radovanovic wrote: >>> Thanks, kern.proc.filedesc is super-efficient compared to what I had in >>> mind. I assume right way to use it would be through kinfo_getfile(3). >> >> Both direct sysctl use and kinfo_getfile() are supported, in the sense >> that the API and ABI of the interfaces are not supposed to change in >> non-backward compatible way, and the interfaces itself are not supposed >> to disappear. >> > > Thanks. After *lot* of copying structures from C to C# I got to the file > structure, but it doesn't seem obvious to me how to get to the file name > from there? Ignore previous email, I wasted time copying kinfo_proc instead of kinfo_file...