From owner-freebsd-arch@FreeBSD.ORG Tue Jul 9 21:17:14 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5E4CFAB; Tue, 9 Jul 2013 21:17:14 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 6B7831D20; Tue, 9 Jul 2013 21:17:14 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 3F8641203CF; Tue, 9 Jul 2013 23:16:58 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id E0AE828494; Tue, 9 Jul 2013 23:16:57 +0200 (CEST) Date: Tue, 9 Jul 2013 23:16:57 +0200 From: Jilles Tjoelker To: Mikolaj Golub Subject: Re: ABI change in libkvm (kvm_uread removal) Message-ID: <20130709211657.GA86400@stack.nl> References: <20130709185846.GA19508@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130709185846.GA19508@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-arch@freebsd.org, Robert Millan X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jul 2013 21:17:14 -0000 On Tue, Jul 09, 2013 at 09:59:19PM +0300, Mikolaj Golub wrote: > On Tue, Jul 09, 2013 at 07:45:59PM +0200, Robert Millan wrote: > > In 2011 you removed kvm_uread() from libkvm, in r227839. > > Was this an intentional ABI change? I notice that kvm.h public header > > still has the declaration. Also, the soname was not bumped. > I think I thought then that kvm_uread() was for internal usage only > (it was used by libkvm only for reading process args and env via > procfs(5), no other consumers were found in base, no man page). Also > reading from procfs(5) did not look like libkvm job, so after the last > consumers had been removed, retiring it looked natural. I think I > overlooked the declaration in kvm.h and that I might break ABI, > otherwise it would have made me think more and ask other people if the > removal was ok. > > Should kvm.h and Makefile be adjusted to reflect the new ABI? > Suggestions how this should be fixed properly (if possible) are highly > appreciated. I will do what people suggest. I would suggest bringing back kvm_uread() in stable/9 so that the ABI is kept. In head, I suggest removing kvm_uread() from the header file and bumping the soname. I think MFCing the soname bump will cause more annoyance than the removal of kvm_uread() itself. Much of the code using libkvm uses it to access kernel internals, which are not a proper ABI/API and change fairly frequently. Therefore, it is probably acceptable for this library not to use symbol versioning. The functions that do not expose the caller to kernel internals like kvm_getprocs() should probably not be used; instead, libprocstat provides a more ABI-stable way to do the same. Calling the sysctls directly is also an option. -- Jilles Tjoelker