From patchwork Mon Nov 11 21:25:45 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: 290511 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 E86412C008A for ; Tue, 12 Nov 2013 08:26:04 +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=XIR4ywg/rRSpe/ft6M yJunYElu9oM4VMVeYwh6f/lJ5l4B7D//1pXHBD7Mki11RS01T9ihNPIAexR5FZW4 f/T8JGeuZUcJWOkKHbVwmyh6/EmGqJru9dWHjQxyj04AO0BYm6+zDkeaknau5e6/ We/Kc3OeKtqX60Vc26YoU/L5M= 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=gnnmnGAgmU0xG130D3anmvtH 3Bw=; b=BPCGZboX6n48IIn2tM+Q+OEKRyh7QubsqJx4jRINL3pETdJluIbtV7gi e81AIBZ5kRoAuTvoHxgXLS9AAeUEObgD9R/UL+IdwlXh7gLdSjVA7omKvjd93y/S ACQPr/dyyCfys70kj0UIXzXky7EFT8EKK5zdIls2TY7a5cCG6HI= Received: (qmail 3863 invoked by alias); 11 Nov 2013 21:25:55 -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 3851 invoked by uid 89); 11 Nov 2013 21:25:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL, BAYES_50, RDNS_NONE, SPF_PASS, T_FRT_STOCK2, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-ob0-f176.google.com Received: from Unknown (HELO mail-ob0-f176.google.com) (209.85.214.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 11 Nov 2013 21:25:53 +0000 Received: by mail-ob0-f176.google.com with SMTP id wp4so3640649obc.7 for ; Mon, 11 Nov 2013 13:25:46 -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=oDiIncAW41MsUWOn3I/hm0n4gM+CrrmUO68r+WrJmwo=; b=DePQuK2QaoHSvwPtpqXwesAbCxsMXM4jRYP5LoRCdPDVqBbZFN8kGL88fH8zQ8fvlf M0x7zc4nXzaeSELZBuQfj1yoKipnMZLVZhGmL3GEtHpmMHr7zE2bb6anrHImWSRdvSwk yqLMlTrYIBCMFxeP3GmwB9CnUksk/PiygTd00Ied2AIciLaHkr5q8KeKmrB3TcR/+nNe wENpE26s2bdD+ztqO9Jgkeyl5+GX4RBlZvd0v9mqPQ2M5YLV7YjvGNV/DSQERA7vjZIz cKuQ1KdzyNDBIDWdIou9DQizmcOBl1POzRE/j9ZEwWwwCQBG8adBUGaq18qafHWsC3+D gzZg== X-Gm-Message-State: ALoCoQk+PM0YlzuzIRBSwqfamb21HcVNA2Zk7djOLiZ1CBP9aEXYNRXUOxI4V0+5KLcsA90gWFg+I5zZVfTyTm0MM7pbq4qylyr7OvZoZHbz+h1oYbj+LeprlBZQMvycOQAGvCEhAAZ6bZFLukq3caRoBiEEsOeuXag6CRO0EAH8+DE1DZuAm4pbor8N8c73i2fliR79sQ4MynskS4HTJHiNmAmDwPYm/g== MIME-Version: 1.0 X-Received: by 10.182.196.3 with SMTP id ii3mr27621128obc.11.1384205146169; Mon, 11 Nov 2013 13:25:46 -0800 (PST) Received: by 10.60.145.144 with HTTP; Mon, 11 Nov 2013 13:25:45 -0800 (PST) In-Reply-To: References: Date: Mon, 11 Nov 2013 13:25:45 -0800 Message-ID: Subject: Re: Recent Go patch broke Solaris bootstrap From: Ian Lance Taylor To: Rainer Orth Cc: gcc-patches X-IsSubscribed: yes On Fri, Nov 8, 2013 at 4:01 AM, Rainer Orth wrote: > The recent Go patch (couldn't find the submission on gcc-patches) broke > Solaris bootstrap: on Solaris 10/x86 I get > > /vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:26:103: error: reference to undefined identifier 'syscall.TCP_KEEPINTVL' > err := os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, secs)) > ^ > /vol/gcc/src/hg/trunk/local/libgo/go/net/tcpsockopt_unix.go:30:103: error: reference to undefined identifier 'syscall.TCP_KEEPIDLE' > return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_KEEPIDLE, secs)) > ^ I think this will be fixed by the appended patch. Bootstrapped and tested on x86_64-unknown-linux-gnu, not that that proves anything. Committed to mainline. Ian diff -r 47a9c8a497d5 libgo/Makefile.am --- a/libgo/Makefile.am Mon Nov 11 13:20:11 2013 -0800 +++ b/libgo/Makefile.am Mon Nov 11 13:23:07 2013 -0800 @@ -770,9 +770,13 @@ if LIBGO_IS_DARWIN go_net_tcpsockopt_file = go/net/tcpsockopt_darwin.go else +if LIBGO_IS_SOLARIS +go_net_tcpsockopt_file = go/net/tcpsockopt_solaris.go +else go_net_tcpsockopt_file = go/net/tcpsockopt_unix.go endif endif +endif go_net_files = \ go/net/cgo_unix.go \ diff -r 47a9c8a497d5 libgo/go/net/tcpsockopt_solaris.go --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgo/go/net/tcpsockopt_solaris.go Mon Nov 11 13:23:07 2013 -0800 @@ -0,0 +1,25 @@ +// 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)) +}