Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbdIVJb3 (ORCPT ); Fri, 22 Sep 2017 05:31:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:57250 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751809AbdIVJb2 (ORCPT ); Fri, 22 Sep 2017 05:31:28 -0400 Date: Fri, 22 Sep 2017 11:31:25 +0200 Message-ID: From: Takashi Iwai To: "Baolin Wang" Cc: , , , , , , , , , , , , , , , , , , , , Subject: Re: [RFC PATCH 2/7] sound: core: Avoid using timespec for struct snd_pcm_status In-Reply-To: <78aa803db47d99c2bee1a4dc8d426621324785b8.1505973912.git.baolin.wang@linaro.org> References: <78aa803db47d99c2bee1a4dc8d426621324785b8.1505973912.git.baolin.wang@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1211 Lines: 37 On Thu, 21 Sep 2017 08:18:04 +0200, Baolin Wang wrote: > > The struct snd_pcm_status will use 'timespec' type variables to record > timestamp, which is not year 2038 safe on 32bits system. > > Userspace will use SNDRV_PCM_IOCTL_STATUS and SNDRV_PCM_IOCTL_STATUS_EXT > as commands to issue ioctl() to fill the 'snd_pcm_status' structure in > userspace. The command number is always defined through _IOR/_IOW/IORW, > so when userspace changes the definition of 'struct timespec' to use > 64-bit types, the command number also changes. > > Thus in the kernel, we now need to define two versions of each such ioctl > and corresponding ioctl commands to handle 32bit time_t and 64bit time_t > in native mode: > struct snd_pcm_status32 { > ...... > struct { s32 tv_sec; s32 tv_nsec; } trigger_tstamp; > struct { s32 tv_sec; s32 tv_nsec; } tstamp; > ...... > } > > struct snd_pcm_status64 { > ...... > struct { s64 tv_sec; s64 tv_nsec; } trigger_tstamp; > struct { s64 tv_sec; s64 tv_nsec; } tstamp; > ...... > } I'm confused. It's different from timespec64? So 32bit user-space would need to use a new own-type timespec instead of the standard timespec that is compliant with y2038? thanks, Takashi