From owner-freebsd-hackers@freebsd.org Tue Nov 10 19:49:51 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 4BC09A2CC15 for ; Tue, 10 Nov 2015 19:49:51 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 D578314CA for ; Tue, 10 Nov 2015 19:49:50 +0000 (UTC) (envelope-from radovanovic@gmail.com) Received: by wmec201 with SMTP id c201so150824064wme.0 for ; Tue, 10 Nov 2015 11:49:49 -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=30HtG4j6bNXNXru5ZAwtyLDnC9hwR2ac2b7jGs8gm7o=; b=V6Aq7XxrN2OHZvOBHqUM3gP6aAskH4xC2b6uZSsYf8H97eoHE6NQIl0vr79UaO9+v3 XCQc56PJl6m8DJV1os6FfqKrQSEtj2uMgWVN8sYwaIoDyI2uRudz8V4299T2FXarLEXE wzhzvKZiNRB6txIt54HMM5WikvARJKoC6ulY75xC//gTf9ta8VAcJvKgIvLginPvMr9N 9QO9rr7vOOztdmRwVv+44xKqGLxCNbyFsjfIXjxZcs2zlllZvpSzIlBc/tyiXieCE4NX xXFhf66xw7p2goKJ1nVy36AlppqfqIp41ewlbHGuZXknSqN20QBRg3O1s7EbUSpGt+kA ld0g== X-Received: by 10.194.110.38 with SMTP id hx6mr6924850wjb.41.1447184989433; Tue, 10 Nov 2015 11:49:49 -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 q1sm5176489wjy.31.2015.11.10.11.49.48 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Nov 2015 11:49:48 -0800 (PST) Message-ID: <56424A5B.3070208@gmail.com> Date: Tue, 10 Nov 2015 20:49:47 +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> In-Reply-To: <20151110121309.GO2257@kib.kiev.ua> 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 19:49:51 -0000 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?