From owner-freebsd-arch@FreeBSD.ORG Tue Jul 8 21:07:31 2014 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29FF6F03; Tue, 8 Jul 2014 21:07:31 +0000 (UTC) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E3753216E; Tue, 8 Jul 2014 21:07:30 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 8C6BAB801F; Tue, 8 Jul 2014 23:07:27 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 7B7B828497; Tue, 8 Jul 2014 23:07:27 +0200 (CEST) Date: Tue, 8 Jul 2014 23:07:27 +0200 From: Jilles Tjoelker To: Bryan Drewery Subject: Re: sys/proc.h inclusion of sys/time.h Message-ID: <20140708210727.GA63071@stack.nl> References: <53BC4F49.7000903@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53BC4F49.7000903@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2014 21:07:31 -0000 On Tue, Jul 08, 2014 at 03:06:33PM -0500, Bryan Drewery wrote: > In r34924 sys/proc.h was changed to only include sys/time.h if not > building in kernel. > [snip] > (Why am I doing this? I need PID_MAX and NO_PID for a tcpdump change I > am testing that is intended for upstreaming. Perhaps I can use > kern.pid_max in __FreeBSD__ and other hacks on other platforms, I have > not yet decided on this.) The kern.pid_max sysctl is mostly intended for running FreeBSD 1.0 binaries, which have a 16-bit pid_t. Therefore, it is run-time adjustable and existing processes may have a pid higher than its value. Ideally, you do not need PID_MAX and NO_PID; try to use a variable of type pid_t only for a process ID and store flags elsewhere. There may be a problem if you need to read pid_t from an internal structure or message, though. -- Jilles Tjoelker