From owner-freebsd-stable@freebsd.org Mon Jul 3 18:46:08 2017 Return-Path: Delivered-To: freebsd-stable@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 C0C249ED519 for ; Mon, 3 Jul 2017 18:46:08 +0000 (UTC) (envelope-from lists@opsec.eu) Received: from home.opsec.eu (home.opsec.eu [IPv6:2001:14f8:200::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88C5C7C5CB for ; Mon, 3 Jul 2017 18:46:08 +0000 (UTC) (envelope-from lists@opsec.eu) Received: from pi by home.opsec.eu with local (Exim 4.89 (FreeBSD)) (envelope-from ) id 1dS6MM-000Bjy-4T; Mon, 03 Jul 2017 20:46:10 +0200 Date: Mon, 3 Jul 2017 20:46:10 +0200 From: Kurt Jaeger To: Chris Ross Cc: freebsd-stable@freebsd.org Subject: Re: Compile-time check for clock_nanosleep() Message-ID: <20170703184610.GH65214@home.opsec.eu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jul 2017 18:46:08 -0000 Hi! > Some time ago, I ported a linux program that was using clock_nanosleep(). > I see now that the extra code I'd put in isn't needed anymore in 11-stable, > as it appears this call was added in 11.1. My question is, to > properly protect these changes, what is the best way to know at > compile time, either (a) that that call is in libc, or (b) that > I'm compiling on FreeBSD 11.1 or later ? Use __FreeBSD_version from sys/param.h: https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions.html -- pi@opsec.eu +49 171 3101372 3 years to go !