From owner-svn-src-stable@freebsd.org Mon Jan 9 00:09:21 2017 Return-Path: Delivered-To: svn-src-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 A43E9CA68AB; Mon, 9 Jan 2017 00:09:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (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 5D1BC1A45; Mon, 9 Jan 2017 00:09:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0909KCZ058820; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0909KPk058818; Mon, 9 Jan 2017 00:09:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701090009.v0909KPk058818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 9 Jan 2017 00:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311708 - in stable: 10/sys/sys 10/usr.bin/kdump 11/sys/sys 11/usr.bin/kdump X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 00:09:21 -0000 Author: jhb Date: Mon Jan 9 00:09:19 2017 New Revision: 311708 URL: https://svnweb.freebsd.org/changeset/base/311708 Log: MFC 306564: Expose kernel-only errno values if _WANT_KERNEL_ERRNO is defined. The kernel uses a few negative errno values for internal conditions such as requesting a system call restart. Normally these errno values are not exposed to userland. However, kdump needs access to these values as some of then can be present in a ktrace system call return record. Previously kdump was defining _KERNEL to gain access to ehse values, but was then having to manually declare 'errno' (and doing it incorrectly). Now, kdump uses _WANT_KERNEL_ERRNO instead of _KERNEL and uses the system-provided declaration of errno. Modified: stable/11/sys/sys/errno.h stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/errno.h stable/10/usr.bin/kdump/kdump.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/sys/errno.h ============================================================================== --- stable/11/sys/sys/errno.h Sun Jan 8 23:41:17 2017 (r311707) +++ stable/11/sys/sys/errno.h Mon Jan 9 00:09:19 2017 (r311708) @@ -184,7 +184,7 @@ __END_DECLS #define ELAST 96 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) /* pseudo-errors returned inside kernel to modify return to process */ #define ERESTART (-1) /* restart syscall */ #define EJUSTRETURN (-2) /* don't modify regs, just return */ Modified: stable/11/usr.bin/kdump/kdump.c ============================================================================== --- stable/11/usr.bin/kdump/kdump.c Sun Jan 8 23:41:17 2017 (r311707) +++ stable/11/usr.bin/kdump/kdump.c Mon Jan 9 00:09:19 2017 (r311708) @@ -41,10 +41,7 @@ static char sccsid[] = "@(#)kdump.c 8.1 #include __FBSDID("$FreeBSD$"); -#define _KERNEL -extern int errno; -#include -#undef _KERNEL +#define _WANT_KERNEL_ERRNO #include #include #include