From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932243AbcFUIeN (ORCPT ); Tue, 21 Jun 2016 04:34:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:53193 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752589AbcFUIdp (ORCPT ); Tue, 21 Jun 2016 04:33:45 -0400 From: Andreas Schwab To: Yury Norov Cc: , , , , , , , , , , , Andrew Pinski Subject: Re: [PATCH 20/27] [AARCH64] Make lp64 and ilp32 directories. References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> <1466485631-3532-22-git-send-email-ynorov@caviumnetworks.com> X-Yow: I was in a HOT TUB! I was NORMAL! I was ITALIAN!! I enjoyed th' EARTHQUAKE! Date: Tue, 21 Jun 2016 10:12:31 +0200 In-Reply-To: <1466485631-3532-22-git-send-email-ynorov@caviumnetworks.com> (Yury Norov's message of "Tue, 21 Jun 2016 08:07:04 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yury Norov writes: > diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c > new file mode 100644 > index 0000000..0f89a09 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c > @@ -0,0 +1,78 @@ > +/* Copyright (C) 2007-2015 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library. If not, see > + . */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +struct kernel_dirent64 > + { > + uint64_t d_ino; > + int64_t d_off; > + unsigned short int d_reclen; > + unsigned char d_type; > + char d_name[256]; > + }; > + > +static size_t conv (char *buf, size_t nbytes) > +{ > + char *end = buf + nbytes; > + struct dirent *u = (struct dirent *) buf; > + struct kernel_dirent64 *k = (struct kernel_dirent64 *) buf; > + size_t sizd = offsetof(struct kernel_dirent64, d_name) > + - offsetof(struct dirent, d_name); > + > + while ((char*) k < end) > + { > + struct kernel_dirent64 *nk = (char *) k + k->d_reclen; > + size_t name_len = k->d_reclen - offsetof(struct kernel_dirent64, d_name); > + > + u->d_ino = k->d_ino; > + u->d_off = k->d_off; > + u->d_reclen = k->d_reclen - sizd; > + u->d_type = k->d_type; > + memcpy (u->d_name, k->d_name, name_len); > + > + u = (char *) u + u->d_reclen; > + k = nk; > + } > + > + return (size_t) u - (size_t) buf; > +} > + > +ssize_t > +__getdents (int fd, char *buf, size_t nbytes) > +{ > + > + struct kernel_dirent64 *k; Unused variable. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."