From patchwork Thu Nov 14 20:20:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 291360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E091F2C0092 for ; Fri, 15 Nov 2013 07:21:15 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=Zs/znatOHK8VUrgwmv xHg4DmRt9DSV51hfG7OcGmlYBAYpVpuXx5MfgsFVp0ZyDmFaJhG+XYI4etLThRkW n4YzuUfXLna4wnXaeSjPtNJMvwD7bo24hMEPdn9I5maQK8Lwdxs9MeRdIX373e1v NFwvLnXLrxulAWaivp6DwuID8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=Lk5DXfgYJmFNgM06jrc458cw U4U=; b=Cf1ss82diwZthC0TjZU2D6UJR3prcva0K3AbB4oU++kvX1C1X3oSXcLv 5Zjrq4O+2vC/DM4v0GnbbhyV1IYyzd4Mhj4SQgC2GRl6dvAACr6uDmQyr2q9sbNL 6ld6ZN3iOBavVnNsXAhF/5zg53tnoORnZ++J2aieOfXsw2dO/fk= Received: (qmail 14447 invoked by alias); 14 Nov 2013 20:21:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 14429 invoked by uid 89); 14 Nov 2013 20:21:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_LOW, RDNS_NONE, SPF_PASS, T_FRT_STOCK2, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-oa0-f48.google.com Received: from Unknown (HELO mail-oa0-f48.google.com) (209.85.219.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 14 Nov 2013 20:20:36 +0000 Received: by mail-oa0-f48.google.com with SMTP id n16so2873034oag.35 for ; Thu, 14 Nov 2013 12:20:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=7G0Li3WcTveNliGlAqjmk78AJGB1paTYWjYuJ+fVpoM=; b=bjI/ULyqQdQEy4IVOEeqtsCLmSZZyywMXUMn6VUX+TVtLFVzogBgejRx1Gx8LzsjPb 9LiVA0AAhO5HJp3mgj9TIKqjPojN0cGF/9xQiIqPRYOuEd0KGg8ECD8tmlk9qfu/5aGO H0DaA/cBQ97Ny3SLQX13/vuDYIR8R7+HUvaElZ1XMVg4z0X9N26gwSG+PjSbr4oPMzn3 V8k8tmZA/Sz6YJY1OAwAulJAANQkrZurXFflap+pgvzgWk2Nb5/b04n8xVRZ4b7AKWFC cIbR5nEcLewdR3TZcnEl0GHPBQmfNxtIR9cepgyKOSyxuasC0Cdz9LSb18AABnPZ0Yy1 WWEg== X-Gm-Message-State: ALoCoQnapF8QAvIT/WbiXya3q8KMx72S1MFCsowjvmKdetypDBGf2b6FB+y+1AqvDdrlYfLeFOAjW/zaXQZV4bl+ZHlsm861+teq4FyPwA8F8Pg3sK4iK8N4Zlh6UPerbBsGJlPH2qw6K3K8Q1j4PPhdna0hbCfUKbBJRh+w29tsaugg3kDk9NtJszMD+8glUvbhoxeGvGjsqqjDHNFGn8PxDWQeGo+SxQ== MIME-Version: 1.0 X-Received: by 10.60.137.193 with SMTP id qk1mr3268654oeb.89.1384460428698; Thu, 14 Nov 2013 12:20:28 -0800 (PST) Received: by 10.60.145.144 with HTTP; Thu, 14 Nov 2013 12:20:28 -0800 (PST) In-Reply-To: References: Date: Thu, 14 Nov 2013 12:20:28 -0800 Message-ID: Subject: Re: Recent Go patch broke Solaris bootstrap From: Ian Lance Taylor To: Rainer Orth Cc: gcc-patches , "gofrontend-dev@googlegroups.com" X-IsSubscribed: yes On Tue, Nov 12, 2013 at 7:16 AM, Rainer Orth wrote: > Ian Lance Taylor writes: > >> On Tue, Nov 12, 2013 at 6:43 AM, Rainer Orth >> wrote: >>> >>> works on Solaris 11, but not on Solaris 9 and 10 which lack >>> TCP_KEEPALIVE_THRESHOLD. >> >> Do they have any facility for changing the keepalive timers? > > There's TCP_KEEPALIVE which is already used in tcpsockopt_darwin.go. OK, great. This patch changes the Solaris code to use the existing Darwin code. Bootstrapped on x86_64-unknown-linux-gnu, not that that proves much. Committed to mainline. Ian diff -r bfe1d96993b8 libgo/Makefile.am --- a/libgo/Makefile.am Thu Nov 14 12:13:29 2013 -0800 +++ b/libgo/Makefile.am Thu Nov 14 12:16:15 2013 -0800 @@ -752,7 +752,7 @@ go_net_tcpsockopt_file = go/net/tcpsockopt_darwin.go else if LIBGO_IS_SOLARIS -go_net_tcpsockopt_file = go/net/tcpsockopt_solaris.go +go_net_tcpsockopt_file = go/net/tcpsockopt_darwin.go else go_net_tcpsockopt_file = go/net/tcpsockopt_unix.go endif diff -r bfe1d96993b8 libgo/go/net/tcpsockopt_solaris.go --- a/libgo/go/net/tcpsockopt_solaris.go Thu Nov 14 12:13:29 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package net - -import ( - "os" - "syscall" - "time" -) - -// Set keep alive period. -func setKeepAlivePeriod(fd *netFD, d time.Duration) error { - if err := fd.incref(); err != nil { - return err - } - defer fd.decref() - - // The kernel expects milliseconds so round to next highest millisecond. - d += (time.Millisecond - time.Nanosecond) - msecs := int(d.Nanoseconds() / time.Millisecond) - - return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPALIVE_THRESHOLD, msecs)) -}