From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 00:52:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AB91106566B; Sun, 5 Feb 2012 00:52:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2948FC15; Sun, 5 Feb 2012 00:52:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q150q0oL059307; Sun, 5 Feb 2012 00:52:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q150q0KL059305; Sun, 5 Feb 2012 00:52:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202050052.q150q0KL059305@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 00:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231003 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 00:52:00 -0000 Author: nwhitehorn Date: Sun Feb 5 00:51:59 2012 New Revision: 231003 URL: http://svn.freebsd.org/changeset/base/231003 Log: Add support for bus_adjust_resource() on all PowerPC/AIM PCI bridges. With this change, NEW_PCIB appears to work without incident at least on a G5 iMac. More testing will be required before it is turned on in GENERIC. Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 00:31:07 2012 (r231002) +++ head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 00:51:59 2012 (r231003) @@ -71,6 +71,9 @@ static int ofw_pci_activate_resource(de static int ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res); +static int ofw_pci_adjust_resource(device_t bus, device_t child, + int type, struct resource *res, u_long start, + u_long end); /* * pcib interface. @@ -106,6 +109,7 @@ static device_method_t ofw_pci_methods[] DEVMETHOD(bus_release_resource, ofw_pci_release_resource), DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), /* pcib interface */ DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), @@ -421,6 +425,30 @@ ofw_pci_deactivate_resource(device_t bus return (rman_deactivate_resource(res)); } +static int +ofw_pci_adjust_resource(device_t bus, device_t child, int type, + struct resource *res, u_long start, u_long end) +{ + struct rman *rm = NULL; + struct ofw_pci_softc *sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + default: + return (ENXIO); + } + + if (!rman_is_region_manager(res, rm)) + return (EINVAL); + return (rman_adjust_resource(res, start, end)); +} + + static phandle_t ofw_pci_get_node(device_t bus, device_t dev) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 04:49:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A854106566C; Sun, 5 Feb 2012 04:49:32 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 294098FC0C; Sun, 5 Feb 2012 04:49:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q154nWeJ067151; Sun, 5 Feb 2012 04:49:32 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q154nWHV067148; Sun, 5 Feb 2012 04:49:32 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202050449.q154nWHV067148@svn.freebsd.org> From: David Xu Date: Sun, 5 Feb 2012 04:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231006 - in head/sys: compat/freebsd32 kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 04:49:32 -0000 Author: davidxu Date: Sun Feb 5 04:49:31 2012 New Revision: 231006 URL: http://svn.freebsd.org/changeset/base/231006 Log: Add 32-bit compat code for AIO kevent flags introduced in revision 230857. Modified: head/sys/compat/freebsd32/freebsd32_signal.h head/sys/kern/vfs_aio.c Modified: head/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_signal.h Sun Feb 5 03:23:26 2012 (r231005) +++ head/sys/compat/freebsd32/freebsd32_signal.h Sun Feb 5 04:49:31 2012 (r231006) @@ -92,6 +92,7 @@ struct sigevent32 { uint32_t _function; uint32_t _attribute; } _sigev_thread; + unsigned short _kevent_flags; uint32_t __spare__[8]; } _sigev_un; }; Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Feb 5 03:23:26 2012 (r231005) +++ head/sys/kern/vfs_aio.c Sun Feb 5 04:49:31 2012 (r231006) @@ -2706,6 +2706,7 @@ convert_sigevent32(struct sigevent32 *si break; case SIGEV_KEVENT: CP(*sig32, *sig, sigev_notify_kqueue); + CP(*sig32, *sig, sigev_notify_kevent_flags); PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); break; default: From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 07:46:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2897A106564A; Sun, 5 Feb 2012 07:46:06 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id ACB6E8FC08; Sun, 5 Feb 2012 07:46:04 +0000 (UTC) Received: by lagz14 with SMTP id z14so3245496lag.13 for ; Sat, 04 Feb 2012 23:46:03 -0800 (PST) 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=Zf+m5iA6U1+uSGhj63F3T+U7rlxNRsGekZU67WV+c6s=; b=E4yRLzbWJHVFvOZhwpU8870t8JFeSU6jbuAOIeYW5D7H9g4eIQmQBQ43jfb2Pc1z+/ vly6yPB6H3R/6gTQh5kntl+ElJdbLQqxMXYi1OKKpTPqAwagKkmL7k3ee9kDn96E/GGc 5tyU3zEPsQKHq5vifvy7p6uA4Ym+wi52tThJs= MIME-Version: 1.0 Received: by 10.152.133.229 with SMTP id pf5mr6968614lab.18.1328427963547; Sat, 04 Feb 2012 23:46:03 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.2.138 with HTTP; Sat, 4 Feb 2012 23:46:03 -0800 (PST) In-Reply-To: <201202041337.q14DbVTn037485@svn.freebsd.org> References: <201202041337.q14DbVTn037485@svn.freebsd.org> Date: Sun, 5 Feb 2012 10:46:03 +0300 X-Google-Sender-Auth: oCFXi5SYP0KzdDT7RF0RXgSS_Mg Message-ID: From: Sergey Kandaurov To: Jaakko Heinonen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230979 - head/usr.bin/touch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 07:46:06 -0000 On 4 February 2012 17:37, Jaakko Heinonen wrote: > Author: jh > Date: Sat Feb =A04 13:37:31 2012 > New Revision: 230979 > URL: http://svn.freebsd.org/changeset/base/230979 > > Log: > =A0Remove useless and potentially dangerous rw() function which tries to > =A0update access and modification times by reading and writing the file. > =A0chmod(2) in rw() doesn't help because utimes(2) allow owner and the > =A0super-user to change times. Using just utimes(2) should be sufficient. > > =A0The -f option becomes no-op. > > =A0Reviewed by: =A0jilles > > Modified: > =A0head/usr.bin/touch/touch.1 > =A0head/usr.bin/touch/touch.c Thank you. FYI, this code was written before utimes(2) was born (yes, before 4.2BSD), so it was technically correct to remove it for more than 20 years ago. > > Modified: head/usr.bin/touch/touch.1 > =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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/touch/touch.1 =A0Sat Feb =A04 13:12:52 2012 =A0 =A0 =A0 = =A0(r230978) > +++ head/usr.bin/touch/touch.1 =A0Sat Feb =A04 13:37:31 2012 =A0 =A0 =A0 = =A0(r230979) > @@ -31,7 +31,7 @@ > =A0.\" =A0 =A0 @(#)touch.1 =A0 =A08.3 (Berkeley) 4/28/95 > =A0.\" $FreeBSD$ > =A0.\" > -.Dd April 28, 1995 > +.Dd February 4, 2012 > =A0.Dt TOUCH 1 > =A0.Os > =A0.Sh NAME > @@ -40,7 +40,7 @@ > =A0.Sh SYNOPSIS > =A0.Nm > =A0.Op Fl A Ar [-][[hh]mm]SS > -.Op Fl acfhm > +.Op Fl achm > =A0.Op Fl r Ar file > =A0.Op Fl t Ar [[CC]YY]MMDDhhmm[.SS] > =A0.Ar > @@ -109,9 +109,6 @@ The > =A0.Nm > =A0utility does not treat this as an error. > =A0No error messages are displayed and the exit value is not affected. > -.It Fl f > -Attempt to force the update, even if the file permissions do not > -currently permit it. > =A0.It Fl h > =A0If the file is a symbolic link, change the times of the link > =A0itself rather than the file that the link points to. > > Modified: head/usr.bin/touch/touch.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/touch/touch.c =A0Sat Feb =A04 13:12:52 2012 =A0 =A0 =A0 = =A0(r230978) > +++ head/usr.bin/touch/touch.c =A0Sat Feb =A04 13:37:31 2012 =A0 =A0 =A0 = =A0(r230979) > @@ -55,7 +55,6 @@ static const char sccsid[] =3D "@(#)touch. > =A0#include > =A0#include > > -int =A0 =A0rw(char *, struct stat *, int); > =A0void =A0 stime_arg1(char *, struct timeval *); > =A0void =A0 stime_arg2(char *, int, struct timeval *); > =A0void =A0 stime_file(char *, struct timeval *); > @@ -69,12 +68,12 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0struct timeval tv[2]; > =A0 =A0 =A0 =A0int (*stat_f)(const char *, struct stat *); > =A0 =A0 =A0 =A0int (*utimes_f)(const char *, const struct timeval *); > - =A0 =A0 =A0 int Aflag, aflag, cflag, fflag, mflag, ch, fd, len, rval, t= imeset; > + =A0 =A0 =A0 int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset; > =A0 =A0 =A0 =A0char *p; > =A0 =A0 =A0 =A0char *myname; > > =A0 =A0 =A0 =A0myname =3D basename(argv[0]); > - =A0 =A0 =A0 Aflag =3D aflag =3D cflag =3D fflag =3D mflag =3D timeset = =3D 0; > + =A0 =A0 =A0 Aflag =3D aflag =3D cflag =3D mflag =3D timeset =3D 0; > =A0 =A0 =A0 =A0stat_f =3D stat; > =A0 =A0 =A0 =A0utimes_f =3D utimes; > =A0 =A0 =A0 =A0if (gettimeofday(&tv[0], NULL)) > @@ -92,7 +91,7 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cflag =3D 1; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 'f': > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fflag =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* No-op for compatibility.= */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 'h': > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cflag =3D 1; > @@ -222,14 +221,8 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!utimes_f(*argv, NULL)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue; > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Try reading/writing. */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!S_ISLNK(sb.st_mode) && !S_ISDIR(sb.st_= mode)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (rw(*argv, &sb, fflag)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", *argv); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", *argv); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0exit(rval); > =A0} > @@ -368,59 +361,10 @@ stime_file(char *fname, struct timeval * > =A0 =A0 =A0 =A0TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim); > =A0} > > -int > -rw(char *fname, struct stat *sbp, int force) > -{ > - =A0 =A0 =A0 int fd, needed_chmod, rval; > - =A0 =A0 =A0 u_char byte; > - > - =A0 =A0 =A0 /* Try regular files. */ > - =A0 =A0 =A0 if (!S_ISREG(sbp->st_mode)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warnx("%s: %s", fname, strerror(EFTYPE)); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (1); > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 needed_chmod =3D rval =3D 0; > - =A0 =A0 =A0 if ((fd =3D open(fname, O_RDWR, 0)) =3D=3D -1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!force || chmod(fname, DEFFILEMODE)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((fd =3D open(fname, O_RDWR, 0)) =3D=3D = -1) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 needed_chmod =3D 1; > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 if (sbp->st_size !=3D 0) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (read(fd, &byte, sizeof(byte)) !=3D size= of(byte)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (lseek(fd, (off_t)0, SEEK_SET) =3D=3D -1= ) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (write(fd, &byte, sizeof(byte)) !=3D siz= eof(byte)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 } else { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (write(fd, &byte, sizeof(byte)) !=3D siz= eof(byte)) { > -err: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", fname); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (ftruncate(fd, (off_t)0)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s: file modified", f= name); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 if (close(fd) && rval !=3D 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", fname); > - =A0 =A0 =A0 } > - =A0 =A0 =A0 if (needed_chmod && chmod(fname, sbp->st_mode) && rval !=3D= 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s: permissions modified", fname); > - =A0 =A0 =A0 } > - =A0 =A0 =A0 return (rval); > -} > - > =A0void > =A0usage(char *myname) > =A0{ > - =A0 =A0 =A0 fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-acfhm] = [-r file] " > + =A0 =A0 =A0 fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-achm] [= -r file] " > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"[-t [[CC]YY]MMDDhhmm[.SS]] file ...\n", m= yname); > =A0 =A0 =A0 =A0exit(1); > =A0} --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 08:17:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E3A71065672; Sun, 5 Feb 2012 08:17:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 0B26E8FC13; Sun, 5 Feb 2012 08:17:46 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D811325D37C0; Sun, 5 Feb 2012 08:17:44 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D816ABDAB0E; Sun, 5 Feb 2012 08:17:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 7WL5OAYT86mL; Sun, 5 Feb 2012 08:17:42 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4A93DBDAB0D; Sun, 5 Feb 2012 08:17:42 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202042300.q14N0SYD055615@svn.freebsd.org> Date: Sun, 5 Feb 2012 08:17:40 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5B5FCCB9-8BA0-4945-AA75-3E62ED5B3DFE@lists.zabbadoz.net> References: <201202042300.q14N0SYD055615@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230997 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:17:46 -0000 On 4. Feb 2012, at 23:00 , Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Feb 4 23:00:27 2012 > New Revision: 230997 > URL: http://svn.freebsd.org/changeset/base/230997 >=20 > Log: > Fix installation script after r230482 -- a missing character = apparently. > Now, back to convalescing. Cool. Thanks! I'll give it a try. > Modified: > head/release/rc.local >=20 > Modified: head/release/rc.local > = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/release/rc.local Sat Feb 4 20:17:07 2012 = (r230996) > +++ head/release/rc.local Sat Feb 4 23:00:27 2012 = (r230997) > @@ -18,7 +18,7 @@ if [ $? -eq 0 ]; then > # goes multiuser > touch /tmp/bsdinstall_log > tail -f /tmp/bsdinstall_log > /dev/ttyv2 & > - /usr/libexec/getty autologin ttyv3 > + /usr/libexec/getty autologin ttyv3 & > EXTERNAL_VTY_STARTED=3D1 > fi > else --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 08:31:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0D7106564A; Sun, 5 Feb 2012 08:31:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF858FC19; Sun, 5 Feb 2012 08:31:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q158VF7K073864; Sun, 5 Feb 2012 08:31:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q158VFO7073862; Sun, 5 Feb 2012 08:31:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202050831.q158VFO7073862@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 08:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231009 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:31:15 -0000 Author: glebius Date: Sun Feb 5 08:31:15 2012 New Revision: 231009 URL: http://svn.freebsd.org/changeset/base/231009 Log: In ifa_init() initialize if_data.ifi_datalen. This would be required after upcoming changes from bz@. Discussed with: bz Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 07:19:00 2012 (r231008) +++ head/sys/net/if.c Sun Feb 5 08:31:15 2012 (r231009) @@ -1416,6 +1416,7 @@ ifa_init(struct ifaddr *ifa) mtx_init(&ifa->ifa_mtx, "ifaddr", NULL, MTX_DEF); refcount_init(&ifa->ifa_refcnt, 1); + ifa->if_data.ifi_datalen = sizeof(ifa->if_data); } void From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 08:53:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4D4E106566B; Sun, 5 Feb 2012 08:53:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3A768FC08; Sun, 5 Feb 2012 08:53:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q158r5ci074553; Sun, 5 Feb 2012 08:53:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q158r5l5074551; Sun, 5 Feb 2012 08:53:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202050853.q158r5l5074551@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 08:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231010 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:53:05 -0000 Author: glebius Date: Sun Feb 5 08:53:05 2012 New Revision: 231010 URL: http://svn.freebsd.org/changeset/base/231010 Log: Better comment for ifa_init(), ifa_ref(), ifa_free(). Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 08:31:15 2012 (r231009) +++ head/sys/net/if.c Sun Feb 5 08:53:05 2012 (r231010) @@ -1408,7 +1408,7 @@ if_maddr_runlock(struct ifnet *ifp) } /* - * Reference count functions for ifaddrs. + * Initialization, desctruction and refcounting functions for ifaddrs. */ void ifa_init(struct ifaddr *ifa) From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 09:17:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2325106564A; Sun, 5 Feb 2012 09:17:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53E18FC0A; Sun, 5 Feb 2012 09:17:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q159HnWt075347; Sun, 5 Feb 2012 09:17:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q159Hnp9075338; Sun, 5 Feb 2012 09:17:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202050917.q159Hnp9075338@svn.freebsd.org> From: Ed Schouten Date: Sun, 5 Feb 2012 09:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231011 - head/usr.bin/systat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 09:17:50 -0000 Author: ed Date: Sun Feb 5 09:17:49 2012 New Revision: 231011 URL: http://svn.freebsd.org/changeset/base/231011 Log: Whitespace fixes. - Remove redundant empty lines. - Replace ^L by \014. This allows you to safely cat/grep/etc this file without causing confusion. Modified: head/usr.bin/systat/icmp.c head/usr.bin/systat/ifstat.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c head/usr.bin/systat/pigs.c head/usr.bin/systat/tcp.c Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/icmp.c Sun Feb 5 09:17:49 2012 (r231011) @@ -277,4 +277,3 @@ fetchicmp(void) if (sysctl(name, 4, &icmpstat, &len, 0, 0) < 0) return; } - Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/ifstat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -58,7 +58,6 @@ static const int col3 = C3; static const int col4 = C4; static const int col5 = C5; - SLIST_HEAD(, if_stat) curlist; SLIST_HEAD(, if_stat_disp) displist; @@ -85,7 +84,7 @@ static void sort_interface_list(void); static u_int getifnum(void); #define IFSTAT_ERR(n, s) do { \ - putchar(' '); \ + putchar('\014'); \ closeifstat(wnd); \ err((n), (s)); \ } while (0) @@ -143,7 +142,6 @@ static u_int getifnum(void); mvprintw(p->if_ypos+1, col2-3, "%s", (const char *)"out"); \ } while (0) - WINDOW * openifstat(void) { @@ -170,7 +168,6 @@ closeifstat(WINDOW *w) return; } - void labelifstat(void) { @@ -254,7 +251,6 @@ fetchifstat(void) IFSTAT_ERR(2, "error getting time of day"); (void)getifmibdata(ifp->if_row, &ifp->if_mib); - new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; new_outb = ifp->if_mib.ifmd_data.ifi_obytes; Modified: head/usr.bin/systat/iostat.c ============================================================================== --- head/usr.bin/systat/iostat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/iostat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -254,7 +254,6 @@ barlabels(int row) return (row); } - void showiostat(void) { Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/ip.c Sun Feb 5 09:17:49 2012 (r231011) @@ -337,4 +337,3 @@ fetchip(void) if (sysctl(name, 4, &curstat.u, &len, 0, 0) < 0) return; } - Modified: head/usr.bin/systat/netcmds.c ============================================================================== --- head/usr.bin/systat/netcmds.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/netcmds.c Sun Feb 5 09:17:49 2012 (r231011) @@ -121,7 +121,6 @@ netcmd(const char *cmd, const char *args return (0); } - static void changeitems(const char *args, int onoff) { Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/netstat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -349,7 +349,6 @@ enter_sysctl(struct inpcb *inp, struct x } } - static struct netinfo * enter(struct inpcb *inp, int state, const char *proto) { @@ -437,7 +436,6 @@ enter(struct inpcb *inp, int state, cons #define SNDCC RCVCC+7 #define STATE SNDCC+7 - void labelnetstat(void) { Modified: head/usr.bin/systat/pigs.c ============================================================================== --- head/usr.bin/systat/pigs.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/pigs.c Sun Feb 5 09:17:49 2012 (r231011) @@ -81,7 +81,6 @@ closepigs(WINDOW *w) delwin(w); } - void showpigs(void) { Modified: head/usr.bin/systat/tcp.c ============================================================================== --- head/usr.bin/systat/tcp.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/tcp.c Sun Feb 5 09:17:49 2012 (r231011) @@ -324,4 +324,3 @@ fetchtcp(void) if (sysctl(name, 4, &curstat, &len, 0, 0) < 0) return; } - From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 09:40:54 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCBC1065673; Sun, 5 Feb 2012 09:40:54 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 07C788FC17; Sun, 5 Feb 2012 09:40:53 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 38121624; Sun, 5 Feb 2012 10:40:52 +0100 (CET) Date: Sun, 5 Feb 2012 10:39:38 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120205093938.GC30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UPT3ojh+0CqEDtpF" Content-Disposition: inline In-Reply-To: <86zkcy5ur9.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 09:40:54 -0000 --UPT3ojh+0CqEDtpF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: > ref8-amd64:/home/trociny% uname -r > 8.2-STABLE > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > daemon: process already running, pid: 19799 >=20 > kopusha:~% uname -r =20 > 10.0-CURRENT > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~%=20 Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also isn't correct. Passing open descriptor to a process that doesn't expect that is bad behaviour. If you pass, eg. open descriptor to a directory and the process is using chroot(2) or jail(2) to sandbox itself it will be able to escape from that sandbox. Passing descriptor to a file has smaller security implication, but it is still wrong. For example hastd, as you probably know, asserts, before sandboxing, that he knows about all open descriptors - if there are some unknown descriptors open it won't run. Also, daemon was passing open descriptor to a pidfile that the child process cannot clean up, because he doesn't know its name. This leaves pidfile with stale PID in it once the process exits, which is also bad. In my opinion, to make daemon(8) work with pidfiles, it cannot exit after executing the given command. It should stay around with pidfile open and just wait for the child to exit. Once the child exits, it should remove the pidfile and also exit. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --UPT3ojh+0CqEDtpF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uTloACgkQForvXbEpPzTCcACgqsmztAXiyZj/9qGD/Gs5FQix lV8Anj5C6M3S6VkO/I8cBwIh94U+hzrQ =Nzp3 -----END PGP SIGNATURE----- --UPT3ojh+0CqEDtpF-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 10:00:38 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6D7A106566C; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 53DE38FC14; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id D0751635; Sun, 5 Feb 2012 11:00:36 +0100 (CET) Date: Sun, 5 Feb 2012 10:59:22 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120205095922.GD30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TybLhxa8M7aNoW+V" Content-Disposition: inline In-Reply-To: <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 10:00:38 -0000 --TybLhxa8M7aNoW+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 04, 2012 at 10:32:56AM -0600, Guy Helmer wrote: >=20 > On Feb 4, 2012, at 1:42 AM, Pawel Jakub Dawidek wrote: >=20 > > On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: > >> Author: ghelmer > >> Date: Wed Feb 1 16:40:59 2012 > >> New Revision: 230869 > >> URL: http://svn.freebsd.org/changeset/base/230869 > >>=20 > >> Log: > >> Change the notes about the pidfile to include Doug's preference > >> for pre-creating the pidfile with appropriate owner and permissions. > >>=20 > >> Requested by dougb > >=20 > > Pre-creating pidfiles? That sounds weird. The common practise is to turn > > eg. /var/run/.pid into /var/run//pid where directory > > has appropriate permissions. Pre-creating pidfiles is simply wrong, > > because applications create pidfile on start and unlink it on exit. > > If application has no permission to remove files from /var/run/ it will > > leave pidfile with stale PID in it, which is bad. Changing application > > to truncate pidfile on exit instead of unlinking it also is a bad idea > > especially because there is working solution - pid directory. >=20 > I prefer this approach, but dougb prefers the other approach. Each has po= sitives and negatives. I tried to accommodate both approaches. I seem to miss positives of the other approach. Leaving stale PIDs in pidfile is something we should avoid at all costs, so recommending that in the manual page is not the best recommendation. I for one would prefer to recommend against it. Even if pidfile is truncated on exit it still leave a mess in /var/run/. But currently it is not truncated on exit (pidfile(3) just unlinks the file, without truncating it first), so we end up with stale PIDs. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --TybLhxa8M7aNoW+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uUvoACgkQForvXbEpPzQgKwCfSTpBlcqXLjv04P0OEz3ylK8q Us4AoPG0JMJ/P88IbMb39P+d4Q/wj06z =aepb -----END PGP SIGNATURE----- --TybLhxa8M7aNoW+V-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 10:59:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E17106566B; Sun, 5 Feb 2012 10:59:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F458FC0C; Sun, 5 Feb 2012 10:59:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15AxoWG079846; Sun, 5 Feb 2012 10:59:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15AxoaY079844; Sun, 5 Feb 2012 10:59:50 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202051059.q15AxoaY079844@svn.freebsd.org> From: Martin Matuska Date: Sun, 5 Feb 2012 10:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231012 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 10:59:51 -0000 Author: mm Date: Sun Feb 5 10:59:50 2012 New Revision: 231012 URL: http://svn.freebsd.org/changeset/base/231012 Log: Analogous to r230407 a separate path buffer in vfs_mount.c is required for r230129. Fixes a out of bounds write to fspath. MFC after: 10 days Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Feb 5 09:17:49 2012 (r231011) +++ head/sys/kern/vfs_mount.c Sun Feb 5 10:59:50 2012 (r231012) @@ -1039,6 +1039,7 @@ vfs_domount( struct vfsconf *vfsp; struct nameidata nd; struct vnode *vp; + char *pathbuf; int error; /* @@ -1102,12 +1103,15 @@ vfs_domount( NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { - error = vn_path_to_global_path(td, vp, fspath, MNAMELEN); + pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); + strcpy(pathbuf, fspath); + error = vn_path_to_global_path(td, vp, pathbuf, MNAMELEN); /* debug.disablefullpath == 1 results in ENODEV */ if (error == 0 || error == ENODEV) { - error = vfs_domount_first(td, vfsp, fspath, vp, + error = vfs_domount_first(td, vfsp, pathbuf, vp, fsflags, optlist); } + free(pathbuf, M_TEMP); } else error = vfs_domount_update(td, vp, fsflags, optlist); mtx_unlock(&Giant); From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 12:46:58 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id CFCF21065670; Sun, 5 Feb 2012 12:46:58 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id CF259152746; Sun, 5 Feb 2012 12:46:54 +0000 (UTC) Message-ID: <4F2E7A3D.8080107@FreeBSD.org> Date: Sun, 05 Feb 2012 04:46:53 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> <20120205095922.GD30033@garage.freebsd.pl> In-Reply-To: <20120205095922.GD30033@garage.freebsd.pl> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigFF0521E5838021636E017BFA" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 12:46:58 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFF0521E5838021636E017BFA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/05/2012 01:59, Pawel Jakub Dawidek wrote: > I seem to miss positives of the other approach. Leaving stale PIDs in > pidfile is something we should avoid at all costs, so recommending that= > in the manual page is not the best recommendation.=20 Which is worse ... potentially stale pidfiles that get cleaned up at every boot, or stale directories that never do? I'm also not sure why you think this method will leave behind a stale pidfile. The idea is that the pidfile is pre-created with the ownership that daemon is going to su to, for the express purpose of allowing it to delete the pidfile when the process exits. If you're saying that this method doesn't work then please point out the problem ASAP because numerous ports rc.d scripts do this now. Doug --=20 It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------enigFF0521E5838021636E017BFA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJPLno+AAoJEFzGhvEaGryElFgH/RvHS89EyN3lc2pyWH+jnkCv +U8RI1um7BsZXLh5DpqtgawGzz13x5pd8dikDqmbAoqWQwCJfGWksywdiQP+z/KW 0EM/0YKYH09EdzzyI1Vl+gkajreHHLfUTse19vDubCsKuqje4AqmMEmU4fz1ry6z fNm/UNUG42gJCi0ytL1RlEHc810g+akYkGWknjDav/RDUFINjQxmrNUWOI0WgBUx OdTg7MhdXK6LWP6kjaB/j2Ur8B5wCrhfrqFQpStVqreVhxl3aOM13wNsEPGHrd2Z xgSlyMOW/mYHMGXKzccLdSGwEKipGJ+OFYCygSRgyHj4uXuykm2gZFBSFWIP8qo= =WPR0 -----END PGP SIGNATURE----- --------------enigFF0521E5838021636E017BFA-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 12:52:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6896106566B; Sun, 5 Feb 2012 12:52:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5AA28FC18; Sun, 5 Feb 2012 12:52:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15CqSfb083289; Sun, 5 Feb 2012 12:52:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15CqS91083287; Sun, 5 Feb 2012 12:52:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202051252.q15CqS91083287@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 12:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231013 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 12:52:28 -0000 Author: glebius Date: Sun Feb 5 12:52:28 2012 New Revision: 231013 URL: http://svn.freebsd.org/changeset/base/231013 Log: Fix typo in r231010. Submitted by: linimon Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 10:59:50 2012 (r231012) +++ head/sys/net/if.c Sun Feb 5 12:52:28 2012 (r231013) @@ -1408,7 +1408,7 @@ if_maddr_runlock(struct ifnet *ifp) } /* - * Initialization, desctruction and refcounting functions for ifaddrs. + * Initialization, destruction and refcounting functions for ifaddrs. */ void ifa_init(struct ifaddr *ifa) From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 13:29:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A26210656A5; Sun, 5 Feb 2012 13:29:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF778FC1E; Sun, 5 Feb 2012 13:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15DT2Ff084402; Sun, 5 Feb 2012 13:29:02 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15DT1kB084400; Sun, 5 Feb 2012 13:29:01 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201202051329.q15DT1kB084400@svn.freebsd.org> From: Justin Hibbits Date: Sun, 5 Feb 2012 13:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231014 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:29:02 -0000 Author: jhibbits Date: Sun Feb 5 13:29:01 2012 New Revision: 231014 URL: http://svn.freebsd.org/changeset/base/231014 Log: Add exca to powerpc modules build as a dependency for cbb. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Feb 5 12:52:28 2012 (r231013) +++ head/sys/modules/Makefile Sun Feb 5 13:29:01 2012 (r231014) @@ -764,6 +764,7 @@ _cardbus= cardbus _cbb= cbb _cfi= cfi _cpufreq= cpufreq +_exca= exca _nvram= powermac_nvram _pccard= pccard _smbfs= smbfs From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 13:52:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB87F1065670; Sun, 5 Feb 2012 13:52:49 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 577E88FC0A; Sun, 5 Feb 2012 13:52:49 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 547446D0; Sun, 5 Feb 2012 14:52:47 +0100 (CET) Date: Sun, 5 Feb 2012 14:51:33 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20120205135131.GG30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> <20120205095922.GD30033@garage.freebsd.pl> <4F2E7A3D.8080107@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m972NQjnE83KvVa/" Content-Disposition: inline In-Reply-To: <4F2E7A3D.8080107@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:52:49 -0000 --m972NQjnE83KvVa/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 05, 2012 at 04:46:53AM -0800, Doug Barton wrote: > On 02/05/2012 01:59, Pawel Jakub Dawidek wrote: >=20 > > I seem to miss positives of the other approach. Leaving stale PIDs in > > pidfile is something we should avoid at all costs, so recommending that > > in the manual page is not the best recommendation.=20 >=20 > Which is worse ... potentially stale pidfiles that get cleaned up at > every boot, or stale directories that never do? Every boot might be very rare situation on servers. Those directories should be cleaned when application is deinstalled and not when process exits. > I'm also not sure why you think this method will leave behind a stale > pidfile. The idea is that the pidfile is pre-created with the ownership > that daemon is going to su to, for the express purpose of allowing it to > delete the pidfile when the process exits. If you're saying that this > method doesn't work then please point out the problem ASAP because > numerous ports rc.d scripts do this now. Great, but this is not how UNIX permissions work. To remove directory entry you have to have rights to modify the directory. Having write permission to file within the directory won't allow you to remove it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --m972NQjnE83KvVa/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uiWMACgkQForvXbEpPzTwVACfTREBUze/Wxv98p0JKuqZ6kQE RLgAnjQWJISuF1L4C5y97X/keDPGi+eX =ufav -----END PGP SIGNATURE----- --m972NQjnE83KvVa/-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 13:53:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEFE21065672 for ; Sun, 5 Feb 2012 13:53:49 +0000 (UTC) (envelope-from chmeeedalf@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 B71478FC13 for ; Sun, 5 Feb 2012 13:53:49 +0000 (UTC) Received: by iaeo4 with SMTP id o4so10912819iae.13 for ; Sun, 05 Feb 2012 05:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; bh=dxyW2yIiTe46XNOpNFyjHpUK0JTk1qayWvl1EEg/i2k=; b=kCmqy9UWyhv5GLxRIaImW1+nVPa4VE4Tiv/YLsjD3sRPPDNNn1GixlaNrtBZWIiTZk sJbWJdeUvM7J1HvteiybD71GhDWZzHE2Z6GV3UlS37bDA4n/7tkToqOQvcxlphwD2uup 2Oq5ko6CgzHgQQTXj84+P/SgiXsbO1sMwqSuk= Received: by 10.42.107.9 with SMTP id b9mr7896587icp.23.1328448661844; Sun, 05 Feb 2012 05:31:01 -0800 (PST) Received: from triad.knownspace (216-15-41-8.c3-0.gth-ubr1.lnh-gth.md.cable.rcn.com. [216.15.41.8]) by mx.google.com with ESMTPS id l28sm21085130ibc.3.2012.02.05.05.31.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 05:31:00 -0800 (PST) Message-Id: <7D839B6E-E8CD-463B-B117-BCB07F07EF20@gmail.com> From: Justin Hibbits To: Justin Hibbits In-Reply-To: <201202051329.q15DT1kB084400@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 5 Feb 2012 08:28:37 -0500 References: <201202051329.q15DT1kB084400@svn.freebsd.org> X-Mailer: Apple Mail (2.936) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231014 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:53:50 -0000 On Feb 5, 2012, at 8:29 AM, Justin Hibbits wrote: > Author: jhibbits > Date: Sun Feb 5 13:29:01 2012 > New Revision: 231014 > URL: http://svn.freebsd.org/changeset/base/231014 > > Log: > Add exca to powerpc modules build as a dependency for cbb. Approved by: nwhitehorn (mentor) sigh. I really should stop committing first thing in the morning. From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 15:21:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA7D1065674; Sun, 5 Feb 2012 15:21:08 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBBF68FC14; Sun, 5 Feb 2012 15:21:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15FL8lN088404; Sun, 5 Feb 2012 15:21:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FL800088402; Sun, 5 Feb 2012 15:21:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051521.q15FL800088402@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231015 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:21:09 -0000 Author: trociny Date: Sun Feb 5 15:21:08 2012 New Revision: 231015 URL: http://svn.freebsd.org/changeset/base/231015 Log: Fix the regression introduced in r226859: if the local component is out of date BIO_READ requests got lost instead of being sent to the remote component. Reviewed by: pjd MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Feb 5 13:29:01 2012 (r231014) +++ head/sbin/hastd/primary.c Sun Feb 5 15:21:08 2012 (r231015) @@ -1255,7 +1255,7 @@ ggate_recv_thread(void *arg) pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queues.", hio); refcount_init(&hio->hio_countdown, ncomps); - for (ii = ncomp; ii < ncomps; ii++) + for (ii = ncomp; ii < ncomp + ncomps; ii++) QUEUE_INSERT1(hio, send, ii); } /* NOTREACHED */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 15:23:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20ABE106566C; Sun, 5 Feb 2012 15:23:33 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE5C8FC0A; Sun, 5 Feb 2012 15:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15FNWsY088524; Sun, 5 Feb 2012 15:23:32 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FNWUQ088522; Sun, 5 Feb 2012 15:23:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051523.q15FNWUQ088522@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231016 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:23:33 -0000 Author: trociny Date: Sun Feb 5 15:23:32 2012 New Revision: 231016 URL: http://svn.freebsd.org/changeset/base/231016 Log: If a local write request is from the synchronization thread, when it is synchronizing data that is out of date on the local component, we should not send G_GATE_CMD_DONE acknowledge to the kernel. This fixes the issue, observed in async mode, when on synchronization from the remote component the worker terminated with "G_GATE_CMD_DONE failed" error. Reported by: Artem Kajalainen Reviewed by: pjd MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Feb 5 15:21:08 2012 (r231015) +++ head/sbin/hastd/primary.c Sun Feb 5 15:23:32 2012 (r231016) @@ -1326,7 +1326,8 @@ local_send_thread(void *arg) } else { hio->hio_errors[ncomp] = 0; if (hio->hio_replication == - HAST_REPLICATION_ASYNC) { + HAST_REPLICATION_ASYNC && + !ISSYNCREQ(hio)) { ggio->gctl_error = 0; write_complete(res, hio); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 15:59:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324071065672; Sun, 5 Feb 2012 15:59:19 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210F88FC14; Sun, 5 Feb 2012 15:59:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15FxI7Y089922; Sun, 5 Feb 2012 15:59:18 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FxIMQ089920; Sun, 5 Feb 2012 15:59:18 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201202051559.q15FxIMQ089920@svn.freebsd.org> From: Andreas Tobler Date: Sun, 5 Feb 2012 15:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231019 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:59:19 -0000 Author: andreast Date: Sun Feb 5 15:59:18 2012 New Revision: 231019 URL: http://svn.freebsd.org/changeset/base/231019 Log: Revert the _NOPROF entries on cpu_throw, cpu_switch and savectx. They can be profiled too now. MFC after: 2 weeks Modified: head/sys/powerpc/aim/swtch64.S Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Sun Feb 5 15:54:32 2012 (r231018) +++ head/sys/powerpc/aim/swtch64.S Sun Feb 5 15:59:18 2012 (r231019) @@ -68,7 +68,7 @@ /* * void cpu_throw(struct thread *old, struct thread *new) */ -ENTRY_NOPROF(cpu_throw) +ENTRY(cpu_throw) mr %r13, %r4 b cpu_switchin @@ -79,7 +79,7 @@ ENTRY_NOPROF(cpu_throw) * * Switch to a new thread saving the current state in the old thread. */ -ENTRY_NOPROF(cpu_switch) +ENTRY(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ @@ -237,7 +237,7 @@ blocked_loop: * savectx(pcb) * Update pcb, saving current processor state */ -ENTRY_NOPROF(savectx) +ENTRY(savectx) std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ std %r13,PCB_CONTEXT+1*8(%r3) std %r14,PCB_CONTEXT+2*8(%r3) From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:16:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AD27106566C; Sun, 5 Feb 2012 16:16:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 6B08B8FC0A; Sun, 5 Feb 2012 16:16:24 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id F12675824F; Sun, 5 Feb 2012 09:49:12 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 5gpzRRBTdP2p; Sun, 5 Feb 2012 09:49:12 -0600 (CST) Received: from elpis.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 4844F58141; Sun, 5 Feb 2012 09:49:12 -0600 (CST) Message-ID: <4F2EA4F7.9010204@freebsd.org> Date: Sun, 05 Feb 2012 09:49:11 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.13) Gecko/20110202 Thunderbird/3.1.7 MIME-Version: 1.0 To: TAKAHASHI Yoshihiro References: <201201231544.q0NFirMh032859@svn.freebsd.org> <20120123160340.GI95413@hoeg.nl> <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> In-Reply-To: <20120128.193030.322386357550021613.nyan@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:16:24 -0000 On 01/28/12 04:30, TAKAHASHI Yoshihiro wrote: > In article<1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> > Nathan Whitehorn writes: > >> I think we didn't make PC98 release media for 9.0, but that's a good >> point. I'm out of commission right now due to an injury, so patches >> would be welcome. >>>> TERM=xterm >>> This code is also used on pc98, right? I think on pc98 we still need >>> to >>> use TERM=cons25w, to support Japanese character sets and keyboard >>> input. > How about the attached patch? > > --- > TAKAHASHI Yoshihiro The top half looks OK. The bottom half (the menu) is relevant only for serial consoles. I guess people could be viewing a remote serial console on a PC-98 graphics console, but then it shouldn't be conditionalized on PC98 machines. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:41:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5FD106566B; Sun, 5 Feb 2012 16:41:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED8F98FC19; Sun, 5 Feb 2012 16:41:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15Gf60Q091588; Sun, 5 Feb 2012 16:41:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Gf6vE091586; Sun, 5 Feb 2012 16:41:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202051641.q15Gf6vE091586@svn.freebsd.org> From: Alexander Motin Date: Sun, 5 Feb 2012 16:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231024 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:41:07 -0000 Author: mav Date: Sun Feb 5 16:41:06 2012 New Revision: 231024 URL: http://svn.freebsd.org/changeset/base/231024 Log: Remove extra semicolon. Submitted by: emaste Modified: head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Sun Feb 5 16:23:55 2012 (r231023) +++ head/sys/dev/sound/pci/hda/hdacc.c Sun Feb 5 16:41:06 2012 (r231024) @@ -612,7 +612,7 @@ hdacc_stream_intr(device_t dev, int dir, struct hdacc_softc *codec = device_get_softc(dev); device_t child; - if ((child = codec->streams[dir][stream]) != NULL); + if ((child = codec->streams[dir][stream]) != NULL) HDAC_STREAM_INTR(child, dir, stream); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:53:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69EFB106566B; Sun, 5 Feb 2012 16:53:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5746D8FC14; Sun, 5 Feb 2012 16:53:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15Gr3rx092066; Sun, 5 Feb 2012 16:53:03 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Gr3AB092056; Sun, 5 Feb 2012 16:53:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202051653.q15Gr3AB092056@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 16:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:53:03 -0000 Author: glebius Date: Sun Feb 5 16:53:02 2012 New Revision: 231025 URL: http://svn.freebsd.org/changeset/base/231025 Log: Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT, that allow to control initial timeout, idle time, idle re-send interval and idle send count on a per-socket basis. Reviewed by: andre, bz, lstewart Modified: head/share/man/man4/tcp.4 head/sys/netinet/tcp.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/sys/param.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Sun Feb 5 16:41:06 2012 (r231024) +++ head/share/man/man4/tcp.4 Sun Feb 5 16:53:02 2012 (r231025) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 14, 2011 +.Dd February 5, 2012 .Dt TCP 4 .Os .Sh NAME @@ -146,6 +146,65 @@ connection. See .Xr mod_cc 4 for details. +.It Dv TCP_KEEPINIT +This write-only +.Xr setsockopt 2 +option accepts a per-socket timeout argument of +.Vt "u_int" +in seconds, for new, non-established +.Tn TCP +connections. +For the global default in milliseconds see +.Va keepinit +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPIDLE +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +for the amount of time, in seconds, that the connection must be idle +before keepalive probes (if enabled) are sent for the connection of this +socket. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepidle +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPINTVL +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +to set the per-socket interval, in seconds, between keepalive probes sent +to a peer. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepintvl +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPCNT +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +and allows a per-socket tuning of the number of probes sent, with no response, +before the connection will be dropped. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default see the +.Va keepcnt +in the +.Sx MIB Variables +section further down. .It Dv TCP_NODELAY Under most circumstances, .Tn TCP @@ -296,17 +355,21 @@ The Maximum Segment Lifetime, in millise Timeout, in milliseconds, for new, non-established .Tn TCP connections. +The default is 75000 msec. .It Va keepidle Amount of time, in milliseconds, that the connection must be idle before keepalive probes (if enabled) are sent. +The default is 7200000 msec (2 hours). .It Va keepintvl The interval, in milliseconds, between keepalive probes sent to remote machines, when no response is received on a .Va keepidle probe. -After -.Dv TCPTV_KEEPCNT -(default 8) probes are sent, with no response, the connection is dropped. +The default is 75000 msec. +.It Va keepcnt +Number of probes sent, with no response, before a connection +is dropped. +The default is 8 packets. .It Va always_keepalive Assume that .Dv SO_KEEPALIVE Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp.h Sun Feb 5 16:53:02 2012 (r231025) @@ -159,6 +159,10 @@ struct tcphdr { #define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */ #define TCP_INFO 0x20 /* retrieve tcp_info structure */ #define TCP_CONGESTION 0x40 /* get/set congestion control algorithm */ +#define TCP_KEEPINIT 0x80 /* N, time to establish connection */ +#define TCP_KEEPIDLE 0x100 /* L,N,X start keeplives after this period */ +#define TCP_KEEPINTVL 0x200 /* L,N interval between keepalives */ +#define TCP_KEEPCNT 0x400 /* L,N number of keepalives before close */ #define TCP_CA_NAME_MAX 16 /* max congestion control name length */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_input.c Sun Feb 5 16:53:02 2012 (r231025) @@ -1446,7 +1446,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ tp->t_rcvtime = ticks; if (TCPS_HAVEESTABLISHED(tp->t_state)) - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); /* * Unscale the window into a 32-bit value. @@ -1889,7 +1889,8 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); } } else { /* @@ -2293,7 +2294,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } /* * If segment contains data or ACK, will call tcp_reass() @@ -2630,12 +2631,11 @@ process_ACK: * compressed state. */ if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { - int timeout; - soisdisconnected(so); - timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; - tcp_timer_activate(tp, TT_2MSL, timeout); + tcp_timer_activate(tp, TT_2MSL, + (tcp_fast_finwait2_recycle ? + tcp_finwait2_timeout : + TP_MAXIDLE(tp))); } tp->t_state = TCPS_FIN_WAIT_2; } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_syncache.c Sun Feb 5 16:53:02 2012 (r231025) @@ -845,7 +845,15 @@ syncache_socket(struct syncache *sc, str */ if (sc->sc_rxmits > 1) tp->snd_cwnd = tp->t_maxseg; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + + /* + * Copy and activate timers. + */ + tp->t_keepinit = sototcpcb(lso)->t_keepinit; + tp->t_keepidle = sototcpcb(lso)->t_keepidle; + tp->t_keepintvl = sototcpcb(lso)->t_keepintvl; + tp->t_keepcnt = sototcpcb(lso)->t_keepcnt; + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); INP_WUNLOCK(inp); Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_timer.c Sun Feb 5 16:53:02 2012 (r231025) @@ -111,12 +111,12 @@ int tcp_finwait2_timeout; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW, &tcp_finwait2_timeout, 0, sysctl_msec_to_ticks, "I", "FIN-WAIT2 timeout"); +int tcp_keepcnt = TCPTV_KEEPCNT; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, keepcnt, CTLFLAG_RW, &tcp_keepcnt, 0, + "Number of keepalive probes to send"); -static int tcp_keepcnt = TCPTV_KEEPCNT; /* max idle probes */ int tcp_maxpersistidle; - /* max idle time in persist */ -int tcp_maxidle; static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, @@ -138,7 +138,6 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - tcp_maxidle = tcp_keepcnt * tcp_keepintvl; INP_INFO_WLOCK(&V_tcbinfo); (void) tcp_tw_2msl_scan(0); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -255,9 +254,9 @@ tcp_timer_2msl(void *xtp) tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && - ticks - tp->t_rcvtime <= tcp_maxidle) - callout_reset_on(&tp->t_timers->tt_2msl, tcp_keepintvl, - tcp_timer_2msl, tp, INP_CPU(inp)); + ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) + callout_reset_on(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp, INP_CPU(inp)); else tp = tcp_close(tp); } @@ -318,7 +317,7 @@ tcp_timer_keep(void *xtp) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { - if (ticks - tp->t_rcvtime >= tcp_keepidle + tcp_maxidle) + if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; /* * Send a packet designed to force a response @@ -340,9 +339,11 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepintvl, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp, INP_CPU(inp)); } else - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepidle, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp, INP_CPU(inp)); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_timer.h Sun Feb 5 16:53:02 2012 (r231025) @@ -153,10 +153,16 @@ struct tcp_timer { #define TT_KEEP 0x08 #define TT_2MSL 0x10 +#define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) +#define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : tcp_keepidle) +#define TP_KEEPINTVL(tp) ((tp)->t_keepintvl ? (tp)->t_keepintvl : tcp_keepintvl) +#define TP_KEEPCNT(tp) ((tp)->t_keepcnt ? (tp)->t_keepcnt : tcp_keepcnt) +#define TP_MAXIDLE(tp) (TP_KEEPCNT(tp) * TP_KEEPINTVL(tp)) + extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ -extern int tcp_maxidle; /* time to drop after starting probes */ +extern int tcp_keepcnt; /* number of keepalives */ extern int tcp_delacktime; /* time before sending a delayed ACK */ extern int tcp_maxpersistidle; extern int tcp_rexmit_min; Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_usrreq.c Sun Feb 5 16:53:02 2012 (r231025) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1118,7 +1119,7 @@ tcp_connect(struct tcpcb *tp, struct soc soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1191,7 +1192,7 @@ tcp6_connect(struct tcpcb *tp, struct so soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1272,6 +1273,7 @@ int tcp_ctloutput(struct socket *so, struct sockopt *sopt) { int error, opt, optval; + u_int ui; struct inpcb *inp; struct tcpcb *tp; struct tcp_info ti; @@ -1439,6 +1441,59 @@ tcp_ctloutput(struct socket *so, struct INP_WUNLOCK(inp); break; + case TCP_KEEPIDLE: + case TCP_KEEPINTVL: + case TCP_KEEPCNT: + case TCP_KEEPINIT: + INP_WUNLOCK(inp); + error = sooptcopyin(sopt, &ui, sizeof(ui), sizeof(ui)); + if (error) + return (error); + + if (ui > (UINT_MAX / hz)) { + error = EINVAL; + break; + } + ui *= hz; + + INP_WLOCK_RECHECK(inp); + switch (sopt->sopt_name) { + case TCP_KEEPIDLE: + tp->t_keepidle = ui; + /* + * XXX: better check current remaining + * timeout and "merge" it with new value. + */ + if ((tp->t_state > TCPS_LISTEN) && + (tp->t_state <= TCPS_CLOSING)) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); + break; + case TCP_KEEPINTVL: + tp->t_keepintvl = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPCNT: + tp->t_keepcnt = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPINIT: + tp->t_keepinit = ui; + if (tp->t_state == TCPS_SYN_RECEIVED || + tp->t_state == TCPS_SYN_SENT) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPINIT(tp)); + break; + } + INP_WUNLOCK(inp); + break; + default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -1636,7 +1691,7 @@ tcp_usrclosed(struct tcpcb *tp) int timeout; timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; + tcp_finwait2_timeout : TP_MAXIDLE(tp); tcp_timer_activate(tp, TT_2MSL, timeout); } } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_var.h Sun Feb 5 16:53:02 2012 (r231025) @@ -203,7 +203,12 @@ struct tcpcb { struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ - uint32_t t_ispare[12]; /* 4 keep timers, 5 UTO, 3 TBD */ + u_int t_keepinit; /* time to establish connection */ + u_int t_keepidle; /* time before keepalive probes begin */ + u_int t_keepintvl; /* interval between keepalives */ + u_int t_keepcnt; /* number of keepalives before close */ + + uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ void *t_pspare2[4]; /* 4 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/sys/param.h Sun Feb 5 16:53:02 2012 (r231025) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000006 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000007 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:54:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E76106566C; Sun, 5 Feb 2012 16:54:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08B508FC1C; Sun, 5 Feb 2012 16:54:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15GsQ2m092139; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GsQcc092137; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051654.q15GsQcc092137@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:54:27 -0000 Author: nwhitehorn Date: Sun Feb 5 16:54:26 2012 New Revision: 231026 URL: http://svn.freebsd.org/changeset/base/231026 Log: Make sure to remap adjusted resources. Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:53:02 2012 (r231025) +++ head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:54:26 2012 (r231026) @@ -431,6 +431,7 @@ ofw_pci_adjust_resource(device_t bus, de { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); + int error; switch (type) { case SYS_RES_MEMORY: @@ -445,7 +446,22 @@ ofw_pci_adjust_resource(device_t bus, de if (!rman_is_region_manager(res, rm)) return (EINVAL); - return (rman_adjust_resource(res, start, end)); + + error = rman_adjust_resource(res, start, end); + if (error) + return (error); + + if (rman_get_flags(res) & RF_ACTIVE) { + /* Remap memory resources */ + error = ofw_pci_deactivate_resource(bus, child, type, + rman_get_rid(res), res); + if (error) + return (error); + error = ofw_pci_activate_resource(bus, child, type, + rman_get_rid(res), res); + } + + return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:00:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0122A106566B; Sun, 5 Feb 2012 20:00:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DECA58FC14; Sun, 5 Feb 2012 20:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15K0dCd098793; Sun, 5 Feb 2012 20:00:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K0d5g098790; Sun, 5 Feb 2012 20:00:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201202052000.q15K0d5g098790@svn.freebsd.org> From: Rui Paulo Date: Sun, 5 Feb 2012 20:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231042 - in head/sys/boot/ficl: . i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:00:40 -0000 Author: rpaulo Date: Sun Feb 5 20:00:39 2012 New Revision: 231042 URL: http://svn.freebsd.org/changeset/base/231042 Log: Fix clang warnings. Modified: head/sys/boot/ficl/fileaccess.c head/sys/boot/ficl/i386/sysdep.h Modified: head/sys/boot/ficl/fileaccess.c ============================================================================== --- head/sys/boot/ficl/fileaccess.c Sun Feb 5 19:59:01 2012 (r231041) +++ head/sys/boot/ficl/fileaccess.c Sun Feb 5 20:00:39 2012 (r231042) @@ -420,6 +420,6 @@ void ficlCompileFile(FICL_SYSTEM *pSys) ficlSetEnv(pSys, "file-ext", FICL_TRUE); #endif /* FICL_HAVE_FTRUNCATE */ #else - &pSys; + (void)pSys; #endif /* FICL_WANT_FILE */ } Modified: head/sys/boot/ficl/i386/sysdep.h ============================================================================== --- head/sys/boot/ficl/i386/sysdep.h Sun Feb 5 19:59:01 2012 (r231041) +++ head/sys/boot/ficl/i386/sysdep.h Sun Feb 5 20:00:39 2012 (r231042) @@ -58,7 +58,7 @@ #include #if !defined IGNORE /* Macro to silence unused param warnings */ -#define IGNORE(x) &x +#define IGNORE(x) (void)x #endif /* @@ -405,7 +405,7 @@ void *ficlRealloc(void *p, size_t size); #if FICL_MULTITHREAD int ficlLockDictionary(short fLock); #else -#define ficlLockDictionary(x) 0 /* ignore */ +#define ficlLockDictionary(x) /* ignore */ #endif /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:04:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CB01065670; Sun, 5 Feb 2012 20:04:43 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC1DD8FC19; Sun, 5 Feb 2012 20:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15K4hId099037; Sun, 5 Feb 2012 20:04:43 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K4hrC099031; Sun, 5 Feb 2012 20:04:43 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201202052004.q15K4hrC099031@svn.freebsd.org> From: Andreas Tobler Date: Sun, 5 Feb 2012 20:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231044 - in head: lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:04:44 -0000 Author: andreast Date: Sun Feb 5 20:04:43 2012 New Revision: 231044 URL: http://svn.freebsd.org/changeset/base/231044 Log: Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful name. Tested on 32- and 64-bit PowerMac. Reviewed by: bde Modified: head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc64/SYS.h head/lib/libc/powerpc64/gen/setjmp.S head/sys/powerpc/include/asm.h Modified: head/lib/libc/powerpc/SYS.h ============================================================================== --- head/lib/libc/powerpc/SYS.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc/SYS.h Sun Feb 5 20:04:43 2012 (r231044) @@ -33,38 +33,38 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Modified: head/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/setjmp.S Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc/gen/setjmp.S Sun Feb 5 20:04:43 2012 (r231044) @@ -69,7 +69,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ mr %r6,%r4 /* save val param */ Modified: head/lib/libc/powerpc64/SYS.h ============================================================================== --- head/lib/libc/powerpc64/SYS.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc64/SYS.h Sun Feb 5 20:04:43 2012 (r231044) @@ -33,13 +33,13 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: mflr %r0; \ @@ -51,18 +51,18 @@ ld %r0,16(%r1); \ mtlr %r0; \ blr; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bnslr; \ mflr %r0; \ std %r0,16(%r1); \ @@ -74,13 +74,13 @@ ENTRY(__CONCAT(__sys_,x)); \ mtlr %r0; \ blr; -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ \ mflr %r0; \ Modified: head/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc64/gen/setjmp.S Sun Feb 5 20:04:43 2012 (r231044) @@ -93,7 +93,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/sys/powerpc/include/asm.h Sun Feb 5 20:04:43 2012 (r231044) @@ -116,9 +116,9 @@ #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ -#define WEAK_ALIAS(alias,sym) \ +#define WEAK_REFERENCE(sym, alias) \ .weak alias; \ - alias = sym + .equ alias,sym #ifdef __STDC__ #define WARN_REFERENCES(_sym,_msg) \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:07:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB77106564A; Sun, 5 Feb 2012 20:07:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C05218FC13; Sun, 5 Feb 2012 20:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15K7jjN099237; Sun, 5 Feb 2012 20:07:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K7jQx099235; Sun, 5 Feb 2012 20:07:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202052007.q15K7jQx099235@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 20:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231046 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:07:46 -0000 Author: nwhitehorn Date: Sun Feb 5 20:07:45 2012 New Revision: 231046 URL: http://svn.freebsd.org/changeset/base/231046 Log: Inherit from PCI bridge driver instead of manually specifying all of its methods. Obtained from: sparc64 MFC after: 1 week Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Feb 5 20:06:43 2012 (r231045) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Feb 5 20:07:45 2012 (r231046) @@ -56,31 +56,10 @@ static int ofw_pcib_pci_route_interrupt( static device_method_t ofw_pcib_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ofw_pcib_pci_probe), - DEVMETHOD(device_attach, ofw_pcib_pci_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_read_ivar, pcib_read_ivar), - DEVMETHOD(bus_write_ivar, pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(device_attach, ofw_pcib_pci_attach), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), - DEVMETHOD(pcib_read_config, pcib_read_config), - DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_pci_route_interrupt), - DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), - DEVMETHOD(pcib_release_msi, pcib_release_msi), - DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), - DEVMETHOD(pcib_release_msix, pcib_release_msix), - DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_pci_get_node), @@ -101,8 +80,8 @@ struct ofw_pcib_softc { struct ofw_bus_iinfo ops_iinfo; }; -DEFINE_CLASS_0(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, - sizeof(struct ofw_pcib_softc)); +DEFINE_CLASS_1(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, + sizeof(struct ofw_pcib_softc), pcib_driver); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0); static int From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:55:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA92106564A; Sun, 5 Feb 2012 20:55:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ACB58FC0C; Sun, 5 Feb 2012 20:55:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15KtcV6001309; Sun, 5 Feb 2012 20:55:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Ktcw4001307; Sun, 5 Feb 2012 20:55:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052055.q15Ktcw4001307@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 20:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231054 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:55:38 -0000 Author: dim Date: Sun Feb 5 20:55:38 2012 New Revision: 231054 URL: http://svn.freebsd.org/changeset/base/231054 Log: In usr.bin/rpcgen/rpc_main.c, properly check the return value of strlcpy(), in addition to checking that of strlcat(). MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Sun Feb 5 20:53:06 2012 (r231053) +++ head/usr.bin/rpcgen/rpc_main.c Sun Feb 5 20:55:38 2012 (r231054) @@ -1125,9 +1125,11 @@ parseargs(int argc, const char *argv[], if (++i == argc) { return (0); } - (void) strlcpy(pathbuf, argv[i], sizeof(pathbuf)); - if (strlcat(pathbuf, "/cpp", sizeof(pathbuf)) - >= sizeof(pathbuf)) { + if (strlcpy(pathbuf, argv[i], + sizeof(pathbuf)) >= sizeof(pathbuf) + || strlcat(pathbuf, "/cpp", + sizeof(pathbuf)) >= + sizeof(pathbuf)) { warnx("argument too long"); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 21:27:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBBB106566B; Sun, 5 Feb 2012 21:27:16 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5E51B8FC18; Sun, 5 Feb 2012 21:27:15 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so5877497bkb.13 for ; Sun, 05 Feb 2012 13:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=yyvWPrW2AY2nBUBHxvGc02Sw0GBokmc1Eux2SiP6Rrc=; b=hyz8sO2K72oJiCm/OAtJ2tYoSzcLwpkj88aNAriyol75oj0Bb0nmAEQX9ChCkrSaoN z3rUvBEZdwbktsx+Po7th/pbSJXY5415qAtxmxvYrQcdOH8w8fKKJXenVTw9d9m+Lw0d stdxB4UR2IUhDgxB/A+kQwM5ScxNQjoJMiBg0= Received: by 10.204.129.200 with SMTP id p8mr7322015bks.114.1328477234411; Sun, 05 Feb 2012 13:27:14 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id t17sm38600935bke.6.2012.02.05.13.27.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 13:27:13 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> X-Comment-To: Pawel Jakub Dawidek Sender: Mikolaj Golub Date: Sun, 05 Feb 2012 23:27:10 +0200 In-Reply-To: <20120205093938.GC30033@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Sun, 5 Feb 2012 10:39:38 +0100") Message-ID: <86lioh7yz5.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 21:27:16 -0000 --=-=-= On Sun, 5 Feb 2012 10:39:38 +0100 Pawel Jakub Dawidek wrote: PJD> On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: >> ref8-amd64:/home/trociny% uname -r >> 8.2-STABLE >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> daemon: process already running, pid: 19799 >> >> kopusha:~% uname -r >> 10.0-CURRENT >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% PJD> Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also PJD> isn't correct. PJD> Passing open descriptor to a process that doesn't expect that is bad PJD> behaviour. If you pass, eg. open descriptor to a directory and the PJD> process is using chroot(2) or jail(2) to sandbox itself it will be able PJD> to escape from that sandbox. Passing descriptor to a file has smaller PJD> security implication, but it is still wrong. For example hastd, as you PJD> probably know, asserts, before sandboxing, that he knows about all open PJD> descriptors - if there are some unknown descriptors open it won't run. PJD> Also, daemon was passing open descriptor to a pidfile that the child PJD> process cannot clean up, because he doesn't know its name. This leaves PJD> pidfile with stale PID in it once the process exits, which is also bad. PJD> In my opinion, to make daemon(8) work with pidfiles, it cannot exit PJD> after executing the given command. It should stay around with pidfile PJD> open and just wait for the child to exit. Once the child exits, it PJD> should remove the pidfile and also exit. Ok, using hastd code as a reference :-) here is my implementation. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=daemon.c.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231014) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,26 +32,31 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include +#include +#include #include #include #include static void restrict_process(const char *); +static void wait_child(pid_t, sigset_t *); +static void dummy_sighandler(int); static void usage(void); int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + sigset_t mask, oldmask; + int ch, nochdir, noclose; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -82,40 +87,96 @@ main(int argc, char *argv[]) if (user != NULL) restrict_process(user); + if (pidfile == NULL) { + /* + * This is a simple case. Daemonize and exec. + */ + if (daemon(nochdir, noclose) == -1) + err(1, NULL); + + execvp(argv[0], argv); + + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + /* * Try to open the pidfile before calling daemon(3), - * to be able to report the error intelligently + * to be able to report the error intelligently. */ - if (pidfile) { - pfh = pidfile_open(pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "pidfile ``%s''", pidfile); + pfh = pidfile_open(pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); } + err(2, "pidfile ``%s''", pidfile); } - if (daemon(nochdir, noclose) == -1) err(1, NULL); + /* + * We want to keep pidfile open while the command is running + * and remove it on exit. So we execute the command in a + * forked process and wait for the child to exit. We don't + * want the waiting daemon to be killed leaving the running + * process and the stale pidfile, so we pass received SIGHUP, + * SIGINT and SIGTERM to the children expecting to get SIGCHLD + * eventually. + */ - /* Now that we are the child, write out the pid */ - if (pidfile) - pidfile_write(pfh); - - execvp(argv[0], argv); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error + * Restore default actions for interesting signals in case + * the parent process decided to ignore some of them. */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) + if (signal(SIGHUP, SIG_DFL) == SIG_ERR) + err(1, "signal"); + if (signal(SIGINT, SIG_DFL) == SIG_ERR) + err(1, "signal"); + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) + err(1, "signal"); + /* + * Because SIGCHLD is ignored by default, setup dummy handler + * for it, so we can mask it. + */ + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) + err(1, "signal"); + /* + * Block interesting signals. + */ + sigemptyset(&mask); + sigaddset(&mask, SIGHUP); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGTERM); + sigaddset(&mask, SIGCHLD); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) + err(1, "sigprocmask"); + /* + * Fork a child to exec and wait until it exits to remove the + * pidfile. + */ + pid = fork(); + if (pid == -1) { pidfile_remove(pfh); + err(1, "fork"); + } + if (pid == 0) { + /* Restore old sigmask in the child. */ + if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) + err(1, "sigprocmask"); + /* Now that we are the child, write out the pid. */ + pidfile_write(pfh); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + execvp(argv[0], argv); + + /* execvp() failed. */ + err(1, "%s", argv[0]); + } + wait_child(pid, &mask); + pidfile_remove(pfh); + exit(0); } static void @@ -132,6 +193,30 @@ restrict_process(const char *user) } static void +wait_child(pid_t pid, sigset_t *mask) +{ + int signo; + + while ((signo = sigwaitinfo(mask, NULL)) != -1) { + switch (signo) { + case SIGCHLD: + return; + default: + if (kill(pid, signo) == -1) { + warn("kill"); + return; + } + } + } +} + +static void +dummy_sighandler(int sig __unused) +{ + /* Nothing to do. */ +} + +static void usage(void) { (void)fprintf(stderr, --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 21:48:05 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E62106566C; Sun, 5 Feb 2012 21:48:05 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 5F19C8FC19; Sun, 5 Feb 2012 21:48:04 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E59BB804; Sun, 5 Feb 2012 22:48:02 +0100 (CET) Date: Sun, 5 Feb 2012 22:46:48 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120205214647.GI30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="STPqjqpCrtky8aYs" Content-Disposition: inline In-Reply-To: <86lioh7yz5.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 21:48:05 -0000 --STPqjqpCrtky8aYs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > Ok, using hastd code as a reference :-) here is my implementation. - I'd not pass selected signals to the child. The parent can still be killed with a whole bunch of different signals that are not passed or cannot be caught or the child process handle them gracefully. Signals should be send to the PID from the pidfile anyway. If someone is sending signals to the parent he has no right to expect well behaviour from the parent. - Now that we handle the pidfile fully in the parent, I'd move dropping provileges after fork(2) and pidfile_write(3). This way pidfiles will always be created with root privileges and we can forget about all the mess with pid directories, etc. - With the above you can wait for child to exit with simple wait(2). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --STPqjqpCrtky8aYs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8u+McACgkQForvXbEpPzSvqgCg9ndmZ+VXAVgb7SUXpHp7dGAJ 08cAniBzA5lGP0hWm5fFuMwN/cCqH+7n =eWsn -----END PGP SIGNATURE----- --STPqjqpCrtky8aYs-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 22:51:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC641106564A; Sun, 5 Feb 2012 22:51:53 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 660448FC13; Sun, 5 Feb 2012 22:51:53 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so8756748obc.13 for ; Sun, 05 Feb 2012 14:51:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.174.101 with SMTP id br5mr6888432obc.0.1328480789567; Sun, 05 Feb 2012 14:26:29 -0800 (PST) Received: by 10.60.0.170 with HTTP; Sun, 5 Feb 2012 14:26:29 -0800 (PST) Received: by 10.60.0.170 with HTTP; Sun, 5 Feb 2012 14:26:29 -0800 (PST) In-Reply-To: <20120205214647.GI30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> Date: Sun, 5 Feb 2012 14:26:29 -0800 Message-ID: From: Jos Backus To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@freebsd.org, Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 22:51:53 -0000 Hi Pawel, On Feb 5, 2012 1:48 PM, "Pawel Jakub Dawidek" wrote: > > On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > > Ok, using hastd code as a reference :-) here is my implementation. > > - I'd not pass selected signals to the child. The parent can still be > killed with a whole bunch of different signals that are not passed or > cannot be caught or the child process handle them gracefully. > Signals should be send to the PID from the pidfile anyway. If someone > is sending signals to the parent he has no right to expect well > behaviour from the parent. > > - Now that we handle the pidfile fully in the parent, I'd move dropping > provileges after fork(2) and pidfile_write(3). This way pidfiles will > always be created with root privileges and we can forget about all the > mess with pid directories, etc. > > - With the above you can wait for child to exit with simple wait(2). If you are going to wait for the child anyway, you are doing almost everything supervise does. All you now need is a Unix domain socket interface so you can receive commands in daemon(1), and run daemon(1) at boot. AND you can remove all the pidfile code :) Jos From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 23:02:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542FB1065679; Sun, 5 Feb 2012 23:02:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F18968FC1A; Sun, 5 Feb 2012 23:02:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15N2Eu9005377; Sun, 5 Feb 2012 23:02:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15N2EMI005375; Sun, 5 Feb 2012 23:02:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052302.q15N2EMI005375@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 23:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231055 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 23:02:15 -0000 Author: dim Date: Sun Feb 5 23:02:13 2012 New Revision: 231055 URL: http://svn.freebsd.org/changeset/base/231055 Log: Regenerate src.conf.5, after r230972 added the WITHOUT_SOURCELESS build options. MFC after: 2 weeks Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Feb 5 20:55:38 2012 (r231054) +++ head/share/man/man5/src.conf.5 Sun Feb 5 23:02:13 2012 (r231055) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd January 13, 2012 +.Dd February 5, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -869,6 +869,23 @@ as a set-user-ID root program. Set to not build the .Bx 4.4 legacy docs. +.It Va WITHOUT_SOURCELESS +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU). +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_SOURCELESS_HOST +.It +.Va WITHOUT_SOURCELESS_UCODE +.El +.It Va WITHOUT_SOURCELESS_HOST +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless native code for host CPU. +.It Va WITHOUT_SOURCELESS_UCODE +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless microcode. .It Va WITHOUT_SSP .\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 23:56:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACA13106566B; Sun, 5 Feb 2012 23:56:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 928CF8FC08; Sun, 5 Feb 2012 23:56:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15NuNJk007250; Sun, 5 Feb 2012 23:56:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15NuNuh007220; Sun, 5 Feb 2012 23:56:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052356.q15NuNuh007220@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 23:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231057 - in head: contrib/llvm/tools/bugpoint contrib/llvm/tools/llc contrib/llvm/tools/lli contrib/llvm/tools/llvm-ar contrib/llvm/tools/llvm-as contrib/llvm/tools/llvm-bcanalyzer con... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 23:56:23 -0000 Author: dim Date: Sun Feb 5 23:56:22 2012 New Revision: 231057 URL: http://svn.freebsd.org/changeset/base/231057 Log: Add a WITH_CLANG_EXTRAS option for src.conf(5), disabled by default, that builds the following additional llvm/clang tools: - bugpoint - llc - lli - llvm-ar - llvm-as - llvm-bcanalyzer - llvm-diff - llvm-dis - llvm-extract - llvm-ld - llvm-link - llvm-mc - llvm-nm - llvm-objdump - llvm-prof - llvm-ranlib - llvm-rtdyld - llvm-stub - macho-dump - opt These tools are mainly useful for people that want to manipulate llvm bitcode (.bc) and llvm assembly language (.ll) files, or want to tinker with llvm and clang themselves. MFC after: 2 weeks Added: head/contrib/llvm/tools/bugpoint/ - copied from r230910, vendor/llvm/dist/tools/bugpoint/ head/contrib/llvm/tools/llc/ - copied from r230910, vendor/llvm/dist/tools/llc/ head/contrib/llvm/tools/lli/ - copied from r230910, vendor/llvm/dist/tools/lli/ head/contrib/llvm/tools/llvm-ar/ - copied from r230910, vendor/llvm/dist/tools/llvm-ar/ head/contrib/llvm/tools/llvm-as/ - copied from r230910, vendor/llvm/dist/tools/llvm-as/ head/contrib/llvm/tools/llvm-bcanalyzer/ - copied from r230910, vendor/llvm/dist/tools/llvm-bcanalyzer/ head/contrib/llvm/tools/llvm-diff/ - copied from r230910, vendor/llvm/dist/tools/llvm-diff/ head/contrib/llvm/tools/llvm-dis/ - copied from r230910, vendor/llvm/dist/tools/llvm-dis/ head/contrib/llvm/tools/llvm-extract/ - copied from r230910, vendor/llvm/dist/tools/llvm-extract/ head/contrib/llvm/tools/llvm-ld/ - copied from r230910, vendor/llvm/dist/tools/llvm-ld/ head/contrib/llvm/tools/llvm-link/ - copied from r230910, vendor/llvm/dist/tools/llvm-link/ head/contrib/llvm/tools/llvm-mc/ - copied from r230910, vendor/llvm/dist/tools/llvm-mc/ head/contrib/llvm/tools/llvm-nm/ - copied from r230910, vendor/llvm/dist/tools/llvm-nm/ head/contrib/llvm/tools/llvm-objdump/ - copied from r230910, vendor/llvm/dist/tools/llvm-objdump/ head/contrib/llvm/tools/llvm-prof/ - copied from r230910, vendor/llvm/dist/tools/llvm-prof/ head/contrib/llvm/tools/llvm-ranlib/ - copied from r230910, vendor/llvm/dist/tools/llvm-ranlib/ head/contrib/llvm/tools/llvm-rtdyld/ - copied from r230910, vendor/llvm/dist/tools/llvm-rtdyld/ head/contrib/llvm/tools/llvm-stub/ - copied from r230910, vendor/llvm/dist/tools/llvm-stub/ head/contrib/llvm/tools/macho-dump/ - copied from r230910, vendor/llvm/dist/tools/macho-dump/ head/contrib/llvm/tools/opt/ - copied from r230910, vendor/llvm/dist/tools/opt/ head/lib/clang/libllvmarchive/ head/lib/clang/libllvmarchive/Makefile (contents, props changed) head/lib/clang/libllvmdebuginfo/ head/lib/clang/libllvmdebuginfo/Makefile (contents, props changed) head/lib/clang/libllvmexecutionengine/ head/lib/clang/libllvmexecutionengine/Makefile (contents, props changed) head/lib/clang/libllvminterpreter/ head/lib/clang/libllvminterpreter/Makefile (contents, props changed) head/lib/clang/libllvmjit/ head/lib/clang/libllvmjit/Makefile (contents, props changed) head/lib/clang/libllvmlinker/ head/lib/clang/libllvmlinker/Makefile (contents, props changed) head/lib/clang/libllvmmcdisassembler/ head/lib/clang/libllvmmcdisassembler/Makefile (contents, props changed) head/lib/clang/libllvmmcjit/ head/lib/clang/libllvmmcjit/Makefile (contents, props changed) head/lib/clang/libllvmobject/ head/lib/clang/libllvmobject/Makefile (contents, props changed) head/lib/clang/libllvmruntimedyld/ head/lib/clang/libllvmruntimedyld/Makefile (contents, props changed) head/tools/build/options/WITH_CLANG_EXTRAS (contents, props changed) head/usr.bin/clang/bugpoint/ head/usr.bin/clang/bugpoint/Makefile (contents, props changed) head/usr.bin/clang/bugpoint/bugpoint.1 (contents, props changed) head/usr.bin/clang/llc/ head/usr.bin/clang/llc/Makefile (contents, props changed) head/usr.bin/clang/llc/llc.1 (contents, props changed) head/usr.bin/clang/lli/ head/usr.bin/clang/lli/Makefile (contents, props changed) head/usr.bin/clang/lli/lli.1 (contents, props changed) head/usr.bin/clang/llvm-ar/ head/usr.bin/clang/llvm-ar/Makefile (contents, props changed) head/usr.bin/clang/llvm-ar/llvm-ar.1 (contents, props changed) head/usr.bin/clang/llvm-as/ head/usr.bin/clang/llvm-as/Makefile (contents, props changed) head/usr.bin/clang/llvm-as/llvm-as.1 (contents, props changed) head/usr.bin/clang/llvm-bcanalyzer/ head/usr.bin/clang/llvm-bcanalyzer/Makefile (contents, props changed) head/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 (contents, props changed) head/usr.bin/clang/llvm-diff/ head/usr.bin/clang/llvm-diff/Makefile (contents, props changed) head/usr.bin/clang/llvm-diff/llvm-diff.1 (contents, props changed) head/usr.bin/clang/llvm-dis/ head/usr.bin/clang/llvm-dis/Makefile (contents, props changed) head/usr.bin/clang/llvm-dis/llvm-dis.1 (contents, props changed) head/usr.bin/clang/llvm-extract/ head/usr.bin/clang/llvm-extract/Makefile (contents, props changed) head/usr.bin/clang/llvm-extract/llvm-extract.1 (contents, props changed) head/usr.bin/clang/llvm-ld/ head/usr.bin/clang/llvm-ld/Makefile (contents, props changed) head/usr.bin/clang/llvm-ld/llvm-ld.1 (contents, props changed) head/usr.bin/clang/llvm-link/ head/usr.bin/clang/llvm-link/Makefile (contents, props changed) head/usr.bin/clang/llvm-link/llvm-link.1 (contents, props changed) head/usr.bin/clang/llvm-mc/ head/usr.bin/clang/llvm-mc/Makefile (contents, props changed) head/usr.bin/clang/llvm-nm/ head/usr.bin/clang/llvm-nm/Makefile (contents, props changed) head/usr.bin/clang/llvm-nm/llvm-nm.1 (contents, props changed) head/usr.bin/clang/llvm-objdump/ head/usr.bin/clang/llvm-objdump/Makefile (contents, props changed) head/usr.bin/clang/llvm-prof/ head/usr.bin/clang/llvm-prof/Makefile (contents, props changed) head/usr.bin/clang/llvm-prof/llvm-prof.1 (contents, props changed) head/usr.bin/clang/llvm-ranlib/ head/usr.bin/clang/llvm-ranlib/Makefile (contents, props changed) head/usr.bin/clang/llvm-ranlib/llvm-ranlib.1 (contents, props changed) head/usr.bin/clang/llvm-rtdyld/ head/usr.bin/clang/llvm-rtdyld/Makefile (contents, props changed) head/usr.bin/clang/llvm-stub/ head/usr.bin/clang/llvm-stub/Makefile (contents, props changed) head/usr.bin/clang/macho-dump/ head/usr.bin/clang/macho-dump/Makefile (contents, props changed) head/usr.bin/clang/opt/ head/usr.bin/clang/opt/Makefile (contents, props changed) head/usr.bin/clang/opt/opt.1 (contents, props changed) Modified: head/lib/clang/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmipa/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmx86disassembler/Makefile head/share/man/man5/src.conf.5 head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .if !make(install) SUBDIR= libclanganalysis \ libclangarcmigrate \ @@ -60,6 +62,19 @@ SUBDIR= libclanganalysis \ libllvmx86info \ libllvmx86instprinter \ libllvmx86utils + +.if ${MK_CLANG_EXTRAS} != "no" +SUBDIR+=libllvmarchive \ + libllvmdebuginfo \ + libllvmexecutionengine \ + libllvminterpreter \ + libllvmjit \ + libllvmlinker \ + libllvmmcdisassembler \ + libllvmmcjit \ + libllvmobject \ + libllvmruntimedyld +.endif .endif SUBDIR+= include Modified: head/lib/clang/libllvmanalysis/Makefile ============================================================================== --- head/lib/clang/libllvmanalysis/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmanalysis/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmanalysis SRCDIR= lib/Analysis @@ -55,6 +57,14 @@ SRCS= AliasAnalysis.cpp \ TypeBasedAliasAnalysis.cpp \ ValueTracking.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= BlockFrequencyInfo.cpp \ + LibCallSemantics.cpp \ + PathNumbering.cpp \ + PathProfileInfo.cpp \ + PathProfileVerifier.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Added: head/lib/clang/libllvmarchive/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmarchive/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +LIB= llvmarchive + +SRCDIR= lib/Archive +SRCS= Archive.cpp \ + ArchiveReader.cpp \ + ArchiveWriter.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmdebuginfo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmdebuginfo/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +LIB= llvmdebuginfo + +SRCDIR= lib/DebugInfo +SRCS= DIContext.cpp \ + DWARFAbbreviationDeclaration.cpp \ + DWARFCompileUnit.cpp \ + DWARFContext.cpp \ + DWARFDebugAbbrev.cpp \ + DWARFDebugArangeSet.cpp \ + DWARFDebugAranges.cpp \ + DWARFDebugInfoEntry.cpp \ + DWARFDebugLine.cpp \ + DWARFFormValue.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmexecutionengine/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmexecutionengine/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +LIB= llvmexecutionengine + +SRCDIR= lib/ExecutionEngine +SRCS= ExecutionEngine.cpp \ + ExecutionEngineBindings.cpp \ + TargetSelect.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvminterpreter/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvminterpreter/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LIB= llvminterpreter + +SRCDIR= lib/ExecutionEngine/Interpreter +SRCS= Execution.cpp \ + ExternalFunctions.cpp \ + Interpreter.cpp \ + +TGHDRS= Intrinsics + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmipa/Makefile ============================================================================== --- head/lib/clang/libllvmipa/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmipa/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmipa SRCDIR= lib/Analysis/IPA @@ -8,6 +10,10 @@ SRCS= CallGraph.cpp \ FindUsedTypes.cpp \ GlobalsModRef.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= IPA.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmipo/Makefile ============================================================================== --- head/lib/clang/libllvmipo/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmipo/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmipo SRCDIR= lib/Transforms/IPO @@ -23,6 +25,10 @@ SRCS= ArgumentPromotion.cpp \ StripDeadPrototypes.cpp \ StripSymbols.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= IPO.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Added: head/lib/clang/libllvmjit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmjit/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +LIB= llvmjit + +SRCDIR= lib/ExecutionEngine/JIT +SRCS= Intercept.cpp \ + JIT.cpp \ + JITDebugRegisterer.cpp \ + JITDwarfEmitter.cpp \ + JITEmitter.cpp \ + JITMemoryManager.cpp \ + OProfileJITEventListener.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmlinker/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmlinker/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +LIB= llvmlinker + +SRCDIR= lib/Linker +SRCS= LinkArchives.cpp \ + LinkItems.cpp \ + LinkModules.cpp \ + Linker.cpp + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmmc/Makefile ============================================================================== --- head/lib/clang/libllvmmc/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmmc/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmc SRCDIR= lib/MC @@ -43,4 +45,8 @@ SRCS= ELFObjectWriter.cpp \ WinCOFFObjectWriter.cpp \ WinCOFFStreamer.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= MCDisassembler.cpp +.endif + .include "../clang.lib.mk" Added: head/lib/clang/libllvmmcdisassembler/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmmcdisassembler/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LIB= llvmmcdisassembler + +SRCDIR= lib/MC/MCDisassembler +SRCS= Disassembler.cpp \ + EDDisassembler.cpp \ + EDInst.cpp \ + EDOperand.cpp \ + EDToken.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmmcjit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmmcjit/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= llvmmcjit + +SRCDIR= lib/ExecutionEngine/MCJIT +SRCS= Intercept.cpp \ + MCJIT.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmobject/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmobject/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +LIB= llvmobject + +SRCDIR= lib/Object +SRCS= Archive.cpp \ + Binary.cpp \ + COFFObjectFile.cpp \ + ELFObjectFile.cpp \ + Error.cpp \ + MachOObject.cpp \ + MachOObjectFile.cpp \ + Object.cpp \ + ObjectFile.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmruntimedyld/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmruntimedyld/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= llvmruntimedyld + +SRCDIR= lib/ExecutionEngine/RuntimeDyld +SRCS= RuntimeDyld.cpp \ + RuntimeDyldMachO.cpp + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmscalaropts/Makefile ============================================================================== --- head/lib/clang/libllvmscalaropts/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmscalaropts/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmscalaropts SRCDIR= lib/Transforms/Scalar @@ -31,6 +33,13 @@ SRCS= ADCE.cpp \ Sink.cpp \ TailRecursionElimination.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= LoopInstSimplify.cpp \ + LowerAtomic.cpp \ + Reg2Mem.cpp \ + Scalar.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmsupport/Makefile ============================================================================== --- head/lib/clang/libllvmsupport/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmsupport/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmsupport SRCDIR= lib/Support @@ -67,4 +69,14 @@ SRCS= APFloat.cpp \ system_error.cpp LLVM_REQUIRES_RTTI= +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= BlockFrequency.cpp \ + BranchProbability.cpp \ + DataExtractor.cpp \ + Disassembler.cpp \ + FileUtilities.cpp \ + MemoryObject.cpp \ + SystemUtils.cpp +.endif + .include "../clang.lib.mk" Modified: head/lib/clang/libllvmtransformutils/Makefile ============================================================================== --- head/lib/clang/libllvmtransformutils/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmtransformutils/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmtransformutils SRCDIR= lib/Transforms/Utils @@ -29,6 +31,11 @@ SRCS= AddrModeMatcher.cpp \ UnifyFunctionExitNodes.cpp \ ValueMapper.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= SimplifyInstructions.cpp \ + Utils.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmx86disassembler/Makefile ============================================================================== --- head/lib/clang/libllvmx86disassembler/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmx86disassembler/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,11 +1,17 @@ # $FreeBSD$ +.include + LIB= llvmx86disassembler SRCDIR= lib/Target/X86/Disassembler INCDIR= lib/Target/X86 SRCS= X86Disassembler.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= X86DisassemblerDecoder.c +.endif + TGHDRS= X86GenDisassemblerTables \ X86GenEDInfo \ X86GenInstrInfo \ Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Feb 5 23:02:41 2012 (r231056) +++ head/share/man/man5/src.conf.5 Sun Feb 5 23:56:22 2012 (r231057) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd February 5, 2012 +.Dd February 6, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -271,12 +271,21 @@ Set to not build the Clang C/C++ compile .Pp It is a default setting on arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb and sparc64/sparc64. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_CLANG_EXTRAS +.El .It Va WITH_CLANG .\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru Set to build the Clang C/C++ compiler. .Pp It is a default setting on amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +.It Va WITH_CLANG_EXTRAS +.\" $FreeBSD$ +Set to build additional clang and llvm tools, such as bugpoint. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Feb 5 23:02:41 2012 (r231056) +++ head/share/mk/bsd.own.mk Sun Feb 5 23:56:22 2012 (r231057) @@ -418,6 +418,7 @@ __DEFAULT_NO_OPTIONS = \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + CLANG_EXTRAS \ CTF \ HESIOD \ ICONV \ @@ -524,6 +525,10 @@ MK_ZFS:= no MK_CTF:= no .endif +.if ${MK_CLANG} == "no" +MK_CLANG_EXTRAS:= no +.endif + .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 5 23:02:41 2012 (r231056) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 5 23:56:22 2012 (r231057) @@ -671,6 +671,44 @@ OLD_FILES+=usr/share/man/man1/clang-cpp. OLD_FILES+=usr/share/man/man1/tblgen.1.gz .endif +.if ${MK_CLANG_EXTRAS} == no +OLD_FILES+=usr/bin/bugpoint +OLD_FILES+=usr/bin/llc +OLD_FILES+=usr/bin/lli +OLD_FILES+=usr/bin/llvm-ar +OLD_FILES+=usr/bin/llvm-as +OLD_FILES+=usr/bin/llvm-bcanalyzer +OLD_FILES+=usr/bin/llvm-diff +OLD_FILES+=usr/bin/llvm-dis +OLD_FILES+=usr/bin/llvm-extract +OLD_FILES+=usr/bin/llvm-ld +OLD_FILES+=usr/bin/llvm-link +OLD_FILES+=usr/bin/llvm-mc +OLD_FILES+=usr/bin/llvm-nm +OLD_FILES+=usr/bin/llvm-objdump +OLD_FILES+=usr/bin/llvm-prof +OLD_FILES+=usr/bin/llvm-ranlib +OLD_FILES+=usr/bin/llvm-rtdyld +OLD_FILES+=usr/bin/llvm-stub +OLD_FILES+=usr/bin/macho-dump +OLD_FILES+=usr/bin/opt +OLD_FILES+=usr/share/man/man1/bugpoint.1.gz +OLD_FILES+=usr/share/man/man1/llc.1.gz +OLD_FILES+=usr/share/man/man1/lli.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz +OLD_FILES+=usr/share/man/man1/llvm-as.1.gz +OLD_FILES+=usr/share/man/man1/llvm-bcanalyzer.1.gz +OLD_FILES+=usr/share/man/man1/llvm-diff.1.gz +OLD_FILES+=usr/share/man/man1/llvm-dis.1.gz +OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ld.1.gz +OLD_FILES+=usr/share/man/man1/llvm-link.1.gz +OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz +OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz +OLD_FILES+=usr/share/man/man1/opt.1.gz +.endif + .if ${MK_CPP} == no OLD_FILES+=usr/bin/cpp OLD_FILES+=usr/share/man/man1/cpp.1.gz Added: head/tools/build/options/WITH_CLANG_EXTRAS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_CLANG_EXTRAS Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build additional clang and llvm tools, such as bugpoint. Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/usr.bin/clang/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,30 @@ # $FreeBSD$ +.include + SUBDIR= clang clang-tblgen tblgen +.if ${MK_CLANG_EXTRAS} != "no" +SUBDIR+=bugpoint \ + llc \ + lli \ + llvm-ar \ + llvm-as \ + llvm-bcanalyzer \ + llvm-diff \ + llvm-dis \ + llvm-extract \ + llvm-ld \ + llvm-link \ + llvm-mc \ + llvm-nm \ + llvm-objdump \ + llvm-prof \ + llvm-ranlib \ + llvm-rtdyld \ + llvm-stub \ + macho-dump \ + opt +.endif + .include Added: head/usr.bin/clang/bugpoint/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/bugpoint/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +PROG_CXX=bugpoint + +SRCDIR= tools/bugpoint +SRCS= BugDriver.cpp \ + CrashDebugger.cpp \ + ExecutionDriver.cpp \ + ExtractFunction.cpp \ + FindBugs.cpp \ + Miscompilation.cpp \ + OptimizerDriver.cpp \ + ToolRunner.cpp \ + bugpoint.cpp + +TGHDRS= Intrinsics +LIBDEPS=llvmbitwriter \ + llvmlinker \ + llvmarchive \ + llvmbitreader \ + llvmipo \ + llvmscalaropts \ + llvminstcombine \ + llvminstrumentation \ + llvmtransformutils \ + llvmipa \ + llvmanalysis \ + llvmtarget \ + llvmmc \ + llvmasmparser \ + llvmcore \ + llvmsupport + +.include "../clang.prog.mk" Added: head/usr.bin/clang/bugpoint/bugpoint.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/bugpoint/bugpoint.1 Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,291 @@ +.\" $FreeBSD$ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "BUGPOINT 1" +.TH BUGPOINT 1 "2011-10-17" "LLVM 3.0" "LLVM Command Guide" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +bugpoint \- automatic test case reduction tool +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBbugpoint\fR [\fIoptions\fR] [\fIinput \s-1LLVM\s0 ll/bc files\fR] [\fI\s-1LLVM\s0 passes\fR] \fB\-\-args\fR +\&\fIprogram arguments\fR +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBbugpoint\fR narrows down the source of problems in \s-1LLVM\s0 tools and passes. It +can be used to debug three types of failures: optimizer crashes, miscompilations +by optimizers, or bad native code generation (including problems in the static +and \s-1JIT\s0 compilers). It aims to reduce large test cases to small, useful ones. +For more information on the design and inner workings of \fBbugpoint\fR, as well as +advice for using bugpoint, see \fIllvm/docs/Bugpoint.html\fR in the \s-1LLVM\s0 +distribution. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-\-additional\-so\fR \fIlibrary\fR" 4 +.IX Item "--additional-so library" +Load the dynamic shared object \fIlibrary\fR into the test program whenever it is +run. This is useful if you are debugging programs which depend on non-LLVM +libraries (such as the X or curses libraries) to run. +.IP "\fB\-\-append\-exit\-code\fR=\fI{true,false}\fR" 4 +.IX Item "--append-exit-code={true,false}" +Append the test programs exit code to the output file so that a change in exit +code is considered a test failure. Defaults to false. +.IP "\fB\-\-args\fR \fIprogram args\fR" 4 +.IX Item "--args program args" +Pass all arguments specified after \-args to the test program whenever it runs. +Note that if any of the \fIprogram args\fR start with a '\-', you should use: +.Sp +.Vb 1 +\& bugpoint [bugpoint args] \-\-args \-\- [program args] +.Ve +.Sp +The \*(L"\-\-\*(R" right after the \fB\-\-args\fR option tells \fBbugpoint\fR to consider any +options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-args\fR option, not as options to +\&\fBbugpoint\fR itself. +.IP "\fB\-\-tool\-args\fR \fItool args\fR" 4 +.IX Item "--tool-args tool args" +Pass all arguments specified after \-\-tool\-args to the \s-1LLVM\s0 tool under test +(\fBllc\fR, \fBlli\fR, etc.) whenever it runs. You should use this option in the +following way: +.Sp +.Vb 1 +\& bugpoint [bugpoint args] \-\-tool\-args \-\- [tool args] +.Ve +.Sp +The \*(L"\-\-\*(R" right after the \fB\-\-tool\-args\fR option tells \fBbugpoint\fR to consider any +options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-tool\-args\fR option, not as +options to \fBbugpoint\fR itself. (See \fB\-\-args\fR, above.) +.IP "\fB\-\-safe\-tool\-args\fR \fItool args\fR" 4 +.IX Item "--safe-tool-args tool args" +Pass all arguments specified after \fB\-\-safe\-tool\-args\fR to the \*(L"safe\*(R" execution +tool. +.IP "\fB\-\-gcc\-tool\-args\fR \fIgcc tool args\fR" 4 +.IX Item "--gcc-tool-args gcc tool args" +Pass all arguments specified after \fB\-\-gcc\-tool\-args\fR to the invocation of +\&\fBgcc\fR. +.IP "\fB\-\-opt\-args\fR \fIopt args\fR" 4 +.IX Item "--opt-args opt args" +Pass all arguments specified after \fB\-\-opt\-args\fR to the invocation of \fBopt\fR. +.IP "\fB\-\-disable\-{dce,simplifycfg}\fR" 4 +.IX Item "--disable-{dce,simplifycfg}" +Do not run the specified passes to clean up and reduce the size of the test +program. By default, \fBbugpoint\fR uses these passes internally when attempting to +reduce test programs. If you're trying to find a bug in one of these passes, +\&\fBbugpoint\fR may crash. +.IP "\fB\-\-enable\-valgrind\fR" 4 +.IX Item "--enable-valgrind" +Use valgrind to find faults in the optimization phase. This will allow +bugpoint to find otherwise asymptomatic problems caused by memory +mis-management. +.IP "\fB\-find\-bugs\fR" 4 +.IX Item "-find-bugs" +Continually randomize the specified passes and run them on the test program +until a bug is found or the user kills \fBbugpoint\fR. +.IP "\fB\-help\fR" 4 +.IX Item "-help" +Print a summary of command line options. +.IP "\fB\-\-input\fR \fIfilename\fR" 4 +.IX Item "--input filename" +Open \fIfilename\fR and redirect the standard input of the test program, whenever +it runs, to come from that file. +.IP "\fB\-\-load\fR \fIplugin\fR" 4 +.IX Item "--load plugin" +Load the dynamic object \fIplugin\fR into \fBbugpoint\fR itself. This object should +register new optimization passes. Once loaded, the object will add new command +line options to enable various optimizations. To see the new complete list of +optimizations, use the \fB\-help\fR and \fB\-\-load\fR options together; for example: +.Sp +.Vb 1 +\& bugpoint \-\-load myNewPass.so \-help +.Ve +.IP "\fB\-\-mlimit\fR \fImegabytes\fR" 4 +.IX Item "--mlimit megabytes" +Specifies an upper limit on memory usage of the optimization and codegen. Set +to zero to disable the limit. +.IP "\fB\-\-output\fR \fIfilename\fR" 4 +.IX Item "--output filename" +Whenever the test program produces output on its standard output stream, it +should match the contents of \fIfilename\fR (the \*(L"reference output\*(R"). If you +do not use this option, \fBbugpoint\fR will attempt to generate a reference output +by compiling the program with the \*(L"safe\*(R" backend and running it. +.IP "\fB\-\-profile\-info\-file\fR \fIfilename\fR" 4 +.IX Item "--profile-info-file filename" +Profile file loaded by \fB\-\-profile\-loader\fR. +.IP "\fB\-\-run\-{int,jit,llc,cbe,custom}\fR" 4 +.IX Item "--run-{int,jit,llc,cbe,custom}" +Whenever the test program is compiled, \fBbugpoint\fR should generate code for it +using the specified code generator. These options allow you to choose the +interpreter, the \s-1JIT\s0 compiler, the static native code compiler, the C +backend, or a custom command (see \fB\-\-exec\-command\fR) respectively. +.IP "\fB\-\-safe\-{llc,cbe,custom}\fR" 4 +.IX Item "--safe-{llc,cbe,custom}" +When debugging a code generator, \fBbugpoint\fR should use the specified code +generator as the \*(L"safe\*(R" code generator. This is a known-good code generator +used to generate the \*(L"reference output\*(R" if it has not been provided, and to +compile portions of the program that as they are excluded from the testcase. +These options allow you to choose the +static native code compiler, the C backend, or a custom command, +(see \fB\-\-exec\-command\fR) respectively. The interpreter and the \s-1JIT\s0 backends +cannot currently be used as the \*(L"safe\*(R" backends. +.IP "\fB\-\-exec\-command\fR \fIcommand\fR" 4 +.IX Item "--exec-command command" +This option defines the command to use with the \fB\-\-run\-custom\fR and +\&\fB\-\-safe\-custom\fR options to execute the bitcode testcase. This can +be useful for cross-compilation. +.IP "\fB\-\-compile\-command\fR \fIcommand\fR" 4 +.IX Item "--compile-command command" +This option defines the command to use with the \fB\-\-compile\-custom\fR +option to compile the bitcode testcase. This can be useful for +testing compiler output without running any link or execute stages. To +generate a reduced unit test, you may add \s-1CHECK\s0 directives to the +testcase and pass the name of an executable compile-command script in this form: +.Sp +.Vb 3 +\& #!/bin/sh +\& llc "$@" +\& not FileCheck [bugpoint input file].ll < bugpoint\-test\-program.s +.Ve +.Sp +This script will \*(L"fail\*(R" as long as FileCheck passes. So the result +will be the minimum bitcode that passes FileCheck. +.IP "\fB\-\-safe\-path\fR \fIpath\fR" 4 +.IX Item "--safe-path path" +This option defines the path to the command to execute with the +\&\fB\-\-safe\-{int,jit,llc,cbe,custom}\fR +option. +.SH "EXIT STATUS" +.IX Header "EXIT STATUS" +If \fBbugpoint\fR succeeds in finding a problem, it will exit with 0. Otherwise, +if an error occurs, it will exit with a non-zero value. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +opt +.SH "AUTHOR" +.IX Header "AUTHOR" +Maintained by the \s-1LLVM\s0 Team (). Added: head/usr.bin/clang/llc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llc/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,45 @@ +# $FreeBSD$ + +PROG_CXX=llc + +SRCDIR= tools/llc +SRCS= llc.cpp + +LIBDEPS=llvmasmparser \ + llvmbitreader \ + llvmarmdisassembler \ + llvmarmasmparser \ + llvmarmcodegen \ + llvmarmdesc \ + llvmarminstprinter \ + llvmarminfo \ + llvmmipscodegen \ + llvmmipsdesc \ + llvmmipsinstprinter \ + llvmmipsinfo \ + llvmpowerpccodegen \ + llvmpowerpcdesc \ + llvmpowerpcinstprinter \ + llvmpowerpcinfo \ + llvmx86disassembler \ + llvmx86asmparser \ + llvmx86codegen \ + llvmx86desc \ + llvmselectiondag \ + llvmasmprinter \ + llvmmcparser \ + llvmcodegen \ + llvmscalaropts \ + llvminstcombine \ + llvmtransformutils \ + llvmipa \ + llvmanalysis \ + llvmtarget \ + llvmx86instprinter \ + llvmx86utils \ + llvmcore \ + llvmx86info \ + llvmmc \ + llvmsupport + +.include "../clang.prog.mk" Added: head/usr.bin/clang/llc/llc.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llc/llc.1 Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,285 @@ +.\" $FreeBSD$ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 00:26:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FD45106566C; Mon, 6 Feb 2012 00:26:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3998FC12; Mon, 6 Feb 2012 00:26:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q160QUiw008219; Mon, 6 Feb 2012 00:26:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q160QUkG008217; Mon, 6 Feb 2012 00:26:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202060026.q160QUkG008217@svn.freebsd.org> From: Adrian Chadd Date: Mon, 6 Feb 2012 00:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231058 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 00:26:30 -0000 Author: adrian Date: Mon Feb 6 00:26:29 2012 New Revision: 231058 URL: http://svn.freebsd.org/changeset/base/231058 Log: Update the mesh reason codes to match the latest 802.11s specification. Submitted by: Reviewed by: rpaulo Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sun Feb 5 23:56:22 2012 (r231057) +++ head/sys/net80211/ieee80211.h Mon Feb 6 00:26:29 2012 (r231058) @@ -927,19 +927,21 @@ enum { IEEE80211_REASON_SETUP_NEEDED = 38, /* 11e */ IEEE80211_REASON_TIMEOUT = 39, /* 11e */ - /* values not yet allocated by ANA */ - IEEE80211_REASON_PEER_LINK_CANCELED = 2, /* 11s */ - IEEE80211_REASON_MESH_MAX_PEERS = 3, /* 11s */ - IEEE80211_REASON_MESH_CPVIOLATION = 4, /* 11s */ - IEEE80211_REASON_MESH_CLOSE_RCVD = 5, /* 11s */ - IEEE80211_REASON_MESH_MAX_RETRIES = 6, /* 11s */ - IEEE80211_REASON_MESH_CONFIRM_TIMEOUT = 7, /* 11s */ - IEEE80211_REASON_MESH_INVALID_GTK = 8, /* 11s */ - IEEE80211_REASON_MESH_INCONS_PARAMS = 9, /* 11s */ - IEEE80211_REASON_MESH_INVALID_SECURITY = 10, /* 11s */ - IEEE80211_REASON_MESH_PERR_UNSPEC = 11, /* 11s */ - IEEE80211_REASON_MESH_PERR_NO_FI = 12, /* 11s */ - IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 13, /* 11s */ + IEEE80211_REASON_PEER_LINK_CANCELED = 52, /* 11s */ + IEEE80211_REASON_MESH_MAX_PEERS = 53, /* 11s */ + IEEE80211_REASON_MESH_CPVIOLATION = 54, /* 11s */ + IEEE80211_REASON_MESH_CLOSE_RCVD = 55, /* 11s */ + IEEE80211_REASON_MESH_MAX_RETRIES = 56, /* 11s */ + IEEE80211_REASON_MESH_CONFIRM_TIMEOUT = 57, /* 11s */ + IEEE80211_REASON_MESH_INVALID_GTK = 58, /* 11s */ + IEEE80211_REASON_MESH_INCONS_PARAMS = 59, /* 11s */ + IEEE80211_REASON_MESH_INVALID_SECURITY = 60, /* 11s */ + IEEE80211_REASON_MESH_PERR_NO_PROXY = 61, /* 11s */ + IEEE80211_REASON_MESH_PERR_NO_FI = 62, /* 11s */ + IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 63, /* 11s */ + IEEE80211_REASON_MESH_MAC_ALRDY_EXISTS_MBSS = 64, /* 11s */ + IEEE80211_REASON_MESH_CHAN_SWITCH_REG = 65, /* 11s */ + IEEE80211_REASON_MESH_CHAN_SWITCH_UNSPEC = 66, /* 11s */ IEEE80211_STATUS_SUCCESS = 0, IEEE80211_STATUS_UNSPECIFIED = 1, From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 04:15:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 517E41065672; Mon, 6 Feb 2012 04:15:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id C204B8FC0C; Mon, 6 Feb 2012 04:15:32 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q164FS13029085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Feb 2012 15:15:29 +1100 Date: Mon, 6 Feb 2012 15:15:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <201202052004.q15K4hrC099031@svn.freebsd.org> Message-ID: <20120206151515.W1346@besplex.bde.org> References: <201202052004.q15K4hrC099031@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231044 - in head: lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 04:15:33 -0000 On Sun, 5 Feb 2012, Andreas Tobler wrote: > Log: > Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which > has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful > name. > > Tested on 32- and 64-bit PowerMac. > > Reviewed by: bde Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 06:03:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27375106564A; Mon, 6 Feb 2012 06:03:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11B2E8FC14; Mon, 6 Feb 2012 06:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1663GRp019219; Mon, 6 Feb 2012 06:03:16 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1663GZR019217; Mon, 6 Feb 2012 06:03:16 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202060603.q1663GZR019217@svn.freebsd.org> From: Kevin Lo Date: Mon, 6 Feb 2012 06:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231060 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 06:03:17 -0000 Author: kevlo Date: Mon Feb 6 06:03:16 2012 New Revision: 231060 URL: http://svn.freebsd.org/changeset/base/231060 Log: - Use uint8_t for the variable x and spell the size of the variable as sizeof(x) - Capitalized comment - Parentheses around return value Requested by: bde Modified: head/sys/kern/subr_mchain.c Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Mon Feb 6 04:23:37 2012 (r231059) +++ head/sys/kern/subr_mchain.c Mon Feb 6 06:03:16 2012 (r231060) @@ -62,7 +62,7 @@ mb_init(struct mbchain *mbp) m = m_gethdr(M_WAIT, MT_DATA); m->m_len = 0; mb_initm(mbp, m); - return 0; + return (0); } void @@ -89,13 +89,13 @@ mb_detach(struct mbchain *mbp) m = mbp->mb_top; mbp->mb_top = NULL; - return m; + return (m); } int mb_fixhdr(struct mbchain *mbp) { - return mbp->mb_top->m_pkthdr.len = m_fixhdr(mbp->mb_top); + return (mbp->mb_top->m_pkthdr.len = m_fixhdr(mbp->mb_top)); } /* @@ -124,70 +124,70 @@ mb_reserve(struct mbchain *mbp, int size mbp->mb_count += size; bpos = mtod(m, caddr_t) + m->m_len; m->m_len += size; - return bpos; + return (bpos); } int mb_put_padbyte(struct mbchain *mbp) { caddr_t dst; - char x = 0; + uint8_t x = 0; dst = mtod(mbp->mb_cur, caddr_t) + mbp->mb_cur->m_len; - /* only add padding if address is odd */ + /* Only add padding if address is odd */ if ((unsigned long)dst & 1) - return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); else - return 0; + return (0); } int mb_put_uint8(struct mbchain *mbp, uint8_t x) { - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint16be(struct mbchain *mbp, uint16_t x) { x = htobe16(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint16le(struct mbchain *mbp, uint16_t x) { x = htole16(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint32be(struct mbchain *mbp, uint32_t x) { x = htobe32(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint32le(struct mbchain *mbp, uint32_t x) { x = htole32(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_int64be(struct mbchain *mbp, int64_t x) { x = htobe64(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_int64le(struct mbchain *mbp, int64_t x) { x = htole64(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int @@ -220,7 +220,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ dstlen = mleft; error = mbp->mb_copy(mbp, source, dst, &srclen, &dstlen); if (error) - return error; + return (error); break; case MB_MINLINE: for (src = source, count = cplen; count; count--) @@ -232,7 +232,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ case MB_MUSER: error = copyin(source, dst, cplen); if (error) - return error; + return (error); break; case MB_MZERO: bzero(dst, cplen); @@ -246,7 +246,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ } mbp->mb_cur = m; mbp->mb_mleft = mleft; - return 0; + return (0); } int @@ -261,7 +261,7 @@ mb_put_mbuf(struct mbchain *mbp, struct } mbp->mb_mleft = M_TRAILINGSPACE(m); mbp->mb_cur = m; - return 0; + return (0); } /* @@ -277,7 +277,7 @@ mb_put_uio(struct mbchain *mbp, struct u while (size > 0 && uiop->uio_resid) { if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) - return EFBIG; + return (EFBIG); left = uiop->uio_iov->iov_len; if (left == 0) { uiop->uio_iov++; @@ -288,7 +288,7 @@ mb_put_uio(struct mbchain *mbp, struct u left = size; error = mb_put_mem(mbp, uiop->uio_iov->iov_base, left, mtype); if (error) - return error; + return (error); uiop->uio_offset += left; uiop->uio_resid -= left; uiop->uio_iov->iov_base = @@ -296,7 +296,7 @@ mb_put_uio(struct mbchain *mbp, struct u uiop->uio_iov->iov_len -= left; size -= left; } - return 0; + return (0); } /* @@ -310,7 +310,7 @@ md_init(struct mdchain *mdp) m = m_gethdr(M_WAIT, MT_DATA); m->m_len = 0; md_initm(mdp, m); - return 0; + return (0); } void @@ -360,25 +360,25 @@ md_next_record(struct mdchain *mdp) struct mbuf *m; if (mdp->md_top == NULL) - return ENOENT; + return (ENOENT); m = mdp->md_top->m_nextpkt; md_done(mdp); if (m == NULL) - return ENOENT; + return (ENOENT); md_initm(mdp, m); - return 0; + return (0); } int md_get_uint8(struct mdchain *mdp, uint8_t *x) { - return md_get_mem(mdp, x, 1, MB_MINLINE); + return (md_get_mem(mdp, x, 1, MB_MINLINE)); } int md_get_uint16(struct mdchain *mdp, uint16_t *x) { - return md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE)); } int @@ -389,7 +389,7 @@ md_get_uint16le(struct mdchain *mdp, uin if (x != NULL) *x = le16toh(v); - return error; + return (error); } int @@ -400,13 +400,13 @@ md_get_uint16be(struct mdchain *mdp, uin if (x != NULL) *x = be16toh(v); - return error; + return (error); } int md_get_uint32(struct mdchain *mdp, uint32_t *x) { - return md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE)); } int @@ -418,7 +418,7 @@ md_get_uint32be(struct mdchain *mdp, uin error = md_get_uint32(mdp, &v); if (x != NULL) *x = be32toh(v); - return error; + return (error); } int @@ -430,13 +430,13 @@ md_get_uint32le(struct mdchain *mdp, uin error = md_get_uint32(mdp, &v); if (x != NULL) *x = le32toh(v); - return error; + return (error); } int md_get_int64(struct mdchain *mdp, int64_t *x) { - return md_get_mem(mdp, (caddr_t)x, 8, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 8, MB_MINLINE)); } int @@ -448,7 +448,7 @@ md_get_int64be(struct mdchain *mdp, int6 error = md_get_int64(mdp, &v); if (x != NULL) *x = be64toh(v); - return error; + return (error); } int @@ -460,7 +460,7 @@ md_get_int64le(struct mdchain *mdp, int6 error = md_get_int64(mdp, &v); if (x != NULL) *x = le64toh(v); - return error; + return (error); } int @@ -474,7 +474,7 @@ md_get_mem(struct mdchain *mdp, caddr_t while (size > 0) { if (m == NULL) { MBERROR("incomplete copy\n"); - return EBADRPC; + return (EBADRPC); } s = mdp->md_pos; count = mtod(m, u_char*) + m->m_len - s; @@ -506,7 +506,7 @@ md_get_mem(struct mdchain *mdp, caddr_t } target += count; } - return 0; + return (0); } int @@ -517,7 +517,7 @@ md_get_mbuf(struct mdchain *mdp, int siz rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAIT); md_get_mem(mdp, NULL, size, MB_MZERO); *ret = rm; - return 0; + return (0); } int @@ -530,7 +530,7 @@ md_get_uio(struct mdchain *mdp, struct u mtype = (uiop->uio_segflg == UIO_SYSSPACE) ? MB_MSYSTEM : MB_MUSER; while (size > 0 && uiop->uio_resid) { if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) - return EFBIG; + return (EFBIG); left = uiop->uio_iov->iov_len; if (left == 0) { uiop->uio_iov++; @@ -542,7 +542,7 @@ md_get_uio(struct mdchain *mdp, struct u left = size; error = md_get_mem(mdp, uiocp, left, mtype); if (error) - return error; + return (error); uiop->uio_offset += left; uiop->uio_resid -= left; uiop->uio_iov->iov_base = @@ -550,5 +550,5 @@ md_get_uio(struct mdchain *mdp, struct u uiop->uio_iov->iov_len -= left; size -= left; } - return 0; + return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 07:39:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B51106564A; Mon, 6 Feb 2012 07:39:54 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6ED918FC15; Mon, 6 Feb 2012 07:39:53 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6141252bkb.13 for ; Sun, 05 Feb 2012 23:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=V9qFGYI00/KfxgwblkohphIHs3hT2fmugMeHB6NixuY=; b=BVvYVNqcUOGmraH1tiH6eWEOjp5vN3wXQ9K3wSzBfflqXoqpBL5UdjYse63wxb1kuF wmSEctwWmyoPe8c8xkC8yUfX3+l94EWWGDni3yE7EmV5Fz8j3ubEnTMQZee8NwZ5LwC9 X0B6oKyKg9OzgDXiqwTtNK491NegnfLWWh/ew= Received: by 10.204.173.11 with SMTP id n11mr7904131bkz.120.1328513992428; Sun, 05 Feb 2012 23:39:52 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id sp6sm42640572bkb.2.2012.02.05.23.39.49 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 23:39:50 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek Organization: TOA Ukraine References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> Sender: Mikolaj Golub Date: Mon, 06 Feb 2012 09:39:47 +0200 In-Reply-To: <20120205214647.GI30033@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Sun, 5 Feb 2012 22:46:48 +0100") Message-ID: <86sjiov29o.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 07:39:54 -0000 --=-=-= On Sun, 5 Feb 2012 22:46:48 +0100 Pawel Jakub Dawidek wrote: PJD> On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: >> Ok, using hastd code as a reference :-) here is my implementation. PJD> - I'd not pass selected signals to the child. The parent can still be PJD> killed with a whole bunch of different signals that are not passed or PJD> cannot be caught or the child process handle them gracefully. PJD> Signals should be send to the PID from the pidfile anyway. If someone PJD> is sending signals to the parent he has no right to expect well PJD> behaviour from the parent. Well, sending a whole bunch of different signals to parent we might not expect right behavior, but why not to provide it for the "standard" ones? E.g. on shutdown init(8) will send SIGTERM and the daemon will gracefully exit terminating the child and cleaning up the pidfile. If the the child process does not handle SIGTERM gracefully I don't see much difference from having only this one process alive or two (with its monitoring daemon). The pidfile is seen in ps(1) output for the daemon process, which allows to identify the monitoring daemon with its child. Or we could change its proctitle to something like "daemon: cmdname[pid]", similar to what sshd does. So people would expect that terminating a daemon will terminate the process it monitors. PJD> - Now that we handle the pidfile fully in the parent, I'd move dropping PJD> provileges after fork(2) and pidfile_write(3). This way pidfiles will PJD> always be created with root privileges and we can forget about all the PJD> mess with pid directories, etc. PJD> - With the above you can wait for child to exit with simple wait(2). Yes, it looks like much simpler, see the attached patch. But I don't think I like it much as it still looks like a half measure to me. -- Mikolaj Golub --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=daemon.c.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231060) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -49,9 +50,9 @@ int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + int ch, nochdir, noclose, status; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -79,43 +80,61 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); + if (pidfile == NULL) { + /* + * This is a simple case. Daemonize and exec. + */ + if (daemon(nochdir, noclose) == -1) + err(1, NULL); + if (user != NULL) + restrict_process(user); + + execvp(argv[0], argv); + + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - if (pidfile) { - pfh = pidfile_open(pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "pidfile ``%s''", pidfile); + pfh = pidfile_open(pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); } + err(2, "pidfile ``%s''", pidfile); } if (daemon(nochdir, noclose) == -1) err(1, NULL); - /* Now that we are the child, write out the pid */ - if (pidfile) + pid = fork(); + if (pid == -1) { + pidfile_remove(pfh); + err(1, "fork"); + } + if (pid == 0) { + /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - execvp(argv[0], argv); + if (user != NULL) + restrict_process(user); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error - */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) - pidfile_remove(pfh); + execvp(argv[0], argv); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + /* execvp() failed. */ + err(1, "%s", argv[0]); + } + (void)wait(&status); + pidfile_remove(pfh); + exit(0); } static void --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 08:28:21 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36089106564A; Mon, 6 Feb 2012 08:28:21 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC528FC14; Mon, 6 Feb 2012 08:28:20 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DC39E924; Mon, 6 Feb 2012 09:28:18 +0100 (CET) Date: Mon, 6 Feb 2012 09:27:06 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120206082706.GA1324@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <86sjiov29o.fsf@in138.ua3> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 08:28:21 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 09:39:47AM +0200, Mikolaj Golub wrote: >=20 > On Sun, 5 Feb 2012 22:46:48 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > >> Ok, using hastd code as a reference :-) here is my implementation. >=20 > PJD> - I'd not pass selected signals to the child. The parent can still = be > PJD> killed with a whole bunch of different signals that are not passe= d or > PJD> cannot be caught or the child process handle them gracefully. > PJD> Signals should be send to the PID from the pidfile anyway. If som= eone > PJD> is sending signals to the parent he has no right to expect well > PJD> behaviour from the parent. >=20 > Well, sending a whole bunch of different signals to parent we might not e= xpect > right behavior, but why not to provide it for the "standard" ones? E.g. on > shutdown init(8) will send SIGTERM and the daemon will gracefully exit > terminating the child and cleaning up the pidfile. If the the child proce= ss > does not handle SIGTERM gracefully I don't see much difference from having > only this one process alive or two (with its monitoring daemon). >=20 > The pidfile is seen in ps(1) output for the daemon process, which allows = to > identify the monitoring daemon with its child. Or we could change its > proctitle to something like "daemon: cmdname[pid]", similar to what sshd = does. > So people would expect that terminating a daemon will terminate the proce= ss it > monitors. >=20 > PJD> - Now that we handle the pidfile fully in the parent, I'd move drop= ping > PJD> provileges after fork(2) and pidfile_write(3). This way pidfiles = will > PJD> always be created with root privileges and we can forget about al= l the > PJD> mess with pid directories, etc. >=20 > PJD> - With the above you can wait for child to exit with simple wait(2). >=20 > Yes, it looks like much simpler, see the attached patch. But I don't thin= k I > like it much as it still looks like a half measure to me. I like this approach much better, as it is just simpler, but it is your call, Mikolaj. For the patch itself. You don't have to have two separate cases depending on request for pidfile. You can specify NULL pfh to the pidfile functions. Even in example from the manual page when pfh is NULL there is a case where we warn, but continue execution and call pidfile functions. This should simplify the code. If you do that (actually even if you don't), remember to either use warn(3) before pidfile_remove(3) and exit(3) after or preserve errno before calling pidfile_remove(3), as pidfile_remove(3) can modify it if unlink(2) is unsuccessful or pfh is NULL. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --0F1p//8PRICkK4MW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8vjtoACgkQForvXbEpPzRTWwCfUaxD+cpq07A2KXKLwmhUOe0L GaIAoI5fnVF3erG5aeJmPa8ROu46e464 =p6W1 -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 08:50:20 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2422E106566B; Mon, 6 Feb 2012 08:50:20 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 9F52B8FC15; Mon, 6 Feb 2012 08:50:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id q168oHVs004274; Mon, 6 Feb 2012 12:50:17 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Mon, 6 Feb 2012 12:50:17 +0400 (MSK) From: Maxim Konovalov To: Gleb Smirnoff In-Reply-To: <201202051653.q15Gr3AB092056@svn.freebsd.org> Message-ID: References: <201202051653.q15Gr3AB092056@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 08:50:20 -0000 On Sun, 5 Feb 2012, 16:53-0000, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Feb 5 16:53:02 2012 > New Revision: 231025 > URL: http://svn.freebsd.org/changeset/base/231025 > > Log: > Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and > TCP_KEEPCNT, that allow to control initial timeout, idle time, idle > re-send interval and idle send count on a per-socket basis. > > Reviewed by: andre, bz, lstewart > Great, thanks! -- Maxim Konovalov From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 10:23:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D986106564A; Mon, 6 Feb 2012 10:23:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6D68FC18; Mon, 6 Feb 2012 10:23:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16ANBPE031501; Mon, 6 Feb 2012 10:23:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16ANBCW031498; Mon, 6 Feb 2012 10:23:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202061023.q16ANBCW031498@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Feb 2012 10:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231071 - head/tools/tools/fixwhite X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:23:12 -0000 Author: ed Date: Mon Feb 6 10:23:11 2012 New Revision: 231071 URL: http://svn.freebsd.org/changeset/base/231071 Log: Add fixwhite(1). This small utility can be used to `sanitize' the whitespace in source code. It does the following things: Global: - Remove empty lines at the beginning and the end of a file. - Merge successive empty lines into a single empty line. Per-line: - Remove trailing whitespace. - Merge spaces preceeding tabs into the tabs. It operated on stdin/stdout. This means that if you use vi(1), you can just run :%!fixwhite to reorganize the file. Added: head/tools/tools/fixwhite/ head/tools/tools/fixwhite/Makefile (contents, props changed) head/tools/tools/fixwhite/fixwhite.1 (contents, props changed) head/tools/tools/fixwhite/fixwhite.c (contents, props changed) Added: head/tools/tools/fixwhite/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/Makefile Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= fixwhite +BINDIR= /usr/bin +WARNS= 6 + +.include Added: head/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/fixwhite.1 Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,46 @@ +.\" Copyright (c) 2012 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 6, 2012 +.Dt FIXWHITE 1 +.Os +.Sh NAME +.Nm fixwhite +.Nd remove unneeded whitespace from text files +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +The +.Nm +utility removes unneeded whitespace from text passed to standard input +and prints the result to standard output. +.Pp +It removes leading and trailing empty lines from the input, as well as +trailing whitespace characters from ever line of text. +Multiple successive empty lines are merged together. +Also, spaces preceeding tabs will be merged into the tab character. +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/tools/tools/fixwhite/fixwhite.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/fixwhite.c Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2012 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +static char *queue = NULL; +static size_t queuelen = 0, queuesize = 0; +static off_t column = 0; + +static void +savebyte(char c) +{ + + if (queuelen >= queuesize) { + queuesize += 128; + queue = realloc(queue, queuesize); + if (queue == NULL) { + perror("malloc"); + exit(1); + } + } + queue[queuelen++] = c; + + switch (c) { + case '\n': + column = 0; + break; + case ' ': + column++; + break; + case '\t': + column = (column / 8 + 1) * 8; + break; + } +} + +static bool +peekbyte(size_t back, char c) +{ + + return (queuelen >= back && queue[queuelen - back] == c); +} + +static void +savewhite(char c, bool leading) +{ + off_t ncolumn; + + switch (c) { + case '\n': + if (leading) { + /* Remove empty lines before input. */ + queuelen = 0; + column = 0; + } else { + /* Remove trailing whitespace. */ + while (peekbyte(1, ' ') || peekbyte(1, '\t')) + queuelen--; + /* Remove redundant empty lines. */ + if (peekbyte(2, '\n') && peekbyte(1, '\n')) + return; + savebyte('\n'); + } + break; + case ' ': + savebyte(' '); + break; + case '\t': + /* Convert preceeding spaces to tabs. */ + ncolumn = (column / 8 + 1) * 8; + while (peekbyte(1, ' ')) { + queuelen--; + column--; + } + while (column < ncolumn) + savebyte('\t'); + break; + } +} + +static void +printwhite(void) +{ + + if (fwrite(queue, 1, queuelen, stdout) != queuelen) { + perror("write"); + exit(1); + } + queuelen = 0; +} + +static char +readchar(void) +{ + int c; + + c = getchar(); + if (c == EOF && ferror(stdin)) { + perror("read"); + exit(1); + } + return (c); +} + +static void +writechar(char c) +{ + + if (putchar(c) == EOF) { + perror("write"); + exit(1); + } + /* XXX: Multi-byte characters. */ + column++; +} + +int +main(void) +{ + int c; + bool leading = true; + + while ((c = readchar()) != EOF) { + if (isspace(c)) + /* Save whitespace. */ + savewhite(c, leading); + else { + /* Reprint whitespace and print regular character. */ + printwhite(); + writechar(c); + leading = false; + } + } + /* Terminate non-empty files with a newline. */ + if (!leading) + writechar('\n'); + return (0); +} From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 10:47:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68D98106564A; Mon, 6 Feb 2012 10:47:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57CD68FC08; Mon, 6 Feb 2012 10:47:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16AlDAb032399; Mon, 6 Feb 2012 10:47:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AlD3Z032397; Mon, 6 Feb 2012 10:47:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061047.q16AlD3Z032397@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231074 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:47:13 -0000 Author: tuexen Date: Mon Feb 6 10:47:12 2012 New Revision: 231074 URL: http://svn.freebsd.org/changeset/base/231074 Log: Fix a typo which was already fixed by eadler in r227489. We missed to integrate this fix in our code base, so it was removed in r227755. MFC after: 3 days. Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Feb 6 10:38:20 2012 (r231073) +++ head/sys/netinet/sctp_structs.h Mon Feb 6 10:47:12 2012 (r231074) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:04:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D978B1065670; Mon, 6 Feb 2012 11:04:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6198FC0C; Mon, 6 Feb 2012 11:04:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16B4aMX032963; Mon, 6 Feb 2012 11:04:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16B4aSp032953; Mon, 6 Feb 2012 11:04:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061104.q16B4aSp032953@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 11:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231075 - in head/sys: fs/ext2fs fs/nfsclient geom/journal kern nfsclient sys ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:04:36 -0000 Author: kib Date: Mon Feb 6 11:04:36 2012 New Revision: 231075 URL: http://svn.freebsd.org/changeset/base/231075 Log: Current implementations of sync(2) and syncer vnode fsync() VOP uses mnt_noasync counter to temporary remove MNTK_ASYNC mount option, which is needed to guarantee a synchronous completion of the initiated i/o before syscall or VOP return. Global removal of MNTK_ASYNC option is harmful because not only i/o started from corresponding thread becomes synchronous, but all i/o is synchronous on the filesystem which is initiated during sync(2) or syncer activity. Instead of removing MNTK_ASYNC from mnt_kern_flag, provide a local thread flag to disable async i/o for current thread only. Use the opportunity to move DOINGASYNC() macro into sys/vnode.h and consistently use it through places which tested for MNTK_ASYNC. Some testing demonstrated 60-70% improvements in run time for the metadata-intensive operations on async-mounted UFS volumes, but still with great deviation due to other reasons. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks Modified: head/sys/fs/ext2fs/inode.h head/sys/fs/nfsclient/nfs_clvnops.c head/sys/geom/journal/g_journal.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/nfsclient/nfs_vnops.c head/sys/sys/proc.h head/sys/sys/vnode.h head/sys/ufs/ufs/inode.h Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/fs/ext2fs/inode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -158,9 +158,6 @@ struct indir { #define VTOI(vp) ((struct inode *)(vp)->v_data) #define ITOV(ip) ((ip)->i_vnode) -/* Check whether the MNTK_ASYNC flag has been set for a mount point */ -#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) - /* This overlays the fid structure (see mount.h). */ struct ufid { uint16_t ufid_len; /* Length of structure. */ Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 11:04:36 2012 (r231075) @@ -1376,7 +1376,7 @@ ncl_writerpc(struct vnode *vp, struct ui if (ret && !error) error = ret; } - if (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) + if (DOINGASYNC(vp)) *iomode = NFSWRITE_FILESYNC; if (error && NFS_ISV4(vp)) error = nfscl_maperr(uiop->uio_td, error, (uid_t)0, (gid_t)0); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/geom/journal/g_journal.c Mon Feb 6 11:04:36 2012 (r231075) @@ -2870,7 +2870,7 @@ g_journal_do_switch(struct g_class *clas struct mount *mp; struct bintime bt; char *mountpoint; - int error, vfslocked; + int error, save, vfslocked; DROP_GIANT(); g_topology_lock(); @@ -2932,10 +2932,7 @@ g_journal_do_switch(struct g_class *clas goto next; } - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); GJ_TIMER_START(1, &bt); vfs_msync(mp, MNT_NOWAIT); @@ -2950,11 +2947,7 @@ g_journal_do_switch(struct g_class *clas mountpoint, error); } - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/kern/vfs_subr.c Mon Feb 6 11:04:36 2012 (r231075) @@ -3521,7 +3521,7 @@ sync_fsync(struct vop_fsync_args *ap) { struct vnode *syncvp = ap->a_vp; struct mount *mp = syncvp->v_mount; - int error; + int error, save; struct bufobj *bo; /* @@ -3551,17 +3551,10 @@ sync_fsync(struct vop_fsync_args *ap) vfs_unbusy(mp); return (0); } - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); vfs_msync(mp, MNT_NOWAIT); error = VFS_SYNC(mp, MNT_LAZY); - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); vfs_unbusy(mp); return (error); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/kern/vfs_syscalls.c Mon Feb 6 11:04:36 2012 (r231075) @@ -134,7 +134,7 @@ sys_sync(td, uap) struct sync_args *uap; { struct mount *mp, *nmp; - int vfslocked; + int save, vfslocked; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -145,18 +145,10 @@ sys_sync(td, uap) vfslocked = VFS_LOCK_GIANT(mp); if ((mp->mnt_flag & MNT_RDONLY) == 0 && vn_start_write(NULL, &mp, V_NOWAIT) == 0) { - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); vfs_msync(mp, MNT_NOWAIT); VFS_SYNC(mp, MNT_NOWAIT); - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && - mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); } VFS_UNLOCK_GIANT(vfslocked); Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/nfsclient/nfs_vnops.c Mon Feb 6 11:04:36 2012 (r231075) @@ -1448,7 +1448,7 @@ nfs_writerpc(struct vnode *vp, struct ui tsiz -= len; } nfsmout: - if (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) + if (DOINGASYNC(vp)) committed = NFSV3WRITE_FILESYNC; *iomode = committed; if (error) Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/sys/proc.h Mon Feb 6 11:04:36 2012 (r231075) @@ -400,7 +400,7 @@ do { \ #define TDP_NOSLEEPING 0x00000100 /* Thread is not allowed to sleep on a sq. */ #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */ #define TDP_ITHREAD 0x00000400 /* Thread is an interrupt thread. */ -#define TDP_UNUSED800 0x00000800 /* available. */ +#define TDP_SYNCIO 0x00000800 /* Local override, disable async i/o. */ #define TDP_SCHED1 0x00001000 /* Reserved for scheduler private use */ #define TDP_SCHED2 0x00002000 /* Reserved for scheduler private use */ #define TDP_SCHED3 0x00004000 /* Reserved for scheduler private use */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/sys/vnode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -538,6 +538,10 @@ void assert_vop_unlocked(struct vnode *v */ #define VCALL(c) ((c)->a_desc->vdesc_call(c)) +#define DOINGASYNC(vp) \ + (((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) != 0 && \ + ((curthread->td_pflags & TDP_SYNCIO) == 0)) + /* * VMIO support inline */ Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/ufs/ufs/inode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -176,7 +176,6 @@ struct indir { /* Determine if soft dependencies are being done */ #define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) #define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) -#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) #define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) #define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:34:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 453101065672; Mon, 6 Feb 2012 11:34:48 +0000 (UTC) (envelope-from ivoras@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 D369B8FC12; Mon, 6 Feb 2012 11:34:47 +0000 (UTC) Received: by yhfs35 with SMTP id s35so2932210yhf.13 for ; Mon, 06 Feb 2012 03:34:47 -0800 (PST) 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 :content-transfer-encoding; bh=fm/jCDf52hOCIrOsVkq+EENPcSa3z2kMDK/YJr0GxVY=; b=PLyQbh6PmYsvxZMbU3uS4ewrIEO/fiXoUC878QgkD3r5YfIuhrIelu0RV3L/ZT/NzM uca6/SpFOlr8z5BdoDNLZ+hDtZr9tRMEbPP6Pz0SbE0In4Y4B8ToVeZC+4qJT8kW7d0s YbhtD2sf2QWN+1tEem3WqAitUmMhN1KEapTsc= Received: by 10.236.110.110 with SMTP id t74mr22122055yhg.121.1328528087129; Mon, 06 Feb 2012 03:34:47 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.100.121.14 with HTTP; Mon, 6 Feb 2012 03:34:06 -0800 (PST) In-Reply-To: <201202041649.q14GnUnI043572@svn.freebsd.org> References: <201202041649.q14GnUnI043572@svn.freebsd.org> From: Ivan Voras Date: Mon, 6 Feb 2012 12:34:06 +0100 X-Google-Sender-Auth: 5OksnqpGFU87L49c6xU41Pm6dlU Message-ID: To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:34:48 -0000 On 4 February 2012 17:49, Ryan Stone wrote: > Author: rstone > Date: Sat Feb =C2=A04 16:49:29 2012 > New Revision: 230984 > URL: http://svn.freebsd.org/changeset/base/230984 > > Log: > =C2=A0Whenever a new kernel thread is spawned, explicitly clear any CPU a= ffinity > =C2=A0set on the new thread. =C2=A0This prevents the thread from inadvert= ently > =C2=A0inheriting affinity from a random sibling. Shouldn't new threads inherit affinity from the threads which spawned them? From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:35:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2096106564A; Mon, 6 Feb 2012 11:35:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85ACE8FC08; Mon, 6 Feb 2012 11:35:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16BZUEq033927; Mon, 6 Feb 2012 11:35:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16BZUY6033922; Mon, 6 Feb 2012 11:35:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202061135.q16BZUY6033922@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Feb 2012 11:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231076 - in head: sbin/ipfw sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:35:30 -0000 Author: glebius Date: Mon Feb 6 11:35:29 2012 New Revision: 231076 URL: http://svn.freebsd.org/changeset/base/231076 Log: Make the 'tcpwin' option of ipfw(8) accept ranges and lists. Submitted by: sem Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Feb 6 11:04:36 2012 (r231075) +++ head/sbin/ipfw/ipfw.8 Mon Feb 6 11:35:29 2012 (r231076) @@ -1652,10 +1652,12 @@ option for details on matching fragmente TCP packets only. Match if the TCP header sequence number field is set to .Ar seq . -.It Cm tcpwin Ar win -TCP packets only. -Match if the TCP header window field is set to -.Ar win . +.It Cm tcpwin Ar tcpwin-list +Matches TCP packets whose header window field is set to +.Ar tcpwin-list , +which is either a single value or a list of values or ranges +specified in the same way as +.Ar ports . .It Cm tcpoptions Ar spec TCP packets only. Match if the TCP header contains the comma separated list of Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sbin/ipfw/ipfw2.c Mon Feb 6 11:35:29 2012 (r231076) @@ -512,6 +512,7 @@ static struct _s_x _port_name[] = { {"ipttl", O_IPTTL}, {"mac-type", O_MAC_TYPE}, {"tcpdatalen", O_TCPDATALEN}, + {"tcpwin", O_TCPWIN}, {"tagged", O_TAGGED}, {NULL, 0} }; @@ -1480,7 +1481,11 @@ show_ipfw(struct ip_fw *rule, int pcwidt break; case O_TCPWIN: - printf(" tcpwin %d", ntohs(cmd->arg1)); + if (F_LEN(cmd) == 1) + printf(" tcpwin %u", cmd->arg1); + else + print_newports((ipfw_insn_u16 *)cmd, 0, + O_TCPWIN); break; case O_TCPACK: @@ -3447,8 +3452,12 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); - fill_cmd(cmd, O_TCPWIN, 0, - htons(strtoul(*av, NULL, 0))); + if (strpbrk(*av, "-,")) { + if (!add_ports(cmd, *av, 0, O_TCPWIN)) + errx(EX_DATAERR, "invalid tcpwin len %s", *av); + } else + fill_cmd(cmd, O_TCPWIN, 0, + strtoul(*av, NULL, 0)); av++; break; Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sys/netinet/ipfw/ip_fw2.c Mon Feb 6 11:35:29 2012 (r231076) @@ -1650,8 +1650,22 @@ do { \ break; case O_TCPWIN: - match = (proto == IPPROTO_TCP && offset == 0 && - cmd->arg1 == TCP(ulp)->th_win); + if (proto == IPPROTO_TCP && offset == 0) { + uint16_t x; + uint16_t *p; + int i; + + x = ntohs(TCP(ulp)->th_win); + if (cmdlen == 1) { + match = (cmd->arg1 == x); + break; + } + /* Otherwise we have ranges. */ + p = ((ipfw_insn_u16 *)cmd)->ports; + i = cmdlen - 1; + for (; !match && i > 0; i--, p += 2) + match = (x >= p[0] && x <= p[1]); + } break; case O_ESTAB: Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Mon Feb 6 11:35:29 2012 (r231076) @@ -569,7 +569,6 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IPPRECEDENCE: case O_IPVER: case O_SOCKARG: - case O_TCPWIN: case O_TCPFLAGS: case O_TCPOPTS: case O_ESTAB: @@ -679,6 +678,7 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IPTTL: case O_IPLEN: case O_TCPDATALEN: + case O_TCPWIN: case O_TAGGED: if (cmdlen < 1 || cmdlen > 31) goto bad_size; From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:47:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC862106566C; Mon, 6 Feb 2012 11:47:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBB678FC16; Mon, 6 Feb 2012 11:47:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16BlOQa034304; Mon, 6 Feb 2012 11:47:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16BlODi034302; Mon, 6 Feb 2012 11:47:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061147.q16BlODi034302@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 11:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231077 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:47:25 -0000 Author: kib Date: Mon Feb 6 11:47:24 2012 New Revision: 231077 URL: http://svn.freebsd.org/changeset/base/231077 Log: JNEWBLK dependency may legitimately appear on the buf dependency list. If softdep_sync_buf() discovers such dependency, it should do nothing, which is safe as it is only waiting on the parent buffer to be written, so it can be removed. Committed on behalf of: jeff MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 11:35:29 2012 (r231076) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 11:47:24 2012 (r231077) @@ -12112,6 +12112,7 @@ top: case D_FREEWORK: case D_FREEDEP: case D_JSEGDEP: + case D_JNEWBLK: continue; default: From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:51:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92A79106564A; Mon, 6 Feb 2012 11:51:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67C488FC0C; Mon, 6 Feb 2012 11:51:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16Bp5F5034465; Mon, 6 Feb 2012 11:51:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16Bp51j034462; Mon, 6 Feb 2012 11:51:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202061151.q16Bp51j034462@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Feb 2012 11:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231078 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:51:05 -0000 Author: glebius Date: Mon Feb 6 11:51:04 2012 New Revision: 231078 URL: http://svn.freebsd.org/changeset/base/231078 Log: Bump .Dd for r231076. Submitted by: bz Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Feb 6 11:47:24 2012 (r231077) +++ head/sbin/ipfw/ipfw.8 Mon Feb 6 11:51:04 2012 (r231078) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2011 +.Dd February 6, 2012 .Dt IPFW 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 12:03:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C921065710; Mon, 6 Feb 2012 12:03:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 884C58FC12; Mon, 6 Feb 2012 12:03:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16C3L6p034873; Mon, 6 Feb 2012 12:03:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16C3LO3034869; Mon, 6 Feb 2012 12:03:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202061203.q16C3LO3034869@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 12:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231079 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 12:03:22 -0000 Author: dim Date: Mon Feb 6 12:03:21 2012 New Revision: 231079 URL: http://svn.freebsd.org/changeset/base/231079 Log: Let rpcgen(1) support an environment variable RPCGEN_CPP to find the C preprocessor to run. Previously, it always ran /usr/bin/cpp, unless you used the -Y option, and even then you could not set the basename. It also attempted to run /usr/ccs/lib/cpp for SVR4 compatibility, but this is obsolete, and has been removed. Note that setting RPCGEN_CPP to a command with arguments is supported, though the command line parsing is simplistic. However, setting it to e.g. "gcc46 -E" or "clang -E" will lead to problems, because both gcc and clang in -E mode will consider files with unknown extensions (such as .x) as object files, and attempt to link them. This could be worked around by also adding "-x c", but it is much safer to set RPCGEN_CPP to e.g. "cpp46" or "clang-cpp" instead. MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c head/usr.bin/rpcgen/rpcgen.1 Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 11:51:04 2012 (r231078) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:03:21 2012 (r231079) @@ -75,13 +75,8 @@ static void s_output(int, const char **, #define EXTEND 1 /* alias for TRUE */ #define DONT_EXTEND 0 /* alias for FALSE */ -#define SVR4_CPP "/usr/ccs/lib/cpp" -#define SUNOS_CPP "/usr/bin/cpp" - -static int cppDefined = 0; /* explicit path for C preprocessor */ - static const char *svcclosetime = "120"; -static const char *CPP = SVR4_CPP; +static const char *CPP = NULL; static const char CPPFLAGS[] = "-C"; static char pathbuf[MAXPATHLEN + 1]; static const char *allv[] = { @@ -97,7 +92,7 @@ static int allnc = sizeof (allnv)/sizeof * machinations for handling expanding argument list */ static void addarg(const char *); /* add another argument to the list */ -static void putarg(int, const char *); /* put argument at specified location */ +static void insarg(int, const char *); /* insert arg at specified location */ static void clear_args(void); /* clear argument list */ static void checkfiles(const char *, const char *); /* check if out file already exists */ @@ -105,7 +100,7 @@ static void checkfiles(const char *, con #define ARGLISTLEN 20 -#define FIXEDARGS 2 +#define FIXEDARGS 0 static char *arglist[ARGLISTLEN]; static int argcount = FIXEDARGS; @@ -288,24 +283,35 @@ clear_args(void) argcount = FIXEDARGS; } -/* make sure that a CPP exists */ +/* prepend C-preprocessor and flags before arguments */ static void -find_cpp(void) +prepend_cpp(void) { + int idx = 1; + const char *var; + char *dupvar, *s, *t; struct stat buf; - if (stat(CPP, &buf) < 0) { /* SVR4 or explicit cpp does not exist */ - if (cppDefined) { - warnx("cannot find C preprocessor: %s", CPP); - crash(); - } else { /* try the other one */ - CPP = SUNOS_CPP; - if (stat(CPP, &buf) < 0) { /* can't find any cpp */ - warnx("cannot find C preprocessor: %s", CPP); - crash(); - } + if (CPP != NULL) + insarg(0, CPP); + else if ((var = getenv("RPCGEN_CPP")) == NULL) + insarg(0, "/usr/bin/cpp"); + else { + /* Parse command line in a rudimentary way */ + dupvar = xstrdup(var); + for (s = dupvar, idx = 0; (t = strsep(&s, " \t")) != NULL; ) { + if (t[0]) + insarg(idx++, t); } + free(dupvar); } + + if (stat(arglist[0], &buf) < 0) { + warnx("cannot find C preprocessor: %s", arglist[0]); + crash(); + } + + insarg(idx, CPPFLAGS); } /* @@ -320,9 +326,7 @@ open_input(const char *infile, const cha (void) pipe(pd); switch (childpid = fork()) { case 0: - find_cpp(); - putarg(0, CPP); - putarg(1, CPPFLAGS); + prepend_cpp(); addarg(define); if (infile) addarg(infile); @@ -934,18 +938,26 @@ addarg(const char *cp) } +/* + * Insert an argument at the specified location + */ static void -putarg(int place, const char *cp) +insarg(int place, const char *cp) { - if (place >= ARGLISTLEN) { - warnx("arglist coding error"); + int i; + + if (argcount >= ARGLISTLEN) { + warnx("too many defines"); crash(); /*NOTREACHED*/ } - if (cp != NULL) - arglist[place] = xstrdup(cp); - else - arglist[place] = NULL; + + /* Move up existing arguments */ + for (i = argcount - 1; i > place; i--) + arglist[i + 1] = arglist[i]; + + arglist[place] = xstrdup(cp); + argcount++; } /* @@ -1134,7 +1146,6 @@ parseargs(int argc, const char *argv[], return (0); } CPP = pathbuf; - cppDefined = 1; goto nextarg; Modified: head/usr.bin/rpcgen/rpcgen.1 ============================================================================== --- head/usr.bin/rpcgen/rpcgen.1 Mon Feb 6 11:51:04 2012 (r231078) +++ head/usr.bin/rpcgen/rpcgen.1 Mon Feb 6 12:03:21 2012 (r231079) @@ -490,6 +490,11 @@ Give the name of the directory where .Nm will start looking for the C-preprocessor. .El +.Sh ENVIRONMENT +If the +.Ev RPCGEN_CPP +environment variable is set, its value is used as the command line of the +C preprocessor to be run on the input file. .Sh EXAMPLES The following example: .Dl example% rpcgen -T prot.x From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 12:08:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04265106566C; Mon, 6 Feb 2012 12:08:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E780D8FC12; Mon, 6 Feb 2012 12:08:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16C8fMJ035133; Mon, 6 Feb 2012 12:08:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16C8fnU035131; Mon, 6 Feb 2012 12:08:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202061208.q16C8fnU035131@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 12:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231080 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 12:08:42 -0000 Author: dim Date: Mon Feb 6 12:08:41 2012 New Revision: 231080 URL: http://svn.freebsd.org/changeset/base/231080 Log: Amend r231079 by properly shifting up the existing arguments in rpc_main.c's insarg() function. I had forgotten to put this in my patch queue, sorry. Pointy hat to: me MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:03:21 2012 (r231079) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:08:41 2012 (r231080) @@ -953,7 +953,7 @@ insarg(int place, const char *cp) } /* Move up existing arguments */ - for (i = argcount - 1; i > place; i--) + for (i = argcount - 1; i >= place; i--) arglist[i + 1] = arglist[i]; arglist[place] = xstrdup(cp); From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 13:08:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D6D7106564A; Mon, 6 Feb 2012 13:08:30 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 084808FC1C; Mon, 6 Feb 2012 13:08:29 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id q16D8Hkw062672; Mon, 6 Feb 2012 22:08:20 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Mon, 06 Feb 2012 22:07:21 +0900 (JST) Message-Id: <20120206.220721.343708041459090867.nyan@FreeBSD.org> To: nwhitehorn@freebsd.org From: TAKAHASHI Yoshihiro In-Reply-To: <4F2EA4F7.9010204@freebsd.org> References: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> <4F2EA4F7.9010204@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Feb__6_22_07_21_2012_754)--" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:08:30 -0000 ----Next_Part(Mon_Feb__6_22_07_21_2012_754)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit In article <4F2EA4F7.9010204@freebsd.org> Nathan Whitehorn writes: >>>>> TERM=xterm >>>> This code is also used on pc98, right? I think on pc98 we still need >>>> to >>>> use TERM=cons25w, to support Japanese character sets and keyboard >>>> input. >> How about the attached patch? > > The top half looks OK. The bottom half (the menu) is relevant only for > serial consoles. I guess people could be viewing a remote serial > console on a PC-98 graphics console, but then it shouldn't be > conditionalized on PC98 machines. Ok. I update the patch. --- TAKAHASHI Yoshihiro ----Next_Part(Mon_Feb__6_22_07_21_2012_754)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a.diff" Index: src/release/rc.local =================================================================== RCS file: /home/ncvs/src/release/rc.local,v retrieving revision 1.6 diff -u -r1.6 rc.local --- src/release/rc.local 23 Jan 2012 16:17:54 -0000 1.6 +++ src/release/rc.local 6 Feb 2012 13:04:37 -0000 @@ -8,10 +8,16 @@ : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +MACHINE=`uname -m` + kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs - TERM=xterm + if [ ${MACHINE} = "pc98" ]; then + TERM=cons25w + else + TERM=xterm + fi if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system @@ -31,6 +37,7 @@ echo " ansi Standard ANSI terminal" echo " vt100 VT100 or compatible terminal" echo " xterm xterm terminal emulator (or compatible)" + echo " cons25w cons25w terminal" echo echo -n "Console type [vt100]: " read TERM ----Next_Part(Mon_Feb__6_22_07_21_2012_754)---- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:11:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F9D6106566B; Mon, 6 Feb 2012 14:11:24 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E89C8FC08; Mon, 6 Feb 2012 14:11:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16EBOx7039271; Mon, 6 Feb 2012 14:11:24 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16EBOwt039268; Mon, 6 Feb 2012 14:11:24 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201202061411.q16EBOwt039268@svn.freebsd.org> From: Guy Helmer Date: Mon, 6 Feb 2012 14:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231087 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:11:24 -0000 Author: ghelmer Date: Mon Feb 6 14:11:24 2012 New Revision: 231087 URL: http://svn.freebsd.org/changeset/base/231087 Log: Using the O_CLOEXEC flag on open(2) caused the pidfile lock to be lost when the child process execs daemon's target program thanks to flock(2) semantics. So, we apparently have to leak the open pidfile's file descriptor to keep the lock for the pidfile(3) functions to work properly. Test case demonstrated by trociny: ref8-amd64:/home/trociny% uname -r 8.2-STABLE ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 daemon: process already running, pid: 19799 kopusha:~% uname -r 10.0-CURRENT kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Mon Feb 6 13:36:49 2012 (r231086) +++ head/lib/libutil/pidfile.c Mon Feb 6 14:11:24 2012 (r231087) @@ -124,7 +124,7 @@ pidfile_open(const char *path, mode_t mo * pidfile_write() can be called multiple times. */ fd = flopen(pfh->pf_path, - O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode); + O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode); if (fd == -1) { if (errno == EWOULDBLOCK && pidptr != NULL) { count = 20; From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:25:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576901065672; Mon, 6 Feb 2012 14:25:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 07EDC8FC08; Mon, 6 Feb 2012 14:25:15 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id C2541A2D; Mon, 6 Feb 2012 15:25:14 +0100 (CET) Date: Mon, 6 Feb 2012 15:24:02 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120206142402.GG1324@garage.freebsd.pl> References: <201202061411.q16EBOwt039268@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UTZ8bGhNySVQ9LYl" Content-Disposition: inline In-Reply-To: <201202061411.q16EBOwt039268@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231087 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:25:17 -0000 --UTZ8bGhNySVQ9LYl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 02:11:24PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Mon Feb 6 14:11:24 2012 > New Revision: 231087 > URL: http://svn.freebsd.org/changeset/base/231087 >=20 > Log: > Using the O_CLOEXEC flag on open(2) caused the pidfile lock to be lost > when the child process execs daemon's target program thanks to flock(2) > semantics. So, we apparently have to leak the open pidfile's file > descriptor to keep the lock for the pidfile(3) functions to work proper= ly. > > Test case demonstrated by trociny: > =20 > ref8-amd64:/home/trociny% uname -r > 8.2-STABLE > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > daemon: process already running, pid: 19799 > =20 > kopusha:~% uname -r > 10.0-CURRENT > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% Not sure if you saw the following discussion, but O_CLOEXEC is ok here. Mikolaj is working on improving daemon to handle it properly. What we had in 8.2-STABLE is also incorrect, but for other reasons. All in all, O_CLOEXEC should stay. What Mikolaj presented is a problem in daemon(8) and not pidfile(3). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --UTZ8bGhNySVQ9LYl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8v4oIACgkQForvXbEpPzSRMQCfc5oRcV8KhB8d2JJLul7mbJoG Zq8AoJ39wwZRPVWUydlDyiA1QC4QrBVX =No2B -----END PGP SIGNATURE----- --UTZ8bGhNySVQ9LYl-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:32:24 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 439D6106566C; Mon, 6 Feb 2012 14:32:24 +0000 (UTC) (envelope-from ghelmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id C9F858FC1A; Mon, 6 Feb 2012 14:32:22 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q16EVvsO019560; Mon, 6 Feb 2012 08:32:04 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q16EVjIh074179 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 6 Feb 2012 08:31:45 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q16EVjIh074179 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1328538709; bh=5NUXxddw6KTLF7+CbMvI8/MHMcl9Hbna68P4/jL3n/g=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=iICw2fDoVVzgV4E/mrX7m/qwwpJxSiTfxdBYjBFJyL3XO0c2XGvue/o1KGe08Gw88 d3yZ6vtjQpQ3/ZcVGF2npKA1lmZxWnSqdQto1UhA4EBtEh3e/pXFR/80tjPLHprGMx iBUBOL+L6t9e5b3Ko5kR9ZNtxLfp/F0Ti8tFaJ7w= Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120205093938.GC30033@garage.freebsd.pl> Date: Mon, 6 Feb 2012 08:31:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Mon, 06 Feb 2012 08:31:49 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q16EVjIh074179 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.406, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.49) X-Palisade-MailScanner-From: ghelmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:32:24 -0000 On Feb 5, 2012, at 3:39 AM, Pawel Jakub Dawidek wrote: > On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: >> ref8-amd64:/home/trociny% uname -r >> 8.2-STABLE >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> daemon: process already running, pid: 19799 >>=20 >> kopusha:~% uname -r =20 >> 10.0-CURRENT >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~%=20 >=20 > Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also > isn't correct. >=20 > Passing open descriptor to a process that doesn't expect that is bad > behaviour. If you pass, eg. open descriptor to a directory and the > process is using chroot(2) or jail(2) to sandbox itself it will be = able > to escape from that sandbox. Passing descriptor to a file has smaller > security implication, but it is still wrong. For example hastd, as you > probably know, asserts, before sandboxing, that he knows about all = open > descriptors - if there are some unknown descriptors open it won't run. >=20 > Also, daemon was passing open descriptor to a pidfile that the child > process cannot clean up, because he doesn't know its name. This leaves > pidfile with stale PID in it once the process exits, which is also = bad. >=20 > In my opinion, to make daemon(8) work with pidfiles, it cannot exit > after executing the given command. It should stay around with pidfile > open and just wait for the child to exit. Once the child exits, it > should remove the pidfile and also exit. If my understanding of flock(2) semantics is correct, with open(2) = O_CLOEXEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the = pidfile file descriptor during an exec will result in loss of the lock = on the pidfile regardless of whether daemon(8) hangs around to wait for = the child exit. Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:44:52 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F175A1065672; Mon, 6 Feb 2012 14:44:52 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9DDB78FC14; Mon, 6 Feb 2012 14:44:52 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 0ECF2A57; Mon, 6 Feb 2012 15:44:51 +0100 (CET) Date: Mon, 6 Feb 2012 15:43:39 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120206144337.GH1324@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2xzXx3ruJf7hsAzo" Content-Disposition: inline In-Reply-To: <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:44:53 -0000 --2xzXx3ruJf7hsAzo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 08:31:47AM -0600, Guy Helmer wrote: > If my understanding of flock(2) semantics is correct, with open(2) O_CLOE= XEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the pidfile f= ile descriptor during an exec will result in loss of the lock on the pidfil= e regardless of whether daemon(8) hangs around to wait for the child exit. My expectation is that as long as parent process holds pidfile descriptor open and locked, the pidfile should remain locked even after fork(2)/execve(2). Worth checking, though. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --2xzXx3ruJf7hsAzo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8v5xkACgkQForvXbEpPzTI5wCgyTkHOoWHzU4WHjxsGjRJnkZ0 Vg8AoOBW/FOz8tg77nzE85rF3N2ZcISl =SJOw -----END PGP SIGNATURE----- --2xzXx3ruJf7hsAzo-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:21:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD67106564A; Mon, 6 Feb 2012 15:21:55 +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 C3F148FC1B; Mon, 6 Feb 2012 15:21:55 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 7BA1D46B17; Mon, 6 Feb 2012 10:21:55 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0B7DEB95C; Mon, 6 Feb 2012 10:21:55 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Mon, 6 Feb 2012 07:53:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202051654.q15GsQcc092137@svn.freebsd.org> In-Reply-To: <201202051654.q15GsQcc092137@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201202060753.43627.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 10:21:55 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:21:56 -0000 On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Feb 5 16:54:26 2012 > New Revision: 231026 > URL: http://svn.freebsd.org/changeset/base/231026 > > Log: > Make sure to remap adjusted resources. Hmm, I had considered remapping adjusted resources an invalid operation (i.e. should fail with EINVAL). I believe that the NEW_PCIB code should only apply this API to resources backing the resource windows in PCI-PCI bridges and that those resources should never have RF_ACTIVE set. Are you seeing calls of it for active resources? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:21:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530D21065670; Mon, 6 Feb 2012 15:21:59 +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 285B68FC1C; Mon, 6 Feb 2012 15:21:59 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D59ED46B2A; Mon, 6 Feb 2012 10:21:58 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 45F7CB960; Mon, 6 Feb 2012 10:21:56 -0500 (EST) From: John Baldwin To: Ivan Voras Date: Mon, 6 Feb 2012 09:30:31 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202041649.q14GnUnI043572@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201202060930.31511.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 10:21:58 -0500 (EST) Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:21:59 -0000 On Monday, February 06, 2012 6:34:06 am Ivan Voras wrote: > On 4 February 2012 17:49, Ryan Stone wrote: > > Author: rstone > > Date: Sat Feb 4 16:49:29 2012 > > New Revision: 230984 > > URL: http://svn.freebsd.org/changeset/base/230984 > > > > Log: > > Whenever a new kernel thread is spawned, explicitly clear any CPU affinity > > set on the new thread. This prevents the thread from inadvertently > > inheriting affinity from a random sibling. > > Shouldn't new threads inherit affinity from the threads which spawned them? User threads still do, but kernel threads are a bit tricky since most of them get created during boot when everything is running on the BSP, so the affinity they would inherit is rather bogus. Even post-boot many of the cases I can think of when you would create kthreads (e.g. expanding a thread pool), you don't really want to inherit affinity. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:39:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542781065675; Mon, 6 Feb 2012 15:39:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 229E68FC1B; Mon, 6 Feb 2012 15:39:58 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ00C06A6HYT00@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:39:53 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ00CB9A6B6Y00@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:39:48 -0600 (CST) Date: Mon, 06 Feb 2012 09:39:46 -0600 From: Nathan Whitehorn In-reply-to: <20120206.220721.343708041459090867.nyan@FreeBSD.org> To: TAKAHASHI Yoshihiro Message-id: <4F2FF442.2090102@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.153022, SenderIP=76.208.68.223 References: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> <4F2EA4F7.9010204@freebsd.org> <20120206.220721.343708041459090867.nyan@FreeBSD.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:39:59 -0000 On 02/06/12 07:07, TAKAHASHI Yoshihiro wrote: > In article<4F2EA4F7.9010204@freebsd.org> > Nathan Whitehorn writes: > >>>>>> TERM=xterm >>>>> This code is also used on pc98, right? I think on pc98 we still need >>>>> to >>>>> use TERM=cons25w, to support Japanese character sets and keyboard >>>>> input. >>> How about the attached patch? >> The top half looks OK. The bottom half (the menu) is relevant only for >> serial consoles. I guess people could be viewing a remote serial >> console on a PC-98 graphics console, but then it shouldn't be >> conditionalized on PC98 machines. > Ok. I update the patch. > > --- > TAKAHASHI Yoshihiro Looks good to me. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:40:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E22A41065676; Mon, 6 Feb 2012 15:40:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id B357E8FC1C; Mon, 6 Feb 2012 15:40:56 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ00800A889Y00@smtpauth2.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:40:56 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ007C7A862J00@smtpauth2.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:40:55 -0600 (CST) Date: Mon, 06 Feb 2012 09:40:54 -0600 From: Nathan Whitehorn In-reply-to: <201202060753.43627.jhb@freebsd.org> To: John Baldwin Message-id: <4F2FF486.5090507@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.153022, SenderIP=76.208.68.223 References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202060753.43627.jhb@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:40:57 -0000 On 02/06/12 06:53, John Baldwin wrote: > On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sun Feb 5 16:54:26 2012 >> New Revision: 231026 >> URL: http://svn.freebsd.org/changeset/base/231026 >> >> Log: >> Make sure to remap adjusted resources. > Hmm, I had considered remapping adjusted resources an invalid operation (i.e. > should fail with EINVAL). I believe that the NEW_PCIB code should only apply > this API to resources backing the resource windows in PCI-PCI bridges and that > those resources should never have RF_ACTIVE set. Are you seeing calls of it > for active resources? > No, I was just trying to be safe here, since it wasn't clear that that was invalid. I'm happy to replace the contents of the if with return EINVAL or something. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:59:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 595BD106564A; Mon, 6 Feb 2012 15:59:58 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3B38FC0A; Mon, 6 Feb 2012 15:59:57 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so6877447wib.13 for ; Mon, 06 Feb 2012 07:59:56 -0800 (PST) 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=sYU984wzktceO0eiD2yXGUPrgLkTvqE5a4jDvJXX6UU=; b=Wy8/fujzZ/hwaMyqDzVPa37kPPrlJ1p/rVTDi6cH7C6mJd9vElKBxDZmtlm2akMAMj pL8R6ThR7EIF11QTjDseNj9yTI1eEkPw4fOTF9OvqJX661Pp4M/cSubR48J2KZd/tKFe Ff2Y0lysFKFnq0szB6COtU7P6YTfdmnfKDNQU= MIME-Version: 1.0 Received: by 10.180.105.129 with SMTP id gm1mr15915045wib.1.1328542502025; Mon, 06 Feb 2012 07:35:02 -0800 (PST) Received: by 10.180.106.129 with HTTP; Mon, 6 Feb 2012 07:35:02 -0800 (PST) In-Reply-To: References: <201202041649.q14GnUnI043572@svn.freebsd.org> Date: Mon, 6 Feb 2012 10:35:02 -0500 Message-ID: From: Ryan Stone To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:59:58 -0000 On Mon, F