From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by sourceware.org (Postfix) with ESMTPS id ED7643858C60 for ; Mon, 24 Jan 2022 11:45:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED7643858C60 Received: by mail-oi1-x22b.google.com with SMTP id s127so25073887oig.2 for ; Mon, 24 Jan 2022 03:45:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=7fCVqSqq7zswGpswIUDOvc1orsssfkWAhoA8dUf2Nog=; b=ZINaZRvn4kvOsKMUeZyDbZ37PxIOedZcaMqh0KPLbskcg/wSmGEwEJAt3ssZWH4jYm rrJYqbO+sDSHoA6KS2YhUEk94n9JT1EDiUAchfoXKR3JhBkXDIHKP3ppGN53REs4DNip mPbRnxxfwWSTxEGnqUboU6OmKFrSF8tBptuNpJHoo/x6iHN0Sfzc8uarcZh88GrQhrqd 9yO2C12yg7QbBq2mLFjLn1rCV6DdrmnZYJJZ3G8LegShdoI8Gw0lL3iMnYPM0FSHEVe7 1O8fJ4Q0E4QFz5n1Y7rnSKXChoZOLcdP/N7d3hXmOscUO1/m4B3Z6TX21kSEO2Z1Alpa 2Qog== X-Gm-Message-State: AOAM530fZFYBSc+qv5pJrpo4IJ3boB/SP3CeQUylWPnvDMRup3lJDbHg aVFw3F0hF9dLDEQzLtc723iQ6UJaL79JhA== X-Google-Smtp-Source: ABdhPJz4yX07yNxwAU9tkVjHUbBsGpv3S7xYa9PSpCyX5WVv1xOZaE0GXHpdDCZ9KuWV5tFxNtV/lg== X-Received: by 2002:a54:4e8c:: with SMTP id c12mr957836oiy.65.1643024730360; Mon, 24 Jan 2022 03:45:30 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:27f8:c505:63c0:de61:b716? ([2804:431:c7cb:27f8:c505:63c0:de61:b716]) by smtp.gmail.com with ESMTPSA id bp4sm5346844oib.49.2022.01.24.03.45.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jan 2022 03:45:30 -0800 (PST) Message-ID: Date: Mon, 24 Jan 2022 08:45:26 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 1/2] support: Add support_socket_so_timestamp_time64 Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org References: <20211213143643.1182659-1-adhemerval.zanella@linaro.org> <20211213143643.1182659-2-adhemerval.zanella@linaro.org> <87ee51708n.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <87ee51708n.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2022 11:45:34 -0000 On 21/01/2022 09:16, Florian Weimer wrote: > * Adhemerval Zanella: > >> +bool >> +support_socket_so_timestamp_time64 (int fd) >> +{ >> +#ifdef __linux__ >> +# if __LINUX_KERNEL_VERSION >= 0x050100 \ >> + || __WORDSIZE == 64 \ >> + || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) >> + return true; >> +# else >> + int level = SOL_SOCKET; >> + int optname = COMPAT_SO_TIMESTAMP_NEW; >> + int optval; >> + socklen_t len = sizeof (optval); >> + >> + int r = syscall (__NR_getsockopt, fd, level, optname, &optval, &len); >> +# ifdef __NR_socketcall >> + if (r == -1 && errno == ENOSYS) >> + { >> + long int args[] = { fd, level, optname, (long int) &optval, >> + sizeof (optval) }; >> + r = syscall (__NR_socketcall, 15 /* SOCKOP_getsockopt */ , args); >> + } >> +# endif >> + return r != -1; >> +# endif >> +#else >> + return false; >> +#endif >> +} > > Is the socketcall fallback really required? Why would anyone backport > time64 support without also backporting direct system call support? > It does not make sense indeed, all supported architecture already support direct socket syscall with a kernel with 64 bit time_t support (v5.1.). I will remove it.