From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 00:43:08 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27EB2106564A; Sun, 3 Jul 2011 00:43:08 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx09.syd.optusnet.com.au (fallbackmx09.syd.optusnet.com.au [211.29.132.242]) by mx1.freebsd.org (Postfix) with ESMTP id 934198FC08; Sun, 3 Jul 2011 00:43:07 +0000 (UTC) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by fallbackmx09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p62MWu4i007090; Sun, 3 Jul 2011 08:32:56 +1000 Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p62MWmvw023823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Jul 2011 08:32:48 +1000 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id p62MWldN001432; Sun, 3 Jul 2011 08:32:47 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id p62MWlLx001431; Sun, 3 Jul 2011 08:32:47 +1000 (EST) (envelope-from peter) Date: Sun, 3 Jul 2011 08:32:47 +1000 From: Peter Jeremy To: Robert Millan Message-ID: <20110702223247.GB28815@server.vk2pj.dyndns.org> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FkmkrVfFsRoUs1wW" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] bogus use of __linux__ in aicasm X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 00:43:08 -0000 --FkmkrVfFsRoUs1wW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Jul-02 17:22:15 +0200, Robert Millan wrote: >Code in sys/dev/aic7xxx/aicasm/ contains a few checks on the __linux__ >macro that actually break build on GNU systems (including Linux-based >ones but also GNU/kFreeBSD). Thanks for all the patches. I wonder if you could use send-pr to formally log them so they don't get lost. --=20 Peter Jeremy --FkmkrVfFsRoUs1wW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iEYEARECAAYFAk4PnI8ACgkQ/opHv/APuId1QwCfQTzfM3MQucq8ljtjaZUSVsFv D6AAoIuVJSz39YYB4PqSBq8DUNpUnota =Fyki -----END PGP SIGNATURE----- --FkmkrVfFsRoUs1wW-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 02:19:16 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F1D106566B for ; Sun, 3 Jul 2011 02:19:16 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5408FC0C for ; Sun, 3 Jul 2011 02:19:16 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Sat, 2 Jul 2011 22:08:27 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id A43C833C02; Sat, 2 Jul 2011 22:08:27 -0400 (EDT) Date: Sat, 2 Jul 2011 22:08:27 -0400 From: Ed Maste To: Alexander Kabaev Message-ID: <20110703020827.GA5763@sandvine.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20110702193724.5c55a6c9@kan.dnsalias.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, Robert Millan Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 02:19:16 -0000 On Sat, Jul 02, 2011 at 07:37:24PM -0400, Alexander Kabaev wrote: > On Sat, 2 Jul 2011 17:41:03 +0200 > Robert Millan wrote: > > > My request is that FreeBSD also defines __FreeBSD_kernel__. If this > > happens, life would be made a bit easier on both sides, as it'd be > > more natural for porters of either system to support both using a > > single macro [1]. I think this is a good idea, especially if it means that a single change can make it into upstream projects to support both FreeBSD and Debian kFreeBSD. > I do not think this belongs in GCC at all. You should already have a > defined symbol to identify your OS and that should be used in cases > where it matters. I suspect the proposed patch put it in GCC based on the fact that we already have __FreeBSD__ in contrib/gcc/config/freebsd-spec.h: builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \ > Alternatively, you should provide the symbol in > similar way in which we provide __FreeBSD_version, through well-known > header like sys/param.h and not pollute GCC. I suspect this is probably a reasonable alternative, but may mean software will have to pick up an additional #include. Out of curiosity, what is the canonical way for software to identify a Linux kernel -- __linux__ or some variant? Where is it defined? Regards, Ed Maste From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 03:05:13 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 797F0106566C; Sun, 3 Jul 2011 03:05:13 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1D4768FC0A; Sun, 3 Jul 2011 03:05:12 +0000 (UTC) Received: by vxg33 with SMTP id 33so4240606vxg.13 for ; Sat, 02 Jul 2011 20:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=xrSVdwivqvf7kRSzijmwCLlH76uRTBIXqIYbCz3WqAQ=; b=UAD3+bqzxhnhpfJRk0L7q5i/2h6exfrkT4+yCA3zYAyUUizUqmSIPXP1TK4opkLBMF nS/bnxcd1y0OyMCM7JtBIwlVAPifJYIejVt641iS7iHCQdj7GicRR7EkUEy1WOWbDaaS knDqzquEQub94zu52Pp8aROGTjT7UK2twpkzE= MIME-Version: 1.0 Received: by 10.220.8.193 with SMTP id i1mr1840270vci.108.1309662312212; Sat, 02 Jul 2011 20:05:12 -0700 (PDT) Received: by 10.220.92.201 with HTTP; Sat, 2 Jul 2011 20:05:12 -0700 (PDT) In-Reply-To: <20110703020827.GA5763@sandvine.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> Date: Sat, 2 Jul 2011 20:05:12 -0700 Message-ID: From: Garrett Cooper To: Ed Maste Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Robert Millan Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 03:05:13 -0000 On Sat, Jul 2, 2011 at 7:08 PM, Ed Maste wrote: > On Sat, Jul 02, 2011 at 07:37:24PM -0400, Alexander Kabaev wrote: > >> On Sat, 2 Jul 2011 17:41:03 +0200 >> Robert Millan wrote: >> >> > My request is that FreeBSD also defines __FreeBSD_kernel__. =A0If this >> > happens, life would be made a bit easier on both sides, as it'd be >> > more natural for porters of either system to support both using a >> > single macro [1]. > > I think this is a good idea, especially if it means that a single change = can > make it into upstream projects to support both FreeBSD and Debian > kFreeBSD. > >> I do not think this belongs in GCC at all. You should already have a >> defined symbol to identify your OS and that should be used in cases >> where it matters. > > I suspect the proposed patch put it in GCC based on the fact that we > already have __FreeBSD__ in contrib/gcc/config/freebsd-spec.h: > =A0 =A0 =A0 =A0builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR);= =A0 =A0 =A0\ > >> Alternatively, you should provide the symbol in >> similar way in which we provide __FreeBSD_version, through well-known >> header like sys/param.h and not pollute GCC. > > I suspect this is probably a reasonable alternative, but may mean softwar= e > will have to pick up an additional #include. > > Out of curiosity, what is the canonical way for software to identify a > Linux kernel -- __linux__ or some variant? =A0Where is it defined? linux is most often reliably defined value based on my personal experience and it's defined in gcc [look for `builtin_define.*("linux");' (note: this is a regexp..)]. Example: $ echo '' | gcc -E -xc -dM -c - 2>&1 | grep linux #define __linux 1 #define __linux__ 1 #define __gnu_linux__ 1 #define linux 1 HTH, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 10:20:51 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EACD110656D0 for ; Sun, 3 Jul 2011 10:20:51 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8374D8FC16 for ; Sun, 3 Jul 2011 10:20:51 +0000 (UTC) Received: by pvg11 with SMTP id 11so5269365pvg.13 for ; Sun, 03 Jul 2011 03:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=67KEzGr6JVNPklIDLwEmQoGDy9XmbOV4/UM9FC+9Zfk=; b=d/iv2GjY6XtAUZ5D7oU8hfXscWOdLfmDIoh3uN9TJr/z0QOa37bbp/0SQTE2r7SBuI utNxPdfDqk6wpoGyHem9Je4J8wRzNPWIE27nNHz0STBoFbRxDfiUzpQtmGfYWjdruGxs ZSPcZaha+NxhfjvFdralzgzscaiVdzdhsoLyI= MIME-Version: 1.0 Received: by 10.68.25.166 with SMTP id d6mr6064224pbg.136.1309688451070; Sun, 03 Jul 2011 03:20:51 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 03:20:51 -0700 (PDT) In-Reply-To: <4E0F9729.9080002@gmx.de> References: <4E0F9729.9080002@gmx.de> Date: Sun, 3 Jul 2011 12:20:51 +0200 X-Google-Sender-Auth: 7fXHmQTiG23zBuWtqvvRJAflbmE Message-ID: From: Robert Millan To: Matthias Andree Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] Remove -nostdinc in aicasm X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 10:20:52 -0000 2011/7/3 Matthias Andree : > Note that there are GCC-version-specific directories for the more > intricate details such as stdarg.h and compiler-specific builtins -- you > don't get those with -I/usr/include either. I know. That's actually the problem I'm trying to solve ( not found). -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 10:24:59 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72177106566C; Sun, 3 Jul 2011 10:24:59 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4548A8FC0A; Sun, 3 Jul 2011 10:24:59 +0000 (UTC) Received: by pzk27 with SMTP id 27so2075760pzk.13 for ; Sun, 03 Jul 2011 03:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ig0b5u/45lMg4bIHw0imCZfq15whyqxA2kfXbkM3G1s=; b=HUnVrYVqyK/n4FV0GoBLLYxR5PeHGY81KcqSz/RU+8xNRWiJIVZBM8hF8G2lzLehVn oeLt2ngYiZui0fsWtoU1BxWPrh1TOh6g61rqE235CK9xGA7Ap4JHze1gdsSmN57uDxBy BDDM2lQKzCWoC6Azvuz96i1Fxt57g7QUt9FDg= MIME-Version: 1.0 Received: by 10.68.27.41 with SMTP id q9mr5566219pbg.337.1309688698740; Sun, 03 Jul 2011 03:24:58 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 03:24:58 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 Jul 2011 12:24:58 +0200 X-Google-Sender-Auth: OKCg6YbDWO9Yt6CBO_fViC0tbDA Message-ID: From: Robert Millan To: Benjamin Kaduk Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 10:24:59 -0000 2011/7/3 Benjamin Kaduk : > % =C2=A0 =C2=A0 =C2=A0 builtin_define_with_int_value ("__FreeBSD__", FBSD= _MAJOR); =C2=A0 =C2=A0 =C2=A0\ > % + =C2=A0 =C2=A0 builtin_define ("__FreeBSD_kernel__"); =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0\ > > Is there a reason to prefer just defining the symbol to also including th= e > major version number as is done for __FreeBSD__? None. It's just not useful from our side, but it does no harm either. (In Debian world, there's no tight integration like you have by putting FreeBSD kernel and compiler(s) in the same repository. A particular version of GCC can be used to compile for one kernel or another, so we wouldn't be able to "commit" it to a specific kernel version) --=20 Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 10:34:34 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDB0A106566C for ; Sun, 3 Jul 2011 10:34:34 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id A8FC88FC08 for ; Sun, 3 Jul 2011 10:34:34 +0000 (UTC) Received: by pzk27 with SMTP id 27so2080255pzk.13 for ; Sun, 03 Jul 2011 03:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=NPAtMzo/akls+KU4xll0dSuSCEf0A0l+adz/pMrvvUA=; b=taZEkQcVjzglLG5cMMxOIchVWqXebIJjsmBgHAWrzlqfSrSWth/DdpG59CIhbJW8yN MUmmhQcBhBxzNcuzAUHkHMNpGhYUVUiz6D6aYvn2OBg57N3cuQjwhsD7eFhk3XIvG/og 1rvIb6SJna2WqidVQYiNzpdxvHD1XIkPLGaiU= MIME-Version: 1.0 Received: by 10.68.27.41 with SMTP id q9mr5572741pbg.337.1309689274198; Sun, 03 Jul 2011 03:34:34 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 03:34:34 -0700 (PDT) In-Reply-To: <20110702193724.5c55a6c9@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> Date: Sun, 3 Jul 2011 12:34:34 +0200 X-Google-Sender-Auth: HwLiXaizMgmlWHwqS-Vi_QZ4IHs Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 10:34:34 -0000 2011/7/3 Alexander Kabaev : > I do not think this belongs in GCC at all. You should already have a > defined symbol to identify your OS and that should be used in cases > where it matters. If we wanted to identify the OS as a whole, we can currently do this with something like: "#if defined(__FreeBSD_kernel__) && defined(__GLIBC__)" however, in practice this never happens. What almost every check wants is either to know about our userland APIs (hence __GLIBC__) or to know about our kernel APIs (then __FreeBSD_kernel__). In both cases, the check also wants to match other operating systems (FreeBSD when it comes to kernel API checks, and GNU/{Linux,Hurd} when it comes to userland API checks). Using macros that are shared (like __GLIBC__) or that could potentially be shared (like __FreeBSD_kernel__) with other operating systems maximizes the opportunities to: a) produce simpler checks like "#ifdef __GLIBC__" which are easier to read and maintain. b) collaborate with other projects by producing patches which have the collateral effect of improving portability with other operating systems. -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 10:39:50 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EB1F106566C; Sun, 3 Jul 2011 10:39:50 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 22E2C8FC13; Sun, 3 Jul 2011 10:39:50 +0000 (UTC) Received: by pzk27 with SMTP id 27so2082565pzk.13 for ; Sun, 03 Jul 2011 03:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=eA1z3W/Nh5N9YSwCST9aUHqoG2PxiOTEGBwkhZXV258=; b=LLD1IMfsrEibSRjw8ffzHQlBEnoAsSmtNQg5wvgR+oKQsfeHQ1aO+5laLBckYNYCdN ew1hWJUuu4kE55DqG4+q1LphSR8SA39Ywmhaj60dhL5P11gANeefej/UQsuRr0gxKj0q /zXqsDlC0/NsjksBKG/6iCJkZIqt32uF6nv54= MIME-Version: 1.0 Received: by 10.68.29.74 with SMTP id i10mr5805585pbh.69.1309689589759; Sun, 03 Jul 2011 03:39:49 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 03:39:49 -0700 (PDT) In-Reply-To: <20110703020827.GA5763@sandvine.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> Date: Sun, 3 Jul 2011 12:39:49 +0200 X-Google-Sender-Auth: OUuebO5hWn-TzOCcY8EFu6DJPuI Message-ID: From: Robert Millan To: Ed Maste Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 10:39:50 -0000 2011/7/3 Ed Maste : >> Alternatively, you should provide the symbol in >> similar way in which we provide __FreeBSD_version, through well-known >> header like sys/param.h and not pollute GCC. > > I suspect this is probably a reasonable alternative, but may mean software > will have to pick up an additional #include. Having to pick up an additional #include is sometimes a source of trouble, because: a) it's easy to forget (and hard to detect when having forgotten only breaks the other platform) b) one might not be able to assume this file is present ( is not in POSIX, for example) Nevermind that, it's much better than not having the macro at all. -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 10:41:45 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75FD5106564A for ; Sun, 3 Jul 2011 10:41:45 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 18DD78FC26 for ; Sun, 3 Jul 2011 10:41:44 +0000 (UTC) Received: by pvg11 with SMTP id 11so5278916pvg.13 for ; Sun, 03 Jul 2011 03:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WljxUBisCMWthlgo9f5sDJkGAwpqZ1u9lajixukDVRI=; b=KtJZjFLcA5fmsYzR+DNyYJqYOM3JM3kWWW14GW0w6/4WVDFoyf1iuMbWeGNc5Y7MwF /xrpLezT/iZ/BsrWwZtSlD/vjQ23m/kPIbe6w7o5W2X00A7EIbkfrqj2Dh6hDseCt4uv gjO284AzC1eNgAfPEEEV84QIM4qL32QyRPnAs= MIME-Version: 1.0 Received: by 10.68.35.103 with SMTP id g7mr6015868pbj.471.1309689704539; Sun, 03 Jul 2011 03:41:44 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 03:41:44 -0700 (PDT) In-Reply-To: <20110702193724.5c55a6c9@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> Date: Sun, 3 Jul 2011 12:41:44 +0200 X-Google-Sender-Auth: YKR5ieRol6Ofj4O8RDVqdikg8v8 Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 10:41:45 -0000 2011/7/3 Alexander Kabaev : > GCC is on the way to be > pushed out into ports in FreeBSD and it will not the the only usable > compiler before long. Your proposal will force similar changes in > Clang, Path64 and PCC, , to be really universal which is not > practical. Would my proposal be more welcome if it included a patch for Clang, Path64 and PCC as well? -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 11:47:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AC8B106564A; Sun, 3 Jul 2011 11:47:39 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id F37B88FC0C; Sun, 3 Jul 2011 11:47:38 +0000 (UTC) Received: by pvg11 with SMTP id 11so5309383pvg.13 for ; Sun, 03 Jul 2011 04:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=2+shwlHsT+/5Ux38uXvx9eBcRu9UWisJWgTgWPNOV44=; b=cPuID48D4wdY8nG70EXASFgCFtt4vc6X5sEwPM1bh+Qyg3/aIZwHsbfSSwZXwR8Agk qkCvKYA4YvCZ5tzoF7i/dcjHEczj5NF57LZWA1TwByOjwsYp72YYMx/5DegvbA+BP3g2 eYhZ1KpiZgdDpLy8ular10qIgr6S2rE0e0oWg= MIME-Version: 1.0 Received: by 10.68.32.137 with SMTP id j9mr6136816pbi.2.1309693658583; Sun, 03 Jul 2011 04:47:38 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 04:47:38 -0700 (PDT) Date: Sun, 3 Jul 2011 13:47:38 +0200 X-Google-Sender-Auth: 3-m0JCmPBXH8X1wh5dxhKJc8eAo Message-ID: From: Robert Millan To: freebsd-hackers@freebsd.org, Ed Maste Content-Type: multipart/mixed; boundary=bcaec520ef1948d2f204a728d111 Cc: Subject: [PATCH] PAGE_SIZE in libsbuf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 11:47:39 -0000 --bcaec520ef1948d2f204a728d111 Content-Type: text/plain; charset=UTF-8 On arm, ia64, powerpc and sparc, Linux doesn't define a static PAGE_SIZE. It can only be obtained via sysconf(). In addition, GNU/Hurd doesn't define PAGE_SIZE at all. This patch improves portability of libsbuf to be built on those platforms. In case you'd like to know, Debian is using libsbuf not just for its GNU/kFreeBSD port, but also provides it to developers in Debian GNU/Linux: http://packages.debian.org/search?keywords=libsbuf-dev https://buildd.debian.org/status/package.php?p=freebsd-libs&suite=sid -- Robert Millan --bcaec520ef1948d2f204a728d111 Content-Type: text/plain; charset=US-ASCII; name="sbuf_page_size.diff" Content-Disposition: attachment; filename="sbuf_page_size.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gpnxrdgb0 SW5kZXg6IHN5cy9rZXJuL3N1YnJfc2J1Zi5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9rZXJuL3N1YnJf c2J1Zi5jCShyZXZpc2lvbiAyMjM3MjEpCisrKyBzeXMva2Vybi9zdWJyX3NidWYuYwkod29ya2lu ZyBjb3B5KQpAQCAtNzYsNiArNzYsMTEgQEAKICNkZWZpbmUJU0JVRl9TRVRGTEFHKHMsIGYpCWRv IHsgKHMpLT5zX2ZsYWdzIHw9IChmKTsgfSB3aGlsZSAoMCkKICNkZWZpbmUJU0JVRl9DTEVBUkZM QUcocywgZikJZG8geyAocyktPnNfZmxhZ3MgJj0gfihmKTsgfSB3aGlsZSAoMCkKIAorI2lmICFk ZWZpbmVkKFBBR0VfU0laRSkgJiYgIWRlZmluZWQoX0tFUk5FTCkKKyNpbmNsdWRlIDx1bmlzdGQu aD4KKyNkZWZpbmUgUEFHRV9TSVpFCQlzeXNjb25mKF9TQ19QQUdFU0laRSkKKyNlbmRpZgorCiAj ZGVmaW5lCVNCVUZfTUlORVhURU5EU0laRQkxNgkJLyogU2hvdWxkIGJlIHBvd2VyIG9mIDIuICov CiAKICNpZmRlZiBQQUdFX1NJWkUK --bcaec520ef1948d2f204a728d111-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 11:57:58 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1956E106566B; Sun, 3 Jul 2011 11:57:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 722EB8FC1A; Sun, 3 Jul 2011 11:57:56 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p63BvoQD050677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Jul 2011 14:57:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p63BvoZt095796; Sun, 3 Jul 2011 14:57:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p63BvohH095795; Sun, 3 Jul 2011 14:57:50 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 3 Jul 2011 14:57:50 +0300 From: Kostik Belousov To: Robert Millan Message-ID: <20110703115750.GL48734@deviant.kiev.zoral.com.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0A22s/3ja2DLkBMy" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] PAGE_SIZE in libsbuf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 11:57:58 -0000 --0A22s/3ja2DLkBMy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 03, 2011 at 01:47:38PM +0200, Robert Millan wrote: > On arm, ia64, powerpc and sparc, Linux doesn't define a static > PAGE_SIZE. It can only be obtained via sysconf(). In addition, > GNU/Hurd doesn't define PAGE_SIZE at all. >=20 > This patch improves portability of libsbuf to be built on those platforms. >=20 > In case you'd like to know, Debian is using libsbuf not just for its > GNU/kFreeBSD port, but also provides it to developers in Debian > GNU/Linux: >=20 > http://packages.debian.org/search?keywords=3Dlibsbuf-dev > https://buildd.debian.org/status/package.php?p=3Dfreebsd-libs&suite=3Dsid I think the different workaround is already included in the latest sbuf source. Please see http://svnweb.freebsd.org/base/head/sys/kern/subr_sbuf.c?revision=3D222015&= view=3Dmarkup --0A22s/3ja2DLkBMy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk4QWT4ACgkQC3+MBN1Mb4jJzgCfXI1c+0ylOYQB3t1rIVifSIq7 VtEAn1PxRgzd0Pu4QCcI064xc2MJuDIQ =Hgsp -----END PGP SIGNATURE----- --0A22s/3ja2DLkBMy-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 12:08:00 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5A67106566B; Sun, 3 Jul 2011 12:08:00 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3153E8FC0A; Sun, 3 Jul 2011 12:07:59 +0000 (UTC) Received: by pvg11 with SMTP id 11so5319342pvg.13 for ; Sun, 03 Jul 2011 05:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=F/sDbLKCAINPBBV5Fzm8MF481diFW9FRjKsw/hDi72w=; b=nG/+35B4VdoBWmrfhy5zloXEL7TAmJO0cltbIzusD9VJJ5A6JV7aXdW1DQrBkzdi9D Pj7Z1rTt1dBWVVG+0qi6I+r+2wKpJWg1pL38HX2sqrfLzKFJVubOXxRS/0ln7PzrRw92 oKiP0R+oC+58AwboxBS+YNRq2D8xY2SCuyDBk= MIME-Version: 1.0 Received: by 10.68.25.166 with SMTP id d6mr6147480pbg.136.1309694879431; Sun, 03 Jul 2011 05:07:59 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 05:07:59 -0700 (PDT) In-Reply-To: <20110703115750.GL48734@deviant.kiev.zoral.com.ua> References: <20110703115750.GL48734@deviant.kiev.zoral.com.ua> Date: Sun, 3 Jul 2011 14:07:59 +0200 X-Google-Sender-Auth: URUdKaYULLRBLTG9eItUd_zw_d4 Message-ID: From: Robert Millan To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] PAGE_SIZE in libsbuf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 12:08:00 -0000 2011/7/3 Kostik Belousov : > I think the different workaround is already included in the latest > sbuf source. Please see > http://svnweb.freebsd.org/base/head/sys/kern/subr_sbuf.c?revision=222015&view=markup How does libsbuf react if the guess fails? Also note this codepath isn't tested in FreeBSD (except for pc98). I'm afraid this situation could lead to runtime errors somehow. I'd still propose replacing this guess with a sysconf() check. -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 12:34:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0468106566C; Sun, 3 Jul 2011 12:34:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 035E18FC18; Sun, 3 Jul 2011 12:34:41 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p63CYZJ9052886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Jul 2011 15:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p63CYZSO097091; Sun, 3 Jul 2011 15:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p63CYZQl097089; Sun, 3 Jul 2011 15:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 3 Jul 2011 15:34:35 +0300 From: Kostik Belousov To: Robert Millan Message-ID: <20110703123435.GN48734@deviant.kiev.zoral.com.ua> References: <20110703115750.GL48734@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ppqw4mhdCbV3XNpT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] PAGE_SIZE in libsbuf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 12:34:42 -0000 --ppqw4mhdCbV3XNpT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 03, 2011 at 02:07:59PM +0200, Robert Millan wrote: > 2011/7/3 Kostik Belousov : > > I think the different workaround is already included in the latest > > sbuf source. Please see > > http://svnweb.freebsd.org/base/head/sys/kern/subr_sbuf.c?revision=3D222= 015&view=3Dmarkup >=20 > How does libsbuf react if the guess fails? Also note this codepath > isn't tested in FreeBSD (except for pc98). >=20 > I'm afraid this situation could lead to runtime errors somehow. I'd > still propose replacing this guess with a sysconf() check. Which runtime errors ? The constant is used to size the malloc allocations. Use of the PAGE_SIZE is an attempt to do some optimization. I think it would work if you use e.g. 42 instead of PAGE_SIZE. --ppqw4mhdCbV3XNpT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk4QYdoACgkQC3+MBN1Mb4j9PwCfQRbDXJe5qB/t2HHTrA8hg76X 3msAnRDZqkBybktcBXVhSGq97qUpUFEw =QHJl -----END PGP SIGNATURE----- --ppqw4mhdCbV3XNpT-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 14:15:10 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81BE71065679 for ; Sun, 3 Jul 2011 14:15:10 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 56ACC8FC0C for ; Sun, 3 Jul 2011 14:15:10 +0000 (UTC) Received: by pvg11 with SMTP id 11so5382836pvg.13 for ; Sun, 03 Jul 2011 07:15:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=jXlakOQZAwrovHcxSlrOUeiNsjiogJ834IFzVYqMiYE=; b=Z9dXqJr8+L2RPSGYddFo5v/y8Kn62uKXn8MmGOoAvMxD/zFFIZX6CTH5y8+P4to2Tg 7wai7aspRJaMh4vKQ6cDrnCXzAZCVb4YHgVjVaswVvJKBXHTK1/yjgj7KTeTkUWoT1g1 4tmf2QnCOz+oBiKIb465W0LLQJPol8xpsa9Ks= MIME-Version: 1.0 Received: by 10.68.32.137 with SMTP id j9mr6250632pbi.2.1309702509872; Sun, 03 Jul 2011 07:15:09 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 07:15:09 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 Jul 2011 16:15:09 +0200 X-Google-Sender-Auth: DyOOJ14epVOMufAvFxBn1fiIMkM Message-ID: From: Robert Millan To: Benjamin Kaduk Content-Type: multipart/mixed; boundary=bcaec520ef19dcc6c204a72ae060 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] Remove -nostdinc in aicasm X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 14:15:10 -0000 --bcaec520ef19dcc6c204a72ae060 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/7/2 Robert Millan : > 2011/7/2 Benjamin Kaduk : >> There is a functional difference between '-nostdinc -I/usr/include -I.' = even >> when the standard include search path is just /usr/include -- the standa= rd >> include paths are always searched last (unless -nostdinc is given), even= if >> they are explicitly listed on the command line. =C2=A0If there are confl= icting >> definitions in /usr/local/foo.h and ./foo.h, this gimmick can be necessa= ry >> to pull in the correct version. =C2=A0(I've needed to do this when packa= ging >> software for the freebsd ports collection, though with /usr/local/includ= e >> replacing '.'.) > > In this case I'd rather be safe than sorry and use -iwithprefix or > -isystem `gcc --print-file-name=3D` on GCC only. I hope this patch is better. Please have a look. --=20 Robert Millan --bcaec520ef19dcc6c204a72ae060 Content-Type: text/plain; charset=US-ASCII; name="aicasm_nostdinc.diff" Content-Disposition: attachment; filename="aicasm_nostdinc.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gpo31lc10 SW5kZXg6IHN5cy9kZXYvYWljN3h4eC9haWNhc20vTWFrZWZpbGUKPT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lz L2Rldi9haWM3eHh4L2FpY2FzbS9NYWtlZmlsZQkocmV2aXNpb24gMjIzNzIxKQorKysgc3lzL2Rl di9haWM3eHh4L2FpY2FzbS9NYWtlZmlsZQkod29ya2luZyBjb3B5KQpAQCAtMjYsNiArMjYsMTMg QEAKIAogTk9TVERJTkM9CS1ub3N0ZGluYwogQ0ZMQUdTKz0gJHtOT1NURElOQ30gLUkvdXNyL2lu Y2x1ZGUgLUkuCisjIFRoaXMgaXMgbmVlZGVkIHdoZW4gdXNpbmcgdXBzdHJlYW0gR0NDICh3aG9z ZSA8c3RkZGVmLmg+LCBldGMsIGFyZQorIyBub3QgcmUtZW5hYmxlZCBieSAtSS91c3IvaW5jbGRl KS4KKy5pZiAke0NDOlQ6TWNsYW5nfSAhPSAiY2xhbmciCitHQ0NJTkNESVIhPQlnY2MgLS1wcmlu dC1maWxlLW5hbWU9CitDRkxBR1MrPQktSSR7R0NDSU5DRElSfS9pbmNsdWRlIC1JJHtHQ0NJTkNE SVJ9L2luY2x1ZGUtZml4ZWQKKy5lbmRpZgorCiAuaWZkZWYgTUFLRVNSQ1BBVEgKIENGTEFHUys9 IC1JJHtNQUtFU1JDUEFUSH0KIC5lbmRpZgo= --bcaec520ef19dcc6c204a72ae060-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 14:15:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49C1A106566C; Sun, 3 Jul 2011 14:15:55 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1C3AF8FC1A; Sun, 3 Jul 2011 14:15:55 +0000 (UTC) Received: by pzk27 with SMTP id 27so2187275pzk.13 for ; Sun, 03 Jul 2011 07:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=rB8glhKhlD7ZTwG5+V56bg+SeR6Nfbd04XcEE2jqtDk=; b=GrmyFX4CCUPQ/yv0vYrb7Rx8uahMAy0Axi4CQjn8Gon+ZSXeIr9CvYB9U2u+RCtmdh X5CcoQmPkTpYOo9cTdqGJtxT9oJ0dVNv4nfi4e3uOa4gBQj9UEEM9nBkk/Ay1mm2Upny 4dMLeNyDHBEYRfNT96h+IbqPzGceHS3eZNKAA= MIME-Version: 1.0 Received: by 10.68.29.42 with SMTP id g10mr6410326pbh.203.1309702554671; Sun, 03 Jul 2011 07:15:54 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 07:15:54 -0700 (PDT) In-Reply-To: <20110703123435.GN48734@deviant.kiev.zoral.com.ua> References: <20110703115750.GL48734@deviant.kiev.zoral.com.ua> <20110703123435.GN48734@deviant.kiev.zoral.com.ua> Date: Sun, 3 Jul 2011 16:15:54 +0200 X-Google-Sender-Auth: nzzR2151y-CNTcXbOsSOJod9hTk Message-ID: From: Robert Millan To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] PAGE_SIZE in libsbuf X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 14:15:55 -0000 2011/7/3 Kostik Belousov : > Which runtime errors ? The constant is used to size the malloc > allocations. Use of the PAGE_SIZE is an attempt to do some optimization. > > I think it would work if you use e.g. 42 instead of PAGE_SIZE. Never mind then. Thanks for the info. -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 14:35:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6F221065674 for ; Sun, 3 Jul 2011 14:35:39 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7EFBF8FC17 for ; Sun, 3 Jul 2011 14:35:39 +0000 (UTC) Received: by vws18 with SMTP id 18so4401219vws.13 for ; Sun, 03 Jul 2011 07:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=ni83C3ElTm/8TyAOKJ5lhYZWZ6sUDy6UsEEyRSfUddc=; b=NMuNhh9s6e8UpHOxqTu+BVhTEE946A4sR1pr4gNEa19UWY6vKweLkcAr3eNZCEsoxi WNfRwh82/0l1JfGtU4OYQHeA+QaJZek19F2iD15yOBY2iVo+KSSL8RI0Pci69WgW7XvO KuuLyQZtLPNki/zP8tZPZiH5tPtkmr1zCC4tI= Received: by 10.52.166.165 with SMTP id zh5mr3370208vdb.158.1309703738598; Sun, 03 Jul 2011 07:35:38 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id 20sm3030919vbe.15.2011.07.03.07.35.36 (version=SSLv3 cipher=OTHER); Sun, 03 Jul 2011 07:35:37 -0700 (PDT) Date: Sun, 3 Jul 2011 10:35:31 -0400 From: Alexander Kabaev To: Garrett Cooper Message-ID: <20110703103531.4a553271@kan.dnsalias.net> In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/iuc1qVM5aE7B20Se6WzXTHr"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org, Robert, Ed Maste , Millan Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 14:35:40 -0000 --Sig_/iuc1qVM5aE7B20Se6WzXTHr Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Sat, 2 Jul 2011 20:05:12 -0700 Garrett Cooper wrote: > On Sat, Jul 2, 2011 at 7:08 PM, Ed Maste wrote: > > On Sat, Jul 02, 2011 at 07:37:24PM -0400, Alexander Kabaev wrote: > > > >> On Sat, 2 Jul 2011 17:41:03 +0200 > >> Robert Millan wrote: > >> > >> > My request is that FreeBSD also defines __FreeBSD_kernel__. =9AIf > >> > this happens, life would be made a bit easier on both sides, as > >> > it'd be more natural for porters of either system to support > >> > both using a single macro [1]. > > > > I think this is a good idea, especially if it means that a single > > change can make it into upstream projects to support both FreeBSD > > and Debian kFreeBSD. > > > >> I do not think this belongs in GCC at all. You should already have > >> a defined symbol to identify your OS and that should be used in > >> cases where it matters. > > > > I suspect the proposed patch put it in GCC based on the fact that we > > already have __FreeBSD__ in contrib/gcc/config/freebsd-spec.h: > > =9A =9A =9A =9Abuiltin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR= ); > > =9A =9A\ > > > >> Alternatively, you should provide the symbol in > >> similar way in which we provide __FreeBSD_version, through > >> well-known header like sys/param.h and not pollute GCC. > > > > I suspect this is probably a reasonable alternative, but may mean > > software will have to pick up an additional #include. > > > > Out of curiosity, what is the canonical way for software to > > identify a Linux kernel -- __linux__ or some variant? =9AWhere is it > > defined? >=20 > linux is most often reliably defined value based on my personal > experience and it's defined in gcc [look for > `builtin_define.*("linux");' (note: this is a regexp..)]. Example: >=20 > $ echo '' | gcc -E -xc -dM -c - 2>&1 | grep linux > #define __linux 1 > #define __linux__ 1 > #define __gnu_linux__ 1 > #define linux 1 >=20 > HTH, > -Garrett __linux__ is exactly what __FreeBSD__ is and dies not identify kernel but rather Linux as whole OS, whatever that might be these days. There does not appear to be an universal macro that identifies environment as using Linux kernel regardless of the rest of components used (say, to identify Android and Ubuntu or something embedded with ucLibc as running Linux kernel with different userland implementations). --=20 Alexander Kabaev --Sig_/iuc1qVM5aE7B20Se6WzXTHr Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOEH43Q6z1jMm+XZYRAl8ZAKDJtBR1I9io5uBJ8Cwb6gu7maPwaQCfcWu+ 3xGLMqKLpOoGKj+9LJqNEHI= =sPWw -----END PGP SIGNATURE----- --Sig_/iuc1qVM5aE7B20Se6WzXTHr-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 14:39:12 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B2A7106566B for ; Sun, 3 Jul 2011 14:39:12 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id ED7748FC22 for ; Sun, 3 Jul 2011 14:39:11 +0000 (UTC) Received: by iwr19 with SMTP id 19so5254445iwr.13 for ; Sun, 03 Jul 2011 07:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=ywEW97PRskKNnooDp2/Ej4MbVsb7Q4BeIa2i2SnhV+E=; b=Rb2DIxf8gM7NszZ4Il8YGKqeRVBC0rLiCRQQEudyQl2qDzrPpOndcYxi8/fnhQynju uyyZA/5tFDoFzPRRf/8ipIqLNfAyFPTjskN+PPsY5ahghvsqCaDX1ilTvxKCeCsMv1SD wADvkPnjrXdGYhy+a6BrRB0dFeNi7g94Hp3Hk= Received: by 10.42.172.133 with SMTP id n5mr112046icz.421.1309703951126; Sun, 03 Jul 2011 07:39:11 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.155.141 with HTTP; Sun, 3 Jul 2011 07:38:41 -0700 (PDT) In-Reply-To: <20110703103531.4a553271@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> From: Chris Rees Date: Sun, 3 Jul 2011 15:38:41 +0100 X-Google-Sender-Auth: 5U_VNvNb4UE9Wf8yi82mO-AXxWY Message-ID: To: Alexander Kabaev Content-Type: text/plain; charset=ISO-8859-1 Cc: Garrett Cooper , freebsd-hackers@freebsd.org, Millan , Ed Maste , Robert@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 14:39:12 -0000 2011/7/3 Alexander Kabaev : > > __linux__ is exactly what __FreeBSD__ is and dies not identify kernel > but rather Linux as whole OS, whatever that might be these days. > > There does not appear to be an universal macro that identifies > environment as using Linux kernel regardless of the rest of components > used (say, to identify Android and Ubuntu or something embedded with > ucLibc as running Linux kernel with different userland > implementations). Please-- Linux is not and has never been an OS. __linux__ applies to the kernel, the OS is called GNU/Linux. Call me pedantic, but that was a nonsensical statement. Chris From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 14:39:33 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A070106566B for ; Sun, 3 Jul 2011 14:39:33 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0917A8FC0A for ; Sun, 3 Jul 2011 14:39:31 +0000 (UTC) Received: by vws18 with SMTP id 18so4402469vws.13 for ; Sun, 03 Jul 2011 07:39:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=MY3/J2nJTU/Tca4nUqAvmuzEzgJJEP8AHZD/gidZOTM=; b=sVIRwap5H5EnB8q2Y5W6ptzX/gFBQznnpbnbED0OnigHlOx2vcdQQZDebXMcFaZycD OC5+wCZwtr41+nqpuZyMuCXOqNnhgMdk3qEoTlaKBi/3GXzPSyUygKNrl8vu1LmKaqFU 4ZqFlSadCa5Fd+/4Z2GXQIYOXjawW489NIQcc= Received: by 10.52.95.46 with SMTP id dh14mr7201253vdb.60.1309703971371; Sun, 03 Jul 2011 07:39:31 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id 20sm3038206vbe.3.2011.07.03.07.39.30 (version=SSLv3 cipher=OTHER); Sun, 03 Jul 2011 07:39:30 -0700 (PDT) Date: Sun, 3 Jul 2011 10:39:25 -0400 From: Alexander Kabaev To: Robert Millan Message-ID: <20110703103925.0bdf255a@kan.dnsalias.net> In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/R_6ZJhCzxSpuBU2b9SQT+6/"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 14:39:33 -0000 --Sig_/R_6ZJhCzxSpuBU2b9SQT+6/ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 3 Jul 2011 12:41:44 +0200 Robert Millan wrote: > 2011/7/3 Alexander Kabaev : > > GCC is on the way to be > > pushed out into ports in FreeBSD and it will not the the only usable > > compiler before long. Your proposal will force similar changes in > > Clang, Path64 and PCC, , to be really universal which is > > not practical. >=20 > Would my proposal be more welcome if it included a patch for Clang, > Path64 and PCC as well? >=20 > --=20 > Robert Millan Not really, unless you have way of sticking this definition into past compiler releases. --=20 Alexander Kabaev --Sig_/R_6ZJhCzxSpuBU2b9SQT+6/ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOEH8hQ6z1jMm+XZYRAnHZAJ46zd5q7IVaSX8yKYmQmbODFx1PqgCfRUQ/ /ARxhzRone2utHUlqzSbO9c= =S2uw -----END PGP SIGNATURE----- --Sig_/R_6ZJhCzxSpuBU2b9SQT+6/-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 14:44:38 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C17C106564A; Sun, 3 Jul 2011 14:44:38 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id F12838FC0C; Sun, 3 Jul 2011 14:44:37 +0000 (UTC) Received: by qyk38 with SMTP id 38so2963920qyk.13 for ; Sun, 03 Jul 2011 07:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=6/YLMsZUZX+sRzcPjIFY39DcOlZRFno0ocauhECHUag=; b=ZhIRP/wrFgQlrWC4G7mqKO0yeKxXJ1bAEBPNH9UW2s4VcXEwehcmpaxEH+gXqSnavh Yf62lmCLe8oBVXYm5bAihdN9LYKvOPxyd7hmBuvDDjT6CHFpXfN5nVXsYVBld37pekcM VUE3CF0+Wj9Z2ebML5QTUlpJ2GZfA+2HdoseE= Received: by 10.229.90.79 with SMTP id h15mr3710771qcm.220.1309704277340; Sun, 03 Jul 2011 07:44:37 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id v4sm4079764qca.4.2011.07.03.07.44.35 (version=SSLv3 cipher=OTHER); Sun, 03 Jul 2011 07:44:36 -0700 (PDT) Date: Sun, 3 Jul 2011 10:44:31 -0400 From: Alexander Kabaev To: Chris Rees Message-ID: <20110703104431.7ef5223d@kan.dnsalias.net> In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ttoH9J3xn1U1YeBN0AY=yi9"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 14:44:38 -0000 --Sig_/ttoH9J3xn1U1YeBN0AY=yi9 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 3 Jul 2011 15:38:41 +0100 Chris Rees wrote: > 2011/7/3 Alexander Kabaev : > > > > __linux__ is exactly what __FreeBSD__ is and dies not identify > > kernel but rather Linux as whole OS, whatever that might be these > > days. > > > > There does not appear to be an universal macro that identifies > > environment as using Linux kernel regardless of the rest of > > components used (say, to identify Android and Ubuntu or something > > embedded with ucLibc as running Linux kernel with different userland > > implementations). >=20 > Please-- Linux is not and has never been an OS. >=20 > __linux__ applies to the kernel, the OS is called GNU/Linux. >=20 > Call me pedantic, but that was a nonsensical statement. >=20 > Chris How about you spare Linux vs. GNU/Linux wordplay for advocacy lists, where they belong? --=20 Alexander Kabaev --Sig_/ttoH9J3xn1U1YeBN0AY=yi9 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOEIBTQ6z1jMm+XZYRAniaAJ9+79smu/orOdzFAE5omqMmBovaeACcCgtq jkBav5D/Nn8hukE4egGXnO8= =8zNR -----END PGP SIGNATURE----- --Sig_/ttoH9J3xn1U1YeBN0AY=yi9-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 14:55:08 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C1E21065670 for ; Sun, 3 Jul 2011 14:55:08 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id CC8558FC14 for ; Sun, 3 Jul 2011 14:55:07 +0000 (UTC) Received: by iwr19 with SMTP id 19so5261279iwr.13 for ; Sun, 03 Jul 2011 07:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=R2zsbF/unzTezDDUl+HSod4AVCHcm6caSjVGFS5ogsM=; b=YpdtHbBLb+UwhthUOijRCigt1J12/LJa6vqXugixxzWqJmwfC/RSYgjZQFqV6f5gGz NVPDlzBxiCZ5678RppW3OMfty8beG8MuninVI99PPgZ1KXN4T7qaE2nQviZQ2pyHsvy7 rv9T/dMrN+y3c8mpQdDWZE1MuG2MP5YMrIZBE= Received: by 10.231.81.83 with SMTP id w19mr4652879ibk.34.1309704907175; Sun, 03 Jul 2011 07:55:07 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.231.155.141 with HTTP; Sun, 3 Jul 2011 07:54:37 -0700 (PDT) In-Reply-To: <20110703104431.7ef5223d@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <20110703104431.7ef5223d@kan.dnsalias.net> From: Chris Rees Date: Sun, 3 Jul 2011 15:54:37 +0100 X-Google-Sender-Auth: VtOOe1vBFVDf6hWP5AYrzBJxNKI Message-ID: To: Alexander Kabaev Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 14:55:08 -0000 On 3 July 2011 15:44, Alexander Kabaev wrote: > On Sun, 3 Jul 2011 15:38:41 +0100 > Chris Rees wrote: >> 2011/7/3 Alexander Kabaev : >> > >> > __linux__ is exactly what __FreeBSD__ is and dies not identify >> > kernel but rather Linux as whole OS, whatever that might be these >> > days. >> > >> > There does not appear to be an universal macro that identifies >> > environment as using Linux kernel regardless of the rest of >> > components used (say, to identify Android and Ubuntu or something >> > embedded with ucLibc as running Linux kernel with different userland >> > implementations). >> >> Please-- Linux is not and has never been an OS. >> >> __linux__ applies to the kernel, the OS is called GNU/Linux. >> >> Call me pedantic, but that was a nonsensical statement. >> >> Chris > > How about you spare Linux vs. GNU/Linux wordplay for advocacy lists, > where they belong? [Further discussion on IRC] Chris From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 15:37:31 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F8BD106564A; Sun, 3 Jul 2011 15:37:31 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 514168FC12; Sun, 3 Jul 2011 15:37:31 +0000 (UTC) Received: by pvg11 with SMTP id 11so5427777pvg.13 for ; Sun, 03 Jul 2011 08:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZcsFJq18iYOi6uIXjrjqYf8cMaG8wMc9Wy+W4+p/HQs=; b=ZBgxp5BbwOWbaWtfob4j/6mCz2FUBYDw2ungbiaTR4CchgTMkkjvd3z7i9LZsYU1kL QDsjmMU7F9WG0MwrxvEAQimmmPiBgOyCPt8v4F1Fs+wStK6nQ8NxJJlcKexYN5/2s9F4 7Gy4xs6lE4R/nHH1c1vUT57DddBY1JiXdwc94= MIME-Version: 1.0 Received: by 10.68.29.74 with SMTP id i10mr6015934pbh.69.1309707450881; Sun, 03 Jul 2011 08:37:30 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 08:37:30 -0700 (PDT) In-Reply-To: <20110703103531.4a553271@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> Date: Sun, 3 Jul 2011 17:37:30 +0200 X-Google-Sender-Auth: iAV8GU95s87JxzIf2o6Txw5mBoc Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Cc: Garrett Cooper , freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 15:37:31 -0000 2011/7/3 Alexander Kabaev : > __linux__ is exactly what __FreeBSD__ is and dies not identify kernel > but rather Linux as whole OS, whatever that might be these days. > > There does not appear to be an universal macro that identifies > environment as using Linux kernel regardless of the rest of components > used (say, to identify Android and Ubuntu or something embedded with > ucLibc as running Linux kernel with different userland > implementations). I think I'll cowardly try to stick to a practical POV and avoid the discussion about names that tends to get people excited about :-) So from a purely practical perspective: - If __linux__ is defined, this implies you're using a specific kernel. - If you're using that specific kernel, this implies __linux__ is defined. which explains why using __linux__ to identify the kernel is useful and reliable. Can __linux__ be used to identify more things? Most notably, can __linux__ be used to identify userland API? - If __linux__ is defined, this does not imply you're using GNU libc. - If you're using GNU libc, this does not imply __linux__ is defined. which explains why using __linux__ to identify libc is a bad idea. However, it can be useful to identify a set of different C libraries (Glibc, Bionic, uclibc, etc) if they share the property you're interested in. -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 15:42:04 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D05F4106564A for ; Sun, 3 Jul 2011 15:42:04 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id A9C0F8FC08 for ; Sun, 3 Jul 2011 15:42:04 +0000 (UTC) Received: by pzk27 with SMTP id 27so2233904pzk.13 for ; Sun, 03 Jul 2011 08:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=S9hzuxvRX1l8qMxksHTGgdK1jo/BKldKt7x674oVAgY=; b=FnDQxvuG/sqk0q5q01V06KAeLuREXzlCuVuA/eAcDY4ZpybfJ2fPCmqU8njVXwoBFY GlyXAXF9EwPmmYnGP0W1+eR77/Gv7ml5+D+gaVo8Ovy2RfW6sbZ3u6sq2L4Z5OyFRmsk 27K3P04/3MRo0zLmUz0QqcLNVDSFSYnxTAyFs= MIME-Version: 1.0 Received: by 10.68.59.99 with SMTP id y3mr5026879pbq.270.1309707724112; Sun, 03 Jul 2011 08:42:04 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 08:42:04 -0700 (PDT) In-Reply-To: <20110703103925.0bdf255a@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703103925.0bdf255a@kan.dnsalias.net> Date: Sun, 3 Jul 2011 17:42:04 +0200 X-Google-Sender-Auth: CDO-K4p9ZlfQ8_GH4rapoujBYtU Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 15:42:04 -0000 2011/7/3 Alexander Kabaev : > Not really, unless you have way of sticking this definition into past > compiler releases. There is one way, but it's slow. It basically involves waiting for long enough that any past release of any compiler you care about includes the macros you need, before starting to use them. :-) -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 15:47:03 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 340DC106564A for ; Sun, 3 Jul 2011 15:47:03 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0ACB98FC0C for ; Sun, 3 Jul 2011 15:47:02 +0000 (UTC) Received: by pzk27 with SMTP id 27so2236296pzk.13 for ; Sun, 03 Jul 2011 08:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FFeNAcFLpkm/5ZZliXpMp9mxHzds6/nMVctSHiL7aMg=; b=AJUz/Tw1pjwXpz1uKpoY50A7pNnVPmaDjkUZXw8G/Tw5DYcWZg3zwHs3yZok7XIwp+ rfNpSwyid9JgcOhbz1ftxFWdq66G8FJkDXdBJhg7Px0Jnpt0aGoJ96m/yeHyzRPsy+E9 EkIam+rX8Z4edNPJE5CayJhqX2Q1YfwWLc7no= MIME-Version: 1.0 Received: by 10.68.29.42 with SMTP id g10mr6473725pbh.203.1309708022233; Sun, 03 Jul 2011 08:47:02 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 08:47:02 -0700 (PDT) In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703103925.0bdf255a@kan.dnsalias.net> Date: Sun, 3 Jul 2011 17:47:02 +0200 X-Google-Sender-Auth: t0h37Z4RWUEA5aNyZWEFNJT1Ic8 Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 15:47:03 -0000 2011/7/3 Robert Millan : > 2011/7/3 Alexander Kabaev : >> Not really, unless you have way of sticking this definition into past >> compiler releases. > > There is one way, but it's slow. =C2=A0It basically involves waiting for > long enough that any past release of any compiler you care about > includes the macros you need, before starting to use them. :-) However, in the case of FreeBSD, where the compilers are imported into your codebase, isn't it enough if support is present in the FreeBSD version of these compilers (for production and development releases of FreeBSD), plus the latest release of the upstream version of each of those compilers? --=20 Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 19:45:29 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C72E1065675 for ; Sun, 3 Jul 2011 19:45:29 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id E07308FC12 for ; Sun, 3 Jul 2011 19:45:28 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p63JjFa8003413 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 3 Jul 2011 12:45:16 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4E10C6C8.30007@freebsd.org> Date: Sun, 03 Jul 2011 12:45:12 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Alexander Kabaev References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> In-Reply-To: <20110703103531.4a553271@kan.dnsalias.net> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , freebsd-hackers@freebsd.org, Millan , Ed Maste , Robert@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 19:45:29 -0000 On 7/3/11 7:35 AM, Alexander Kabaev wrote: > __linux__ is exactly what __FreeBSD__ is and dies not identify kernel > but rather Linux as whole OS, whatever that might be these days. > > There does not appear to be an universal macro that identifies > environment as using Linux kernel regardless of the rest of components > used (say, to identify Android and Ubuntu or something embedded with > ucLibc as running Linux kernel with different userland > implementations). I thought it was (__linux__ && __KERNEL__) From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 19:49:09 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E841B1065672; Sun, 3 Jul 2011 19:49:09 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 8726D8FC08; Sun, 3 Jul 2011 19:49:09 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 928862A28CCD; Sun, 3 Jul 2011 21:49:08 +0200 (CEST) Date: Sun, 3 Jul 2011 21:49:08 +0200 From: Ed Schouten To: Robert Millan Message-ID: <20110703194908.GO71453@hoeg.nl> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wfe1KbQWcwuymTys" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] build config(8) on GNU systems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 19:49:10 -0000 --Wfe1KbQWcwuymTys Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Robert Millan , 20110702 16:56: > Index: usr.sbin/config/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- usr.sbin/config/main.c (revision 223721) > +++ usr.sbin/config/main.c (working copy) > @@ -591,7 +591,11 @@ > if ((dirp =3D opendir(p)) =3D=3D NULL) > err(EX_OSERR, "opendir %s", p); > while ((dp =3D readdir(dirp)) !=3D NULL) { > +#ifdef _DIRENT_HAVE_D_NAMLEN > i =3D dp->d_namlen - 2; > +#else > + i =3D strlen (dp->d_name) - 2; > +#endif > /* Skip non-headers */ > if (dp->d_name[i] !=3D '.' || dp->d_name[i + 1] !=3D 'h') > continue; Why not simply use strlen() unconditionally? --=20 Ed Schouten WWW: http://80386.nl/ --Wfe1KbQWcwuymTys Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQIcBAEBAgAGBQJOEMe0AAoJEG5e2P40kaK7/TcQAKpsL4NeUhq6SAOiK0Zxr+tB MYBSiu1QMo3+JtXFCKCecEqHPpoXew6o2+daktYxFgpxf2eopLdvXLa88Dh6kJT4 DfpTpUam5runU5U8f3HhLM2liwkHgmRkI6yJGUQAgZVdHriF1lMeNqi6ILI+Tv0U 23t6hJc6GCwz/JG2hKNS/iEyjdHj+JoZqU4VtxMBHIHXaj5aUxQDW1+VK2eSz9s/ XAZbvcZMVMF+ZjcBuYVJs/odYez1pnZxk/xDjmhlCvWOjoO3X7N+4BEyBeaC6jti NfL/bWjctynpP3e6eFYbTGDFnRA0VaA2gRsUYKaJkLTJN6Fsd/+NcmVMk2+77LmQ MW2bwz6i6VbVBKRB0ETHkukl7XuHQLrlADzBJTBDjXwZKEIte2qSlnMJ7BOZe5nU 5Rzd/uvr9p7z/wdVUmrVgTj2s+rx4WCffe3OV7HDsOTOaFaXITa6WrSay5RNY1TM Y/5nIwxHcKLffUt/RktBNaWx6XBBt/2RCYoxVKtOclA+YMEABf0W8Pj1DcKtcGxu QdhfhIj+F5fq3KEC/6FwTgFUfPuInLbkN2zoiXM5t991QOe2rTCvjgsF9cL8kxGJ PjPXT1fRKzTOrQigKhPiW4EBNNlmXykxmoO6IWbBhXHRTU1h7dIE74KvERR+rBm1 C4bx9FZh2pEPJgC05cNM =Mj3D -----END PGP SIGNATURE----- --Wfe1KbQWcwuymTys-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 20:24:29 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 183B2106566B; Sun, 3 Jul 2011 20:24:29 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id D109D8FC13; Sun, 3 Jul 2011 20:24:28 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 3D2A02A292A8; Sun, 3 Jul 2011 22:24:28 +0200 (CEST) Date: Sun, 3 Jul 2011 22:24:28 +0200 From: Ed Schouten To: Zhihao Yuan Message-ID: <20110703202428.GP71453@hoeg.nl> References: <20110703194908.GO71453@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Vr2UxLU0KdcKBaxP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Robert Millan , Ed Maste Subject: Re: [PATCH] build config(8) on GNU systems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 20:24:29 -0000 --Vr2UxLU0KdcKBaxP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Zhihao Yuan , 20110703 22:22: > Programmers always want to make things "cooler". Just leave the > ->d_namlen there :) Portability isn't achieved by adding #ifdefs, but by writing portable code. ;-) --=20 Ed Schouten WWW: http://80386.nl/ --Vr2UxLU0KdcKBaxP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQIcBAEBAgAGBQJOEM/8AAoJEG5e2P40kaK7lokP/RFsUrVb1cJg7LuYDawuBF// fbMgEDEv2yFpOHe9aeOmkhXhLFOUp68qZoDuyJWA6LwIsfMOlbTxCveDlPHWy4wd pP3vVDEaA2Dq+Pf2UhazW2tlt1grMr+2UtSLv8HAykh4IuAr8AFVUdKC2DIlvZ+M hkPjZxf/uxRnGzf35KvIsWqhdSF2PdM4VMvUH1wBHuz/jQQFz0ij6PSleiQIRwMu ztuLScWGQpiMV5firr8em/ngLvHmaOmqqhr+urCkhxMMNvZgsWP1oEMEruAk46Z3 Ii2kjjN5wSe1hGxfvN3DmJ/iFWyte/z1tjJb1uMbP0zZ13buEVQe5wJG6xkF6Osp OSZWJCvQnZmK/Ol7BOifQqhEnP7A5MYp7vdzBY+l+hcorQTAUiY5kqicf3JwzUZI E/72AfwwDw/UmGwRaajViteI3STXHO5swpBR0Kixl/UTiBZosId1dsDWSXeYfJMQ 0dzS7u5wJ7aIJsiFhbmJR85R4jFUDEm98g/u7jG+Gnnv16tTQpKuMPsIBI0fQsH0 ND1fncP2mKU7mtiuSb0OnNxUBUU76nid1rLbAR0dKCWeLo94TMkSe0iHGLkXL1za ycwU5MpeMHR/JPBYTqYK4zxh6Fd0QEdmENYGoMg3rx/2P7LDXfT3LHSPh9oz/ii3 dFEvk0F1lkuww/szGEQU =Hkmp -----END PGP SIGNATURE----- --Vr2UxLU0KdcKBaxP-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 20:43:49 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2773106564A; Sun, 3 Jul 2011 20:43:49 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id A503F8FC14; Sun, 3 Jul 2011 20:43:49 +0000 (UTC) Received: by pzk27 with SMTP id 27so2383102pzk.13 for ; Sun, 03 Jul 2011 13:43:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=+nutaKXo1TtTBUhc2G/iZ4l3sMwzcrN+/MPzFWvfWro=; b=hT0gqCwF8NW8lNW9g0zpq5KljvNaO5cWCEpOy/0M784PAzqr5yadA3o3cBVPVfyMxe Qp6qJAiaRLJ1mgNBE2hZoL+7FbunxQhZazhI1KarESmBU5XE8S3eYYb+q4nbXYEiSsI2 vhK3J7+5llcF51fnj6mp80yclCh6iCAZ1K2SU= MIME-Version: 1.0 Received: by 10.68.25.166 with SMTP id d6mr6555161pbg.136.1309725828885; Sun, 03 Jul 2011 13:43:48 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 13:43:48 -0700 (PDT) In-Reply-To: <20110703202428.GP71453@hoeg.nl> References: <20110703194908.GO71453@hoeg.nl> <20110703202428.GP71453@hoeg.nl> Date: Sun, 3 Jul 2011 22:43:48 +0200 X-Google-Sender-Auth: ZAPPEn-_0d4UQkelM147NYYvwkc Message-ID: From: Robert Millan To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ed Maste , Zhihao Yuan Subject: Re: [PATCH] build config(8) on GNU systems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 20:43:49 -0000 2011/7/3 Ed Schouten : > * Zhihao Yuan , 20110703 22:22: >> Programmers always want to make things "cooler". Just leave the >> ->d_namlen there :) > > Portability isn't achieved by adding #ifdefs, but by writing portable > code. ;-) I really don't mind either way. I hope you two can agree on what's best ;-) -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 20:52:14 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915A0106564A; Sun, 3 Jul 2011 20:52:14 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by mx1.freebsd.org (Postfix) with ESMTP id 0428F8FC08; Sun, 3 Jul 2011 20:52:13 +0000 (UTC) Received: by fxe6 with SMTP id 6so3819985fxe.17 for ; Sun, 03 Jul 2011 13:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=/9TbQxfHW4Pl3rMVygHDJvZWzxJhLDaV1hunHr+2muk=; b=u0SdJ2V+VRWPI7NKUVJxQdObo0LGz/dXeJ+QIvSmZx7Jh8XCbfuzePjaS6Fi3YazGZ K3TH4hTjptWLTkjG597pITrbtlq579mqfrD0AOrPmFSz8jSRhUwIypdi/ZjvXVyr2MPU uUSn8AJXo5vKkIiUN7AC9UUj0UKz0KSDY48fI= MIME-Version: 1.0 Received: by 10.223.1.201 with SMTP id 9mr8361556fag.91.1309724570359; Sun, 03 Jul 2011 13:22:50 -0700 (PDT) Received: by 10.223.96.205 with HTTP; Sun, 3 Jul 2011 13:22:50 -0700 (PDT) In-Reply-To: <20110703194908.GO71453@hoeg.nl> References: <20110703194908.GO71453@hoeg.nl> Date: Sun, 3 Jul 2011 15:22:50 -0500 Message-ID: From: Zhihao Yuan To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Robert Millan , Ed Maste Subject: Re: [PATCH] build config(8) on GNU systems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 20:52:14 -0000 Programmers always want to make things "cooler". Just leave the ->d_namlen there :) On Sun, Jul 3, 2011 at 2:49 PM, Ed Schouten wrote: > * Robert Millan , 20110702 16:56: >> Index: usr.sbin/config/main.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- usr.sbin/config/main.c =C2=A0 =C2=A0(revision 223721) >> +++ usr.sbin/config/main.c =C2=A0 =C2=A0(working copy) >> @@ -591,7 +591,11 @@ >> =C2=A0 =C2=A0 =C2=A0 if ((dirp =3D opendir(p)) =3D=3D NULL) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 err(EX_OSERR, "opendir = %s", p); >> =C2=A0 =C2=A0 =C2=A0 while ((dp =3D readdir(dirp)) !=3D NULL) { >> +#ifdef _DIRENT_HAVE_D_NAMLEN >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 i =3D dp->d_namlen - 2; >> +#else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 i =3D strlen (dp->d_name) - = 2; >> +#endif >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Skip non-headers */ >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (dp->d_name[i] !=3D = '.' || dp->d_name[i + 1] !=3D 'h') >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 continue; > > Why not simply use strlen() unconditionally? > > -- > =C2=A0Ed Schouten > =C2=A0WWW: http://80386.nl/ > --=20 Zhihao Yuan, nickname lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/ From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 21:00:58 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2A7A106566B; Sun, 3 Jul 2011 21:00:58 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 85DD68FC1B; Sun, 3 Jul 2011 21:00:58 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id EA5242A292BD; Sun, 3 Jul 2011 23:00:57 +0200 (CEST) Date: Sun, 3 Jul 2011 23:00:57 +0200 From: Ed Schouten To: Robert Millan Message-ID: <20110703210057.GQ71453@hoeg.nl> References: <20110703194908.GO71453@hoeg.nl> <20110703202428.GP71453@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w1A23YewkF9s+fLd" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Ed Maste , Zhihao Yuan Subject: Re: [PATCH] build config(8) on GNU systems X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 21:00:58 -0000 --w1A23YewkF9s+fLd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fixed in r223744. Thanks! --=20 Ed Schouten WWW: http://80386.nl/ --w1A23YewkF9s+fLd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQIcBAEBAgAGBQJOENiJAAoJEG5e2P40kaK78SgP/3wRQ3DHMGFTAk8fH8vgApYm +Yg9git2YnKcWGSJYrsg3w9CB6RlE5P5HdVGGkmy5BmMwEP+Drif12bj2EFVgKKE qGa6jbQ7GDyHAN7g1AJ5WHErRa3LKPQXL+D2HWHV6kHqep6O6XzrLu1JRKHS0viW mEIaOfSLy8IIGAszxwrnDhOg9ESYx1zhUx4SXNrugoEte2irE9wNavUJmguWj7fC hrQgKTm15DSo9W85oR0WrGR+WMqZd9epywZiIl1tEfuvfyiOcPEk/GMNP+EMFiD1 mdjnfou4vW2+alxxYd0GLN21BcXFE85kobmWJwmJB9Fiiof5yVTkhE2mE1g1l4pJ I6zOHPxCQmjaVRdF43InCi9+s8UTaRL0QoyYU4oa+Mle64P8iHrMDoBZ2UirYtJj BCDSlJMGsS1Enfg5g17NTW62CIh2+qvtU8+jbSTCou97SZYyr1J3A78lE9oBK4z3 gRLEdTcqu4I67vqGHYbrBBWElvWwSuot1GMAT2qrh7A+GZXNrpQa2caAiyXmHiyt GFiVrKmFJ004sXCPEiO/9aLg7KXXBQoAuan3wzq/s7+tbNsArWhn9D996FzQSLtd //RhpzaLXP5zp4RMjsz2AQxbAGliFEIIWfccI/9Pt9AoXR4FB8vwlQGbGs79gFBH JxJBiLwtO9jSjdWeONbx =hu11 -----END PGP SIGNATURE----- --w1A23YewkF9s+fLd-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 21:22:47 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10091106566B for ; Sun, 3 Jul 2011 21:22:47 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id DA6108FC14 for ; Sun, 3 Jul 2011 21:22:46 +0000 (UTC) Received: by pvg11 with SMTP id 11so5599334pvg.13 for ; Sun, 03 Jul 2011 14:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WQnQKYp9pf3t7paDJbY/kAsspImhVm6Rfqo3AWP3IW0=; b=KOcbp2fiyNL3YO0OBiyW4GRBKne/AUpHBssE4b6mOtuQDf571zcLr0hVB/My4+fAqi JWgGZfXY+ST2t4Xf1mfs9gXyC5BzVvxFPcBBXqWIkKVrSgrIcbKMmK38F+79rAF1DiXB 0Xsr5kKsDPEXtJocAfSybEuQuuB9mwuud5fPo= MIME-Version: 1.0 Received: by 10.68.13.68 with SMTP id f4mr6029880pbc.404.1309728166224; Sun, 03 Jul 2011 14:22:46 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.47.138 with HTTP; Sun, 3 Jul 2011 14:22:45 -0700 (PDT) In-Reply-To: <20110703205635.GB22963@lonesome.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703103925.0bdf255a@kan.dnsalias.net> <20110703205635.GB22963@lonesome.com> Date: Sun, 3 Jul 2011 23:22:45 +0200 X-Google-Sender-Auth: fK72C55W-zOJZP3Og3AQpzi-KoQ Message-ID: From: Robert Millan To: Mark Linimon Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 21:22:47 -0000 2011/7/3 Mark Linimon : > On Sun, Jul 03, 2011 at 05:47:02PM +0200, Robert Millan wrote: >> isn't it enough if support is present in the FreeBSD >> version of these compilers (for production and development releases of >> FreeBSD), plus the latest release of the upstream version of each of >> those compilers? > > You may find the gcc team very uninterested in changing things around > to support FreeBSD. >From my experience interacting with them, what I know for sure is they won't add a new macro for FreeBSD unless they get a clear signal that FreeBSD wants it (e.g. by checking it in its downstream version of GCC). Other than that, I don't see a problem with getting a one-line patch accepted in upstream GCC tree. -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 4 07:12:34 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C9C3106564A for ; Mon, 4 Jul 2011 07:12:34 +0000 (UTC) (envelope-from exorcistkiller@gmail.com) Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE588FC0A for ; Mon, 4 Jul 2011 07:12:34 +0000 (UTC) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Qdd33-0003Ak-2p for freebsd-hackers@freebsd.org; Sun, 03 Jul 2011 23:54:25 -0700 Date: Sun, 3 Jul 2011 23:54:25 -0700 (PDT) From: exorcistkiller To: freebsd-hackers@freebsd.org Message-ID: <1309762465080-4549149.post@n5.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: priv_check() question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 07:12:34 -0000 Hi! I am taking a FreeBSD course this summer and I'm doing a homework. A new system call uidkill() is to be added. uidkill(uid_t uid, int signum) sends signal specified by signum to all processes owned by uid, excluding the calling process itself. I'm almost done, however I get stuck with priv_check(). If the calling process is trying to send signal to processes owned by others, permission should be denied. My implementation simply uses an if (p->p_ucred->cr_uid == ksi.ksi_uid) to deny it, however priv_check() is required. My question is: what privilege a process should have to send signal to processes owned by others? PRIV_SIGNAL_DIFFCRED? -- View this message in context: http://freebsd.1045724.n5.nabble.com/priv-check-question-tp4549149p4549149.html Sent from the freebsd-hackers mailing list archive at Nabble.com. From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 2 14:12:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD8471065673 for ; Sat, 2 Jul 2011 14:12:39 +0000 (UTC) (envelope-from marm.mm@t-online.de) Received: from mailout09.t-online.de (mailout09.t-online.de [194.25.134.84]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1E38FC13 for ; Sat, 2 Jul 2011 14:12:39 +0000 (UTC) Received: from fwd06.aul.t-online.de (fwd06.aul.t-online.de ) by mailout09.t-online.de with smtp id 1Qd0dH-00034Z-Lq; Sat, 02 Jul 2011 15:53:15 +0200 Received: from [192.168.0.108] (bjJb42ZbrhhWxxSbDxwkTn3zs9r9JGRJzShEhR8YNogghdo3oaHI-SxclhkuX2UgTx@[91.36.221.112]) by fwd06.t-online.de with esmtp id 1Qd0dH-0z5KbI0; Sat, 2 Jul 2011 15:53:15 +0200 User-Agent: Microsoft-Entourage/12.0.0.071130 Date: Sat, 02 Jul 2011 15:53:14 +0200 From: Martin =?ISO-8859-1?B?TfZsbGVy?= To: "freebsd-hackers@freebsd.org" Message-ID: Thread-Topic: Question about lseek/fseek Thread-Index: Acw4v2Mi2QHnntRLQGC6h+LnMpCyGQ== Mime-version: 1.0 X-ID: bjJb42ZbrhhWxxSbDxwkTn3zs9r9JGRJzShEhR8YNogghdo3oaHI-SxclhkuX2UgTx X-TOI-MSGID: 602d2919-7ff0-4334-9972-5e2c8266cfb4 X-Mailman-Approved-At: Mon, 04 Jul 2011 13:11:15 +0000 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Question about lseek/fseek X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jul 2011 14:12:39 -0000 Hi Hackers, Why does these function allow seeking beyond the EOF of a file in O_RDONLY/=B2rb=B2 mode ? How does these function then signal the EOF correctly ? Seeking beyond the EOF makes sense for me in write-mode but not in read-onl= y mode ! With Regards, Martin From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 08:16:50 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A10106564A for ; Sun, 3 Jul 2011 08:16:50 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id DDEA38FC0A for ; Sun, 3 Jul 2011 08:16:49 +0000 (UTC) Received: by pzk27 with SMTP id 27so2020563pzk.13 for ; Sun, 03 Jul 2011 01:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=OQdIHi/yN4NeHTN9T6W8NtljZ6y0gMQJBG9dgzqwqjA=; b=FOWW9kVPPmvM1zKLvZCxk7JONzi8gt9YoW211yIlAfnZ9rPJi1umRjjUpZKGZ77goS ycURbURxwdGmGAcdl6rSkSNA06TfbbehMIggubm7WW2RLugELY74NrGwWTWz4me0tGp5 FWpi4Q53jno0N7ko9x/Diw6hBWMotiPtFZuBY= MIME-Version: 1.0 Received: by 10.142.149.5 with SMTP id w5mr2240402wfd.326.1309681009339; Sun, 03 Jul 2011 01:16:49 -0700 (PDT) Received: by 10.142.174.13 with HTTP; Sun, 3 Jul 2011 01:16:49 -0700 (PDT) Date: Sun, 3 Jul 2011 04:16:49 -0400 Message-ID: From: grarpamp To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Mon, 04 Jul 2011 13:11:27 +0000 Subject: Jails: Setting different times in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 08:16:50 -0000 Would be nice to be able to set different times in different jails. All jails would tick in step with the system. But each jail could have it's birthtime set specifically via jail(8), jail(2), etc. Either by specification of a specific time, or an offset from the current true system time. ie: jail(8): -t [-|+] Child jails would offset from their parent, not the system. Internally, gettimeofday, filesystem timestamps, and any other userland interfaces would be hooked and adjusted by referencing a table of jail ID's and their offsets. Similar to how setting TZ or /etc/localtime effects a timezone offset. But transparent and undetectable to the jail unless set as visible by the invoker. Useful for creating alternate histories, testing time dependant protocols and applications, forensics, pen testing, etc. From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 3 21:14:10 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B154F106566B for ; Sun, 3 Jul 2011 21:14:10 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 90BA38FC08 for ; Sun, 3 Jul 2011 21:14:10 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 9BBB556205; Sun, 3 Jul 2011 15:56:35 -0500 (CDT) Date: Sun, 3 Jul 2011 15:56:35 -0500 From: Mark Linimon To: Robert Millan Message-ID: <20110703205635.GB22963@lonesome.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703103925.0bdf255a@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Mon, 04 Jul 2011 13:13:12 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jul 2011 21:14:10 -0000 On Sun, Jul 03, 2011 at 05:47:02PM +0200, Robert Millan wrote: > isn't it enough if support is present in the FreeBSD > version of these compilers (for production and development releases of > FreeBSD), plus the latest release of the upstream version of each of > those compilers? You may find the gcc team very uninterested in changing things around to support FreeBSD. mcl From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 4 14:13:08 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A38F1065674 for ; Mon, 4 Jul 2011 14:13:08 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3F16B8FC15 for ; Mon, 4 Jul 2011 14:13:07 +0000 (UTC) Received: by gwb15 with SMTP id 15so2509304gwb.13 for ; Mon, 04 Jul 2011 07:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Q7sOozCDM/tpbrvQ18py/G2CzvCvF7E5dmAzba8OEEo=; b=e2TIUn7RxTrF91aRmtwnurt9gTUGGZcCcG3Tq5FEdaX88kIv7YaT0M9gm/BTQAt6v/ Xr1nfQZOTdsLcIEoWZ8T7loN1Y6M34gtwhEHR/UkjA8gLyMYgOURTJDbQo96LZkBboWF l56fjQHTwwaEjDukmwZiz+TcSYJXN4UPADv6Y= MIME-Version: 1.0 Received: by 10.236.78.233 with SMTP id g69mr7723657yhe.298.1309787406763; Mon, 04 Jul 2011 06:50:06 -0700 (PDT) Received: by 10.236.203.6 with HTTP; Mon, 4 Jul 2011 06:50:06 -0700 (PDT) In-Reply-To: References: Date: Mon, 4 Jul 2011 15:50:06 +0200 Message-ID: From: "deeptech71@gmail.com" To: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: what is the RIGHT(TM) way to configure background DHCP? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 14:13:08 -0000 moving [ http://lists.freebsd.org/pipermail/freebsd-questions/2011-June/231301.html ] to the freebsd-hackers list, as there doesn't seem to be enough 1337 people in the freebsd-questions list. :< From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 4 14:47:08 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE5BF1065672 for ; Mon, 4 Jul 2011 14:47:08 +0000 (UTC) (envelope-from Lowell@Be-Well.Ilk.Org) Received: from mail2.sea5.speakeasy.net (mail2.sea5.speakeasy.net [69.17.117.41]) by mx1.freebsd.org (Postfix) with ESMTP id B63848FC0A for ; Mon, 4 Jul 2011 14:47:08 +0000 (UTC) Received: (qmail 4693 invoked from network); 4 Jul 2011 14:20:28 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 4 Jul 2011 14:20:28 -0000 Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.8]) by be-well.ilk.org (Postfix) with ESMTP id 5FC4E5C60; Mon, 4 Jul 2011 10:20:20 -0400 (EDT) Received: by lowell-desk.lan (Postfix, from userid 1147) id 312E239847; Mon, 4 Jul 2011 10:20:18 -0400 (EDT) From: Lowell Gilbert To: "deeptech71\@gmail.com" References: Date: Mon, 04 Jul 2011 10:20:17 -0400 In-Reply-To: (deeptech's message of "Mon, 4 Jul 2011 15:50:06 +0200") Message-ID: <44k4byunz2.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailman-Approved-At: Mon, 04 Jul 2011 15:21:17 +0000 Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org Subject: Re: what is the RIGHT(TM) way to configure background DHCP? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 14:47:08 -0000 "deeptech71@gmail.com" writes: > moving [ http://lists.freebsd.org/pipermail/freebsd-questions/2011-June/231301.html > ] to the freebsd-hackers list, as there doesn't seem to be enough 1337 > people in the freebsd-questions list. :< You might want to try rewording your question, because it didn't make any sense the first time. [All of your examples were commented out, so it was no surprise that they didn't work.] I considered trying to use my chrystal ball to guess that you needed "SYNCDHCP" in your interface config, but you had obviously read the manual for rc.conf(5), so that seemed unlikely... From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 4 16:30:06 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A066106566B; Mon, 4 Jul 2011 16:30:06 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 05DDD8FC14; Mon, 4 Jul 2011 16:30:05 +0000 (UTC) Received: by pvg11 with SMTP id 11so6426483pvg.13 for ; Mon, 04 Jul 2011 09:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=HiTxVnJpT3+Z5yEXncJxlPi6e9s2QlHe6odjWnWKAoQ=; b=O/mSXDki1Edl2NXtEQwe9VZSdbhee5xAXaiaIrphE4plCFdHaS8Pg9aUnmNzwk2vp7 dLGd1jgi13GYS30Jg0Po6mAuNAHJK9PdDXCLfr1PaQgsAaUfzRc3ORVFEy/u1Zu0UQPC Rlx/qsr74EHoKkZhH+GhK+LNnjFrl2k+C2be4= MIME-Version: 1.0 Received: by 10.68.59.99 with SMTP id y3mr6463001pbq.270.1309797005629; Mon, 04 Jul 2011 09:30:05 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.46.106 with HTTP; Mon, 4 Jul 2011 09:30:05 -0700 (PDT) Date: Mon, 4 Jul 2011 18:30:05 +0200 X-Google-Sender-Auth: Iib50-gsLILk8IIqcds5RWxvGJM Message-ID: From: Robert Millan To: freebsd-hackers@freebsd.org, Ed Maste Content-Type: multipart/mixed; boundary=bcaec51a72623f995604a740e1b8 Cc: Subject: [PATCH] __FreeBSD_cc_version in X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 16:30:06 -0000 --bcaec51a72623f995604a740e1b8 Content-Type: text/plain; charset=UTF-8 This patch fixes a (harmless) warning when is parsed by upstream version of GCC. -- Robert Millan --bcaec51a72623f995604a740e1b8 Content-Type: text/plain; charset=US-ASCII; name="cdefs_freebsd_cc.diff" Content-Disposition: attachment; filename="cdefs_freebsd_cc.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gppnb8ap0 SW5kZXg6IHN5cy9zeXMvY2RlZnMuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvc3lzL2NkZWZzLmgJKHJl dmlzaW9uIDIyMzczNikKKysrIHN5cy9zeXMvY2RlZnMuaAkod29ya2luZyBjb3B5KQpAQCAtMzQ5 LDcgKzM0OSw3IEBACiAjZW5kaWYKIAogLyogQ29tcGlsZXItZGVwZW5kZW50IG1hY3JvcyB0aGF0 IHJlbHkgb24gRnJlZUJTRC1zcGVjaWZpYyBleHRlbnNpb25zLiAqLwotI2lmIF9fRnJlZUJTRF9j Y192ZXJzaW9uID49IDMwMDAwMSAmJiBkZWZpbmVkKF9fR05VQ19fKSAmJiAhZGVmaW5lZChfX0lO VEVMX0NPTVBJTEVSKQorI2lmIGRlZmluZWQoX19GcmVlQlNEX2NjX3ZlcnNpb24pICYmIF9fRnJl ZUJTRF9jY192ZXJzaW9uID49IDMwMDAwMSAmJiBkZWZpbmVkKF9fR05VQ19fKSAmJiAhZGVmaW5l ZChfX0lOVEVMX0NPTVBJTEVSKQogI2RlZmluZQlfX3ByaW50ZjBsaWtlKGZtdGFyZywgZmlyc3R2 YXJhcmcpIFwKIAkgICAgX19hdHRyaWJ1dGVfXygoX19mb3JtYXRfXyAoX19wcmludGYwX18sIGZt dGFyZywgZmlyc3R2YXJhcmcpKSkKICNlbHNlCg== --bcaec51a72623f995604a740e1b8-- From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 4 16:40:05 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A9DB106564A for ; Mon, 4 Jul 2011 16:40:05 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5B5418FC0A for ; Mon, 4 Jul 2011 16:40:05 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p64Ge03e026833 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 4 Jul 2011 09:40:03 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4E11ECE2.9050402@freebsd.org> Date: Mon, 04 Jul 2011 09:40:02 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: grarpamp References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Jails: Setting different times in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 16:40:05 -0000 On 7/3/11 1:16 AM, grarpamp wrote: > Would be nice to be able to set different times in different jails. > All jails would tick in step with the system. > But each jail could have it's birthtime set specifically via jail(8), > jail(2), etc. Either by specification of a specific time, or an offset > from the current true system time. ie: > > jail(8): -t [-|+] > > Child jails would offset from their parent, not the system. > > Internally, gettimeofday, filesystem timestamps, and any other > userland interfaces would be hooked and adjusted by referencing > a table of jail ID's and their offsets. Similar to how setting TZ or > /etc/localtime effects a timezone offset. But transparent and > undetectable to the jail unless set as visible by the invoker. > > Useful for creating alternate histories, testing time dependant > protocols and applications, forensics, pen testing, etc. possibly achievable in libc? in any case file this idea somewhere.. :-) > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 4 17:00:33 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBC0C106566B for ; Mon, 4 Jul 2011 17:00:33 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id ADF4F8FC1F for ; Mon, 4 Jul 2011 17:00:33 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Mon, 4 Jul 2011 13:00:33 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id ED7B233C02; Mon, 4 Jul 2011 13:00:32 -0400 (EDT) Date: Mon, 4 Jul 2011 13:00:32 -0400 From: Ed Maste To: Message-ID: <20110704170032.GA60078@sandvine.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <4E10C6C8.30007@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4E10C6C8.30007@freebsd.org> User-Agent: Mutt/1.4.2.1i Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2011 17:00:34 -0000 On Sun, Jul 03, 2011 at 12:45:12PM -0700, Julian Elischer wrote: > On 7/3/11 7:35 AM, Alexander Kabaev wrote: > >__linux__ is exactly what __FreeBSD__ is and dies not identify kernel > >but rather Linux as whole OS, whatever that might be these days. > > > >There does not appear to be an universal macro that identifies > >environment as using Linux kernel regardless of the rest of components > >used (say, to identify Android and Ubuntu or something embedded with > >ucLibc as running Linux kernel with different userland > >implementations). > I thought it was (__linux__ && __KERNEL__) I corresponded with Julian off-list, but for the sake of the archives I'll summarize here. This is not correct because __KERNEL__ is used for code or header files to detect that they are targetting the kernel (e.g., a device driver) while what we're looking for here is a macro for userland code to detect that it is being compiled to run _on_ a given kernel (Linux or FreeBSD). -Ed From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 06:57:12 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B51E106564A for ; Tue, 5 Jul 2011 06:57:12 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 446448FC1C for ; Tue, 5 Jul 2011 06:57:11 +0000 (UTC) Received: from SBHFISLREXT03 ([10.132.254.62]) by SCSFISLTC01 (8.14.3/8.14.3) with ESMTP id p656vBJp006701 for ; Tue, 5 Jul 2011 01:57:11 -0500 Received: from SBHFISLTCGW07.FNFIS.COM (Not Verified[10.132.248.135]) by SBHFISLREXT03 with MailMarshal (v6, 5, 4, 7535) id ; Tue, 05 Jul 2011 01:57:13 -0500 Received: from SBHFISLTCGW07.FNFIS.COM ([10.132.248.135]) by SBHFISLTCGW07.FNFIS.COM with Microsoft SMTPSVC(6.0.3790.4675); Tue, 5 Jul 2011 01:57:11 -0500 Received: from [10.0.0.104] ([10.132.254.136]) by SBHFISLTCGW07.FNFIS.COM over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 5 Jul 2011 01:57:10 -0500 From: Devin Teske Mime-Version: 1.0 (Apple Message framework v1084) Date: Mon, 4 Jul 2011 23:57:07 -0700 To: FreeBSD Hackers Message-Id: <6EFB048A-4DD5-4335-8755-D6694B8C7BDC@vicor.com> X-Mailer: Apple Mail (2.1084) X-OriginalArrivalTime: 05 Jul 2011 06:57:10.0808 (UTC) FILETIME=[C326B180:01CC3AE0] Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Devin Teske Subject: [ANNOUNCE] tzdialog(8) -- tzsetup(8) translated from C to sh(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 06:57:12 -0000 Hi fellow hackers, I'd like to share some work that I've been slaving over for the past 7 days. I've converted tzsetup(8) from a C program that relies on dialog(3) into an= sh(1) script that relies on either dialog(1) or Xdialog(1). http://druidbsd.sourceforge.net/download/tzdialog.txt or http://druidbsd.sourceforge.net/ The advantages of this are two-fold: 1. Bring tzsetup(8) to the GUI 2. Bring tzsetup(8) to Linux This new script, I'm calling tzdialog(8). Major focal points were: 1. Speed (just as fast as tzsetup(8)) 2. Conciseness (the code is conceptually clean) 3. Closeness to original code (you can find a large amount in-common betwee= n the C code and sh(1) code). that is, in addition to the overall goals/reasons: 1. Act as a drop-in replacement for FreeBSD's tzsetup(8). 2. Provide a Graphical User Interface (GUI) via Xdialog(1) -- an X11-enable= d drop-in replacement for dialog(1). 3. To bring tzsetup(8) to Linux (replacing tzselect(8)) and other systems t= hat support dialog(1) and/or Xdialog(1). 4. Provide a single interface for both Linux and FreeBSD users without need= ing to ship two separate binaries. I'm very happy with the results. Whether I'm using tzdialog(8) on a Linux b= ox, FreeBSD box, on the console, or in the GUI (either locally or via X11 f= orwarding), it's just like I would expect tzsetup(8) to behave (with some a= dded bonuses -- such as the added `-v' flag). Please do let me know what you think. I'm not proposing that we replace tzsetup(8) in the base with this, rather = I'm just asking that a few people could try it out and let me know what you= think. --=20 Cheers, Devin Teske -> LEGAL DISCLAIMER <- This message contains confidential and proprietary information of the sender, and is intended only for the person(s) to whom it is addressed. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you have received this message in error, please notify the e-mail sender immediately, and delete the original message without making a copy. -> FUN STUFF <- -----BEGIN GEEK CODE BLOCK----- Version 3.12 GAT/CS/B/CC/E/IT/MC/M/MU/P/S/TW d+(++) s: a- C+++@$ UB++++$ P++++@$ L++++$ = E- W+++ N? o? K? w@ O M++$ V- PS+>++ PE@ Y+ PGP-> t(+) 5? X(+) R(-) tv+ b+>++ = DI+ D+(++) G++ e>++++ h r+++ z+++ ------END GEEK CODE BLOCK------ http://www.geekcode.com/ -> END TRANSMISSION <- _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. _____________ From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 08:27:52 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FF0F1065673; Tue, 5 Jul 2011 08:27:52 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 63D5C8FC24; Tue, 5 Jul 2011 08:27:52 +0000 (UTC) Received: by pvg11 with SMTP id 11so7035286pvg.13 for ; Tue, 05 Jul 2011 01:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=VvPvW4duv2w/J/SzdW+DGTFJ2vVJgJjgCAFk3eLmAdo=; b=a2XAetpW/TJUub/qt/JNRpzvsA7z/yI5txTblgpgNtps8t54qGYyow+yBLikkOh4H9 7HNDUUegIhBWso6va1swbIMmtsG3BS7VSda+iQxEaqET7u5lDOkg/WMoEUhUf0lzYwK5 TEW6+ZNmFD3V9cc0OqT7pbROymF11+yLPYBLM= MIME-Version: 1.0 Received: by 10.68.32.137 with SMTP id j9mr8468378pbi.2.1309854471892; Tue, 05 Jul 2011 01:27:51 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.46.106 with HTTP; Tue, 5 Jul 2011 01:27:51 -0700 (PDT) Date: Tue, 5 Jul 2011 10:27:51 +0200 X-Google-Sender-Auth: vY8a7uIThLqerC2U6jbYWqVeYDY Message-ID: From: Robert Millan To: freebsd-hackers@freebsd.org, Ed Maste Content-Type: multipart/mixed; boundary=bcaec520ef19812e9204a74e42ef Cc: Subject: [PATCH] FreeBSD compiler extensions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 08:27:52 -0000 --bcaec520ef19812e9204a74e42ef Content-Type: text/plain; charset=UTF-8 This patch conditionalizes a pair of FreeBSD compiler extensions so that its CFLAGS are only used on FreeBSD. -- Robert Millan --bcaec520ef19812e9204a74e42ef Content-Type: text/plain; charset=US-ASCII; name="freebsd_cflags.diff" Content-Disposition: attachment; filename="freebsd_cflags.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gpqlilao0 SW5kZXg6IHN5cy9jb25mL2tlcm4ubWsKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2NvbmYva2Vybi5tawko cmV2aXNpb24gMjIzNzM2KQorKysgc3lzL2NvbmYva2Vybi5tawkod29ya2luZyBjb3B5KQpAQCAt MSwxMSArMSwyMSBAQAogIyAkRnJlZUJTRCQKIAorLmlmICFkZWZpbmVkKE9QU1lTKQorT1BTWVMh PQkJdW5hbWUgLXMKKy5lbmRpZgorCiAjCiAjIFdhcm5pbmcgZmxhZ3MgZm9yIGNvbXBpbGluZyB0 aGUga2VybmVsIGFuZCBjb21wb25lbnRzIG9mIHRoZSBrZXJuZWw6CiAjCisuaWYgJHtPUFNZU30g PT0gIkZyZWVCU0QiCisjIEZyZWVCU0QgZXh0ZW5zaW9uLCBub3QgYXZhaWxhYmxlIGluIHVwc3Ry ZWFtIEdDQworZm9ybWF0X2V4dGVuc2lvbnM9CS1mZm9ybWF0LWV4dGVuc2lvbnMKK25vX2FsaWdu X2xvbmdfc3RyaW5ncz0JLW1uby1hbGlnbi1sb25nLXN0cmluZ3MKKy5lbmRpZgorCiBDV0FSTkZM QUdTPz0JLVdhbGwgLVdyZWR1bmRhbnQtZGVjbHMgLVduZXN0ZWQtZXh0ZXJucyAtV3N0cmljdC1w cm90b3R5cGVzIFwKIAkJLVdtaXNzaW5nLXByb3RvdHlwZXMgLVdwb2ludGVyLWFyaXRoIC1XaW5s aW5lIC1XY2FzdC1xdWFsIFwKLQkJLVd1bmRlZiAtV25vLXBvaW50ZXItc2lnbiAtZmZvcm1hdC1l eHRlbnNpb25zIFwKKwkJLVd1bmRlZiAtV25vLXBvaW50ZXItc2lnbiAke2Zvcm1hdF9leHRlbnNp b25zfSBcCiAJCS1XbWlzc2luZy1pbmNsdWRlLWRpcnMgLWZkaWFnbm9zdGljcy1zaG93LW9wdGlv bgogIwogIyBUaGUgZm9sbG93aW5nIGZsYWdzIGFyZSBuZXh0IHVwIGZvciB3b3JraW5nIG9uOgpA QCAtMzIsNyArNDIsNyBAQAogIwogLmlmICR7TUFDSElORV9DUFVBUkNIfSA9PSAiaTM4NiIKIC5p ZiAke0NDOlQ6TWNsYW5nfSAhPSAiY2xhbmciCi1DRkxBR1MrPQktbW5vLWFsaWduLWxvbmctc3Ry aW5ncyAtbXByZWZlcnJlZC1zdGFjay1ib3VuZGFyeT0yIC1tbm8tc3NlCitDRkxBR1MrPQkke25v X2FsaWduX2xvbmdfc3RyaW5nc30gLW1wcmVmZXJyZWQtc3RhY2stYm91bmRhcnk9MiAtbW5vLXNz ZQogLmVsc2UKIENGTEFHUys9CS1tbm8tYWVzIC1tbm8tYXZ4CiAuZW5kaWYK --bcaec520ef19812e9204a74e42ef-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 08:46:53 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 672D4106566B for ; Tue, 5 Jul 2011 08:46:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 447138FC1A for ; Tue, 5 Jul 2011 08:46:53 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id ECFCB46B06; Tue, 5 Jul 2011 04:46:52 -0400 (EDT) Date: Tue, 5 Jul 2011 09:46:52 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: exorcistkiller In-Reply-To: <1309762465080-4549149.post@n5.nabble.com> Message-ID: References: <1309762465080-4549149.post@n5.nabble.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: priv_check() question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 08:46:53 -0000 On Sun, 3 Jul 2011, exorcistkiller wrote: > Hi! I am taking a FreeBSD course this summer and I'm doing a homework. A new > system call uidkill() is to be added. uidkill(uid_t uid, int signum) sends > signal specified by signum to all processes owned by uid, excluding the > calling process itself. > > I'm almost done, however I get stuck with priv_check(). If the calling > process is trying to send signal to processes owned by others, permission > should be denied. My implementation simply uses an if (p->p_ucred->cr_uid == > ksi.ksi_uid) to deny it, however priv_check() is required. My question is: > what privilege a process should have to send signal to processes owned by > others? PRIV_SIGNAL_DIFFCRED? The right way to think about "privileges" in FreeBSD is that they exempt subjects (usually processes) from normal access control rules -- typically as a result of a root uid. The access control rules for signalling are captured by p_cansignal() and cr_cansignal(), depending on whether the "subject" is a process or a cached credential. Processes have access to slightly greater rights than raw credentials due to additional context -- for example, information about parent-child relationships. These functions then invoke further privilege checks if required, perhaps overriding the normal requirement that uids match, etc. kill() implements a couple of broadcast modes for signals -- you may want to look at the implementation there to see how this is done. Robert From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 08:48:45 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D2141065674 for ; Tue, 5 Jul 2011 08:48:45 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [46.28.110.116]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF638FC08 for ; Tue, 5 Jul 2011 08:48:44 +0000 (UTC) Received: by vlakno.cz (Postfix, from userid 1002) id A26827F38C4; Tue, 5 Jul 2011 10:48:43 +0200 (CEST) Date: Tue, 5 Jul 2011 10:48:43 +0200 From: Roman Divacky To: Robert Millan Message-ID: <20110705084843.GA98162@freebsd.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] FreeBSD compiler extensions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 08:48:45 -0000 Why do you need this? Format-extensions are kernel only (which you dont use I presume) and no-align-long-strings is boot only (which you dont use either). Hm? :) roman On Tue, Jul 05, 2011 at 10:27:51AM +0200, Robert Millan wrote: > This patch conditionalizes a pair of FreeBSD compiler extensions so > that its CFLAGS are only used on FreeBSD. > > -- > Robert Millan > Index: sys/conf/kern.mk > =================================================================== > --- sys/conf/kern.mk (revision 223736) > +++ sys/conf/kern.mk (working copy) > @@ -1,11 +1,21 @@ > # $FreeBSD$ > > +.if !defined(OPSYS) > +OPSYS!= uname -s > +.endif > + > # > # Warning flags for compiling the kernel and components of the kernel: > # > +.if ${OPSYS} == "FreeBSD" > +# FreeBSD extension, not available in upstream GCC > +format_extensions= -fformat-extensions > +no_align_long_strings= -mno-align-long-strings > +.endif > + > CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ > - -Wundef -Wno-pointer-sign -fformat-extensions \ > + -Wundef -Wno-pointer-sign ${format_extensions} \ > -Wmissing-include-dirs -fdiagnostics-show-option > # > # The following flags are next up for working on: > @@ -32,7 +42,7 @@ > # > .if ${MACHINE_CPUARCH} == "i386" > .if ${CC:T:Mclang} != "clang" > -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse > +CFLAGS+= ${no_align_long_strings} -mpreferred-stack-boundary=2 -mno-sse > .else > CFLAGS+= -mno-aes -mno-avx > .endif > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 09:04:20 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 133741065670; Tue, 5 Jul 2011 09:04:20 +0000 (UTC) (envelope-from cbergstrom@pathscale.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id DDB328FC13; Tue, 5 Jul 2011 09:04:19 +0000 (UTC) Received: by pzk27 with SMTP id 27so3868510pzk.13 for ; Tue, 05 Jul 2011 02:04:19 -0700 (PDT) Received: by 10.68.6.228 with SMTP id e4mr7814682pba.216.1309855271214; Tue, 05 Jul 2011 01:41:11 -0700 (PDT) Received: from [192.168.1.33] (ppp-58-8-62-202.revip2.asianet.co.th [58.8.62.202]) by mx.google.com with ESMTPS id q5sm4354057pbk.58.2011.07.05.01.41.07 (version=SSLv3 cipher=OTHER); Tue, 05 Jul 2011 01:41:09 -0700 (PDT) Message-ID: <4E12CF5E.20602@pathscale.com> Date: Tue, 05 Jul 2011 15:46:22 +0700 From: =?UTF-8?B?IkMuIEJlcmdzdHLDtm0i?= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.7) Gecko/20101031 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: Robert Millan References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] FreeBSD compiler extensions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 09:04:20 -0000 On 07/ 5/11 03:27 PM, Robert Millan wrote: > This patch conditionalizes a pair of FreeBSD compiler extensions so > that its CFLAGS are only used on FreeBSD. Were I work we don't spend much time on compiling any kernel, but I'm superficially curious about the actual code which necessitates you needing these different flags. Is this for performance, correctness or both? (If you have any sort of reduced code example you can share that would be great) From a biased vendor perspective - less lock-in to a single compiler is usually a good thing. (The linux kernel may be the best example of what not to do.) Sorry I can't comment on the correctness of the patch. ./C From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 10:11:37 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26FBF106566C; Tue, 5 Jul 2011 10:11:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id DE9F88FC08; Tue, 5 Jul 2011 10:11:36 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:6d76:6d58:e114:c665] (unknown [IPv6:2001:7b8:3a7:0:6d76:6d58:e114:c665]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id ED2E35C59; Tue, 5 Jul 2011 12:11:35 +0200 (CEST) Message-ID: <4E12E358.80002@FreeBSD.org> Date: Tue, 05 Jul 2011 12:11:36 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Robert Millan References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] __FreeBSD_cc_version in X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 10:11:37 -0000 On 2011-07-04 18:30, Robert Millan wrote: > This patch fixes a (harmless) warning when is parsed by > upstream version of GCC. > > -#if __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER) > +#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && !defined(__INTEL_COMPILER) As far as I can see, this code only gives warnings when compiled with gcc 4.5 or higher, and when using the -Wundef flag. Isn't it easier to just remove the -Wundef flag here? Additionally, it looks like the C standard is a bit vague about whether the preprocessor uses short-circuited boolean evaluation (although gcc's manual says it does), so I'm not sure whether this patch solves the problem properly either. From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 10:38:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50C71065670 for ; Tue, 5 Jul 2011 10:38:35 +0000 (UTC) (envelope-from matthias.andree@gmx.de) Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by mx1.freebsd.org (Postfix) with SMTP id 09A9C8FC16 for ; Tue, 5 Jul 2011 10:38:34 +0000 (UTC) Received: (qmail invoked by alias); 05 Jul 2011 10:38:33 -0000 Received: from f055251049.adsl.alicedsl.de (EHLO apollo.emma.line.org) [78.55.251.49] by mail.gmx.net (mp017) with SMTP; 05 Jul 2011 12:38:33 +0200 X-Authenticated: #428038 X-Provags-ID: V01U2FsdGVkX1+AfVQvXHiAVbnIrqxlA3GUrJjVbEEf2u5gMgLzCy OeuJZQY0ccYPPc Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by apollo.emma.line.org (Postfix) with ESMTP id D87AC23D164 for ; Tue, 5 Jul 2011 12:38:32 +0200 (CEST) Message-ID: <4E12E9A8.1090900@gmx.de> Date: Tue, 05 Jul 2011 12:38:32 +0200 From: Matthias Andree User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Mnenhy/0.8.3 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4E12E358.80002@FreeBSD.org> In-Reply-To: <4E12E358.80002@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Subject: Re: [PATCH] __FreeBSD_cc_version in X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 10:38:35 -0000 Am 05.07.2011 12:11, schrieb Dimitry Andric: > On 2011-07-04 18:30, Robert Millan wrote: >> This patch fixes a (harmless) warning when is parsed by >> upstream version of GCC. >> >> -#if __FreeBSD_cc_version >= 300001 && defined(__GNUC__) && >> !defined(__INTEL_COMPILER) >> +#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 >> && defined(__GNUC__) && !defined(__INTEL_COMPILER) > > As far as I can see, this code only gives warnings when compiled with > gcc 4.5 or higher, and when using the -Wundef flag. Isn't it easier to > just remove the -Wundef flag here? > > Additionally, it looks like the C standard is a bit vague about whether > the preprocessor uses short-circuited boolean evaluation (although gcc's > manual says it does), so I'm not sure whether this patch solves the > problem properly either. The CPP #if argument is a /constant-expression/, according to K&R's The C Programming language 2nd ed., so it shall short-circuit. From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 10:55:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04D4B1065670 for ; Tue, 5 Jul 2011 10:55:42 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from mail.embedded-brains.de (host-82-135-62-35.customer.m-online.net [82.135.62.35]) by mx1.freebsd.org (Postfix) with ESMTP id 93B308FC1C for ; Tue, 5 Jul 2011 10:55:41 +0000 (UTC) Received: by mail.embedded-brains.de (Postfix, from userid 65534) id 748656523D1; Tue, 5 Jul 2011 12:55:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fidibus.eb.z X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from [192.168.96.31] (eb0011.eb.z [192.168.96.31]) by mail.embedded-brains.de (Postfix) with ESMTP id CA55F6523CF; Tue, 5 Jul 2011 12:55:38 +0200 (CEST) Message-ID: <4E12EDAA.7070301@embedded-brains.de> Date: Tue, 05 Jul 2011 12:55:38 +0200 From: Sebastian Huber User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Lightning/1.0b1 Thunderbird/3.0.11 MIME-Version: 1.0 To: John Baldwin References: <4E043B5F.3080908@embedded-brains.de> <201106240914.49279.jhb@freebsd.org> In-Reply-To: <201106240914.49279.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org Subject: Re: Unit Tests for FreeBSD Kernel APIs? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 10:55:42 -0000 On 06/24/2011 03:14 PM, John Baldwin wrote: > On Friday, June 24, 2011 3:23:11 am Sebastian Huber wrote: >> Hello, >> >> exists there some unit tests for FreeBSD kernel APIs, e.g. mutex(9), >> condvar(9), etc.? >> >> Have a nice day! > > Hmm, I have a kernel module that does some tests, but it is not in the tree. > One of the issues is that many of the tests you want to do for some of these > APIs involve timing. For rwlocks, for example, I used KTR traces and used > a kernel module that forked 4 threads to all compete over a single lock. I > then verified via KTR traces that every branch was taken (and made liberal > use of KASSERT()s which caught a few edge cases I had missed initially). > The background for my question is that we want to use the FreeBSD 8.2 network and USB stack for another operating system (RTEMS). Thus we have to implement several core APIs in terms of our operating system services. -- Sebastian Huber, embedded brains GmbH Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany Phone : +49 89 18 90 80 79-6 Fax : +49 89 18 90 80 79-9 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 13:36:03 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F0FF106566B; Tue, 5 Jul 2011 13:36:03 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 48B068FC08; Tue, 5 Jul 2011 13:36:02 +0000 (UTC) Received: by pzk27 with SMTP id 27so4135285pzk.13 for ; Tue, 05 Jul 2011 06:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=iMyGFXLA2Vm3kk7hUioN8zjCIwQTUsmd2VE4/X0ZqCg=; b=VkOyngQ3GZOJi1WksEtgK0ize6In1kojghG5aUYGKpqlV2PB+EJ0gqx81zAL7NaZ7W Ta9S8rwDbNeudrP5F4FMLsxF/xM3ypXWmHSDcx3LoTAp13pPyGjZM8LHqrNd6riIi7UF CMUD63zOkKay54oPD4QxrzbiQR2ygvFQEyTqY= MIME-Version: 1.0 Received: by 10.68.50.9 with SMTP id y9mr9705084pbn.24.1309872962639; Tue, 05 Jul 2011 06:36:02 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Tue, 5 Jul 2011 06:36:02 -0700 (PDT) In-Reply-To: <4E12E358.80002@FreeBSD.org> References: <4E12E358.80002@FreeBSD.org> Date: Tue, 5 Jul 2011 15:36:02 +0200 X-Google-Sender-Auth: f3_91AR0QWxyXhlr9VOryeRtUXM Message-ID: From: Robert Millan To: Dimitry Andric Content-Type: multipart/mixed; boundary=bcaec5430590a3990a04a752908d Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] __FreeBSD_cc_version in X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 13:36:03 -0000 --bcaec5430590a3990a04a752908d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/7/5 Dimitry Andric : > As far as I can see, this code only gives warnings when compiled with > gcc 4.5 or higher, and when using the -Wundef flag. =C2=A0Isn't it easier= to > just remove the -Wundef flag here? Here's a patch to remove -Wundef. I think it's a bad idea however, IMHO it's better to fix the cause of the warning instead. --=20 Robert Millan --bcaec5430590a3990a04a752908d Content-Type: text/plain; charset=US-ASCII; name="wundef.diff" Content-Disposition: attachment; filename="wundef.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gpqwf2410 SW5kZXg6IHN5cy9jb25mL2tlcm4ubWsKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2NvbmYva2Vybi5tawko cmV2aXNpb24gMjIzNzM2KQorKysgc3lzL2NvbmYva2Vybi5tawkod29ya2luZyBjb3B5KQpAQCAt NSw3ICs1LDcgQEAKICMKIENXQVJORkxBR1M/PQktV2FsbCAtV3JlZHVuZGFudC1kZWNscyAtV25l c3RlZC1leHRlcm5zIC1Xc3RyaWN0LXByb3RvdHlwZXMgXAogCQktV21pc3NpbmctcHJvdG90eXBl cyAtV3BvaW50ZXItYXJpdGggLVdpbmxpbmUgLVdjYXN0LXF1YWwgXAotCQktV3VuZGVmIC1Xbm8t cG9pbnRlci1zaWduIC1mZm9ybWF0LWV4dGVuc2lvbnMgXAorCQktV25vLXBvaW50ZXItc2lnbiAt ZmZvcm1hdC1leHRlbnNpb25zIFwKIAkJLVdtaXNzaW5nLWluY2x1ZGUtZGlycyAtZmRpYWdub3N0 aWNzLXNob3ctb3B0aW9uCiAjCiAjIFRoZSBmb2xsb3dpbmcgZmxhZ3MgYXJlIG5leHQgdXAgZm9y IHdvcmtpbmcgb246Cg== --bcaec5430590a3990a04a752908d-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 14:38:20 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6191F106566C for ; Tue, 5 Jul 2011 14:38:20 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id DC82C8FC1E for ; Tue, 5 Jul 2011 14:38:19 +0000 (UTC) Received: by qwc9 with SMTP id 9so3961161qwc.13 for ; Tue, 05 Jul 2011 07:38:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=SyqUbiQF4PxMXUNiME2Do1RXowh8LcYlFBwUJUT354E=; b=qXs5yTmWdBi+uoDRm20XW8EdG8kWH+tD0s39CN6e9OzuX6c+niyD6TvDGXCdTJoRem p+AFZ5XwI9HWLdKxCl3EivZk41tAp56Mryrph43NQ+48VkL8So+FzxsQkwI2Z0l+FsZg B/G4vfmLprA+cp78uasBuAtiYTQ1TCNWNTtJQ= MIME-Version: 1.0 Received: by 10.229.7.3 with SMTP id b3mr5458284qcb.194.1309876699070; Tue, 05 Jul 2011 07:38:19 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.62.229 with HTTP; Tue, 5 Jul 2011 07:38:19 -0700 (PDT) In-Reply-To: References: <4E12E358.80002@FreeBSD.org> Date: Tue, 5 Jul 2011 07:38:19 -0700 X-Google-Sender-Auth: UePBzZNcumaN_-by6H3Mcc7XFnY Message-ID: From: mdf@FreeBSD.org To: Robert Millan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Ed Maste , Dimitry Andric Subject: Re: [PATCH] __FreeBSD_cc_version in X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 14:38:20 -0000 On Tue, Jul 5, 2011 at 6:36 AM, Robert Millan wrote: > 2011/7/5 Dimitry Andric : >> As far as I can see, this code only gives warnings when compiled with >> gcc 4.5 or higher, and when using the -Wundef flag. =A0Isn't it easier t= o >> just remove the -Wundef flag here? > > Here's a patch to remove -Wundef. =A0I think it's a bad idea however, > IMHO it's better to fix the cause of the warning instead. The problem is that, IIRC, C guarantees that an undefined symbol when checked in a #if context will evaluate to 0. So -Wundef checks for warnings on compliant code. Personally I have no objection to the original patch. Cheers, matthew From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 15:17:06 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A89B10656AD; Tue, 5 Jul 2011 15:17:06 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4F42E8FC1A; Tue, 5 Jul 2011 15:17:06 +0000 (UTC) Received: by pvg11 with SMTP id 11so7449938pvg.13 for ; Tue, 05 Jul 2011 08:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=gGEol8J0a+HJD2Kgd7FKp/Q1JbIeuOogYNPdJSqgS2I=; b=GRBhJVLF6Q2RyOi2IgXKIM7GENhZTZ2alAl26e4Xoruo0ex3Elt+7FQU/pdwzaj68S xZvwujdNtw2MDS6EjQLW5RI9ByVB8qf53sLLCtFPfMqbuRnpLUiV2vr9D3R7c/xSTqSD BR010Vy+GZnSwrFMTw1aisL+Z+yathiS0EXms= MIME-Version: 1.0 Received: by 10.68.62.231 with SMTP id b7mr9142640pbs.225.1309879025983; Tue, 05 Jul 2011 08:17:05 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Tue, 5 Jul 2011 08:17:05 -0700 (PDT) In-Reply-To: <20110705084843.GA98162@freebsd.org> References: <20110705084843.GA98162@freebsd.org> Date: Tue, 5 Jul 2011 17:17:05 +0200 X-Google-Sender-Auth: _7DsQRr6d4zbkylNAI6VpUZp1tI Message-ID: From: Robert Millan To: Roman Divacky Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] FreeBSD compiler extensions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 15:17:06 -0000 2011/7/5 Roman Divacky : > Why do you need this? Format-extensions are kernel only (which you dont use I > presume) Actually, we compile the kernel of FreeBSD regularly, both 8-STABLE and 9-CURRENT. It is the base of the Debian GNU/kFreeBSD distribution. We've recently ported the build system so that it can be compiled on Debian GNU/Linux as well. You can see build logs here: https://buildd.debian.org/status/package.php?suite=sid&p=kfreebsd-8 https://buildd.debian.org/status/package.php?p=kfreebsd-9&suite=experimental > and no-align-long-strings is boot only (which you dont use either). We don't currently provide the FreeBSD bootloader, though we might do in the future (it just takes someone to be interested enough to make a Debian package). I guess it doesn't hurt to wrap no-align-long-strings as well? (but if you prefer, I can send a patch for format-extensions only). Thanks! -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 17:44:56 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8C651065673 for ; Tue, 5 Jul 2011 17:44:56 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6D38FC15 for ; Tue, 5 Jul 2011 17:44:56 +0000 (UTC) Received: by vxg33 with SMTP id 33so6000035vxg.13 for ; Tue, 05 Jul 2011 10:44:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=79tzalPC5BuAli7GuzYejWw74ZGmQL3QDMvXJoVhqmc=; b=BJwJ1LSN62Y6tx62yCud2XxMsr3Gf6VwOhMfCWvGGQEz8v+uEpVT53Wk6ZWxULV2Gu MAl9IG3tohQ/dhmmKDJgCXmJclqxDld77zgcx9GAROUrJifJRceC4bE0nqjivRRjiEqk In1I93T4Ns3KclVk9/zahC2LnMaOFjd+CGWiE= Received: by 10.52.164.6 with SMTP id ym6mr560108vdb.81.1309887895509; Tue, 05 Jul 2011 10:44:55 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id bh17sm2502673vdc.39.2011.07.05.10.44.52 (version=SSLv3 cipher=OTHER); Tue, 05 Jul 2011 10:44:53 -0700 (PDT) Date: Tue, 5 Jul 2011 13:44:47 -0400 From: Alexander Kabaev To: Robert Millan Message-ID: <20110705134447.493e0bf1@kan.dnsalias.net> In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703103925.0bdf255a@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/+2uiJC6Ay6sE1WhOW/+BFwZ"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 17:44:56 -0000 --Sig_/+2uiJC6Ay6sE1WhOW/+BFwZ Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Sun, 3 Jul 2011 17:47:02 +0200 Robert Millan wrote: > 2011/7/3 Robert Millan : > > 2011/7/3 Alexander Kabaev : > >> Not really, unless you have way of sticking this definition into > >> past compiler releases. > > > > There is one way, but it's slow. =9AIt basically involves waiting for > > long enough that any past release of any compiler you care about > > includes the macros you need, before starting to use them. :-) >=20 > However, in the case of FreeBSD, where the compilers are imported into > your codebase, isn't it enough if support is present in the FreeBSD > version of these compilers (for production and development releases of > FreeBSD), plus the latest release of the upstream version of each of > those compilers? >=20 > --=20 > Robert Millan The slow way would be the right way if you were inclined to really take it. Once old releases of tools that can be broken by the new macro use are long and forgotten we can start on relying on said macro, but not before. I disagree with the notion that we supporting only the imported compiler version is sufficient in FreeBSD. This was a long time deficiency of our development policy and it did more harm than good in the long term. We do want FSF source releases to work work out of the box, and when they do not, it is our loss. I know for a fact that several of our bigger customers are using compilers built for them by a third party and do not rely on the toolchain we supply in source tree. Breaking them would be bad.=20 --=20 Alexander Kabaev --Sig_/+2uiJC6Ay6sE1WhOW/+BFwZ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOE02TQ6z1jMm+XZYRAqw2AJ44CadPUQvPujufA+TCBfV+NCSIHwCeKFry jid9GdJlXhpLeWHBDlnNgZk= =vwcZ -----END PGP SIGNATURE----- --Sig_/+2uiJC6Ay6sE1WhOW/+BFwZ-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 18:05:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 971A21065672 for ; Tue, 5 Jul 2011 18:05:35 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 452D48FC08 for ; Tue, 5 Jul 2011 18:05:34 +0000 (UTC) Received: by qyk30 with SMTP id 30so1773032qyk.13 for ; Tue, 05 Jul 2011 11:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=2AjkqsZDEkWIgQpiX7hpnzM/9GoQeqIqYN7YvGSI4Bc=; b=Ug+S6ZO3kCQNadx50h5zKbBAd4XxMxtfaoVAHtr6lF/DfLLTFBrwCJ1jPgOj1cM2JI V7jhI1tJPLux70vtHENdmn5EsRBbiRtWURcQ3FUSM24nSBPuwBiMMW+Fs0KTlI4QA4js EivKrJUEyR/cWGVbJ1nRITahX7SNXnbWTCAiw= Received: by 10.224.69.228 with SMTP id a36mr6001997qaj.11.1309889134432; Tue, 05 Jul 2011 11:05:34 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id g16sm5716538qcs.47.2011.07.05.11.05.32 (version=SSLv3 cipher=OTHER); Tue, 05 Jul 2011 11:05:33 -0700 (PDT) Date: Tue, 5 Jul 2011 14:05:27 -0400 From: Alexander Kabaev To: Robert Millan , freebsd-hackers@freebsd.org Message-ID: <20110705140527.17362ed5@kan.dnsalias.net> In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ysc1mR5.B5Jmaeu6YmM=8CX"; protocol="application/pgp-signature" Cc: Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 18:05:35 -0000 --Sig_/ysc1mR5.B5Jmaeu6YmM=8CX Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 3 Jul 2011 17:37:30 +0200 Robert Millan wrote: > 2011/7/3 Alexander Kabaev : > > __linux__ is exactly what __FreeBSD__ is and dies not identify > > kernel but rather Linux as whole OS, whatever that might be these > > days. > > > > There does not appear to be an universal macro that identifies > > environment as using Linux kernel regardless of the rest of > > components used (say, to identify Android and Ubuntu or something > > embedded with ucLibc as running Linux kernel with different userland > > implementations). >=20 > I think I'll cowardly try to stick to a practical POV and avoid the > discussion about names that tends to get people excited about :-) >=20 > So from a purely practical perspective: >=20 > - If __linux__ is defined, this implies you're using a specific > kernel. > - If you're using that specific kernel, this implies __linux__ is > defined. >=20 > which explains why using __linux__ to identify the kernel is useful > and reliable. >=20 > Can __linux__ be used to identify more things? Most notably, can > __linux__ be used to identify userland API? >=20 > - If __linux__ is defined, this does not imply you're using GNU libc. > - If you're using GNU libc, this does not imply __linux__ is defined. >=20 > which explains why using __linux__ to identify libc is a bad idea. > However, it can be useful to identify a set of different C libraries > (Glibc, Bionic, uclibc, etc) if they share the property you're > interested in. >=20 > --=20 > Robert Millan I agree with all of the above reasons, but none of them change the fact that __linux__ is used left and right to identify both kernel and userland environments just as __FreeBSD__ is. You choose to disable __FreeBSD__ in GNU/kFreeBSD presumably because it makes your life porting software easier and are asking FreeBSD project to cope with the decision. This breaks compiles of new software with older compilers than do not define the macro, takes __FreeBSD__ out of symmetry with __linux__ and other similarly defined platform macros and forces a race to update every other compiler out there to follow the suit. I fail to see the benefits out-weighting the drawbacks in this scenario. --=20 Alexander Kabaev --Sig_/ysc1mR5.B5Jmaeu6YmM=8CX Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOE1JsQ6z1jMm+XZYRAvk8AKC0EatDS1Jkq9gHvoiaOQITmeE05QCg5qsW fENstdcAljnvT0Pey78eC7g= =2d6g -----END PGP SIGNATURE----- --Sig_/ysc1mR5.B5Jmaeu6YmM=8CX-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 18:49:06 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8134D1065675 for ; Tue, 5 Jul 2011 18:49:06 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 15EBE8FC1B for ; Tue, 5 Jul 2011 18:49:05 +0000 (UTC) Received: from park.js.berklix.net (p5DCBEC33.dip.t-dialin.net [93.203.236.51]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id p65In3Pa070450 for ; Tue, 5 Jul 2011 18:49:03 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id p65ImswH065521 for ; Tue, 5 Jul 2011 20:48:54 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id p65ImnaC054149 for ; Tue, 5 Jul 2011 18:48:54 GMT (envelope-from jhs@fire.js.berklix.net) Message-Id: <201107051848.p65ImnaC054149@fire.js.berklix.net> To: hackers@freebsd.org From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Linux Unix Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com/~jhs/cv/ Date: Tue, 05 Jul 2011 20:48:49 +0200 Sender: jhs@berklix.com Cc: Subject: regression error with calendar X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 18:49:06 -0000 There's a regression error with calendar between FreeBSD-8.1 & 8.2-RELEASES Test data: ----- Tue+1 TESTXXXXX 1 Tuesday+1 TESTXXXXX 2 * Tuesday+1 TESTXXXXX 3 Tuesday+1 * TESTXXXXX 4 Tuesday TESTXXXXX5 Tuesday TESTXXXXX6 ----- Data shown with od -c in case any mail or web archive scrambles tabs 0000000 T u e + 1 \t T E S T X X X X X 0000020 1 \n T u e s d a y + 1 \t T E S T 0000040 X X X X X 2 \n * T u e s d a 0000060 y + 1 \t T E S T X X X X X 3 \n 0000100 T u e s d a y + 1 * \t T E S T 0000120 X X X X X 4 \n T u e s d a y \t 0000140 T E S T X X X X X 5 \n T u e s d 0000160 a y \t \t T E S T X X X X X 6 \n \n 0000200 ----- Can someone confirm it please ? Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Reply below, not above; Indent with "> "; Cumulative like a play script. Format: Plain text. Not HTML, multipart/alternative, base64, quoted-printable. From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 19:04:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F2F4106564A for ; Tue, 5 Jul 2011 19:04:42 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id DA14E8FC12 for ; Tue, 5 Jul 2011 19:04:41 +0000 (UTC) Received: by pvg11 with SMTP id 11so7699653pvg.13 for ; Tue, 05 Jul 2011 12:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=U3PJiIJT4OIBCCPyrABKldcJBGBizmJWLsehrXLNWnM=; b=Anv1fBc3Bly8Wv1e92t/gRctvZ4sZ70UPYdMSSgo0h2D8N0hiKYpIfbzFqXNl8Fz5K pdK0bzb+hMRZO4IGlSYy8wlXc6X7n1Mw17NLlSbCApqZt4Q7zR2GFYzZ/2c7ecmuFBan eNb9ZYJI2lKzpNfviWynOMz33fyT6Wu4eMWAk= MIME-Version: 1.0 Received: by 10.68.32.101 with SMTP id h5mr9472460pbi.158.1309892681362; Tue, 05 Jul 2011 12:04:41 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Tue, 5 Jul 2011 12:04:41 -0700 (PDT) In-Reply-To: <20110705140527.17362ed5@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <20110705140527.17362ed5@kan.dnsalias.net> Date: Tue, 5 Jul 2011 21:04:41 +0200 X-Google-Sender-Auth: 9j87MUuQOCBWyY-DrUNupCZXHAk Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 19:04:42 -0000 2011/7/5 Alexander Kabaev : > I agree with all of the above reasons, but none of them change the fact > that __linux__ is used left and right to identify both kernel and > userland environments Yes, __linux__ is used to identify userland. And almost 100% of the times it is the wrong macro. We've spent several years fixing this kind of bug. To give just one example among hundreds, here's the latest incarnation of __linux__ misuse, reported 3 days ago: http://lists.debian.org/debian-bsd/2011/07/msg00013.html > just as __FreeBSD__ is. Not exactly. For example, when you see __FreeBSD__, you know what libc you're dealing with. > You choose to disable > __FreeBSD__ in GNU/kFreeBSD presumably because it makes your life > porting software easier If Debian GNU/kFreeBSD enabled __FreeBSD__, software would expect that it is being built on FreeBSD, and make lots of wrong assumptions. Debian GNU/kFreeBSD is not FreeBSD. It is a derivative that builds on the kernel of FreeBSD and some of its kernel-specific libraries. It's not surprising that asserting we're FreeBSD via the compiler results in breakage (to begin with, even GCC headers wouldn't work properly). (similar statements can be made for e.g. Darwin, which I think you're familiar with) > and are asking FreeBSD project to cope with > the decision. I'm asking FreeBSD project to make life easier for a derivative that is, one way or another, part of its ecosystem, at no cost other than the time spent discussing the proposal. > This breaks compiles of new software with older > compilers than do not define the macro, As far as I'm concerned, new software isn't supposed to rely on this macro unconditionally untill it is deemed reasonable to do so. > takes __FreeBSD__ out of > symmetry with =C2=A0__linux__ I could argue that __FreeBSD_kernel__ would be in symmetry with __linux__. But that's wordplay. I think we agreed to leave it out of the list :-) > and other similarly defined platform macros > and forces a race to update every other compiler out there to follow > the suit. There's no race, and nobody forcing it. --=20 Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 19:40:02 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D3C9106564A for ; Tue, 5 Jul 2011 19:40:02 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 3508F8FC1D for ; Tue, 5 Jul 2011 19:40:02 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 1A1A72166BA; Tue, 5 Jul 2011 22:24:35 +0300 (EEST) Date: Tue, 5 Jul 2011 22:24:35 +0300 From: Jaakko Heinonen To: "Julian H. Stacey" Message-ID: <20110705192434.GA57761@jh> References: <201107051848.p65ImnaC054149@fire.js.berklix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107051848.p65ImnaC054149@fire.js.berklix.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: hackers@freebsd.org Subject: Re: regression error with calendar X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 19:40:02 -0000 On 2011-07-05, Julian H. Stacey wrote: > There's a regression error with calendar between FreeBSD-8.1 & 8.2-RELEASES > Test data: > ----- > Tue+1 TESTXXXXX 1 > Tuesday+1 TESTXXXXX 2 > * Tuesday+1 TESTXXXXX 3 > Tuesday+1 * TESTXXXXX 4 > Tuesday TESTXXXXX5 > Tuesday TESTXXXXX6 > ----- This look like PR bin/155873 (http://www.freebsd.org/cgi/query-pr.cgi?pr=155873). -- Jaakko From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 20:02:44 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A8BD106566C for ; Tue, 5 Jul 2011 20:02:44 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id DD1768FC15 for ; Tue, 5 Jul 2011 20:02:43 +0000 (UTC) Received: by vxg33 with SMTP id 33so6120585vxg.13 for ; Tue, 05 Jul 2011 13:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; bh=7iUiFfHskheX+j2JNxqo/qD/8xLIlSqzymFb0McKnyE=; b=d8TMYlk1REUL1DhB0M1HnQMcvSwdl2IjWj8tzl2XEsgWJl1v+6xjvTUt/U7Ex7FFAx E4YFkv5XSJPMoM64VU1S1ttgAECDM/VNkGobiJVOe2a3vdpD6cea41R/rTq6d7zOdofW rjoO8WP5plaFwSoDPbFD7mRq0H2OZKAZyKiDk= Received: by 10.52.179.230 with SMTP id dj6mr6872074vdc.130.1309896163232; Tue, 05 Jul 2011 13:02:43 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id c1sm2565398vdu.29.2011.07.05.13.02.41 (version=SSLv3 cipher=OTHER); Tue, 05 Jul 2011 13:02:41 -0700 (PDT) Date: Tue, 5 Jul 2011 16:02:36 -0400 From: Alexander Kabaev To: Robert Millan Message-ID: <20110705160236.1c20d810@kan.dnsalias.net> In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <20110705140527.17362ed5@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/t0UylTkCbab3vSAd11tfxmX"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 20:02:44 -0000 --Sig_/t0UylTkCbab3vSAd11tfxmX Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On Tue, 5 Jul 2011 21:04:41 +0200 Robert Millan wrote: > 2011/7/5 Alexander Kabaev : > > I agree with all of the above reasons, but none of them change the > > fact that __linux__ is used left and right to identify both kernel > > and userland environments >=20 > Yes, __linux__ is used to identify userland. And almost 100% of the > times it is the wrong macro. We've spent several years fixing this > kind of bug. To give just one example among hundreds, here's the > latest incarnation of __linux__ misuse, reported 3 days ago: >=20 > http://lists.debian.org/debian-bsd/2011/07/msg00013.html >=20 > > just as __FreeBSD__ is. >=20 > Not exactly. For example, when you see __FreeBSD__, you know what > libc you're dealing with. >=20 Only because there was no GNU/kFreeBSD before and people got lazy. Using __FreeBSD__ to identify userland can be considered just as wrong practice as using __linux__ for the same purpose, yet several years have been spent fixing this on Linux and quick hack is somehow appropriate for FreeBSD. Why do you keep arguing that intended use of __FreeBSD__ is any different than one of __linux__? It is not and both should be fixed when misused. > > You choose to disable > > __FreeBSD__ in GNU/kFreeBSD presumably because it makes your life > > porting software easier >=20 > If Debian GNU/kFreeBSD enabled __FreeBSD__, software would expect that > it is being built on FreeBSD, and make lots of wrong assumptions. >=20 > Debian GNU/kFreeBSD is not FreeBSD. It is a derivative that builds on > the kernel of FreeBSD and some of its kernel-specific libraries. It's > not surprising that asserting we're FreeBSD via the compiler results > in breakage (to begin with, even GCC headers wouldn't work properly). > Then be a proper OS and have __kFreeBSD__ or what not defined in your toolchain. > (similar statements can be made for e.g. Darwin, which I think you're > familiar with) >=20 Darwin _is_ a proper first-class OS, per above. Last time I checked we were not forced to change out toolchain in any way to cater to their uses of components they borrow from FreeBSD. > > and are asking FreeBSD project to cope with > > the decision. >=20 > I'm asking FreeBSD project to make life easier for a derivative that > is, one way or another, part of its ecosystem, at no cost other than > the time spent discussing the proposal. >=20 Not true, the change does break backward compatibility with older software if the new macro were to be used as you propose, to enable the code that is specific to FreeBSD kernel. > > This breaks compiles of new software with older > > compilers than do not define the macro, >=20 > As far as I'm concerned, new software isn't supposed to rely on this > macro unconditionally untill it is deemed reasonable to do so. >=20 > > takes __FreeBSD__ out of > > symmetry with =9A__linux__ >=20 > I could argue that __FreeBSD_kernel__ would be in symmetry with > __linux__. But that's wordplay. I think we agreed to leave it out of > the list :-) >=20 See above. Why inventing your own symbol as opposed fixing the use of existing one is more appropriate on FreeBSD and not on Linux? > > and other similarly defined platform macros > > and forces a race to update every other compiler out there to follow > > the suit. >=20 > There's no race, and nobody forcing it. >=20 Predefined symbols are only useful if all compilers are consistent in their use. --=20 Alexander Kabaev --Sig_/t0UylTkCbab3vSAd11tfxmX Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFOE23gQ6z1jMm+XZYRAp35AKDSce56QsmXhqjZJDSu5B1oRq/RrQCeOL2L qIkPZw+W82oWQ3B4a8/ik/o= =KSgC -----END PGP SIGNATURE----- --Sig_/t0UylTkCbab3vSAd11tfxmX-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 20:12:15 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57ED8106566B for ; Tue, 5 Jul 2011 20:12:15 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id F1FA68FC16 for ; Tue, 5 Jul 2011 20:12:14 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Tue, 5 Jul 2011 16:12:14 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 1BEE633C02; Tue, 5 Jul 2011 16:12:14 -0400 (EDT) Date: Tue, 5 Jul 2011 16:12:14 -0400 From: Ed Maste To: Alexander Kabaev Message-ID: <20110705201214.GA31647@sandvine.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <20110705140527.17362ed5@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20110705140527.17362ed5@kan.dnsalias.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org, Robert Millan Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 20:12:15 -0000 On Tue, Jul 05, 2011 at 02:05:27PM -0400, Alexander Kabaev wrote: > I agree with all of the above reasons, but none of them change the fact > that __linux__ is used left and right to identify both kernel and > userland environments just as __FreeBSD__ is. You choose to disable > __FreeBSD__ in GNU/kFreeBSD presumably because it makes your life > porting software easier and are asking FreeBSD project to cope with > the decision. This breaks compiles of new software with older > compilers than do not define the macro, takes __FreeBSD__ out of > symmetry with __linux__ and other similarly defined platform macros > and forces a race to update every other compiler out there to follow > the suit. I fail to see the benefits out-weighting the drawbacks in > this scenario. There are two separate issues here - the macro itself, and where it's defined. On the topic of the macro itself, __FreeBSD__ implies something about the kernel and the libc, and it used to be the same case for __linux__. This became broken for __linux__ once people started combining a Linux kernel with other than glibc, and it would break if those combining the FreeBSD kernel with another libc defined __FreeBSD__. (A note on terminology - some may dislike the "GNU/" name for various reasons, but either way their project is properly called "Debian GNU/kFreeBSD." I'll refer to it as "kFreeBSD" here for brevity though, since the kFreeBSD part is the unique aspect of this project vs other Debian ports, and the full name is rather awkward to type.) kFreeBSD can't define __FreeBSD__, since it will break any existing software that uses that to infer something about the libc in use. So, that project had a choice; they could have created a new macro __Debian_GNU_kFreeBSD__, say, that indicates the kernel and libc in use. However, defining __FreeBSD_kernel__ (and __glibc__ presumably) makes more sense, and actually reduces the porting effort for both them and the FreeBSD porters. Any effort on porting software to the FreeBSD kernel done by either project is then applicable to the other. If kFreeBSD project members make a change to get some piece of software working on a FreeBSD kernel and then gets that change commited upstream we can take advantage of that work without any additional effort on our part. On the topic of where such a macro should be defined I originally had no strong opinion. However, valid points have been raised about compiling software for FreeBSD using compilers that are not the one in the base system (from ports or otherwise, and GCC or otherwise). This I think is a very valid point and one that would make me lean towards defining the macro in sys/param.h. How workable is it to #include sys/param.h to pick up the macro where needed? -Ed Maste From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 21:03:09 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8817E106566B; Tue, 5 Jul 2011 21:03:09 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 160D68FC16; Tue, 5 Jul 2011 21:03:08 +0000 (UTC) Received: from park.js.berklix.net (p5DCBEC33.dip.t-dialin.net [93.203.236.51]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id p65L36vr071156; Tue, 5 Jul 2011 21:03:07 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by park.js.berklix.net (8.13.8/8.13.8) with ESMTP id p65L2wKf066514; Tue, 5 Jul 2011 23:02:58 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id p65L2lWN055393; Tue, 5 Jul 2011 21:02:53 GMT (envelope-from jhs@fire.js.berklix.net) Message-Id: <201107052102.p65L2lWN055393@fire.js.berklix.net> To: Jaakko Heinonen From: "Julian H. Stacey" Organization: http://www.berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Tue, 05 Jul 2011 22:24:35 +0300." <20110705192434.GA57761@jh> Date: Tue, 05 Jul 2011 23:02:47 +0200 Sender: jhs@berklix.com Cc: edwin@freebsd.org, hackers@freebsd.org, Ivana Belgers Subject: Re: regression error with calendar X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 21:03:09 -0000 Hi Jaako, > From: Jaakko Heinonen Jaakko Heinonen wrote: > On 2011-07-05, Julian H. Stacey wrote: > > There's a regression error with calendar between FreeBSD-8.1 & 8.2-RELEASES > > Test data: > > ----- > > Tue+1 TESTXXXXX 1 > > Tuesday+1 TESTXXXXX 2 > > * Tuesday+1 TESTXXXXX 3 > > Tuesday+1 * TESTXXXXX 4 > > Tuesday TESTXXXXX5 > > Tuesday TESTXXXXX6 > > ----- > > This look like PR bin/155873 > (http://www.freebsd.org/cgi/query-pr.cgi?pr=155873). Ah Yes, that's the same problem. Thanks ! Can FreeBSD please revert the broken code out of CVS, until/ if author / importer / whoever might want to fix it. The new code breaks basic common functionality, to add rare usage exotica. Broken calendar code failed to mail prompt me to call meetings in time. Probably caused lots of missed reminders. Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com Reply below, not above; Indent with "> "; Cumulative like a play script. Format: Plain text. Not HTML, multipart/alternative, base64, quoted-printable. From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 5 22:46:09 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id DEB45106566B; Tue, 5 Jul 2011 22:46:09 +0000 (UTC) Date: Tue, 5 Jul 2011 22:46:09 +0000 From: Alexander Best To: freebsd-hackers@freebsd.org Message-ID: <20110705224609.GA93031@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: strange 'vmstat -z' output X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2011 22:46:09 -0000 hi there, i'm seeing the following with 'vmstat -z' on CURRENT, running on amd64: ITEM SIZE LIMIT USED FREE REQ FAIL SLEEP 128 Bucket: 1048, 0, 150, 0, 1650,12746, 0 ...how can the number of failures be greater than the number of requests? cheers. alex From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 00:40:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35C8C106566B for ; Wed, 6 Jul 2011 00:40:55 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id ED1C88FC0C for ; Wed, 6 Jul 2011 00:40:54 +0000 (UTC) Received: by gxk28 with SMTP id 28so3140490gxk.13 for ; Tue, 05 Jul 2011 17:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=jMd+YoV91pfY610okgk0jQ8Jz5ygNvIFv/tVzSHzig0=; b=ma/9lPQr+sGADx72bUQ1ycyVVR4sePjWnfoWo1ARNy0dGRuLe/qVaSUlZh7cSa75eq 4nif+FOVErE/0ECxt2eZ+CpkclpuUuT5DBYKc1mWc1yWiVLYXgSoFAZxLXZLrr0jFHu9 C3edkxpGVMyVTPVgZftwfP0BGQqouP0RfipmI= MIME-Version: 1.0 Received: by 10.150.207.17 with SMTP id e17mr6441506ybg.243.1309912854038; Tue, 05 Jul 2011 17:40:54 -0700 (PDT) Received: by 10.150.92.6 with HTTP; Tue, 5 Jul 2011 17:40:54 -0700 (PDT) In-Reply-To: <20110705224609.GA93031@freebsd.org> References: <20110705224609.GA93031@freebsd.org> Date: Wed, 6 Jul 2011 04:40:54 +0400 Message-ID: From: Sergey Kandaurov To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: strange 'vmstat -z' output X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 00:40:55 -0000 On 6 July 2011 02:46, Alexander Best wrote: > hi there, > > i'm seeing the following with 'vmstat -z' on CURRENT, running on amd64: > > ITEM =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 SIZE =A0LIMIT =A0 =A0 USED =A0 = =A0 FREE =A0 =A0 =A0REQ FAIL SLEEP > 128 Bucket: =A0 =A0 =A0 =A0 =A0 =A01048, =A0 =A0 =A00, =A0 =A0 150, =A0 = =A0 =A0 0, =A0 =A01650,12746, =A0 0 > > ...how can the number of failures be greater than the number of requests? Here REQ is the total number of successful allocations, not just requests. --=20 wbr, pluknet From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 01:07:12 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB24106566B for ; Wed, 6 Jul 2011 01:07:12 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id E874E8FC0A for ; Wed, 6 Jul 2011 01:07:11 +0000 (UTC) Received: by gyf3 with SMTP id 3so3165727gyf.13 for ; Tue, 05 Jul 2011 18:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to; bh=HRhkG9Jl+m27rD2al8viEPoykvDxOjPtPhdr18TFAIc=; b=vi+9BZl3Ab2gmzfkd4oTSvVUtBloNPqgfH40ih6Z5g8lD/bjPVxHuAnMeBXUb9iSXX 2eKlutdTWWjD1zijgEHCyBhGc7z1N1yXoKoHbSa9eyv6pyQwGSHl2yqoAGVuc39QwkWn N0Kj8hBBOObYbFINLm0JxY0SvVyQkarT5NwWQ= Received: by 10.236.189.100 with SMTP id b64mr9801113yhn.411.1309914431135; Tue, 05 Jul 2011 18:07:11 -0700 (PDT) Received: from DataIX.net (adsl-99-181-128-71.dsl.klmzmi.sbcglobal.net [99.181.128.71]) by mx.google.com with ESMTPS id i30sm5229313yhm.21.2011.07.05.18.07.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jul 2011 18:07:09 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p66176Uq086562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Jul 2011 21:07:06 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p66176Wp086561; Tue, 5 Jul 2011 21:07:06 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Tue, 5 Jul 2011 21:07:06 -0400 From: Jason Hellenthal To: Alexander Best Message-ID: <20110706010706.GA58614@DataIX.net> References: <20110705224609.GA93031@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20110705224609.GA93031@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: strange 'vmstat -z' output X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 01:07:12 -0000 On Tue, Jul 05, 2011 at 10:46:09PM +0000, Alexander Best wrote: > hi there, >=20 > i'm seeing the following with 'vmstat -z' on CURRENT, running on amd64: >=20 > ITEM SIZE LIMIT USED FREE REQ FAIL SLEEP > 128 Bucket: 1048, 0, 150, 0, 1650,12746, 0 >=20 > ...how can the number of failures be greater than the number of requests? >=20 Not to get off track here. Was that sleep patch applied to -CURRENT ? i.e. imported for general usage ? or did you just apply it locally ? If you applied that locally does the same thing happen without it ? From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 01:08:25 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A767106566B for ; Wed, 6 Jul 2011 01:08:25 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 21DFA8FC0C for ; Wed, 6 Jul 2011 01:08:24 +0000 (UTC) Received: by gxk28 with SMTP id 28so3147471gxk.13 for ; Tue, 05 Jul 2011 18:08:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to; bh=EIrtuydpJlBhkTjodsGQk3FASDGAQTDvjUzEuZZTu0A=; b=rEn3hKYSP8y/6UJdswcG2M9pyq5dxzyaA2O7Eo++pIFc59Mk9LE5cUCQNurjvndox8 WYwv92vNwjW9qFfnBK6aftWT0TTG6+KfpKTbk1wHb6HLLpZlMYZ7FiZdiGAgRIJbQ/OE HAQFmjZe0/jE+lWtjM67i+rKfQqvSrqWgW8qk= Received: by 10.236.76.167 with SMTP id b27mr8846636yhe.336.1309914504223; Tue, 05 Jul 2011 18:08:24 -0700 (PDT) Received: from DataIX.net (adsl-99-181-128-71.dsl.klmzmi.sbcglobal.net [99.181.128.71]) by mx.google.com with ESMTPS id v4sm5235127yhm.76.2011.07.05.18.08.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jul 2011 18:08:23 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p6618K2Y087090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Jul 2011 21:08:20 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p6618JJx087089; Tue, 5 Jul 2011 21:08:20 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Tue, 5 Jul 2011 21:08:19 -0400 From: Jason Hellenthal To: Sergey Kandaurov Message-ID: <20110706010819.GB58614@DataIX.net> References: <20110705224609.GA93031@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Cc: Alexander Best , freebsd-hackers@freebsd.org Subject: Re: strange 'vmstat -z' output X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 01:08:25 -0000 On Wed, Jul 06, 2011 at 04:40:54AM +0400, Sergey Kandaurov wrote: > On 6 July 2011 02:46, Alexander Best wrote: > > hi there, > > > > i'm seeing the following with 'vmstat -z' on CURRENT, running on amd64: > > > > ITEM                   SIZE  LIMIT     USED     FREE      REQ FAIL SLEEP > > 128 Bucket:            1048,      0,     150,       0,    1650,12746,   0 > > > > ...how can the number of failures be greater than the number of requests? > > Here REQ is the total number of successful allocations, not just requests. > I think he is refering to "FAIL" column not REQ. From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 06:49:50 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B91B3106566B for ; Wed, 6 Jul 2011 06:49:50 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9828FC0A for ; Wed, 6 Jul 2011 06:49:50 +0000 (UTC) Received: by pzk27 with SMTP id 27so5024871pzk.13 for ; Tue, 05 Jul 2011 23:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=j/QAN53pM5Vwm5vPMTY2vcwgnO79NPa4/2Im2KHtRD4=; b=FAVeATGIT3my9QNLghC41E/Cch5oRzEWz66KOuTNyYXkf7DNnbrImNaKKJDnRIagSK A22JrUj2hxv1WJgpGCDpj9e4CWDP/rzpzhg/SYapja4qb9t32Cgcg0wLpfx/Q0JObJBK ZvN9NUX4pFD91LW5+K0/mlp7QtlTIs4qUFifY= MIME-Version: 1.0 Received: by 10.68.50.9 with SMTP id y9mr10825149pbn.24.1309934989950; Tue, 05 Jul 2011 23:49:49 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Tue, 5 Jul 2011 23:49:49 -0700 (PDT) In-Reply-To: <20110705160236.1c20d810@kan.dnsalias.net> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <20110705140527.17362ed5@kan.dnsalias.net> <20110705160236.1c20d810@kan.dnsalias.net> Date: Wed, 6 Jul 2011 08:49:49 +0200 X-Google-Sender-Auth: 5KDXZj-f1EfS7FbuMd56R6R4gIk Message-ID: From: Robert Millan To: Alexander Kabaev Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 06:49:50 -0000 2011/7/5 Alexander Kabaev : > Only because there was no GNU/kFreeBSD before and people got lazy. Using > __FreeBSD__ to identify userland can be considered just as wrong > practice as using __linux__ for the same purpose, yet several years > have been spent fixing this on Linux and quick hack is somehow > appropriate for FreeBSD. Why do you keep arguing that intended use of > __FreeBSD__ is any different than one of __linux__? =C2=A0It is not and b= oth > should be fixed when misused. I think there's an underlying discussion about naming convention here. You said you wanted to leave it out of the list, but it is central to your argument. I try to keep a purely pragmatic approach, but when you say "using this name may work well, but it is wrong", then we have to argue about what is right and what is wrong, and we can't have a pragmatic discussion anymore. It has become http://tinyurl.com/qysbk already. >> I'm asking FreeBSD project to make life easier for a derivative that >> is, one way or another, part of its ecosystem, at no cost other than >> the time spent discussing the proposal. > > Not true, the change does break backward compatibility with older > software if the new macro were to be used as you propose, to enable the > code that is specific to FreeBSD kernel. It is a timing issue. I don't propose that the macro is used _before_ it has become appropiate to use it. A several year period would be necessary for 3rd party software. --=20 Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 06:53:33 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEF63106564A; Wed, 6 Jul 2011 06:53:33 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id AD7358FC13; Wed, 6 Jul 2011 06:53:33 +0000 (UTC) Received: by pvg11 with SMTP id 11so8224498pvg.13 for ; Tue, 05 Jul 2011 23:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=GN1qr9QQ3mNWKyHLOUy9zr6kUSHZQcC/cf5eksx5eZY=; b=KhqVvuvCzbmcPOJKPI+eb8gQ7QmYA6WQ9RDwT5eHCHyTLS3iEF5ZgSsLgAV+6aNdQR PHZifjSV0i5PA2D5TG4N4hzMYbe63lJa+EjXuvrQ1+g6+SpEJIYJ3YXAnVo4NSCXzOcm C+KCo400IDY0dt1PPo02UraKybhJbeyWJ2wyo= MIME-Version: 1.0 Received: by 10.68.50.9 with SMTP id y9mr10829575pbn.24.1309935212965; Tue, 05 Jul 2011 23:53:32 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Tue, 5 Jul 2011 23:53:32 -0700 (PDT) In-Reply-To: <20110705201214.GA31647@sandvine.com> References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <20110705140527.17362ed5@kan.dnsalias.net> <20110705201214.GA31647@sandvine.com> Date: Wed, 6 Jul 2011 08:53:32 +0200 X-Google-Sender-Auth: E9USm6mqciiDlfL6_hscfmcOIuM Message-ID: From: Robert Millan To: Ed Maste Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 06:53:34 -0000 2011/7/5 Ed Maste : > On the topic of where such a macro should be defined I originally had > no strong opinion. =C2=A0However, valid points have been raised about > compiling software for FreeBSD using compilers that are not the one in > the base system (from ports or otherwise, and GCC or otherwise). =C2=A0Th= is > I think is a very valid point and one that would make me lean towards > defining the macro in sys/param.h. =C2=A0How workable is it to #include > sys/param.h to pick up the macro where needed? That works most of the time. There could be a problem if software can't assume is present, but I think it covers the vast majority of cases. --=20 Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 07:00:21 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 268171065688; Wed, 6 Jul 2011 07:00:21 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9592C8FC16; Wed, 6 Jul 2011 07:00:17 +0000 (UTC) Received: by vxg33 with SMTP id 33so6470742vxg.13 for ; Wed, 06 Jul 2011 00:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=N0dCrmE1IU05Rtto7P7ocE09S9qj8W6bmpSZMLJz9eo=; b=LzmFt1mvm0VqXYB95jhn8NzZ1pKrpG/n3pES4gIybcMn/poE3AWOQtfbGSSa2E1+np KJL6RFZeyoSg4lO2SA6KSOA6F4u+OXPzqhs9KyMHwIo13RKCKh0xcJeFQ30Hb9c4aFG6 sdnTDdHKtwc91VcR5p0M0KYHGLHmZ0qqNX//A= MIME-Version: 1.0 Received: by 10.220.59.193 with SMTP id m1mr2275677vch.38.1309935616775; Wed, 06 Jul 2011 00:00:16 -0700 (PDT) Received: by 10.220.92.201 with HTTP; Wed, 6 Jul 2011 00:00:16 -0700 (PDT) In-Reply-To: References: <20110702193724.5c55a6c9@kan.dnsalias.net> <20110703020827.GA5763@sandvine.com> <20110703103531.4a553271@kan.dnsalias.net> <20110705140527.17362ed5@kan.dnsalias.net> <20110705201214.GA31647@sandvine.com> Date: Wed, 6 Jul 2011 00:00:16 -0700 Message-ID: From: Garrett Cooper To: Robert Millan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Ed Maste Subject: Re: [PATCH] __FreeBSD_kernel__ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 07:00:21 -0000 On Tue, Jul 5, 2011 at 11:53 PM, Robert Millan wrote: > 2011/7/5 Ed Maste : >> On the topic of where such a macro should be defined I originally had >> no strong opinion. =A0However, valid points have been raised about >> compiling software for FreeBSD using compilers that are not the one in >> the base system (from ports or otherwise, and GCC or otherwise). =A0This >> I think is a very valid point and one that would make me lean towards >> defining the macro in sys/param.h. =A0How workable is it to #include >> sys/param.h to pick up the macro where needed? > > That works most of the time. =A0There could be a problem if software > can't assume is present, but I think it covers the vast > majority of cases. Speaking from my limited experience trying to fix net-snmp's autoconf tests over the past couple of days and maintaining LTP, as well as development in general on FreeBSD and Linux platforms, I think that more of an issue lays in socializing the development structure of FreeBSD to third-parties, in particular because a number of groups fail to adhere to some of the practices that have been explicitly or implicitly put forth by FreeBSD in terms of headers and definitions. Granted, this is one piece of the puzzle, but it's an important one, because the following (for example): $ cat foo.c #include #include #include #include #include ... isn't guaranteed to work :). Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 07:28:50 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87D65106566B; Wed, 6 Jul 2011 07:28:50 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1BA4B8FC22; Wed, 6 Jul 2011 07:28:49 +0000 (UTC) Received: by gxk28 with SMTP id 28so3237549gxk.13 for ; Wed, 06 Jul 2011 00:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=CWqhO6PqP3Kv/yblum3xDOFYMbc8Ckuyn3/+Mz1j98k=; b=Im3FsLnhd9nA88dY3+GSASYRM2nnxU7Xz2cHkEdoQNT9RgWawAD/nkN/Tq14G7rNIJ SvBhEMNnS23N4PSPJuX1Hj3h8rgjjI31Snd6ACEn4AVUOvP82cBWKBDbW3gYe3/TYnvd ZCpGdBlsOp4IB4qIyuWAqHijLhi+F5HCv98/k= MIME-Version: 1.0 Received: by 10.150.207.17 with SMTP id e17mr6678018ybg.243.1309937329189; Wed, 06 Jul 2011 00:28:49 -0700 (PDT) Received: by 10.150.92.6 with HTTP; Wed, 6 Jul 2011 00:28:49 -0700 (PDT) In-Reply-To: <20110706010819.GB58614@DataIX.net> References: <20110705224609.GA93031@freebsd.org> <20110706010819.GB58614@DataIX.net> Date: Wed, 6 Jul 2011 11:28:49 +0400 Message-ID: From: Sergey Kandaurov To: Jason Hellenthal Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Alexander Best , freebsd-hackers@freebsd.org Subject: Re: strange 'vmstat -z' output X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 07:28:50 -0000 On 6 July 2011 05:08, Jason Hellenthal wrote: > > > On Wed, Jul 06, 2011 at 04:40:54AM +0400, Sergey Kandaurov wrote: >> On 6 July 2011 02:46, Alexander Best wrote: >> > hi there, >> > >> > i'm seeing the following with 'vmstat -z' on CURRENT, running on amd64= : >> > >> > ITEM =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 SIZE =A0LIMIT =A0 =A0 USED = =A0 =A0 FREE =A0 =A0 =A0REQ FAIL SLEEP >> > 128 Bucket: =A0 =A0 =A0 =A0 =A0 =A01048, =A0 =A0 =A00, =A0 =A0 150, = =A0 =A0 =A0 0, =A0 =A01650,12746, =A0 0 >> > >> > ...how can the number of failures be greater than the number of reques= ts? >> >> Here REQ is the total number of successful allocations, not just request= s. >> > > I think he is refering to "FAIL" column not REQ. > Yes. And FAIL is not a subset of REQ. They are success / failure counters. That's why FAIL can be less/greater then REQ. --=20 wbr, pluknet From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 08:25:58 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id C6EA31065677; Wed, 6 Jul 2011 08:25:58 +0000 (UTC) Date: Wed, 6 Jul 2011 08:25:58 +0000 From: Alexander Best To: Sergey Kandaurov Message-ID: <20110706082558.GA57532@freebsd.org> References: <20110705224609.GA93031@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Cc: freebsd-hackers@freebsd.org Subject: Re: strange 'vmstat -z' output X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 08:25:58 -0000 On Wed Jul 6 11, Sergey Kandaurov wrote: > On 6 July 2011 02:46, Alexander Best wrote: > > hi there, > > > > i'm seeing the following with 'vmstat -z' on CURRENT, running on amd64: > > > > ITEM                   SIZE  LIMIT     USED     FREE      REQ FAIL SLEEP > > 128 Bucket:            1048,      0,     150,       0,    1650,12746,   0 > > > > ...how can the number of failures be greater than the number of requests? > > Here REQ is the total number of successful allocations, not just requests. who in the right mind would use the keyword REQ for describing successfull allocations? i think if this is really the case, it should be changed to SUCC and, if possible, REQ, describing the total number of requested allocations, should be added. just my 0.02$. thanks for clearing thinks up for me. unfortunately the vmstat(8) man page doesn't come with any description for the -z output. it would be nice to have sections for every vmstat mode, like in the procstat(1) man page. cheers. alex > > -- > wbr, > pluknet From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 19:47:46 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AC69106564A; Wed, 6 Jul 2011 19:47:46 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3A3A18FC0C; Wed, 6 Jul 2011 19:47:45 +0000 (UTC) Received: by yxl31 with SMTP id 31so160673yxl.13 for ; Wed, 06 Jul 2011 12:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=S9UEnZmogMG+TWy1crpI9HjJSR21sJACp7IUcnHYI4M=; b=JoZPPueV4WIiu1msQfqGGUeaOA3Dl8DMgQsLkendZ0BVke9eC6OdZJJxVigQoh9+1r 7DjCMV/0CEvBmPFuvb1NI+jmNtkIk/x50xFt6WQmVKm53EZNtgKJqtfKfm+g1Q0o1kVc OiOjfaB3+Htk82070uXnuaDHdwLqbK9T+TCaw= MIME-Version: 1.0 Received: by 10.236.78.233 with SMTP id g69mr11468727yhe.298.1309981665332; Wed, 06 Jul 2011 12:47:45 -0700 (PDT) Received: by 10.236.203.6 with HTTP; Wed, 6 Jul 2011 12:47:45 -0700 (PDT) In-Reply-To: <44k4byunz2.fsf@lowell-desk.lan> References: <44k4byunz2.fsf@lowell-desk.lan> Date: Wed, 6 Jul 2011 21:47:45 +0200 Message-ID: From: "deeptech71@gmail.com" To: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: what is the RIGHT(TM) way to configure background DHCP? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 19:47:46 -0000 (i intend the discussion to take place primarily on the freebsd-hackers list, i'm CCing the freebsd-current list for a reason stated below.) (original first post: http://lists.freebsd.org/pipermail/freebsd-questions/2011-June/231301.html) On Mon, Jul 4, 2011 at 4:20 PM, Lowell Gilbert wrote: > You might want to try rewording your question, because it didn't make > any sense the first time. very well. though the question should have made perfect sense the first time. > [All of your examples were commented out, so > it was no surprise that they didn't work.] i chose to use # characters to separate rc.conf snippets from the other sentences i wrote. though perhaps #s were an unfortunate choice, because a # has a comment-begins-here meaning in rc.conf. in any case, "attempt 1" and "attempt 2" didn't work, but "attempt 3" did work, and that rules out the use of # for comments in rc.conf. now i will use "===== rc.conf snippet begins =====" and "===== rc.conf snippet ends =====" instead of # characters. > I considered trying to use my chrystal ball to guess that you needed > "SYNCDHCP" in your interface config, but you had obviously read the > manual for rc.conf(5), so that seemed unlikely... and "SYNCDHCP" makes things even worse. (i have no idea what "SYNCDHCP" is supposed to do, but in my experience:) "SYNCDHCP" makes the boot process wait until DHCP server replies before proceeding. "SYNCDHCP" is actually almost the same as "DHCP", except that "SYNCDHCP" waits indefinitely, while "DHCP" waits for at most defaultroute_delay, and also, "DHCP" gets "Starting network: lo0 sk0. " printed *before* the IP address assignment process starts, while "SYNCDHCP" gets "Starting network: lo0 sk0. " printed *after* the IP address assignment process finishes. so here is the question rephrased: the boot process of my FreeBSD machines takes a relatively long time. it spends 30 seconds idling at some point, because my network interface (sk0) is supposed to have an IP address assigned via DHCP, and the DHCP server on my LAN takes an extremely long time (~40 seconds) to reply to IP address requests. this is unacceptable for me; i want the FreeBSD boot process to finish 30 seconds earlier, even if i won't get the chance to use the network for ~40 seconds after the booting has finished. this was the actual case when my rc.conf had the following options related to network interfaces: ===== rc.conf snippet begins ===== ifconfig_sk0="DHCP" ===== rc.conf snippet ends ===== it took me 3 rc.conf configuration attempts to find a configuration in which the boot process does not idle for 30 seconds. the following was the first attempt: ===== rc.conf snippet begins ===== background_dhclient="YES" background_dhclient_sk0="YES" ===== rc.conf snippet ends ===== with this configuration, the DHCP client isn't even started. ie., the boot process does not idle at all (that's good!), but the network interface will never receive an IP address automatically (that's very bad!). here is the second attempt: ===== rc.conf snippet begins ===== ifconfig_sk0="DHCP" background_dhclient="YES" background_dhclient_sk0="YES" ===== rc.conf snippet ends ===== with this configuration, the DHCP client is started, but the boot process still idles for 30 seconds at some point (as if the background_dhclient and background_dhclient_ variables had no effect). the final attempt is: ===== rc.conf snippet begins ===== ifconfig_sk0="DHCP" defaultroute_delay="0" ===== rc.conf snippet ends ===== this configuration works, ie., during the boot process, there is no idling related to waiting for a DHCP server to reply. but this configuration looks hacky. so what is the RIGHT(TM) way to configure the boot process not to idle much in case of a slow DHCP server, and why? i ask this question partially because there is an rc.conf option background_dhclient (also, background_dhclient_), which doesn't seem to do anything, though it should, since it exists (either that, or the option should be removed). (there has been a recent discussion on the freebsd-current list about rc.d parallelization; [reason for CCing:] could recent rc.d changes have made the background_dhclient option useless?) i'd like to have an in-depth explanation on what effect should any combination of the following options should have on the boot process: defaultroute_delay="0", background_dhclient="YES", synchronous_dhclient="YES". (for example, using both background_dhclient="YES" and synchronous_dhclient="YES" seems stupid; i need a clarification if that's not the case.) what's the explanation if there is more than 1 network card (all of which are to have IP addresses assigned via DHCP)? From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 20:02:38 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 591AE106566B; Wed, 6 Jul 2011 20:02:38 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id F1BF28FC13; Wed, 6 Jul 2011 20:02:37 +0000 (UTC) Received: by vxg33 with SMTP id 33so283558vxg.13 for ; Wed, 06 Jul 2011 13:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VRM9TyKj0tHdxSvPRWgtKeMdG/5PSY0QABr7c+voTtQ=; b=bvnCamJlti6WHtEfo5HS4fm73Q6194PU/LyUKO6hD3rkxoYzZ6N5Zf/tyovyA5ptwH YjbioyTbNGVqpyTIfbQy0gCObKsmkFEm5kyLjdnydnh+6yUHi1Id8Fb2hOdlsYzN4TJ9 rNLPy+EecD5T4SEL83fIGfFMAsabq3hrVdL2U= MIME-Version: 1.0 Received: by 10.220.7.79 with SMTP id c15mr810vcc.3.1309982556290; Wed, 06 Jul 2011 13:02:36 -0700 (PDT) Received: by 10.220.92.201 with HTTP; Wed, 6 Jul 2011 13:02:36 -0700 (PDT) In-Reply-To: References: <44k4byunz2.fsf@lowell-desk.lan> Date: Wed, 6 Jul 2011 13:02:36 -0700 Message-ID: From: Garrett Cooper To: "deeptech71@gmail.com" Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: what is the RIGHT(TM) way to configure background DHCP? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 20:02:38 -0000 On Wed, Jul 6, 2011 at 12:47 PM, deeptech71@gmail.com wrote: > (i intend the discussion to take place primarily on the > freebsd-hackers list, i'm CCing the freebsd-current list for a reason > stated below.) > > (original first post: > http://lists.freebsd.org/pipermail/freebsd-questions/2011-June/231301.html) > > On Mon, Jul 4, 2011 at 4:20 PM, Lowell Gilbert wrote: >> You might want to try rewording your question, because it didn't make >> any sense the first time. > > very well. though the question should have made perfect sense the first time. > >> [All of your examples were commented out, so >> it was no surprise that they didn't work.] > > i chose to use # characters to separate rc.conf snippets from the > other sentences i wrote. though perhaps #s were an unfortunate choice, > because a # has a comment-begins-here meaning in rc.conf. in any case, > "attempt 1" and "attempt 2" didn't work, but "attempt 3" did work, and > that rules out the use of # for comments in rc.conf. now i will use > "===== rc.conf snippet begins =====" and "===== rc.conf snippet ends > =====" instead of # characters. > >> I considered trying to use my chrystal ball to guess that you needed >> "SYNCDHCP" in your interface config, but you had obviously read the >> manual for rc.conf(5), so that seemed unlikely... > > and "SYNCDHCP" makes things even worse. (i have no idea what > "SYNCDHCP" is supposed to do, but in my experience:) "SYNCDHCP" makes > the boot process wait until DHCP server replies before proceeding. > "SYNCDHCP" is actually almost the same as "DHCP", except that > "SYNCDHCP" waits indefinitely, while "DHCP" waits for at most > defaultroute_delay, and also, "DHCP" gets "Starting network: lo0 sk0. > " printed *before* the IP address > assignment process starts, while "SYNCDHCP" gets "Starting network: > lo0 sk0. " printed *after* the IP > address assignment process finishes. > > so here is the question rephrased: > > the boot process of my FreeBSD machines takes a relatively long time. > it spends 30 seconds idling at some point, because my network > interface (sk0) is supposed to have an IP address assigned via DHCP, > and the DHCP server on my LAN takes an extremely long time (~40 > seconds) to reply to IP address requests. this is unacceptable for me; > i want the FreeBSD boot process to finish 30 seconds earlier, even if > i won't get the chance to use the network for ~40 seconds after the > booting has finished. > > this was the actual case when my rc.conf had the following options > related to network interfaces: > ===== rc.conf snippet begins ===== > ifconfig_sk0="DHCP" > ===== rc.conf snippet ends ===== > > it took me 3 rc.conf configuration attempts to find a configuration in > which the boot process does not idle for 30 seconds. > > the following was the first attempt: > ===== rc.conf snippet begins ===== > background_dhclient="YES" > background_dhclient_sk0="YES" > ===== rc.conf snippet ends ===== > with this configuration, the DHCP client isn't even started. ie., the > boot process does not idle at all (that's good!), but the network > interface will never receive an IP address automatically (that's very > bad!). > > here is the second attempt: > ===== rc.conf snippet begins ===== > ifconfig_sk0="DHCP" > background_dhclient="YES" > background_dhclient_sk0="YES" > ===== rc.conf snippet ends ===== > with this configuration, the DHCP client is started, but the boot > process still idles for 30 seconds at some point (as if the > background_dhclient and background_dhclient_ variables had no > effect). > > the final attempt is: > ===== rc.conf snippet begins ===== > ifconfig_sk0="DHCP" > defaultroute_delay="0" > ===== rc.conf snippet ends ===== > this configuration works, ie., during the boot process, there is no > idling related to waiting for a DHCP server to reply. but this > configuration looks hacky. > > so what is the RIGHT(TM) way to configure the boot process not to idle > much in case of a slow DHCP server, and why? > > i ask this question partially because there is an rc.conf option > background_dhclient (also, background_dhclient_), which doesn't > seem to do anything, though it should, since it exists (either that, > or the option should be removed). (there has been a recent discussion > on the freebsd-current list about rc.d parallelization; [reason for > CCing:] could recent rc.d changes have made the background_dhclient > option useless?) > > i'd like to have an in-depth explanation on what effect should any > combination of the following options should have on the boot process: > defaultroute_delay="0", background_dhclient="YES", > synchronous_dhclient="YES". (for example, using both > background_dhclient="YES" and synchronous_dhclient="YES" seems stupid; > i need a clarification if that's not the case.) what's the explanation > if there is more than 1 network card (all of which are to have IP > addresses assigned via DHCP)? Hi, You'll need ifconfig_sk0="DHCP" in order to get dhclient to work. Nothing more, nothing less. The rest of the variables just seem redundant to me (sans background_dhclient vs synchronous_dhclient, but it seems like that should be streamlined to one variable instead of being two anyhow as they're mutually exclusive options that should be fed into dhclient). I recommend bringing this up with rc@ because this is just inefficient and misleading. Look through /etc/network.subr // /etc/rc.d/dhclient if you're curious and capable of reading sh -- it's straightforward what's going on -- it's just that the method for doing it isn't clearcut and straightforward, and it looks like things need to be weedwacked a bit in that section of code. Thanks, -Garrett PS Please don't cross-post ;). From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 6 21:20:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 838BB106564A; Wed, 6 Jul 2011 21:20:35 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCC78FC12; Wed, 6 Jul 2011 21:20:34 +0000 (UTC) Received: by ywf7 with SMTP id 7so178391ywf.13 for ; Wed, 06 Jul 2011 14:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=81mb205TKuKWWVyA4HcldagJU8bhlumU0TQ+0I5foxU=; b=m2OX1XBouw1Uy/TJ9MLR8v+N5GqvFcdDh2zaaIYVdZ047J4L+cC9g1fxvVPdp6VoFn VzYoJahkWg8sYMtUplF2Q43D8fK8XfTxZZ62eWBOZqtRs8E0OXhlu7JIqMkXMEoMr6cT p74NvFRuvHsgwCicn2CChCE3mMvJwRIgiNdSo= MIME-Version: 1.0 Received: by 10.91.201.26 with SMTP id d26mr284873agq.97.1309985887388; Wed, 06 Jul 2011 13:58:07 -0700 (PDT) Received: by 10.90.15.24 with HTTP; Wed, 6 Jul 2011 13:58:07 -0700 (PDT) In-Reply-To: References: <44k4byunz2.fsf@lowell-desk.lan> Date: Wed, 6 Jul 2011 13:58:07 -0700 Message-ID: From: Freddie Cash To: "deeptech71@gmail.com" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: what is the RIGHT(TM) way to configure background DHCP? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jul 2011 21:20:35 -0000 On Wed, Jul 6, 2011 at 12:47 PM, deeptech71@gmail.com wrote: > the boot process of my FreeBSD machines takes a relatively long time. > it spends 30 seconds idling at some point, because my network > interface (sk0) is supposed to have an IP address assigned via DHCP, > and the DHCP server on my LAN takes an extremely long time (~40 > seconds) to reply to IP address requests. this is unacceptable for me; > i want the FreeBSD boot process to finish 30 seconds earlier, even if > i won't get the chance to use the network for ~40 seconds after the > booting has finished. > The simplest method would be to put into /etc/rc.conf: ifconfig_sk0="up" Then into /etc/rc.local: dhclient sk0 & That would bring your interface "up" during the boot process, then manually fire off dhclient once the normal boot process has ended (right before the login prompt appears) as a background process. By the time you login, the IP should be assigned. As for what's "the correct way" to do this via just rc.conf, I'll leave that up to others more "in the know" about how RC works. -- Freddie Cash fjwcash@gmail.com From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 09:33:54 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0C1D106566B; Thu, 7 Jul 2011 09:33:54 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 947F38FC1E; Thu, 7 Jul 2011 09:33:54 +0000 (UTC) Received: by pvg11 with SMTP id 11so384213pvg.13 for ; Thu, 07 Jul 2011 02:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=0o+wQ3PKJm12eiOFUEyfH6JVKJaKdOUUyP1Fkhq9Ms8=; b=U5xvgx9zz1wrXPeiGJfD9YkRzCsPgCfjEC/341i5BunXA/SOXmkAf+QTK12Q8R6z9U VAOQ/K/6FuC6zCMu9EPWAI2dAD/ewTUPCCLjZDPN2L3Wz+Xph9om/aiyjwXk8VIDevfw bq0JLx+vgWAT5ncTGSaxPu/2rG5zhQDVY2Dmk= MIME-Version: 1.0 Received: by 10.68.17.232 with SMTP id r8mr903996pbd.91.1310031233758; Thu, 07 Jul 2011 02:33:53 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Thu, 7 Jul 2011 02:33:53 -0700 (PDT) Date: Thu, 7 Jul 2011 11:33:53 +0200 X-Google-Sender-Auth: qGnljVqgjmsb_-AggDxNkaj-dTQ Message-ID: From: Robert Millan To: freebsd-hackers@freebsd.org, Ed Maste Content-Type: multipart/mixed; boundary=bcaec520e99355367704a7776a02 Cc: debian-hurd@lists.debian.org Subject: [PATCH] avoid assuming MAXPATHLEN in config(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 09:33:54 -0000 --bcaec520e99355367704a7776a02 Content-Type: text/plain; charset=UTF-8 config(8) assumes MAXPATHLEN is defined in a few places, but presence of this macro isn't garanteed (POSIX says that it is only present when a file length limit exists, which may not be the case). This patch fixes a usr.sbin/config compile problem on Debian GNU/Hurd by using dynamic allocation. Doing so also reduces its memory footprint and safeguards against possible error conditions when zero-length pathnames are used. -- Robert Millan --bcaec520e99355367704a7776a02 Content-Type: text/plain; charset=US-ASCII; name="config_maxpathlen.diff" Content-Disposition: attachment; filename="config_maxpathlen.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gptioq3a0 SW5kZXg6IHVzci5zYmluL2NvbmZpZy9ta29wdGlvbnMuYwo9PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSB1c3Iuc2Jp bi9jb25maWcvbWtvcHRpb25zLmMJKHJldmlzaW9uIDIyMzc5MikKKysrIHVzci5zYmluL2NvbmZp Zy9ta29wdGlvbnMuYwkod29ya2luZyBjb3B5KQpAQCAtMjkwLDIyICsyOTAsMjEgQEAKIHN0YXRp YyBjaGFyICoKIHRvb3B0aW9uKGNoYXIgKm5hbWUpCiB7Ci0Jc3RhdGljIGNoYXIgaGJ1ZltNQVhQ QVRITEVOXTsKLQljaGFyIG5idWZbTUFYUEFUSExFTl07CisJY2hhciAqbmJ1ZjsKIAlzdHJ1Y3Qg b3B0X2xpc3QgKnBvOwogCiAJLyogImNhbm5vdCBoYXBwZW4iPyAgdGhlIG90YWIgbGlzdCBzaG91 bGQgYmUgY29tcGxldGUuLiAqLwotCSh2b2lkKXN0cmxjcHkobmJ1ZiwgIm9wdGlvbnMuaCIsIHNp emVvZihuYnVmKSk7CisJbmJ1ZiA9IHN0cmR1cCgib3B0aW9ucy5oIik7CiAKIAlTTElTVF9GT1JF QUNIKHBvLCAmb3RhYiwgb19uZXh0KSB7CiAJCWlmIChlcShwby0+b19uYW1lLCBuYW1lKSkgewot CQkJc3RybGNweShuYnVmLCBwby0+b19maWxlLCBzaXplb2YobmJ1ZikpOworCQkJZnJlZShuYnVm KTsKKwkJCW5idWYgPSBzdHJkdXAocG8tPm9fZmlsZSk7CiAJCQlicmVhazsKIAkJfQogCX0KIAot CSh2b2lkKXN0cmxjcHkoaGJ1ZiwgcGF0aChuYnVmKSwgc2l6ZW9mKGhidWYpKTsKLQlyZXR1cm4g KGhidWYpOworCXJldHVybiAobmJ1Zik7CiB9CiAKIAkKQEAgLTM2Myw3ICszNjIsNyBAQAogewog CUZJTEUgKmZwOwogCWNoYXIgKndkLCAqdGhpcywgKnZhbDsKLQljaGFyIGdlbm9wdFtNQVhQQVRI TEVOXTsKKwljaGFyICpnZW5vcHQgPSBOVUxMOwogCiAJZnAgPSBmb3BlbihmbmFtZSwgInIiKTsK IAlpZiAoZnAgPT0gMCkKQEAgLTM4Nyw3ICszODYsNyBAQAogCQkJCWV4aXQoMSk7CiAJCQl9CiAJ CQljaGFyICpzID0gbnModGhpcyk7Ci0JCQkodm9pZClzbnByaW50ZihnZW5vcHQsIHNpemVvZihn ZW5vcHQpLCAib3B0XyVzLmgiLAorCQkJKHZvaWQpYXNwcmludGYoJmdlbm9wdCwgIm9wdF8lcy5o IiwKIAkJCSAgICBsb3dlcihzKSk7CiAJCQl2YWwgPSBnZW5vcHQ7CiAJCQlmcmVlKHMpOwpAQCAt Mzk5LDYgKzM5OCw3IEBACiAJCQl1cGRhdGVfb3B0aW9uKHRoaXMsIHZhbCwgZmxhZ3MpOwogCX0K IAkodm9pZClmY2xvc2UoZnApOworCWZyZWUoZ2Vub3B0KTsKIAlyZXR1cm4gKDEpOwogfQogCkBA IC00MDgsMTYgKzQwOCwxNyBAQAogc3RhdGljIHZvaWQKIHJlYWRfb3B0aW9ucyh2b2lkKQogewot CWNoYXIgZm5hbWVbTUFYUEFUSExFTl07CisJY2hhciAqZm5hbWUgPSBOVUxMOwogCiAJU0xJU1Rf SU5JVCgmb3RhYik7CiAJcmVhZF9vcHRpb25fZmlsZSgiLi4vLi4vY29uZi9vcHRpb25zIiwgMCk7 Ci0JKHZvaWQpc25wcmludGYoZm5hbWUsIHNpemVvZiBmbmFtZSwgIi4uLy4uL2NvbmYvb3B0aW9u cy4lcyIsCisJKHZvaWQpYXNwcmludGYoJmZuYW1lLCAiLi4vLi4vY29uZi9vcHRpb25zLiVzIiwK IAkgICAgbWFjaGluZW5hbWUpOwogCWlmICghcmVhZF9vcHRpb25fZmlsZShmbmFtZSwgMCkpIHsK LQkJKHZvaWQpc25wcmludGYoZm5hbWUsIHNpemVvZiBmbmFtZSwgIm9wdGlvbnMuJXMiLCBtYWNo aW5lbmFtZSk7CisJCSh2b2lkKWFzcHJpbnRmKCZmbmFtZSwgIm9wdGlvbnMuJXMiLCBtYWNoaW5l bmFtZSk7CiAJCXJlYWRfb3B0aW9uX2ZpbGUoZm5hbWUsIDApOwogCX0KKwlmcmVlKGZuYW1lKTsK IAlyZWFkX29wdGlvbl9maWxlKCIuLi8uLi9jb25mL29wdGlvbnMtY29tcGF0IiwgT0xfQUxJQVMp OwogfQogCkluZGV4OiB1c3Iuc2Jpbi9jb25maWcvbWFpbi5jCj09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHVzci5z YmluL2NvbmZpZy9tYWluLmMJKHJldmlzaW9uIDIyMzc5MikKKysrIHVzci5zYmluL2NvbmZpZy9t YWluLmMJKHdvcmtpbmcgY29weSkKQEAgLTcxLDggKzcxLDggQEAKICNkZWZpbmUJQ0RJUgkiLi4v Y29tcGlsZS8iCiAKIGNoYXIgKglQUkVGSVg7Ci1jaGFyIAlkZXN0ZGlyW01BWFBBVEhMRU5dOwot Y2hhciAJc3JjZGlyW01BWFBBVEhMRU5dOworY2hhciAqCWRlc3RkaXI7CitjaGFyICoJc3JjZGly OwogCiBpbnQJZGVidWdnaW5nOwogaW50CXByb2ZpbGluZzsKQEAgLTEyMiw4ICsxMjIsOCBAQAog CQkJcHJpbnRtYWNoaW5lID0gMTsKIAkJCWJyZWFrOwogCQljYXNlICdkJzoKLQkJCWlmICgqZGVz dGRpciA9PSAnXDAnKQotCQkJCXN0cmxjcHkoZGVzdGRpciwgb3B0YXJnLCBzaXplb2YoZGVzdGRp cikpOworCQkJaWYgKGRlc3RkaXIgPT0gTlVMTCkKKwkJCQlkZXN0ZGlyID0gc3RyZHVwKG9wdGFy Zyk7CiAJCQllbHNlCiAJCQkJZXJyeChFWElUX0ZBSUxVUkUsICJkaXJlY3RvcnkgYWxyZWFkeSBz ZXQiKTsKIAkJCWJyZWFrOwpAQCAtMTY1LDE0ICsxNjUsMTMgQEAKIAkJCWVycigyLCAiJXMiLCBQ UkVGSVgpOwogCQl5eWZpbGUgPSBQUkVGSVg7CiAJfQotCWlmICgqZGVzdGRpciAhPSAnXDAnKSB7 CisJaWYgKGRlc3RkaXIgIT0gTlVMTCkgewogCQlsZW4gPSBzdHJsZW4oZGVzdGRpcik7CiAJCXdo aWxlIChsZW4gPiAxICYmIGRlc3RkaXJbbGVuIC0gMV0gPT0gJy8nKQogCQkJZGVzdGRpclstLWxl bl0gPSAnXDAnOwogCQlnZXRfc3JjZGlyKCk7CiAJfSBlbHNlIHsKLQkJc3RybGNweShkZXN0ZGly LCBDRElSLCBzaXplb2YoZGVzdGRpcikpOwotCQlzdHJsY2F0KGRlc3RkaXIsIFBSRUZJWCwgc2l6 ZW9mKGRlc3RkaXIpKTsKKwkJKHZvaWQpIGFzcHJpbnRmKCZkZXN0ZGlyLCBDRElSICIlcyIsIFBS RUZJWCk7CiAJfQogCiAJU0xJU1RfSU5JVCgmY3B1dHlwZSk7CkBAIC0yMjksNiArMjI4LDE5IEBA CiAJZXhpdCgwKTsKIH0KIAorI2lmbmRlZiBfX0dMSUJDX18KK3N0YXRpYyBjaGFyICoKK2Nhbm9u aWNhbGl6ZV9maWxlX25hbWUoY29uc3QgY2hhciAqcGF0aG5hbWUpCit7CisJY2hhciAqcmV0ID0g bWFsbG9jKE1BWFBBVEhMRU4pOworCWlmIChyZWFscGF0aChwYXRobmFtZSwgcmV0KSA9PSBOVUxM KSB7CisJCWZyZWUocmV0KTsKKwkJcmV0ID0gTlVMTDsKKwl9CisJcmV0dXJuIHJldDsKK30KKyNl bmRpZgorCiAvKgogICogZ2V0X3NyY2RpcgogICoJZGV0ZXJtaW5lIHRoZSByb290IG9mIHRoZSBr ZXJuZWwgc291cmNlIHRyZWUKQEAgLTI0MSw3ICsyNTMsOSBAQAogCWNoYXIgKnAsICpwd2Q7CiAJ aW50IGk7CiAKLQlpZiAocmVhbHBhdGgoIi4uLy4uIiwgc3JjZGlyKSA9PSBOVUxMKQorCWlmIChz cmNkaXIgIT0gTlVMTCkKKwkJZnJlZShzcmNkaXIpOworCWlmICgoc3JjZGlyID0gY2Fub25pY2Fs aXplX2ZpbGVfbmFtZSgiLi4vLi4iKSkgPT0gTlVMTCkKIAkJZXJyKEVYSVRfRkFJTFVSRSwgIlVu YWJsZSB0byBmaW5kIHJvb3Qgb2Ygc291cmNlIHRyZWUiKTsKIAlpZiAoKHB3ZCA9IGdldGVudigi UFdEIikpICE9IE5VTEwgJiYgKnB3ZCA9PSAnLycgJiYKIAkgICAgKHB3ZCA9IHN0cmR1cChwd2Qp KSAhPSBOVUxMKSB7CkBAIC0yNTQsOSArMjY4LDEyIEBACiAJCQkqcCA9ICdcMCc7CiAJCX0KIAkJ aWYgKHN0YXQocHdkLCAmbGcpICE9IC0xICYmIHN0YXQoc3JjZGlyLCAmcGh5KSAhPSAtMSAmJgot CQkgICAgbGcuc3RfZGV2ID09IHBoeS5zdF9kZXYgJiYgbGcuc3RfaW5vID09IHBoeS5zdF9pbm8p Ci0JCQlzdHJsY3B5KHNyY2RpciwgcHdkLCBNQVhQQVRITEVOKTsKLQkJZnJlZShwd2QpOworCQkg ICAgbGcuc3RfZGV2ID09IHBoeS5zdF9kZXYgJiYgbGcuc3RfaW5vID09IHBoeS5zdF9pbm8pIHsK KwkJCWZyZWUoc3JjZGlyKTsKKwkJCXNyY2RpciA9IHB3ZDsKKwkJfSBlbHNlIHsKKwkJCWZyZWUo cHdkKTsKKwkJfQogCX0KIH0KIApJbmRleDogdXNyLnNiaW4vY29uZmlnL21rbWFrZWZpbGUuYwo9 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09Ci0tLSB1c3Iuc2Jpbi9jb25maWcvbWttYWtlZmlsZS5jCShyZXZpc2lvbiAyMjM3 OTIpCisrKyB1c3Iuc2Jpbi9jb25maWcvbWttYWtlZmlsZS5jCSh3b3JraW5nIGNvcHkpCkBAIC0z MDQsOSArMzA0LDkgQEAKIH0KIAogc3RhdGljIHZvaWQKLXJlYWRfZmlsZShjaGFyICpmbmFtZSkK K3JlYWRfZmlsZShjb25zdCBjaGFyICpmbmFtZSkKIHsKLQljaGFyIGlmbmFtZVtNQVhQQVRITEVO XTsKKwljaGFyICppZm5hbWUgPSBOVUxMOwogCUZJTEUgKmZwOwogCXN0cnVjdCBmaWxlX2xpc3Qg KnRwOwogCXN0cnVjdCBkZXZpY2UgKmRwOwpAQCAtMzQ5LDggKzM0OSw5IEBACiAJCQkgICAgZm5h bWUpOwogCQkJZXhpdCgxKTsKIAkJfQotCQkodm9pZCkgc25wcmludGYoaWZuYW1lLCBzaXplb2Yo aWZuYW1lKSwgIi4uLy4uLyVzIiwgd2QpOworCQkodm9pZCkgYXNwcmludGYoJmlmbmFtZSwgIi4u Ly4uLyVzIiwgd2QpOwogCQlyZWFkX2ZpbGUoaWZuYW1lKTsKKwkJZnJlZShpZm5hbWUpOwogCQl3 aGlsZSAoKCh3ZCA9IGdldF93b3JkKGZwKSkgIT0gKGNoYXIgKilFT0YpICYmIHdkKQogCQkJOwog CQlnb3RvIG5leHQ7CkBAIC01NTksMTQgKzU2MCwxMyBAQAogc3RhdGljIHZvaWQKIHJlYWRfZmls ZXModm9pZCkKIHsKLQljaGFyIGZuYW1lW01BWFBBVEhMRU5dOworCWNoYXIgKmZuYW1lID0gTlVM TDsKIAlzdHJ1Y3QgZmlsZXNfbmFtZSAqbmwsICp0bmw7CiAJCi0JKHZvaWQpIHNucHJpbnRmKGZu YW1lLCBzaXplb2YoZm5hbWUpLCAiLi4vLi4vY29uZi9maWxlcyIpOworCXJlYWRfZmlsZSgiLi4v Li4vY29uZi9maWxlcyIpOworCSh2b2lkKSBhc3ByaW50ZigmZm5hbWUsICIuLi8uLi9jb25mL2Zp bGVzLiVzIiwgbWFjaGluZW5hbWUpOwogCXJlYWRfZmlsZShmbmFtZSk7Ci0JKHZvaWQpIHNucHJp bnRmKGZuYW1lLCBzaXplb2YoZm5hbWUpLAotCQkgICAgICAgCSIuLi8uLi9jb25mL2ZpbGVzLiVz IiwgbWFjaGluZW5hbWUpOwotCXJlYWRfZmlsZShmbmFtZSk7CisJZnJlZShmbmFtZSk7CiAJZm9y IChubCA9IFNUQUlMUV9GSVJTVCgmZm50YWIpOyBubCAhPSBOVUxMOyBubCA9IHRubCkgewogCQly ZWFkX2ZpbGUobmwtPmZfbmFtZSk7CiAJCXRubCA9IFNUQUlMUV9ORVhUKG5sLCBmX25leHQpOwpJ bmRleDogdXNyLnNiaW4vY29uZmlnL2NvbmZpZy5oCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHVzci5zYmluL2Nv bmZpZy9jb25maWcuaAkocmV2aXNpb24gMjIzNzkyKQorKysgdXNyLnNiaW4vY29uZmlnL2NvbmZp Zy5oCSh3b3JraW5nIGNvcHkpCkBAIC0xOTksNyArMTk5LDcgQEAKIGV4dGVybiBpbnQJbWF4dXNl cnM7CiAKIGV4dGVybiBjaGFyICpQUkVGSVg7CQkvKiBDb25maWcgZmlsZSBuYW1lIC0gZm9yIGVy cm9yIG1lc3NhZ2VzICovCi1leHRlcm4gY2hhciBzcmNkaXJbXTsJCS8qIHJvb3Qgb2YgdGhlIGtl cm5lbCBzb3VyY2UgdHJlZSAqLworZXh0ZXJuIGNoYXIgKnNyY2RpcjsJCS8qIHJvb3Qgb2YgdGhl IGtlcm5lbCBzb3VyY2UgdHJlZSAqLwogCiAjZGVmaW5lIGVxKGEsYikJKCFzdHJjbXAoYSxiKSkK ICNkZWZpbmUgbnMocykJc3RyZHVwKHMpCg== --bcaec520e99355367704a7776a02-- From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 10:01:27 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5628106566B; Thu, 7 Jul 2011 10:01:27 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 72DFD8FC1A; Thu, 7 Jul 2011 10:01:27 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 664392A29125; Thu, 7 Jul 2011 12:01:23 +0200 (CEST) Date: Thu, 7 Jul 2011 12:01:23 +0200 From: Ed Schouten To: Robert Millan Message-ID: <20110707100123.GF71453@hoeg.nl> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lhhpAkuygu+L0poz" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Ed Maste , debian-hurd@lists.debian.org Subject: Re: [PATCH] avoid assuming MAXPATHLEN in config(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 10:01:27 -0000 --lhhpAkuygu+L0poz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Robert, * Robert Millan , 20110707 11:33: > config(8) assumes MAXPATHLEN is defined in a few places, but presence > of this macro isn't garanteed (POSIX says that it is only present when > a file length limit exists, which may not be the case). Even though it is good to make our code conform to standards as much as possible, do keep in mind that your patch also causes a lot of regressions in that area. The code now uses asprintf(), which is not part of POSIX. I also think the use of __GLIBC__ is frowned upon. --=20 Ed Schouten WWW: http://80386.nl/ --lhhpAkuygu+L0poz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQIcBAEBAgAGBQJOFYPzAAoJEG5e2P40kaK7YiIP/ie9qFToGbLx+QBkwFBe+gFX Bi/1R+SbZGANHWD531SJpx/fXoH9moX1QG+Hv4yUJOVxE/vQRQ+KbmDpA7gGuQ3h W9d3T53sooJxQcXc6bD8gUDOIPzDibDSVqo/o9z5g/x7EV7Si5GgdELlDNClvqDH XnSipBaDIZvgLn7klsncLO3h2C369ctBcBTBZ+pBx4T7MWJRYc9kSH7Jo7cK8Q+t O59rldyHCLJhd8//w1fOi2GToaZJT3DlqExtNHU3RfjHVHR0SFhghJR+5CtdA5jp xMzzMz7l7RflVI38KGTn+kIZqScdso/vZIVMl/OhrT0KoM43lt29+sSrJewX3hlV a8zLWbh+ktRy4B1FauGCSm5Cfq2P5xiCNRXM7KqyqeKTxZhqGJvEvbVXtAFJ034I V/GlOhodBsdjELfM/VpSzAyj1lJ27oSJB9LR1p1BDLylBDrgrGdtnZPs8Zz8iyWf 2FbtFUXR25TQ44NlbLktbAxIUEJItRPd3VPUVr3RxUmHxjUtFx3QZb8VBjuOJZzH +IJ/a/6uGxb9wGUtN/YD5Ex3dsP89JYiV+ar4Bm3bJ+4PKiRb2hU5V7qzJU3+5Cp mBbbdrlHV5I9OaIsaoqleXd43PePZyH20cqXqWCTOvr+DkJakIRi+TDZTDuELrnV +JTlQISWbQTS679FFqzf =vhBk -----END PGP SIGNATURE----- --lhhpAkuygu+L0poz-- From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 10:37:03 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2457106564A for ; Thu, 7 Jul 2011 10:37:03 +0000 (UTC) (envelope-from krivenok.dmitry@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 43F5D8FC12 for ; Thu, 7 Jul 2011 10:37:03 +0000 (UTC) Received: by bwa20 with SMTP id 20so1073120bwa.13 for ; Thu, 07 Jul 2011 03:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=imD9TmAWFOlYSC0JbG8krKmELsBLpIqU5k8ttmel0to=; b=bzoL8UJBgKcmT8nqqa4q+dzTyEOBH3MZQHO5YX0KqDhkBjduz7q4zI77e9a+jITqLZ v3VxiuQUvmFqII9UrHWMULIXQfFWd1/7Vhkrmdp2oUhk4lIx/FD/wesc6zjV/68NJUvK AmqObvkg2EDR22U2i4vEATXTUtsYg9+D1pid8= MIME-Version: 1.0 Received: by 10.204.19.10 with SMTP id y10mr535156bka.190.1310035022050; Thu, 07 Jul 2011 03:37:02 -0700 (PDT) Received: by 10.204.42.65 with HTTP; Thu, 7 Jul 2011 03:37:02 -0700 (PDT) Date: Thu, 7 Jul 2011 14:37:02 +0400 Message-ID: From: Dmitry Krivenok To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: pri_to_rtp returns invalid initial priority X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 10:37:03 -0000 Hi Hackers, I've developed a simple kld which demonstrates a problem I found on my FreeBSD-8.2. ///////////////////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static struct sema sem; /* ###########################################################################*/ static void set_prio( struct thread *td, u_short type, u_short prio) { struct rtprio rtp; int r; rtp.type = type; rtp.prio = prio; r = rtp_to_pri(&rtp, td); if (r != 0) printf("Unable to set priority of type %u to %u (error code: %d).\n", type, prio, r); } /* ###########################################################################*/ static void print_prio( struct thread *td, const char *prefix) { struct rtprio rtp; pri_to_rtp(td, &rtp); printf("%s priority: %u, type: %u.\n", prefix, rtp.prio, rtp.type); } /* ###########################################################################*/ static void set_and_print( struct thread *td, u_short type, u_short prio, const char *prefix) { set_prio(td, type, prio); print_prio(td, prefix); } /* ###########################################################################*/ static void kthread_run( void) { struct thread *td = curthread; sema_wait(&sem); print_prio(td, "[NEW] Initial TS"); set_and_print(td, RTP_PRIO_NORMAL, PRI_MIN_TIMESHARE - PRI_MIN_TIMESHARE, "[NEW] Min TS"); set_and_print(td, RTP_PRIO_NORMAL, (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) / 2, "[NEW] Mid TS"); set_and_print(td, RTP_PRIO_NORMAL, PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE, "[NEW] Max TS"); set_and_print(td, RTP_PRIO_REALTIME, RTP_PRIO_MIN - RTP_PRIO_MIN, "[NEW] Min RT"); set_and_print(td, RTP_PRIO_REALTIME, (RTP_PRIO_MAX - RTP_PRIO_MIN) / 2, "[NEW] Mid RT"); set_and_print(td, RTP_PRIO_REALTIME, RTP_PRIO_MAX - RTP_PRIO_MIN, "[NEW] Max RT"); sema_destroy(&sem); kthread_exit(); } /* ###########################################################################*/ static int event_handler( struct module *module, int event, void *arg) { if (event == MOD_LOAD) { struct kthread_desc desc; struct thread *td = curthread; desc.arg0 = "my_thr"; desc.func = kthread_run; desc.global_threadpp = NULL; sema_init(&sem, 0, "my_sem"); kthread_start(&desc); print_prio(td, "[MAIN] Initial TS"); set_and_print(td, RTP_PRIO_NORMAL, PRI_MIN_TIMESHARE - PRI_MIN_TIMESHARE, "[MAIN] Min TS"); set_and_print(td, RTP_PRIO_NORMAL, (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) / 2, "[MAIN] Mid TS"); set_and_print(td, RTP_PRIO_NORMAL, PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE, "[MAIN] Max TS"); set_and_print(td, RTP_PRIO_REALTIME, RTP_PRIO_MIN - RTP_PRIO_MIN, "[MAIN] Min RT"); set_and_print(td, RTP_PRIO_REALTIME, (RTP_PRIO_MAX - RTP_PRIO_MIN) / 2, "[MAIN] Mid RT"); set_and_print(td, RTP_PRIO_REALTIME, RTP_PRIO_MAX - RTP_PRIO_MIN, "[MAIN] Max RT"); sema_post(&sem); } if (event == MOD_UNLOAD) { } return 0; }; /* ###########################################################################*/ static moduledata_t thr_conf = { "thr", /* module name */ event_handler, /* event handler */ NULL /* extra data */ }; /* ###########################################################################*/ DECLARE_MODULE(thr, thr_conf, SI_SUB_KLD, SI_ORDER_ANY); ///////////////////////////////////////////////////////////////////////////////////////////// On FreeBSD-8.2 I get the following results: [MAIN] Initial TS priority: 65508, type: 3. [MAIN] Min TS priority: 0, type: 3. [MAIN] Mid TS priority: 31, type: 3. [MAIN] Max TS priority: 63, type: 3. [MAIN] Min RT priority: 0, type: 2. [MAIN] Mid RT priority: 15, type: 2. [MAIN] Max RT priority: 31, type: 2. [NEW] Initial TS priority: 65504, type: 3. [NEW] Min TS priority: 0, type: 3. [NEW] Mid TS priority: 31, type: 3. [NEW] Max TS priority: 63, type: 3. [NEW] Min RT priority: 0, type: 2. [NEW] Mid RT priority: 15, type: 2. [NEW] Max RT priority: 31, type: 2. [MAIN] Initial TS priority: 20, type: 3. [MAIN] Min TS priority: 0, type: 3. [MAIN] Mid TS priority: 31, type: 3. [MAIN] Max TS priority: 63, type: 3. [MAIN] Min RT priority: 0, type: 2. [MAIN] Mid RT priority: 15, type: 2. [MAIN] Max RT priority: 31, type: 2. [NEW] Initial TS priority: 65504, type: 3. [NEW] Min TS priority: 0, type: 3. [NEW] Mid TS priority: 31, type: 3. [NEW] Max TS priority: 63, type: 3. [NEW] Min RT priority: 0, type: 2. [NEW] Mid RT priority: 15, type: 2. [NEW] Max RT priority: 31, type: 2. [MAIN] Initial TS priority: 65531, type: 3. [MAIN] Min TS priority: 0, type: 3. [MAIN] Mid TS priority: 31, type: 3. [MAIN] Max TS priority: 63, type: 3. [MAIN] Min RT priority: 0, type: 2. [MAIN] Mid RT priority: 15, type: 2. [MAIN] Max RT priority: 31, type: 2. [NEW] Initial TS priority: 65504, type: 3. [NEW] Min TS priority: 0, type: 3. [NEW] Mid TS priority: 31, type: 3. [NEW] Max TS priority: 63, type: 3. [NEW] Min RT priority: 0, type: 2. [NEW] Mid RT priority: 15, type: 2. [NEW] Max RT priority: 31, type: 2. Note that initial priorities are almost always wrong (but sometimes they are okay). It looks like a negative priority was saved in rrprio.prio which is u_short. I tried my kld on FreeBSD-CURRENT but got only correct results: [MAIN] Initial TS priority: 52, type: 3. [MAIN] Min TS priority: 0, type: 3. [MAIN] Mid TS priority: 51, type: 3. [MAIN] Max TS priority: 103, type: 3. [MAIN] Min RT priority: 0, type: 2. [MAIN] Mid RT priority: 15, type: 2. [MAIN] Max RT priority: 31, type: 2. [NEW] Initial TS priority: 0, type: 3. [NEW] Min TS priority: 0, type: 3. [NEW] Mid TS priority: 51, type: 3. [NEW] Max TS priority: 103, type: 3. [NEW] Min RT priority: 0, type: 2. [NEW] Mid RT priority: 15, type: 2. [NEW] Max RT priority: 31, type: 2. [MAIN] Initial TS priority: 7, type: 3. [MAIN] Min TS priority: 0, type: 3. [MAIN] Mid TS priority: 51, type: 3. [MAIN] Max TS priority: 103, type: 3. [MAIN] Min RT priority: 0, type: 2. [MAIN] Mid RT priority: 15, type: 2. [MAIN] Max RT priority: 31, type: 2. [NEW] Initial TS priority: 0, type: 3. [NEW] Min TS priority: 0, type: 3. [NEW] Mid TS priority: 51, type: 3. [NEW] Max TS priority: 103, type: 3. [NEW] Min RT priority: 0, type: 2. [NEW] Mid RT priority: 15, type: 2. [NEW] Max RT priority: 31, type: 2. I guess either the problem was fixed in FreeBSD-CURRENT or it is still in both 8.2 and CURRENT but for some reason (e.g. race) I cannot hit it on CURRENT. The latter is unlikely (but still possible) because I run it lots of times on CURRENT: for ((i=0; i<10000; i++)) do sudo make load unload >/dev/null && dmesg | tail -n 14 | grep "MAIN.*Initial" ; done but didn't see the problem. I tried to compare priority-related stuff in 8.2 and CURRENT tries but didn't find a change which could fix that problem. Could someone more experienced in kernel programming please tell me what is wrong here? Is it a problem which was really fixed in CURRENT (when, where?) or is it a bug which doesn't show itself on my CURRENT box? Thanks in advance! P.S. In case you want to reproduce this problem please save the code above in thr.c and create the following Makefile: ######################################################## # Declare Name of kernel module KMOD = thr # Enumerate Source files for kernel module SRCS = thr.c # Include kernel module makefile .include ######################################################## Then type $ make $ sudo make load unload $ dmesg | tail -n 14 -- Sincerely yours, Dmitry V. Krivenok e-mail: krivenok.dmitry@gmail.com skype: krivenok_dmitry jabber: krivenok_dmitry@jabber.ru icq: 242-526-443 From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 11:12:03 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D46D11065670; Thu, 7 Jul 2011 11:12:03 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A8C6E8FC18; Thu, 7 Jul 2011 11:12:03 +0000 (UTC) Received: by pwi7 with SMTP id 7so759000pwi.13 for ; Thu, 07 Jul 2011 04:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BCHvDgeJYfaUCIH9k2nE4FH+PpQZJ0eyWeuPcX+v9bI=; b=bpRnDEzpz2nXYwFIjmpQ8Wpl8O/A1IdhoFUf6REwfgu7bfzm1T1vG17QMjOxOap4uS v857JtCZUWg+JB1TA+odzqqhYCmaBQq7hyfG+7ZGOE+4IRVfVt1fU07QCepaxdQ9PzgL MHpKvKeqMJ0KnoFl+lEy0mLsnuW5EE8kNA87k= MIME-Version: 1.0 Received: by 10.68.50.198 with SMTP id e6mr975749pbo.292.1310037123141; Thu, 07 Jul 2011 04:12:03 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Thu, 7 Jul 2011 04:12:03 -0700 (PDT) In-Reply-To: <20110707100123.GF71453@hoeg.nl> References: <20110707100123.GF71453@hoeg.nl> Date: Thu, 7 Jul 2011 13:12:03 +0200 X-Google-Sender-Auth: LeJUGmunHhqoi2_1Lod2HNkY0j0 Message-ID: From: Robert Millan To: Ed Schouten Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ed Maste , debian-hurd@lists.debian.org Subject: Re: [PATCH] avoid assuming MAXPATHLEN in config(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 11:12:03 -0000 2011/7/7 Ed Schouten : > * Robert Millan , 20110707 11:33: >> config(8) assumes MAXPATHLEN is defined in a few places, but presence >> of this macro isn't garanteed (POSIX says that it is only present when >> a file length limit exists, which may not be the case). > > Even though it is good to make our code conform to standards as much as > possible, do keep in mind that your patch also causes a lot of > regressions in that area. The code now uses asprintf(), which is not > part of POSIX. I also think the use of __GLIBC__ is frowned upon. Uhm... you're right. Actually I knew asprintf() is not part of POSIX, it just didn't occur to me that this contradicted my point about MAXPATHLEN [1]. As for the __GLIBC__ bit, it is difficult to handle this without a function that canonicalizes arbitrary-length pathnames. Would you prefer something like: #ifdef MAXPATHLEN // use realpath on a statically-allocated buffer #else // assume canonicalize_file_name() is present #endif [1] Btw, POSIX itself is quite contradictory too: it doesn't let you assume MAXPATHLEN, but it doesn't give you the facilities you need in case it isn't present (e.g. asprintf and canonicalize_file_name but gethostname and getline / fgetln come to mind too). -- Robert Millan From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 08:31:34 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FC28106566C for ; Thu, 7 Jul 2011 08:31:34 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4468FC15 for ; Thu, 7 Jul 2011 08:31:34 +0000 (UTC) Received: by pwi7 with SMTP id 7so657737pwi.13 for ; Thu, 07 Jul 2011 01:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=VVFzO/nY9Lh8MxM59YgXnvMtcdxwITh5tg6k9OswGow=; b=rtVPmZ5lwaGtsv+WxjK4Xua6QI4bOnq1Samj1iDywft5RGt7V0KjaXledOWtaB3Uwi pW5yQBA2kK0PcZz5hY3TncJ2t8rdQ9k6dZddo7K8J8mtl3k0r4i8vstPt5Ic04GasoTr ynLOk2sf9Zk/bocx64UNYnBkHE1Z2i3/Qh5Cg= MIME-Version: 1.0 Received: by 10.142.112.15 with SMTP id k15mr300444wfc.405.1310027493689; Thu, 07 Jul 2011 01:31:33 -0700 (PDT) Received: by 10.142.156.20 with HTTP; Thu, 7 Jul 2011 01:31:33 -0700 (PDT) In-Reply-To: <4E11ECE2.9050402@freebsd.org> References: <4E11ECE2.9050402@freebsd.org> Date: Thu, 7 Jul 2011 04:31:33 -0400 Message-ID: From: grarpamp To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Thu, 07 Jul 2011 11:16:17 +0000 Subject: Re: Jails: Setting different times in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 08:31:34 -0000 > possibly achievable in libc? I don't know. Where else would it be done? stat, utimes, gettimeofday, clock_gettime, adjtime, etc and their variations. I've not checked what currently happens, but I don't think root in a jail should be able to set any kernel time parameters, absent a syscall that says it should. > in any case file this idea somewhere.. :-) Don't know here either. I looked at the lists and hackers seemed closest. I'll bcc current. Someone could maybe todo-wiki this thread as low hanging fruit. Cheers. From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 11:17:52 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBC951065675; Thu, 7 Jul 2011 11:17:52 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 5EB2F8FC1C; Thu, 7 Jul 2011 11:17:52 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id C267A2A28D03; Thu, 7 Jul 2011 13:17:51 +0200 (CEST) Date: Thu, 7 Jul 2011 13:17:51 +0200 From: Ed Schouten To: Robert Millan Message-ID: <20110707111751.GI71453@hoeg.nl> References: <20110707100123.GF71453@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="29v4wwwYFo25Y52C" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Ed Maste , debian-hurd@lists.debian.org Subject: Re: [PATCH] avoid assuming MAXPATHLEN in config(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 11:17:53 -0000 --29v4wwwYFo25Y52C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Robert Millan , 20110707 13:12: > As for the __GLIBC__ bit, it is difficult to handle this without a > function that canonicalizes arbitrary-length pathnames. Would you > prefer something like: >=20 > #ifdef MAXPATHLEN > // use realpath on a statically-allocated buffer > #else > // assume canonicalize_file_name() is present > #endif Considering that the function is rather small anyway, why not compile it in unconditionally (though having a different name). --=20 Ed Schouten WWW: http://80386.nl/ --29v4wwwYFo25Y52C Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQIcBAEBAgAGBQJOFZXfAAoJEG5e2P40kaK75mQP/jddpVSo6+s/qW5IsvdAOGJ3 UBiGaXyxJ6pq9M7XfHeHFNfsiI3BIdVdb3Q2acRbLWerxqXUUBbxc06bEmRgFrDJ EjDxh8epcRpVMtSrztG8ILf5pcxGoyS1+d894PApZe0iujCidZEiSnSuBzfBvxg1 xCtHXz1QH56pVYBUvtR7x65GwLYUbJOA1kXkOsV6svoeMVfM2ShfB6FRoxDZtj93 4kaWw4MaDxSwEWjq99/d2GqXIe8qaCm4CTSuXEE8I1gOOpiwgiWTyIToXZhBQ43R 4/DkxAVFB9wc1BXD/qKSjsMp5SVIqKk1u9RFOhr463yWLUQaHAsWWKqmnv7a1rMa l4d0Ibk4qD6x9fpIV30+oEDdJdWUnI5uDxI2nf4PZaCj0l3b2tfptqBoa2C/yOeH s3uBuovo8MSK++MD6bIF3xbnc8p3uheIb90UugbVCSxXXL5mSwWeAlVWw7e1sS6a mKJTuHPhuMoGpoZdNGeJ5vNmAovA+UyfVIR/k+WnhQl1GIMUXW/tZWuwGPJ/0T5g WcWNMXSX3wB2b7ugij8OiyaFG38SV22HiMdE4sNG8A5WTxXEVgDMXW4sThCjcvYg V8+5ZxMY0m68YubMHFd9Rxs8OjcppJdiR4PsUqEA9KTywCRWQVcBe+IdqAErkR/7 jXjS7WoiPlxabydrxLsh =FUEQ -----END PGP SIGNATURE----- --29v4wwwYFo25Y52C-- From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 18:57:14 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9285106566C for ; Thu, 7 Jul 2011 18:57:14 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 7557D8FC0C for ; Thu, 7 Jul 2011 18:57:14 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id p67IvDuR069370 for ; Thu, 7 Jul 2011 11:57:13 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <4E160189.3020005@rawbw.com> Date: Thu, 07 Jul 2011 11:57:13 -0700 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Possible to see which requests are in queue contributing to system load? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 18:57:14 -0000 top(1) shows the load as a number supposedly equal to the resource queue length. But is there a way to detail this information? For example I want the system to log which requests to which files by which process/thread are in the queue and when they are fulfilled by the scheduler? Yuri From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 7 19:02:18 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 509CC106567D for ; Thu, 7 Jul 2011 19:02:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 268A28FC22 for ; Thu, 7 Jul 2011 19:02:18 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id BF46046B60; Thu, 7 Jul 2011 15:02:17 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4D9B38A03C; Thu, 7 Jul 2011 15:02:17 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 7 Jul 2011 14:46:54 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107071446.54447.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 07 Jul 2011 15:02:17 -0400 (EDT) Cc: Dmitry Krivenok Subject: Re: pri_to_rtp returns invalid initial priority X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2011 19:02:18 -0000 On Thursday, July 07, 2011 6:37:02 am Dmitry Krivenok wrote: > Hi Hackers, > I've developed a simple kld which demonstrates a problem I found on my > FreeBSD-8.2. Maybe revision 222802? -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 01:05:14 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 954D1106566B for ; Fri, 8 Jul 2011 01:05:14 +0000 (UTC) (envelope-from james@freedomnet.co.nz) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 556598FC16 for ; Fri, 8 Jul 2011 01:05:14 +0000 (UTC) Received: by vxg33 with SMTP id 33so1480050vxg.13 for ; Thu, 07 Jul 2011 18:05:13 -0700 (PDT) Received: by 10.52.75.2 with SMTP id y2mr1992562vdv.307.1310085558062; Thu, 07 Jul 2011 17:39:18 -0700 (PDT) Received: from new-host.home (pool-108-7-70-195.bstnma.fios.verizon.net [108.7.70.195]) by mx.google.com with ESMTPS id i8sm2973818vby.23.2011.07.07.17.39.17 (version=SSLv3 cipher=OTHER); Thu, 07 Jul 2011 17:39:17 -0700 (PDT) Message-ID: <4E1651B4.9050103@freedomnet.co.nz> Date: Thu, 07 Jul 2011 20:39:16 -0400 From: James Jones User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: mips xlr system for direct compiling X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 01:05:14 -0000 I have been working on cross compiling some software for MIPS XLR. I found it would be quicker if I direct compile. Can some one recommend a MIPS XLR system that I could have at home for doing some development work on? Or is the possible compiler farm I might get access to . From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 03:42:22 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B586A106564A for ; Fri, 8 Jul 2011 03:42:22 +0000 (UTC) (envelope-from webmaster@kibab.com) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 65D3B8FC18 for ; Fri, 8 Jul 2011 03:42:22 +0000 (UTC) Received: from kibab-darwin.local (95-26-230-106.broadband.corbina.ru [95.26.230.106]) by mx0.deglitch.com (Postfix) with ESMTPSA id A0A4D8FC2D; Fri, 8 Jul 2011 07:42:17 +0400 (MSD) Message-ID: <4E167C94.70300@kibab.com> Date: Fri, 08 Jul 2011 07:42:12 +0400 From: Ilya Bakulin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ru; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 1.1.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD3767EDBEB3864393338BB2F" Cc: "Robert N. M. Watson" , Jonathan Anderson , Ben Laurie Subject: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 03:42:22 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD3767EDBEB3864393338BB2F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi hackers, As a part of ongoing effort to enhance usage of Capsicum in FreeBSD base system, I want to ask you, which applications in the base system should receive sandboxing support. So far, the following applications were sandboxed during initial Capsicum research project: sshd: critical system service run by root; gzip: utility that operates with potentially buggy compression code tcpdump: contains complex packet-parsing code, run by root; I have added sandboxing to syslogd, because this is also a critical system service run by root. I'm also going to add sandboxing to xz (compression algorithms) and ntpd (critical system service run by root). The question is: which applications should also be processed? I think that the most wanted candidates are SUID programs and/or popular network daemons. But looking at gzip example I also think about text-processing tools in general. At the moment I prefer not to focus on applications that are used only on desktop system -- primary usage of FreeBSD is ultra-reliable serving platform, although iXSystems guys may correct me :-) --=20 Regards, Ilya Bakulin http://kibab.com xmpp://kibab612@jabber.ru --------------enigD3767EDBEB3864393338BB2F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4WfJkACgkQo9vlj1oadwjDRACfajS6Nb6+Kn+6RWmguVVdHC6S wlIAoJrwKr9tlxl3BL50sizKFlFLerm+ =OBXp -----END PGP SIGNATURE----- --------------enigD3767EDBEB3864393338BB2F-- From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 04:25:29 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF936106566B for ; Fri, 8 Jul 2011 04:25:29 +0000 (UTC) (envelope-from mattjeet@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6F9E38FC08 for ; Fri, 8 Jul 2011 04:25:28 +0000 (UTC) Received: by bwa20 with SMTP id 20so1942013bwa.13 for ; Thu, 07 Jul 2011 21:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Y84w8gpc0SsNvPt2TXTwJPjsTQmGdh1Bot7mK/TmOxE=; b=wFoVk1wvu4g87Uxz2Ncie52MyVUh9K0gHkUNkJxzXX3c0M8+gmJgl3ctwnbxDt0CdK aAenVnD5cLO38j9WlutwM1kq7V0vP64SyojEGc+iVn/R1vbRaFPTKAhm4JUvHvNMhgHU CtQL8OnyMn0lJl1+Q92jzpEjQbxYP0PNm5dMg= MIME-Version: 1.0 Received: by 10.205.24.79 with SMTP id rd15mr1238471bkb.177.1310097738921; Thu, 07 Jul 2011 21:02:18 -0700 (PDT) Sender: mattjeet@gmail.com Received: by 10.204.34.205 with HTTP; Thu, 7 Jul 2011 21:02:18 -0700 (PDT) In-Reply-To: <4E167C94.70300@kibab.com> References: <4E167C94.70300@kibab.com> Date: Thu, 7 Jul 2011 21:02:18 -0700 X-Google-Sender-Auth: 29T1H7M2TAt0OQRWLl9f8A8SqIU Message-ID: From: Matt Olander To: Ilya Bakulin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, "Robert N. M. Watson" , Jonathan Anderson , Ben Laurie Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: matt@ixsystems.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 04:25:30 -0000 On Thu, Jul 7, 2011 at 8:42 PM, Ilya Bakulin wrote: > Hi hackers, > As a part of ongoing effort to enhance usage of Capsicum in FreeBSD base > system, I want to ask you, which applications in the base system should > receive sandboxing support. > So far, the following applications were sandboxed during initial > Capsicum research project: > =A0sshd: critical system service run by root; > =A0gzip: utility that operates with potentially buggy compression code > =A0tcpdump: contains complex packet-parsing code, run by root; > I have added sandboxing to syslogd, because this is also a critical > system service run by root. > I'm also going to add sandboxing to xz (compression algorithms) and ntpd > (critical system service run by root). > > The question is: which applications should also be processed? I think > that the most wanted candidates are SUID programs and/or popular network > daemons. > But looking at gzip example I also think about text-processing tools in > general. > > At the moment I prefer not to focus on applications that are used only > on desktop system -- primary usage of FreeBSD is ultra-reliable serving > platform, although iXSystems guys may correct me :-) Haha, we will not disagree with you (yet!). This is a great project and I appreciate your work on it. What about inetd? Is that possible or does each service it support need sandboxing, too? How about sendmail and bind? Cheers, -matt From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 04:48:33 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E99C2106566B for ; Fri, 8 Jul 2011 04:48:32 +0000 (UTC) (envelope-from sendtomatt@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id B59AC8FC17 for ; Fri, 8 Jul 2011 04:48:32 +0000 (UTC) Received: by iyb11 with SMTP id 11so1935466iyb.13 for ; Thu, 07 Jul 2011 21:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=mnrNAh/FwyuRfL6ItBNh4sG6+Pzx1kWTo7W4rX4o+S4=; b=gwZ5y3Cd/s2Ytei4G8htaohzQSmjR1sea12MRVaDfJItD5EmI7dgfZRN4FjYIycZMI IIUbsX79n/IuoycO2htWdCPRohRIk6T1/fBxV5fQiHPHxN5Hsp7/XZO3sw2lb79JzNen 7PXhZxmFBc7MgGbIVBtnIS3A1EttCTvenGGAM= Received: by 10.42.149.10 with SMTP id t10mr1668606icv.125.1310098919335; Thu, 07 Jul 2011 21:21:59 -0700 (PDT) Received: from sidhe.local ([75.111.38.94]) by mx.google.com with ESMTPS id j7sm10491810icq.14.2011.07.07.21.21.48 (version=SSLv3 cipher=OTHER); Thu, 07 Jul 2011 21:21:58 -0700 (PDT) Message-ID: <4E1685D8.403@gmail.com> Date: Thu, 07 Jul 2011 21:21:44 -0700 From: Matt User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.18) Gecko/20110624 Thunderbird/3.1.11 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4E167C94.70300@kibab.com> In-Reply-To: <4E167C94.70300@kibab.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Ben Laurie Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 04:48:33 -0000 On 07/07/11 20:42, Ilya Bakulin wrote: > Hi hackers, > As a part of ongoing effort to enhance usage of Capsicum in FreeBSD base > system, I want to ask you, which applications in the base system should > receive sandboxing support. > So far, the following applications were sandboxed during initial > Capsicum research project: > sshd: critical system service run by root; > gzip: utility that operates with potentially buggy compression code > tcpdump: contains complex packet-parsing code, run by root; > I have added sandboxing to syslogd, because this is also a critical > system service run by root. > I'm also going to add sandboxing to xz (compression algorithms) and ntpd > (critical system service run by root). > > The question is: which applications should also be processed? I think > that the most wanted candidates are SUID programs and/or popular network > daemons. > But looking at gzip example I also think about text-processing tools in > general. > > At the moment I prefer not to focus on applications that are used only > on desktop system -- primary usage of FreeBSD is ultra-reliable serving > platform, although iXSystems guys may correct me :-) > I'm not too familiar with the operation of capsicum, but in general anything with untrusted (including in many cases user) input can be worth sandboxing, especially in a server environment. Obviously server processes themselves are often worth restricting to things like jails or vms etc., so sandboxing could be an alternative. I can also see cases where interpreters, database server software, and file viewers/editors could be sandboxed to prevent exploits from "running away" with the system via the exploited process. Especially in server environment, 'sudo less /var/log/' and kablooey. Admins may have to run "user" software, or non suid, executables which nonetheless receive the admin's elevated permissions. Call them usid, user set id, I suppose. Not the best, but it happens, especially when things need to work an hour ago. A few ideas along those lines: -any server software -any interpreter (perl, python, etc)? -any shell?... minicom wget curl netcat links/lynx Can it be made a switch on sudo? sudo --sandbox=someprofile,option tcpdump -tti pflog0 Hopefully I'm not missing the boat and these ideas are applicable :) Matt From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 07:01:13 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFCD106564A; Fri, 8 Jul 2011 07:01:13 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 850188FC15; Fri, 8 Jul 2011 07:01:13 +0000 (UTC) Received: from a91-153-123-205.elisa-laajakaista.fi (a91-153-123-205.elisa-laajakaista.fi [91.153.123.205]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 31B1F151679; Fri, 8 Jul 2011 10:01:05 +0300 (EEST) Date: Fri, 8 Jul 2011 10:01:05 +0300 From: Jaakko Heinonen To: "Julian H. Stacey" , edwin@FreeBSD.org Message-ID: <20110708070105.GA2057@a91-153-123-205.elisa-laajakaista.fi> References: <20110705192434.GA57761@jh> <201107052102.p65L2lWN055393@fire.js.berklix.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107052102.p65L2lWN055393@fire.js.berklix.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: hackers@freebsd.org, Ivana Belgers Subject: Re: regression error with calendar X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 07:01:13 -0000 On 2011-07-05, Julian H. Stacey wrote: > Jaakko Heinonen wrote: > > On 2011-07-05, Julian H. Stacey wrote: > > > There's a regression error with calendar between FreeBSD-8.1 & 8.2-RELEASES > > > Test data: > > > ----- > > > Tue+1 TESTXXXXX 1 > > > Tuesday+1 TESTXXXXX 2 > > > * Tuesday+1 TESTXXXXX 3 > > > Tuesday+1 * TESTXXXXX 4 > > > Tuesday TESTXXXXX5 > > > Tuesday TESTXXXXX6 > > > ----- > > > > This look like PR bin/155873 > > (http://www.freebsd.org/cgi/query-pr.cgi?pr=155873). > > Ah Yes, that's the same problem. Thanks ! Can FreeBSD please revert > the broken code out of CVS, until/ if author / importer / whoever > might want to fix it. The new code breaks basic common functionality, > to add rare usage exotica. I guess that reverting r205821 would mean reverting all of edwin's recent calendar(1) work (http://svnweb.freebsd.org/base/user/edwin/calendar/?view=log). > Broken calendar code failed to mail prompt me to call meetings in time. > Probably caused lots of missed reminders. There is also another recent calendar(1) regression: http://www.freebsd.org/cgi/query-pr.cgi?pr=157718 Edwin, please comment if you plan to take a look at these regressions. -- Jaakko From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 09:17:28 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF68C106566C for ; Fri, 8 Jul 2011 09:17:28 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5E28FC13 for ; Fri, 8 Jul 2011 09:17:28 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id p688wxUn027172 for ; Fri, 8 Jul 2011 16:59:02 +0800 (CST) From: Kevin Lo To: freebsd-hackers@FreeBSD.org Content-Type: text/plain; charset="us-ascii" Date: Fri, 08 Jul 2011 16:58:58 +0800 Message-ID: <1310115538.2435.6.camel@srgsec> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Subject: Fwd: Add xdr_sizeof() support? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 09:17:29 -0000 As per request, forward this message to hackers@. -------- Original Message -------- Date: Fri, 08 Jul 2011 14:54:33 +0800 From: Kevin Lo To: developers@FreeBSD.org Subject: Add xdr_sizeof() support? Hi, We've had a function implementation for xdr_sizeof(3), but never added in libc. NetBSD imported our xdr_sizeof() into their libc: http://mail-index.netbsd.org/source-changes/2011/07/04/msg024213.html I was just wondering if there was a particular reason not to add it? Kevin From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 11:09:54 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 980491065680 for ; Fri, 8 Jul 2011 11:09:54 +0000 (UTC) (envelope-from webmaster@kibab.com) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 21CE48FC0C for ; Fri, 8 Jul 2011 11:09:54 +0000 (UTC) Received: from zugang.kibab.com (unknown [78.110.54.255]) by mx0.deglitch.com (Postfix) with ESMTPA id C6A558FC2D; Fri, 8 Jul 2011 15:09:51 +0400 (MSD) Received: from 139.149.1.231 (SquirrelMail authenticated user kibab) by zugang.kibab.com with HTTP; Fri, 8 Jul 2011 15:09:52 +0400 Message-ID: <2c9d3cc8a0b85313f55f53ca573af81a.squirrel@zugang.kibab.com> In-Reply-To: <4E1685D8.403@gmail.com> References: <4E167C94.70300@kibab.com> <4E1685D8.403@gmail.com> Date: Fri, 8 Jul 2011 15:09:52 +0400 From: "Ilya Bakulin" To: "Matt" User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: freebsd-hackers@freebsd.org, "Robert N. M. Watson" , Jonathan Anderson , Ben Laurie Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 11:09:54 -0000 [CCing Ben, Robert and Jonathan as it's very important for me to receive their feedback about my thoughts] Let me focus on those application ideas that you've mentioned. All the following are my thoughts and this may be incorrect, in this case please correct me. > -any server software Yes, server software is a good candidate for bringing cap.mode in. Though this applies to servers that do not include in-process support for interpreters (ie Apache + mod_php), see later why. Such software as nginx, lighttpd is OK. Speaking about base system components, this list includes inetd daemons (but modification of inetd itself is NOT sufficient and ineffective, capability support implies modifying code of daemons) > -any interpreter (perl, python, etc)? Proper capsicumization of these things requires heavy code hacking, and probably won't be accepted by upstream anyway, until Capsicum becomes a standard not only for BSD world. Should hold on for now. > -any shell?... Processes that are started by the shell will inherit its capabilities. So this is undesirable IMHO. We should modify applications themselves. > minicom > wget > curl > links/lynx This is Ports software, we may try to modify it and even send patches to upstream, or maintain our local patches. I wanted to focus on base system components during GSoC, but it doesn't hurt to try to capsicumize these tools either. > netcat We have it in base system, will look at it. >From your first email: > How about sendmail and bind? I don't know how many people actually use sendmail in base system? Regarding bind -- it's a good idea, though bind already includes support for running in jail AFAIK. Thank you for your feedback! On Fri, July 8, 2011 8:21 am, Matt wrote: > I'm not too familiar with the operation of capsicum, but in general > anything with untrusted (including in many cases user) input can be > worth sandboxing, especially in a server environment. Obviously server > processes themselves are often worth restricting to things like jails or > vms etc., so sandboxing could be an alternative. > > I can also see cases where interpreters, database server software, and > file viewers/editors could be sandboxed to prevent exploits from > "running away" with the system via the exploited process. Especially in > server environment, 'sudo less /var/log/' and > kablooey. Admins may have to run "user" software, or non suid, > executables which nonetheless receive the admin's elevated permissions. > Call them usid, user set id, I suppose. Not the best, but it happens, > especially when things need to work an hour ago. > > A few ideas along those lines: > -any server software > -any interpreter (perl, python, etc)? > -any shell?... > minicom > wget > curl > netcat > links/lynx > > > Can it be made a switch on sudo? > sudo --sandbox=someprofile,option tcpdump -tti pflog0 > > Hopefully I'm not missing the boat and these ideas are applicable :) > Matt > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > !DSPAM:4e168c7810433083710550! > > > -- Regards, Ilya Bakulin http://kibab.com xmpp://kibab612@jabber.ru From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 12:08:02 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5BD01065678 for ; Fri, 8 Jul 2011 12:08:02 +0000 (UTC) (envelope-from robert.watson@cl.cam.ac.uk) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 693998FC1A for ; Fri, 8 Jul 2011 12:08:02 +0000 (UTC) Received: from c0129.aw.cl.cam.ac.uk (c0129.aw.cl.cam.ac.uk [128.232.100.129]) by cyrus.watson.org (Postfix) with ESMTPSA id 915C846B53; Fri, 8 Jul 2011 08:08:01 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Fri, 8 Jul 2011 13:08:00 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <57BDDB28-E356-4C61-B9E2-88FBF38A6F78@cl.cam.ac.uk> References: <4E167C94.70300@kibab.com> To: matt@ixsystems.com X-Mailer: Apple Mail (2.1084) X-Mailman-Approved-At: Fri, 08 Jul 2011 12:21:51 +0000 Cc: Ilya Bakulin , Jonathan Anderson , Ben Laurie , freebsd-hackers@freebsd.org Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 12:08:02 -0000 On 8 Jul 2011, at 05:02, Matt Olander wrote: > What about inetd? Is that possible or does each service it support > need sandboxing, too? How about sendmail and bind? I'm less concerned about the core connection juggling content of inetd = than the external services it launches -- however, inetd has a number of = built-in services that do interpret and manipulate untrustworthy data = (even if only in basic ways), and directly sandboxing them with Capsicum = would be very useful. I'd also like to see some focus on network command line tools -- = especially things like dig, ping, finger, host, etc, which tend to not = need access to things after some threshold moment, and/or can motivate = compartmentalisation work on libraries such as the resolver. At this = point we should go for easy wins with 100% correctness. (Getting a version of the resolver working with sandboxed Capsicum stuff = seems like a priority: it's a known issue with our sandboxed tcpdump, so = modifying lwresd or similar so it can work with UNIX domain sockets, and = teaching the resolver code to use them, would be excellent.) Robert= From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 12:23:48 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29A8F1065674 for ; Fri, 8 Jul 2011 12:23:48 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 11CB28FC08 for ; Fri, 8 Jul 2011 12:23:46 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QfA5x-0002vp-KB for freebsd-hackers@freebsd.org; Fri, 08 Jul 2011 14:23:45 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jul 2011 14:23:45 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jul 2011 14:23:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Fri, 08 Jul 2011 14:23:33 +0200 Lines: 15 Message-ID: References: <4E167C94.70300@kibab.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: <4E167C94.70300@kibab.com> X-Enigmail-Version: 1.1.2 Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 12:23:48 -0000 On 08/07/2011 05:42, Ilya Bakulin wrote: > Hi hackers, > As a part of ongoing effort to enhance usage of Capsicum in FreeBSD base > system, I want to ask you, which applications in the base system should > receive sandboxing support. How about a small description what sandboxing can bring to applications? I'm browsing the documents at http://www.cl.cam.ac.uk/research/security/capsicum/documentation.html but it looks like it still mostly describes the generic framework rather than what you can do with it. From it, it looks like you can set limits on file handle operations (e.g. (lc_limitfd(STDOUT_FILENO, CAP_FSTAT | CAP_SEEK | CAP_WRITE)), but what else? From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 12:21:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8EBF106564A for ; Fri, 8 Jul 2011 12:21:39 +0000 (UTC) (envelope-from jra40@hermes.cam.ac.uk) Received: from ppsw-50.csi.cam.ac.uk (ppsw-50.csi.cam.ac.uk [131.111.8.150]) by mx1.freebsd.org (Postfix) with ESMTP id 74E078FC18 for ; Fri, 8 Jul 2011 12:21:38 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from mail-pw0-f54.google.com ([209.85.160.54]:42241) by ppsw-50.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:465) with esmtpsa (PLAIN:jra40) (TLSv1:RC4-SHA:128) id 1Qf9jC-0006XH-pl (Exim 4.72) for freebsd-hackers@freebsd.org (return-path ); Fri, 08 Jul 2011 13:00:14 +0100 Received: by pwi7 with SMTP id 7so1435069pwi.13 for ; Fri, 08 Jul 2011 05:00:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.25.1 with SMTP id y1mr2515299pbf.169.1310126412523; Fri, 08 Jul 2011 05:00:12 -0700 (PDT) Received: by 10.68.62.39 with HTTP; Fri, 8 Jul 2011 05:00:12 -0700 (PDT) In-Reply-To: <2c9d3cc8a0b85313f55f53ca573af81a.squirrel@zugang.kibab.com> References: <4E167C94.70300@kibab.com> <4E1685D8.403@gmail.com> <2c9d3cc8a0b85313f55f53ca573af81a.squirrel@zugang.kibab.com> Date: Fri, 8 Jul 2011 13:00:12 +0100 Message-ID: From: Jonathan Anderson To: Ilya Bakulin Content-Type: text/plain; charset=UTF-8 Sender: Jonathan Anderson X-Mailman-Approved-At: Fri, 08 Jul 2011 12:35:27 +0000 Cc: Matt , freebsd-hackers@freebsd.org, "Robert N. M. Watson" , Ben Laurie Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 12:21:40 -0000 On 8 July 2011 12:09, Ilya Bakulin wrote: > modification of inetd itself is NOT sufficient and > ineffective, capability support implies modifying code of daemons Speaking as someone who isn't terribly familiar with inetd: One could imagine inetd (or an inetd-like service) accepting connections, wrapping them up with capability rights masks, and forking capability-mode daemons that can't e.g. reconnect a socket. See comments about unmodified binaries, below. >> -any interpreter (perl, python, etc)? > Proper capsicumization of these things requires heavy code hacking, and > probably won't be accepted by upstream anyway, until Capsicum becomes a > standard not only for BSD world. Should hold on for now. Fair enough. I think the language-level things are probably a better target for CTSRD, whose vocabulary includes fine-grained memory regions, rather than (relatively coarse) files and processes. >> -any shell?... > Processes that are started by the shell will inherit its capabilities. So > this is undesirable IMHO. We should modify applications themselves. Do take a look at https://github.com/trombonehero/capsh, which is a (not-fully-functional-as-a-shell-yet) capability-aware shell. It executes child processes in capability-mode sandboxes, providing access to explicitly named resources via library preloading (replacing the regular open() and friends, which will die with ECAPMODE, with versions that search through a list of explicitly inherited files). The philosophy is a bit like Plash, but the details are built on Capsicum foundations. As I said, I wouldn't call it functional yet, but it does allow me to run simple binaries, e.g. cat, unmodified but in a sandbox. So while I agree that it's good to modify applications to take advantage of Capsicum, there is some exploration to be done in bringing Capsicum-backed security improvements to unmodified applications. >> minicom >> wget >> curl >> links/lynx > This is Ports software, we may try to modify it and even send patches to > upstream, or maintain our local patches. I wanted to focus on base system > components during GSoC, but it doesn't hurt to try to capsicumize these > tools either. > > From your first email: >> How about sendmail and bind? > I don't know how many people actually use sendmail in base system? > Regarding bind -- it's a good idea, though bind already includes support > for running in jail AFAIK. Both of these do seem like ideal candidates. Jail support is actually a plus: it means that some of the compartmentalization work might already be done for you, and provides a comparison point (evaluation with Jail, Capsicum and Jail+Capsicum). >> Can it be made a switch on sudo? >> sudo --sandbox=someprofile,option tcpdump -tti pflog0 Interesting... this starts to sound a bit like Mac OS X's sandbox policy files ("run this binary, constrained by policy X.sb"). I think that the capsh/Plash approach is a more natural fit for capabilities (policy files fit nicely with MAC), and indeed, a more natural tool for the job we're trying to do here. Perhaps 'sudo --sandbox command infile:r outfile:rw' could do something very much like what capsh tries to do. Jon -- Jonathan Anderson Research Student, Security Group Computer Laboratory University of Cambridge +44 (1223) 763747 jonathan.anderson@cl.cam.ac.uk From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 13:48:56 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6B2D1065670; Fri, 8 Jul 2011 13:48:56 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 430888FC17; Fri, 8 Jul 2011 13:48:56 +0000 (UTC) Received: by pzk27 with SMTP id 27so1949887pzk.13 for ; Fri, 08 Jul 2011 06:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=wNCU5YeC4igysRyhQUGj6wrLettEe1lwonuGMt/pMes=; b=Qukc4NgWmbkP4j8n9DjVgOzsiSkSHMXZn6Z2q2V+SWxe2QAmD4P3W/fNdorywAzbbB bdMt/nSElSNVKegM4pe0VLvnG2hGJS0kYhWjrR4uj+pwOp8Jp3h8OuD/wiD2hkgu8n3R spWJ+fUuDApdCUTRBGa4v62gdB116qgJwVYZY= MIME-Version: 1.0 Received: by 10.68.50.198 with SMTP id e6mr2826146pbo.292.1310132935793; Fri, 08 Jul 2011 06:48:55 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.68.57.4 with HTTP; Fri, 8 Jul 2011 06:48:55 -0700 (PDT) In-Reply-To: <20110707111751.GI71453@hoeg.nl> References: <20110707100123.GF71453@hoeg.nl> <20110707111751.GI71453@hoeg.nl> Date: Fri, 8 Jul 2011 15:48:55 +0200 X-Google-Sender-Auth: FI9UMJPKpze-88NBH8cKWOshedk Message-ID: From: Robert Millan To: Ed Schouten Content-Type: multipart/mixed; boundary=bcaec544eb763f1c1804a78f1802 Cc: freebsd-hackers@freebsd.org, Ed Maste , debian-hurd@lists.debian.org Subject: Re: [PATCH] avoid assuming MAXPATHLEN in config(8) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 13:48:56 -0000 --bcaec544eb763f1c1804a78f1802 Content-Type: text/plain; charset=UTF-8 2011/7/7 Ed Schouten : > Considering that the function is rather small anyway, why not compile it > in unconditionally (though having a different name). Hi Ed, I made the adjustment you requested, plus a bit more polishing (plugged a memleak, etc), and then I hit what seems like a memory corruption heisenbug. I haven't been able to determine whether my patch introduces this bug or it just uncovers it. As for now please disregard my request untill I have time to debug this properly. Thanks -- Robert Millan --bcaec544eb763f1c1804a78f1802 Content-Type: text/plain; charset=US-ASCII; name="maxpathlen.diff" Content-Disposition: attachment; filename="maxpathlen.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gpv7b3xu1 PT09IG1vZGlmaWVkIGZpbGUgJ2NvbmZpZy5oJwotLS0gY29uZmlnLmgJMjAxMS0wNy0wNyAxMzo1 OTowNSArMDAwMAorKysgY29uZmlnLmgJMjAxMS0wNy0wNyAxNDowNjoyOCArMDAwMApAQCAtMTk5 LDcgKzE5OSw3IEBACiBleHRlcm4gaW50CW1heHVzZXJzOwogCiBleHRlcm4gY2hhciAqUFJFRklY OwkJLyogQ29uZmlnIGZpbGUgbmFtZSAtIGZvciBlcnJvciBtZXNzYWdlcyAqLwotZXh0ZXJuIGNo YXIgc3JjZGlyW107CQkvKiByb290IG9mIHRoZSBrZXJuZWwgc291cmNlIHRyZWUgKi8KK2V4dGVy biBjaGFyICpzcmNkaXI7CQkvKiByb290IG9mIHRoZSBrZXJuZWwgc291cmNlIHRyZWUgKi8KIAog I2RlZmluZSBlcShhLGIpCSghc3RyY21wKGEsYikpCiAjZGVmaW5lIG5zKHMpCXN0cmR1cChzKQoK PT09IG1vZGlmaWVkIGZpbGUgJ21haW4uYycKLS0tIG1haW4uYwkyMDExLTA3LTA3IDEzOjU5OjA1 ICswMDAwCisrKyBtYWluLmMJMjAxMS0wNy0wNyAxNzo1MTozOSArMDAwMApAQCAtNzEsOCArNzEs OCBAQAogI2RlZmluZQlDRElSCSIuLi9jb21waWxlLyIKIAogY2hhciAqCVBSRUZJWDsKLWNoYXIg CWRlc3RkaXJbTUFYUEFUSExFTl07Ci1jaGFyIAlzcmNkaXJbTUFYUEFUSExFTl07CitjaGFyICoJ ZGVzdGRpcjsKK2NoYXIgKglzcmNkaXI7CiAKIGludAlkZWJ1Z2dpbmc7CiBpbnQJcHJvZmlsaW5n OwpAQCAtMTIyLDggKzEyMiw4IEBACiAJCQlwcmludG1hY2hpbmUgPSAxOwogCQkJYnJlYWs7CiAJ CWNhc2UgJ2QnOgotCQkJaWYgKCpkZXN0ZGlyID09ICdcMCcpCi0JCQkJc3RybGNweShkZXN0ZGly LCBvcHRhcmcsIHNpemVvZihkZXN0ZGlyKSk7CisJCQlpZiAoZGVzdGRpciA9PSBOVUxMKQorCQkJ CWRlc3RkaXIgPSBzdHJkdXAob3B0YXJnKTsKIAkJCWVsc2UKIAkJCQllcnJ4KEVYSVRfRkFJTFVS RSwgImRpcmVjdG9yeSBhbHJlYWR5IHNldCIpOwogCQkJYnJlYWs7CkBAIC0xNjUsMTQgKzE2NSwx MyBAQAogCQkJZXJyKDIsICIlcyIsIFBSRUZJWCk7CiAJCXl5ZmlsZSA9IFBSRUZJWDsKIAl9Ci0J aWYgKCpkZXN0ZGlyICE9ICdcMCcpIHsKKwlpZiAoZGVzdGRpciAhPSBOVUxMKSB7CiAJCWxlbiA9 IHN0cmxlbihkZXN0ZGlyKTsKIAkJd2hpbGUgKGxlbiA+IDEgJiYgZGVzdGRpcltsZW4gLSAxXSA9 PSAnLycpCiAJCQlkZXN0ZGlyWy0tbGVuXSA9ICdcMCc7CiAJCWdldF9zcmNkaXIoKTsKIAl9IGVs c2UgewotCQlzdHJsY3B5KGRlc3RkaXIsIENESVIsIHNpemVvZihkZXN0ZGlyKSk7Ci0JCXN0cmxj YXQoZGVzdGRpciwgUFJFRklYLCBzaXplb2YoZGVzdGRpcikpOworCQkodm9pZCkgYXNwcmludGYo JmRlc3RkaXIsICIlcyVzIiwgQ0RJUiwgUFJFRklYKTsKIAl9CiAKIAlTTElTVF9JTklUKCZjcHV0 eXBlKTsKQEAgLTIzMCw2ICsyMjksMjcgQEAKIH0KIAogLyoKKyAqIHhyZWFscGF0aAorICoJcmVh bHBhdGgoKSB3aXRoIGV4dGVuc2lvbiB0byB1c2UgbWFsbG9jKCkgd2hlbiByZXNvbHZlZCBpcyBO VUxMLgorICovCitzdGF0aWMgY2hhciAqCit4cmVhbHBhdGgoY29uc3QgY2hhciAqbmFtZSwgY2hh ciAqcmVzb2x2ZWQpCit7CisjaWZkZWYgTUFYUEFUSExFTgorCWlmIChyZXNvbHZlZCA9PSBOVUxM KSB7CisJCXJlc29sdmVkID0gbWFsbG9jKE1BWFBBVEhMRU4pOworCQlpZiAocmVhbHBhdGgobmFt ZSwgcmVzb2x2ZWQpID09IE5VTEwpIHsKKwkJCWZyZWUocmVzb2x2ZWQpOworCQkJcmVzb2x2ZWQg PSBOVUxMOworCQl9CisJfSBlbHNlCisjZW5kaWYKKwkJcmVzb2x2ZWQgPSByZWFscGF0aChuYW1l LCByZXNvbHZlZCk7CisKKwlyZXR1cm4gcmVzb2x2ZWQ7Cit9CisKKy8qCiAgKiBnZXRfc3JjZGly CiAgKglkZXRlcm1pbmUgdGhlIHJvb3Qgb2YgdGhlIGtlcm5lbCBzb3VyY2UgdHJlZQogICoJYW5k IHNhdmUgdGhhdCBpbiBzcmNkaXIuCkBAIC0yNDEsNyArMjYxLDkgQEAKIAljaGFyICpwLCAqcHdk OwogCWludCBpOwogCi0JaWYgKHJlYWxwYXRoKCIuLi8uLiIsIHNyY2RpcikgPT0gTlVMTCkKKwlp ZiAoc3JjZGlyICE9IE5VTEwpCisJCWZyZWUoc3JjZGlyKTsKKwlpZiAoKHNyY2RpciA9IHhyZWFs cGF0aCgiLi4vLi4iLCBOVUxMKSkgPT0gTlVMTCkKIAkJZXJyKEVYSVRfRkFJTFVSRSwgIlVuYWJs ZSB0byBmaW5kIHJvb3Qgb2Ygc291cmNlIHRyZWUiKTsKIAlpZiAoKHB3ZCA9IGdldGVudigiUFdE IikpICE9IE5VTEwgJiYgKnB3ZCA9PSAnLycgJiYKIAkgICAgKHB3ZCA9IHN0cmR1cChwd2QpKSAh PSBOVUxMKSB7CkBAIC0yNTQsOSArMjc2LDEyIEBACiAJCQkqcCA9ICdcMCc7CiAJCX0KIAkJaWYg KHN0YXQocHdkLCAmbGcpICE9IC0xICYmIHN0YXQoc3JjZGlyLCAmcGh5KSAhPSAtMSAmJgotCQkg ICAgbGcuc3RfZGV2ID09IHBoeS5zdF9kZXYgJiYgbGcuc3RfaW5vID09IHBoeS5zdF9pbm8pCi0J CQlzdHJsY3B5KHNyY2RpciwgcHdkLCBNQVhQQVRITEVOKTsKLQkJZnJlZShwd2QpOworCQkgICAg bGcuc3RfZGV2ID09IHBoeS5zdF9kZXYgJiYgbGcuc3RfaW5vID09IHBoeS5zdF9pbm8pIHsKKwkJ CWZyZWUoc3JjZGlyKTsKKwkJCXNyY2RpciA9IHB3ZDsKKwkJfSBlbHNlIHsKKwkJCWZyZWUocHdk KTsKKwkJfQogCX0KIH0KIApAQCAtMzg2LDkgKzQxMSw5IEBACiAJY2hhciAqY3AgPSBOVUxMOwog CiAJaWYgKGZpbGUpCi0JCWFzcHJpbnRmKCZjcCwgIiVzLyVzIiwgZGVzdGRpciwgZmlsZSk7CisJ CWFzcHJpbnRmKCZjcCwgIiVzLyVzIiwgZGVzdGRpciA/IGRlc3RkaXIgOiAiIiwgZmlsZSk7CiAJ ZWxzZQotCQljcCA9IHN0cmR1cChkZXN0ZGlyKTsKKwkJY3AgPSBzdHJkdXAoZGVzdGRpciA/IGRl c3RkaXIgOiAiIik7CiAJcmV0dXJuIChjcCk7CiB9CiAKCj09PSBtb2RpZmllZCBmaWxlICdta21h a2VmaWxlLmMnCi0tLSBta21ha2VmaWxlLmMJMjAxMS0wNy0wNyAxMzo1OTowNSArMDAwMAorKysg bWttYWtlZmlsZS5jCTIwMTEtMDctMDcgMTQ6MTI6MDYgKzAwMDAKQEAgLTE1Miw3ICsxNTIsNyBA QAogCQlmcHJpbnRmKG9mcCwgIkRFQlVHPS1nXG4iKTsKIAlpZiAocHJvZmlsaW5nKQogCQlmcHJp bnRmKG9mcCwgIlBST0ZMRVZFTD0lZFxuIiwgcHJvZmlsaW5nKTsKLQlpZiAoKnNyY2RpciAhPSAn XDAnKQorCWlmIChzcmNkaXIgIT0gTlVMTCkKIAkJZnByaW50ZihvZnAsIlM9JXNcbiIsIHNyY2Rp cik7CiAJd2hpbGUgKGZnZXRzKGxpbmUsIEJVRlNJWiwgaWZwKSAhPSAwKSB7CiAJCWlmICgqbGlu ZSAhPSAnJScpIHsKQEAgLTMwNCw5ICszMDQsOSBAQAogfQogCiBzdGF0aWMgdm9pZAotcmVhZF9m aWxlKGNoYXIgKmZuYW1lKQorcmVhZF9maWxlKGNvbnN0IGNoYXIgKmZuYW1lKQogewotCWNoYXIg aWZuYW1lW01BWFBBVEhMRU5dOworCWNoYXIgKmlmbmFtZTsKIAlGSUxFICpmcDsKIAlzdHJ1Y3Qg ZmlsZV9saXN0ICp0cDsKIAlzdHJ1Y3QgZGV2aWNlICpkcDsKQEAgLTM0OSw4ICszNDksOSBAQAog CQkJICAgIGZuYW1lKTsKIAkJCWV4aXQoMSk7CiAJCX0KLQkJKHZvaWQpIHNucHJpbnRmKGlmbmFt ZSwgc2l6ZW9mKGlmbmFtZSksICIuLi8uLi8lcyIsIHdkKTsKKwkJKHZvaWQpIGFzcHJpbnRmKCZp Zm5hbWUsICIuLi8uLi8lcyIsIHdkKTsKIAkJcmVhZF9maWxlKGlmbmFtZSk7CisJCWZyZWUoaWZu YW1lKTsKIAkJd2hpbGUgKCgod2QgPSBnZXRfd29yZChmcCkpICE9IChjaGFyICopRU9GKSAmJiB3 ZCkKIAkJCTsKIAkJZ290byBuZXh0OwpAQCAtNTU5LDE0ICs1NjAsMTMgQEAKIHN0YXRpYyB2b2lk CiByZWFkX2ZpbGVzKHZvaWQpCiB7Ci0JY2hhciBmbmFtZVtNQVhQQVRITEVOXTsKKwljaGFyICpm bmFtZTsKIAlzdHJ1Y3QgZmlsZXNfbmFtZSAqbmwsICp0bmw7CiAJCi0JKHZvaWQpIHNucHJpbnRm KGZuYW1lLCBzaXplb2YoZm5hbWUpLCAiLi4vLi4vY29uZi9maWxlcyIpOwotCXJlYWRfZmlsZShm bmFtZSk7Ci0JKHZvaWQpIHNucHJpbnRmKGZuYW1lLCBzaXplb2YoZm5hbWUpLAotCQkgICAgICAg CSIuLi8uLi9jb25mL2ZpbGVzLiVzIiwgbWFjaGluZW5hbWUpOwotCXJlYWRfZmlsZShmbmFtZSk7 CisJcmVhZF9maWxlKCIuLi8uLi9jb25mL2ZpbGVzIik7CisJKHZvaWQpIGFzcHJpbnRmKCZmbmFt ZSwgIi4uLy4uL2NvbmYvZmlsZXMuJXMiLCBtYWNoaW5lbmFtZSk7CisJcmVhZF9maWxlKGZuYW1l KTsKKwlmcmVlKGZuYW1lKTsKIAlmb3IgKG5sID0gU1RBSUxRX0ZJUlNUKCZmbnRhYik7IG5sICE9 IE5VTEw7IG5sID0gdG5sKSB7CiAJCXJlYWRfZmlsZShubC0+Zl9uYW1lKTsKIAkJdG5sID0gU1RB SUxRX05FWFQobmwsIGZfbmV4dCk7Cgo9PT0gbW9kaWZpZWQgZmlsZSAnbWtvcHRpb25zLmMnCi0t LSBta29wdGlvbnMuYwkyMDExLTA3LTA3IDEzOjU5OjA1ICswMDAwCisrKyBta29wdGlvbnMuYwky MDExLTA3LTA3IDE3OjUxOjM5ICswMDAwCkBAIC0yOTAsMjIgKzI5MCwyMCBAQAogc3RhdGljIGNo YXIgKgogdG9vcHRpb24oY2hhciAqbmFtZSkKIHsKLQlzdGF0aWMgY2hhciBoYnVmW01BWFBBVEhM RU5dOwotCWNoYXIgbmJ1ZltNQVhQQVRITEVOXTsKKwljaGFyICpuYnVmOwogCXN0cnVjdCBvcHRf bGlzdCAqcG87CiAKIAkvKiAiY2Fubm90IGhhcHBlbiI/ICB0aGUgb3RhYiBsaXN0IHNob3VsZCBi ZSBjb21wbGV0ZS4uICovCi0JKHZvaWQpc3RybGNweShuYnVmLCAib3B0aW9ucy5oIiwgc2l6ZW9m KG5idWYpKTsKKwluYnVmID0gIm9wdGlvbnMuaCI7CiAKIAlTTElTVF9GT1JFQUNIKHBvLCAmb3Rh Yiwgb19uZXh0KSB7CiAJCWlmIChlcShwby0+b19uYW1lLCBuYW1lKSkgewotCQkJc3RybGNweShu YnVmLCBwby0+b19maWxlLCBzaXplb2YobmJ1ZikpOworCQkJbmJ1ZiA9IHBvLT5vX2ZpbGU7CiAJ CQlicmVhazsKIAkJfQogCX0KIAotCSh2b2lkKXN0cmxjcHkoaGJ1ZiwgcGF0aChuYnVmKSwgc2l6 ZW9mKGhidWYpKTsKLQlyZXR1cm4gKGhidWYpOworCXJldHVybiAocGF0aChuYnVmKSk7CiB9CiAK IAkKQEAgLTM2Myw3ICszNjEsNyBAQAogewogCUZJTEUgKmZwOwogCWNoYXIgKndkLCAqdGhpcywg KnZhbDsKLQljaGFyIGdlbm9wdFtNQVhQQVRITEVOXTsKKwljaGFyICpnZW5vcHQ7CiAKIAlmcCA9 IGZvcGVuKGZuYW1lLCAiciIpOwogCWlmIChmcCA9PSAwKQpAQCAtMzg3LDcgKzM4NSw3IEBACiAJ CQkJZXhpdCgxKTsKIAkJCX0KIAkJCWNoYXIgKnMgPSBucyh0aGlzKTsKLQkJCSh2b2lkKXNucHJp bnRmKGdlbm9wdCwgc2l6ZW9mKGdlbm9wdCksICJvcHRfJXMuaCIsCisJCQkodm9pZClhc3ByaW50 ZigmZ2Vub3B0LCAib3B0XyVzLmgiLAogCQkJICAgIGxvd2VyKHMpKTsKIAkJCXZhbCA9IGdlbm9w dDsKIAkJCWZyZWUocyk7CkBAIC0zOTksNiArMzk3LDcgQEAKIAkJCXVwZGF0ZV9vcHRpb24odGhp cywgdmFsLCBmbGFncyk7CiAJfQogCSh2b2lkKWZjbG9zZShmcCk7CisJZnJlZShnZW5vcHQpOwog CXJldHVybiAoMSk7CiB9CiAKQEAgLTQwOCwxNiArNDA3LDE3IEBACiBzdGF0aWMgdm9pZAogcmVh ZF9vcHRpb25zKHZvaWQpCiB7Ci0JY2hhciBmbmFtZVtNQVhQQVRITEVOXTsKKwljaGFyICpmbmFt ZTsKIAogCVNMSVNUX0lOSVQoJm90YWIpOwogCXJlYWRfb3B0aW9uX2ZpbGUoIi4uLy4uL2NvbmYv b3B0aW9ucyIsIDApOwotCSh2b2lkKXNucHJpbnRmKGZuYW1lLCBzaXplb2YgZm5hbWUsICIuLi8u Li9jb25mL29wdGlvbnMuJXMiLAorCSh2b2lkKWFzcHJpbnRmKCZmbmFtZSwgIi4uLy4uL2NvbmYv b3B0aW9ucy4lcyIsCiAJICAgIG1hY2hpbmVuYW1lKTsKIAlpZiAoIXJlYWRfb3B0aW9uX2ZpbGUo Zm5hbWUsIDApKSB7Ci0JCSh2b2lkKXNucHJpbnRmKGZuYW1lLCBzaXplb2YgZm5hbWUsICJvcHRp b25zLiVzIiwgbWFjaGluZW5hbWUpOworCQkodm9pZClzcHJpbnRmKGZuYW1lLCAib3B0aW9ucy4l cyIsIG1hY2hpbmVuYW1lKTsKIAkJcmVhZF9vcHRpb25fZmlsZShmbmFtZSwgMCk7CiAJfQorCWZy ZWUoZm5hbWUpOwogCXJlYWRfb3B0aW9uX2ZpbGUoIi4uLy4uL2NvbmYvb3B0aW9ucy1jb21wYXQi LCBPTF9BTElBUyk7CiB9CiAKCg== --bcaec544eb763f1c1804a78f1802-- From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 14:54:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11BAC106566B for ; Fri, 8 Jul 2011 14:54:35 +0000 (UTC) (envelope-from pieter@thedarkside.nl) Received: from mail.thelostparadise.com (router.thelostparadise.com [IPv6:2a02:898:0:30::30:1]) by mx1.freebsd.org (Postfix) with ESMTP id 940708FC14 for ; Fri, 8 Jul 2011 14:54:34 +0000 (UTC) Received: by mail.thelostparadise.com (Postfix, from userid 127) id 415EC7303E; Fri, 8 Jul 2011 16:54:32 +0200 (CEST) Received: from localhost by mail.thelostparadise.com (Postfix) with ESMTPSA id 2B71E73038; Fri, 8 Jul 2011 16:54:30 +0200 (CEST) Message-ID: <4E171A25.5080905@thedarkside.nl> Date: Fri, 08 Jul 2011 16:54:29 +0200 From: Pieter de Boer MIME-Version: 1.0 To: Ilya Bakulin References: <4E167C94.70300@kibab.com> In-Reply-To: <4E167C94.70300@kibab.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on aberdeen.thelostparadise.com Cc: freebsd-hackers@freebsd.org, "Robert N. M. Watson" , Jonathan Anderson , Ben Laurie Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 14:54:35 -0000 On 07/08/2011 05:42 AM, Ilya Bakulin wrote: > The question is: which applications should also be processed? I think > that the most wanted candidates are SUID programs and/or popular network > daemons. > But looking at gzip example I also think about text-processing tools in > general. I think tcpdump (and wireshark, but that's a port) may be a good candidate. -- Pieter From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 16:10:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85A3D106566B for ; Fri, 8 Jul 2011 16:10:39 +0000 (UTC) (envelope-from giffunip@tutopia.com) Received: from nm30.bullet.mail.sp2.yahoo.com (nm30.bullet.mail.sp2.yahoo.com [98.139.91.100]) by mx1.freebsd.org (Postfix) with SMTP id 610CE8FC12 for ; Fri, 8 Jul 2011 16:10:39 +0000 (UTC) Received: from [98.139.91.69] by nm30.bullet.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 15:57:22 -0000 Received: from [98.139.91.27] by tm9.bullet.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 15:57:22 -0000 Received: from [127.0.0.1] by omp1027.mail.sp2.yahoo.com with NNFMP; 08 Jul 2011 15:57:22 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 892195.35860.bm@omp1027.mail.sp2.yahoo.com Received: (qmail 38500 invoked by uid 60001); 8 Jul 2011 15:57:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1310140642; bh=lfF/LR+wQh1GmSOQNu4SmY5JluagA9aiAW4WjOjyNIQ=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:MIME-Version:Content-Type; b=5HV8LBEdf5hpvt5DXQ6SFAOVcCn89MDzqgNARYogyBtd/lyb4HKk8/RQ9oOAprCQ+d3NntN8UL2Sr3y5JEJQUJi628HDGNGJOSzJ04wET2YNI0bpt2gPZx4J72T9yPgQ+gpgpnlDulu4XtpScARxQwmqKACEgBQnzoElovevamI= X-YMail-OSG: jRMH8yIVM1l5UJEsJTqt0ABBUBwY_47xApmiUQSzqKRe8Ww m4wcbLH3MA3gZcAl4rdQFXJtKTi8_4Y5wMdS4lUW8wO2ANuPZkWhRLb6F0eT 3PpdpTwVucLvTh7vuA2zg0rrzs_IHNsnE8VgxNQDGl3UQ_307IpDPZXbpu29 5xSx.5_A.JRp1pO14okswaIzKuUaKN0H5kf6_D8ByCJtrldi_DNaVy84wM31 MvEJZw2vBrYdGJfqwF8HfOsLad2RjKm8TBDk5GabI7eNDcG7roIWh2vddyuB Q_0d_dGb.cBUAt6ZpFl_H_IxoSsMjLja1ivL3.2aN8X9OnCQiF52p1g2ZcLe 6I6q96FtAYUs9dGBfuWvjDH3i_EJc7IOn48AgK6Lk0xazeerEcWOpR5r0OnT 2yvrwwuX1JkQBOqE- Received: from [190.157.142.22] by web113508.mail.gq1.yahoo.com via HTTP; Fri, 08 Jul 2011 08:57:22 PDT X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/14.0.3 YahooMailWebService/0.8.112.307740 Message-ID: <1310140642.21018.YahooMailClassic@web113508.mail.gq1.yahoo.com> Date: Fri, 8 Jul 2011 08:57:22 -0700 (PDT) From: "Pedro F. Giffuni" To: Ilya Bakulin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailman-Approved-At: Fri, 08 Jul 2011 16:42:42 +0000 Cc: freebsd-hackers@freebsd.org, "Robert N. M. Watson" , Jonathan Anderson Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: giffunip@tutopia.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 16:10:39 -0000 FWIW; I would think ftpd, which may require an update too, would be a classical candidate. Perhaps also telnetd. I recall sendmail calls bin/sh for some things and there is an option for a restricted shell (rsh), so supporting a shell would help sendmail too. And then some stuff like ipfw is never too security aware. However for those of us not capsicum-aware it's difficult to say if using jails would be better or more practical. cheers, Pedro. From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 18:34:47 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70B58106564A for ; Fri, 8 Jul 2011 18:34:47 +0000 (UTC) (envelope-from reichert@numachi.com) Received: from away.numachi.com (away.numachi.com [66.228.38.138]) by mx1.freebsd.org (Postfix) with SMTP id 32B068FC08 for ; Fri, 8 Jul 2011 18:34:46 +0000 (UTC) Received: (qmail 22035 invoked from network); 8 Jul 2011 18:08:05 -0000 Received: from unknown (HELO meisai.numachi.com) (71.168.108.245) by away.numachi.com with SMTP; 8 Jul 2011 18:08:05 -0000 Received: (qmail 12775 invoked by uid 1001); 8 Jul 2011 18:08:05 -0000 Date: Fri, 8 Jul 2011 14:08:05 -0400 From: Brian Reichert To: Ilya Bakulin Message-ID: <20110708180805.GN7386@numachi.com> References: <4E167C94.70300@kibab.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E167C94.70300@kibab.com> User-Agent: Mutt/1.5.9i Cc: freebsd-hackers@freebsd.org, "Robert N. M. Watson" , Jonathan Anderson , Ben Laurie Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 18:34:47 -0000 On Fri, Jul 08, 2011 at 07:42:12AM +0400, Ilya Bakulin wrote: > The question is: which applications should also be processed? I think > that the most wanted candidates are SUID programs and/or popular network > daemons. I propose 'man'; sneaky stuff can happen there.... Dunno if that meshes with your focus on servers, though... > -- > Regards, > Ilya Bakulin > http://kibab.com > xmpp://kibab612@jabber.ru -- Brian Reichert BSD admin/developer at large From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 21:16:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CFC1106566C; Fri, 8 Jul 2011 21:16:55 +0000 (UTC) (envelope-from lacombar@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id D04AA8FC12; Fri, 8 Jul 2011 21:16:54 +0000 (UTC) Received: by pvg11 with SMTP id 11so1840883pvg.13 for ; Fri, 08 Jul 2011 14:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=jtxg956+kwO5mw29Jv8boQfrZe/cjFR7ZgvOTcuLyfo=; b=mUomSTFE4sY6Xy3IKfsgCcjl5iU+5yN0rxO4bVfYp5dpClpw1z22jdlzAbNKtL969R H1KeLS0BWJbLwl3JSqI00hVu+7f9J4N2ZSXSdcVXvUA7U3pyeEaJ30PtbgD78NTdY9xT NTZO8A1hhrhtKCAspheop2zAN/aCKIgMJHqXQ= MIME-Version: 1.0 Received: by 10.68.54.6 with SMTP id f6mr3198756pbp.139.1310159814249; Fri, 08 Jul 2011 14:16:54 -0700 (PDT) Received: by 10.68.49.42 with HTTP; Fri, 8 Jul 2011 14:16:54 -0700 (PDT) In-Reply-To: References: <4D934AF4.9080503@FreeBSD.org> <742085CD-7F6F-4879-9FFD-517EC3203D52@bsdimp.com> <5AF348C8-6AB6-490D-A12E-89A51528F58F@bsdimp.com> Date: Fri, 8 Jul 2011 17:16:54 -0400 Message-ID: From: Arnaud Lacombe To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: mdf@freebsd.org, "Robert N. M. Watson" , Dimitry Andric , freebsd-hackers Subject: Re: Include file search path X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 21:16:55 -0000 Hi, On Sat, Jun 25, 2011 at 2:01 PM, Arnaud Lacombe wrote: > Hi, > > On Mon, Jun 6, 2011 at 5:37 PM, Arnaud Lacombe wrote= : >> Hi, >> >> On Tue, May 31, 2011 at 12:23 PM, Warner Losh wrote: >>> >>> On May 22, 2011, at 9:48 PM, Arnaud Lacombe wrote: >>> >>>> Hi Warner, >>>> >>>> On Sat, Apr 2, 2011 at 6:49 PM, Warner Losh wrote: >>>>> >>>>> On Apr 2, 2011, at 1:10 PM, Robert N. M. Watson wrote: >>>>> >>>>>> On 2 Apr 2011, at 19:47, Warner Losh wrote: >>>>>> >>>>>>>> (2) Working clang/LLVM cross-compile of FreeBSD. =A0This seems lik= e a basic >>>>>>>> =A0requirement to adopt clang/LLVM, and as far as I'm aware that's= not yet a >>>>>>>> =A0resolved issue? >>>>>>> >>>>>>> 0 work has been done here to my knowledge. =A0The world view for cl= ang and our in-tree gcc differ which makes it a challenge. >>>>>> >>>>>> That's disappointing. I seem to recall it's more an issue of our bui= ld integration with clang/LLVM than an underlying issue in clang/LLVM? >>>>> >>>>> Yes. =A0The problem isn't hard, the cross compile paradigm is just a = little different. >>>>> >>>>>>>> We (Cambridge) are currently bringing up FreeBSD on a new soft-cor= e 64-bit MIPS platform. =A0We're already using a non-base gcc for our boot = loader work, and plan to move to using clang/LLVM later in the year. =A0The= base system seems a bit short on detail when it comes to the above, curren= tly. >>>>>>> >>>>>>> Yes. =A0I've had to add about a dozen changes so far to get close t= o building with xdev compilers. =A0A similar number are needed to make it e= asy to configure and add systree support, I think. >>>>>> >>>>>> Sounds like great progress -- do you think we'll ship 9.0 in a "just= works" state with regard to this? >>>>> >>>>> I sure hope so. =A0I'd like to have demoable stuff by BSDcan. >>>>> >>>> BSDCan has passed, has there been any advance made since that discussi= on ? >>> >>> It is "demonstrable" but not ready to commit to the tree. =A0Needs abou= t 4 hours of work that I've had trouble scheduling on it due to work gettin= g busier than I expected. >>> >> any chances to have a look at the patch or should I wait for the final c= ommit ? >> > ping ? > ping ? - Arnaud From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 8 20:58:22 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40CEE1065674 for ; Fri, 8 Jul 2011 20:58:22 +0000 (UTC) (envelope-from robert.watson@cl.cam.ac.uk) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0598FC08 for ; Fri, 8 Jul 2011 20:58:22 +0000 (UTC) Received: from [192.168.2.112] (host86-144-167-158.range86-144.btcentralplus.com [86.144.167.158]) by cyrus.watson.org (Postfix) with ESMTPSA id DC1DC46B43; Fri, 8 Jul 2011 16:58:20 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20110708180805.GN7386@numachi.com> Date: Fri, 8 Jul 2011 21:58:19 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <19C31A36-F509-4FA3-B157-B2436A3A40B8@cl.cam.ac.uk> References: <4E167C94.70300@kibab.com> <20110708180805.GN7386@numachi.com> To: Brian Reichert X-Mailer: Apple Mail (2.1084) X-Mailman-Approved-At: Sat, 09 Jul 2011 05:10:48 +0000 Cc: Ilya Bakulin , Jonathan Anderson , Ben Laurie , freebsd-hackers@freebsd.org Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2011 20:58:22 -0000 On 8 Jul 2011, at 19:08, Brian Reichert wrote: > On Fri, Jul 08, 2011 at 07:42:12AM +0400, Ilya Bakulin wrote: >> The question is: which applications should also be processed? I think >> that the most wanted candidates are SUID programs and/or popular = network >> daemons. >=20 > I propose 'man'; sneaky stuff can happen there.... >=20 > Dunno if that meshes with your focus on servers, though... This seems like a perfect example of something that wants to be = sandboxed, especially in a post-nroff mandoc world where a single C = binary can be sandboxed. Robert= From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 9 15:13:01 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E463C106564A for ; Sat, 9 Jul 2011 15:13:01 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 70E5F8FC12 for ; Sat, 9 Jul 2011 15:13:00 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id DFF4D14E5A39 for ; Sat, 9 Jul 2011 16:53:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CEmBQyQ+Ijae for ; Sat, 9 Jul 2011 16:53:51 +0200 (CEST) Received: from [193.137.158.212] (unknown [193.137.158.212]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 8F3F114E59EF for ; Sat, 9 Jul 2011 16:53:51 +0200 (CEST) Message-ID: <4E186B89.8080003@FreeBSD.org> Date: Sat, 09 Jul 2011 15:54:01 +0100 From: Gabor Kovesdan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4E167C94.70300@kibab.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2011 15:13:02 -0000 Em 08-07-2011 13:23, Ivan Voras escreveu: > On 08/07/2011 05:42, Ilya Bakulin wrote: >> Hi hackers, >> As a part of ongoing effort to enhance usage of Capsicum in FreeBSD base >> system, I want to ask you, which applications in the base system should >> receive sandboxing support. > > How about a small description what sandboxing can bring to applications? > > I'm browsing the documents at > http://www.cl.cam.ac.uk/research/security/capsicum/documentation.html > but it looks like it still mostly describes the generic framework > rather than what you can do with it. From it, it looks like you can > set limits on file handle operations (e.g. (lc_limitfd(STDOUT_FILENO, > CAP_FSTAT | CAP_SEEK | CAP_WRITE)), but what else? Yes, I've been reading the thread and I don't know either what are the deliverables of a Capsicum sandbox. Anyway, consider sendmail and BIND. I think these are important enough to get some more protection. Gabor From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 9 22:22:38 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85225106566C for ; Sat, 9 Jul 2011 22:22:38 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by mx1.freebsd.org (Postfix) with ESMTP id 1A9CD8FC16 for ; Sat, 9 Jul 2011 22:22:35 +0000 (UTC) Received: by fxe6 with SMTP id 6so2487223fxe.17 for ; Sat, 09 Jul 2011 15:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=TI3DOlFg9xiFs+060RGq5Y65iMAWy4E+EYfIXAmJiSs=; b=ogadrZ0sntfGQhXSZSPORLyVaqmZKEyZSxAcwd/0RHREgH/jAWjLORbIZwcLp9Kjqs qExe+FTzpqqylYuc7rg/X1/dKpPrpwFTWcE5plbTBcfTCTBFdouyTEAu/5HFb8PBdG/E YwS4rYQxuL2eLGx9yhJa/doog4hKnQHKQGch4= Received: by 10.223.13.198 with SMTP id d6mr5055813faa.119.1310250154205; Sat, 09 Jul 2011 15:22:34 -0700 (PDT) Received: from localhost (lan-78-157-92-5.vln.skynet.lt [78.157.92.5]) by mx.google.com with ESMTPS id 21sm8145530fay.21.2011.07.09.15.22.32 (version=SSLv3 cipher=OTHER); Sat, 09 Jul 2011 15:22:33 -0700 (PDT) Date: Sun, 10 Jul 2011 01:22:20 +0300 From: Gleb Kurtsou To: Gabor Kovesdan Message-ID: <20110709222220.GA82930@tops> References: <4E167C94.70300@kibab.com> <4E186B89.8080003@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4E186B89.8080003@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2011 22:22:38 -0000 On (09/07/2011 15:54), Gabor Kovesdan wrote: > Em 08-07-2011 13:23, Ivan Voras escreveu: > > On 08/07/2011 05:42, Ilya Bakulin wrote: > >> Hi hackers, > >> As a part of ongoing effort to enhance usage of Capsicum in FreeBSD base > >> system, I want to ask you, which applications in the base system should > >> receive sandboxing support. > > > > How about a small description what sandboxing can bring to applications? > > > > I'm browsing the documents at > > http://www.cl.cam.ac.uk/research/security/capsicum/documentation.html > > but it looks like it still mostly describes the generic framework > > rather than what you can do with it. From it, it looks like you can > > set limits on file handle operations (e.g. (lc_limitfd(STDOUT_FILENO, > > CAP_FSTAT | CAP_SEEK | CAP_WRITE)), but what else? > Yes, I've been reading the thread and I don't know either what are the > deliverables of a Capsicum sandbox. > > Anyway, consider sendmail and BIND. I think these are important enough > to get some more protection. Both sendmail and bind are very complicated peaces of software. I thinks it would be necessary to split them up into several independent daemons first and than place each into capsicum sandbox. Privilege separation makes sshd a better condidate here (sshd is already sandboxed). I'd really like to see lwresd sandboxed and enabled by default, ntpdate may also be a good candidate but it's not that important. > > Gabor > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 9 22:39:10 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 2EC64106564A for ; Sat, 9 Jul 2011 22:39:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id ACA87150B01 for ; Sat, 9 Jul 2011 22:39:07 +0000 (UTC) Message-ID: <4E18D88B.4060805@FreeBSD.org> Date: Sat, 09 Jul 2011 15:39:07 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4E167C94.70300@kibab.com> <4E186B89.8080003@FreeBSD.org> In-Reply-To: <4E186B89.8080003@FreeBSD.org> X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: Capsicum project: Ideas needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jul 2011 22:39:10 -0000 On 07/09/2011 07:54, Gabor Kovesdan wrote: > Anyway, consider sendmail and BIND. I think these are important enough > to get some more protection. What additional protection could capsicum offer beyond chroot'ing? (That's not a snark, I don't quite understand all the moving parts here.) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/