From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id BEC683858405 for ; Sun, 15 May 2022 03:32:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BEC683858405 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from [10.20.4.187] (unknown [10.20.4.187]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9BxMNo7dIBiU5QWAA--.16664S3; Sun, 15 May 2022 11:32:12 +0800 (CST) Subject: Re: [PATCH v4 09/13] LoongArch: Linux ABI To: Arnd Bergmann Cc: GNU C Library , xuchenghua@loongson.cn, joseph_myers@mentor.com References: <20220509022611.1248063-1-caiyinyu@loongson.cn> <20220509022611.1248063-10-caiyinyu@loongson.cn> From: caiyinyu Message-ID: Date: Sun, 15 May 2022 11:32:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf9BxMNo7dIBiU5QWAA--.16664S3 X-Coremail-Antispam: 1UD129KBjvJXoWxCFW8Jry5tFyxArW5Ww4kWFg_yoW5XF1rpF s8X34kCrs3JayI9r1Yqas8WFySkw1rKw47CFyrKayUJFyYqwn29r9rWF429r4DXws3ZrWv vr4qk34rur9rtrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvS14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r1j 6r4UM28EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJV WxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc7I2V7IY0VAS07AlzVAY IcxG8wCY02Avz4vE-syl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2 IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v2 6r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2 IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2 jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43 ZEXa7VUbrMaUUUUUU== X-CM-SenderInfo: 5fdl5xhq1xqz5rrqw2lrqou0/ X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Sun, 15 May 2022 03:32:20 -0000 在 2022/5/11 下午3:08, Arnd Bergmann 写道: > On Mon, May 9, 2022 at 4:26 AM caiyinyu wrote: >> + >> +#include >> + >> +/* In 64-bit ISA files are always with 64bit off_t and F_*LK64 are the same as >> + non-64-bit versions. It will need to be revised for 128-bit. */ >> +#if __WORDSIZE == 64 >> +#define __O_LARGEFILE 0 >> + >> +#define F_GETLK64 5 /* Get record locking info. */ >> +#define F_SETLK64 6 /* Set record locking info (non-blocking). */ >> +#define F_SETLKW64 7 /* Set record locking info (blocking). */ >> +#endif >> + >> +struct flock >> +{ >> + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ >> + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ >> +#ifndef __USE_FILE_OFFSET64 >> + __off_t l_start; /* Offset where the lock begins. */ >> + __off_t l_len; /* Size of the locked area; zero means until EOF. */ >> +#else >> + __off64_t l_start; /* Offset where the lock begins. */ >> + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ >> +#endif >> + __pid_t l_pid; /* Process holding the lock. */ >> +}; >> + >> +#ifdef __USE_LARGEFILE64 >> +struct flock64 >> +{ >> + short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */ >> + short int l_whence; /* Where `l_start' is relative to (like `lseek'). */ >> + __off64_t l_start; /* Offset where the lock begins. */ >> + __off64_t l_len; /* Size of the locked area; zero means until EOF. */ >> + __pid_t l_pid; /* Process holding the lock. */ >> +}; >> +#endif > Not sure why these are provided here, the kernel has no loongarch64 specific > interface for flock in the current version, so either this refers to > an older version > of the kernel port, or it is something that could be generalized into an > architecture-independent file in glibc. > > Arnd There are struct flock and flock64 we need in glibc bits/fcntl.h, but the macro F_GETLK64 F_SETLK64 F_SETLKW64 in sysdeps/unix/sysv/linux/bits/fcntl-linux.h are: ... # define F_GETLK64      12      /* Get record locking info.  */ # define F_SETLK64      13      /* Set record locking info (non-blocking).  */ # define F_SETLKW64     14      /* Set record locking info (blocking).  */ ... what we need: +#define F_GETLK64 5  /* Get record locking info.  */ +#define F_SETLK64 6  /* Set record locking info (non-blocking). */ +#define F_SETLKW64 7 /* Set record locking info (blocking).  */ x86 ia64 s390 and aarch64 have the same problem and they all use their own fcntl.h. Define new value of these macro in sysdeps/unix/sysv/linux/bits/fcntl-linux.h or add fcntl-linux.h in loongarch port or keep the status quo?? any ideas??