From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id E5A70385842A for ; Fri, 28 Jan 2022 16:42:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E5A70385842A Received: by mail-oi1-x232.google.com with SMTP id g205so13330779oif.5 for ; Fri, 28 Jan 2022 08:42:34 -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=9h1J0u2so/aRSSnS1Xq3bpFmNqZcIbPvY5Fztgcxn3c=; b=JZXBnt1SIj8HVV8WOhWnDaO9rGx/1ZtPuSubYh2g8RDm1OdQFddpAL8jziBfNGYJ/p kfreFuXUomThv7fm+P/ccco3oljjzSqHTa76Rvbr2iBY8RTJ6ielZ7UxmC2+JbeiGJ+I zHz75kHti9XQ5ftOA2ah73P9E9xqXCmquzXZFVsFEnFfmcVWtk9lfV4r7t83WY52o7wk c0pAKQD6jcZb0jVZCCjZJ17FWyr5maPn8SPmvVtOXJB1mZorBLTIrsMsEm4CH9sM9x/V QaikvS3QHS6URq78iFYdtcxNVLcYn1jZG5tZHJGpq5aAAHVhomHps5Ln2z67GJXzeCUD J02A== X-Gm-Message-State: AOAM531cV82OUWRYn4ntgHyeNxFZHf7C9cA35IsWIb42yynCnicnLhQt woSFOgSFT8QdFFPY8fsA5COs9A== X-Google-Smtp-Source: ABdhPJxYaRbd37MDdp+FoH/n+nBqTwc8aKin+zfc/5Y8O6Wh0Aphd32uWNYZAgxUyMb5etvkNHdm8Q== X-Received: by 2002:a05:6808:1247:: with SMTP id o7mr9876262oiv.75.1643388154301; Fri, 28 Jan 2022 08:42:34 -0800 (PST) Received: from ?IPV6:2804:431:c7ca:709a:aad4:4e8:bc05:17ad? ([2804:431:c7ca:709a:aad4:4e8:bc05:17ad]) by smtp.gmail.com with ESMTPSA id e68sm3579099otb.10.2022.01.28.08.42.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jan 2022 08:42:34 -0800 (PST) Message-ID: <081bbb58-c202-503f-a9f0-0ba02864e93d@linaro.org> Date: Fri, 28 Jan 2022 13:42:31 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v5 3/3] Linux: Only generate 64 bit timestamps for 64 bit time_t recvmsg/recvmmsg Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org, Carlos O'Donell References: <20220127201542.2306657-1-adhemerval.zanella@linaro.org> <20220127201542.2306657-4-adhemerval.zanella@linaro.org> <87lez0j6vv.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <87lez0j6vv.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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: Fri, 28 Jan 2022 16:42:36 -0000 On 28/01/2022 11:02, Florian Weimer wrote: > * Adhemerval Zanella: > >> diff --git a/sysdeps/unix/sysv/linux/tst-socket-timestamp-compat.c b/sysdeps/unix/sysv/linux/tst-socket-timestamp-compat.c > >> +/* Check if recvmsg create the additional 64 bit timestamp if only 32 bit >> + is enabled for 64 bit recvmsg symbol. */ >> +static void >> +do_test_large_buffer (bool mc) >> +{ >> + struct mmsghdr mmhdr = { 0 }; >> + /* It should be large enought for either timeval/timespec and the >> + 64 time type as well. */ >> + char msgbuf[512]; > > I think this needs a union with struct cmsgbuf to ensure alignment. > Alternatively, use malloc. Yeah, it does require to setup the alignment. I will change to use an union. > > >> +static void >> +do_test_small_buffer (bool mc) >> +{ >> + struct mmsghdr mmhdr = { 0 }; >> + >> + /* Enable 32 bit timeval precision and check if no 64 bit timeval stamp >> + is created. */ >> + { >> + char msgbuf[CMSG_SPACE (sizeof (struct timeval))]; > > Likewise. > > Rest looks okay. The kernel does not pass on whether a time32 or time64 > system call was used, so implementing time32 recvmsg with recvmsg_time64 > is fine in that regard. > > Thanks, > Florian >