From owner-freebsd-arch@FreeBSD.ORG Tue Jul 8 20:52:27 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB0647C8 for ; Tue, 8 Jul 2014 20:52:27 +0000 (UTC) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B52A2048 for ; Tue, 8 Jul 2014 20:52:26 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id rd3so7979402pab.31 for ; Tue, 08 Jul 2014 13:52:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=Ygi5XG2O9yCvMaBEzbbndO03rc9YeUKCoSfPwqGvPtY=; b=VBTlK2Cbs+8jRXABjFxnQaalw8Cg6mHI8s0opgYr0oR8IRw5+KP5nVF/U37rR5H/em w9P4111Rq2VNc3Q4TCR8KYFHshHFVQRzChkHeo563fsUd3KuS73Vso4fiJyuq3E7eGzZ XvyHC8HRkpC1k8RXIof4EukIu2fCrZAczWhI+f1jQd+LmxO/7ZaTHfDBQ5aaQQelP07o XFmGFeH0smS4fG2zKWMqzwPsS7WDAS5JERtixltQN00lKCK0wmchffdYWgKzrHlTofGm KGyW0QGieNtquR66Gkydpr2i2zq3r23DTTS/sPypvjbZu9WSrhBYC4l9EH1DxicIuqFO wweQ== X-Gm-Message-State: ALoCoQmWeF2flWrNlsvkVeHG/aCCLDLdyDXapebB2//LQGFvF+jCG3MACDanibha3FD0J8jBIEhV X-Received: by 10.68.239.231 with SMTP id vv7mr37235534pbc.10.1404852746192; Tue, 08 Jul 2014 13:52:26 -0700 (PDT) Received: from [10.64.24.152] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id vy8sm43188975pbc.84.2014.07.08.13.52.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 13:52:25 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_81E8B3CF-17C0-480A-B843-FAF9043D41F8"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: sys/proc.h inclusion of sys/time.h From: Warner Losh In-Reply-To: <53BC4F49.7000903@FreeBSD.org> Date: Tue, 8 Jul 2014 14:52:24 -0600 Message-Id: <95BA9E14-C369-4AC3-8D8A-51F1D16720C7@bsdimp.com> References: <53BC4F49.7000903@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.1878.6) 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 20:52:28 -0000 --Apple-Mail=_81E8B3CF-17C0-480A-B843-FAF9043D41F8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jul 8, 2014, at 2:06 PM, Bryan Drewery wrote: > In r34924 sys/proc.h was changed to only include sys/time.h if not = building in kernel. >=20 > However, as the comment next to time.h says itimerval is needed. >=20 > struct proc { > .. > struct itimerval p_realtimer; /* (c) Alarm timer. */ >=20 > This manifests when (hackishly) including sys/proc.h with _KERNEL = defined: >=20 >> In file included from = /root/svn/base/usr.sbin/tcpdump/tcpdump/../../../contrib/tcpdump/print-pfl= og.c:37: >> /usr/include/sys/proc.h:524:19: error: field has incomplete type = 'struct itimerval' >> struct itimerval p_realtimer; /* (c) Alarm timer. */ >=20 > (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.) >=20 > Should we move the inclusion of sys/time.h outside of this ifdef or = just add a forward declaration for struct itimerval above struct proc = like many others? In the kernel, usually we just include sys/time.h before including = sys/proc.h. :) Traditionally, we haven=92t included all the pre-reqs and = left it to users of these files to do so. Should we change it? Not = without a good reason, imho, but honestly I think any reason better than = =93I think it would be cool=94 is likely good enough these days since = n^2 I/O behavior of always including all prereq files isn=92t as big a = deal as it once was... We can=92t do the forward struct declaration because by the time we get = around to defining (not using) struct proc, its size must be known. Warner --Apple-Mail=_81E8B3CF-17C0-480A-B843-FAF9043D41F8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJTvFoIAAoJEGwc0Sh9sBEAs+IP/3dhH3seZ9b1z0yXMvUGoSna rpSslDLjKbtTdPELjbSwv2EmsCXEwUZpO+Ca0m9KpRwlhiaDr4qDOJ3vKAMthNOD L/gP9+n/D2mxAPZtzjsM2XDF8ualHnk22oJzxS3uKYEx0WNP0rT6fmHylGh9vT5v LUBasU7lUQltshTUoIdmBRQ9ZfNNhRKCxCwxRa268KixDAiKrstwBl1Ulq7RFFkq /FlJIEj/hmmYPrrMkB4d+8AtacmQUN6rASi84QYNSiDghTjNZj/Ojps06mQ/iNBZ tODE1E1YiXkWj3uzj+Fgg5qCj0gq+Jfs4iGBbyMxz0dIvnSep6IcEeQsljzdPDEs SkV0RRcwyrXba85lhFsyKXt7dngoxQteKjcyIbUg5UN5VotRAlDXBTPljIb0uDCy iOHYin82H5VpW5/9ZJAHGc7s4VwozOkjeFItCekr3mx1S5RHXLciyhflllTdNmmP NNEEJvfGuMxqwcgiV31nv77m4TbTpztPo9p72sqL5P7SVtGEoRRDi38R437yzgwj DfQVY7RXdJ0mWE9Y0OHPdjyrccARXRr3s5Ap/EgjPgMlAHgHVVXy5hfSViqAo54R iPNKMmFszpS7NzTOvkI/4ffrLOXxI3SYowkpKKmQJIuHlUsSMjS0GeqOYTqqkSJr T8FWawk4An8klEumyMMy =ax4H -----END PGP SIGNATURE----- --Apple-Mail=_81E8B3CF-17C0-480A-B843-FAF9043D41F8--