Hi Yoshinori,
Yoshinori Sato wrote,
Signed-off-by: Yoshinori Sato
<ysato(a)users.sourceforge.jp>
---
libc/misc/dirent/__readdir.c | 39 ++++++++++++++++++++++++++++++++++++++
libc/misc/dirent/readdir.c | 45 ++++----------------------------------------
libc/misc/dirent/readdir64.c | 12 ++++++++++--
3 files changed, 53 insertions(+), 43 deletions(-)
create mode 100644 libc/misc/dirent/__readdir.c
While testing the patch I run into following issues.
Alpha is the first architecture get tested ;)
/home/wbx/embedded-test/openadk/toolchain_qemu-alpha_uclibc-ng_alpha/usr/bin/alpha-openadk-linux-uclibc-gcc
-c libc/misc/dirent/scandir64.c -o libc/misc/dirent/scandir64.os
-Wall -Wstrict-pr
ototypes -Wstrict-aliasing -funsigned-char -fno-builtin -fno-asm
-fmerge-all-constants -std=gnu99 -fno-stack-protector -nostdinc
-I./include -I./include -include libc-symbols.h -I./libc/sysd
eps/linux/alpha -I./libc/sysdeps/linux -I./ldso/ldso/alpha
-I./ldso/include -I. -DSTATIC -Os -fstrict-aliasing -fwrapv
-fno-ident -fhonour-copts -static -Os -pipe -fomit-frame-pointer
-fno-u
nwind-tables -fno-asynchronous-unwind-tables
-I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux/alpha
-I./libpthread/linuxthreads.old/sysdeps/alpha
-I./libpthread/linuxthreads.old/sysde
ps/unix/sysv/linux -I./libpthread/linuxthreads.old/sysdeps/pthread
-I./libpthread/linuxthreads.old -I./libpthread
-I./libc/sysdeps/linux/common -isystem
/home/wbx/embedded-test/openadk/toolc
hain_qemu-alpha_uclibc-ng_alpha/usr/lib/gcc/alpha-openadk-linux-uclibc/5.3.0/include-fixed
-isystem
/home/wbx/embedded-test/openadk/toolchain_qemu-alpha_uclibc-ng_alpha/usr/lib/gcc/alpha-ope
nadk-linux-uclibc/5.3.0/include
-I/home/wbx/embedded-test/openadk/target_qemu-alpha_uclibc-ng_alpha/usr/include/
-DNDEBUG -DIN_LIB=libc -fPIC -MT libc/misc/dirent/scandir64.os -MD
-MP -MF li
bc/misc/dirent/.scandir64.os.dep
In file included from libc/misc/dirent/readdir64.c:20:0:
libc/misc/dirent/__readdir.c:1:1: error: unknown type name
'__DIRENT_TYPE'
__DIRENT_TYPE *__READDIR(DIR * dir)
^
libc/misc/dirent/__readdir.c: In function '__READDIR':
libc/misc/dirent/__readdir.c:4:2: error: unknown type name
'__DIRENT_TYPE'
__DIRENT_TYPE *de;
^
libc/misc/dirent/__readdir.c:16:11: warning: implicit declaration of
function '__GETDENTS' [-Wimplicit-function-declaration]
bytes = __GETDENTS(dir->dd_fd, dir->dd_buf, dir->dd_max);
^
libc/misc/dirent/__readdir.c:25:12: error: '__DIRENT_TYPE'
undeclared (first use in this function)
de = (__DIRENT_TYPE *) (((char *) dir->dd_buf) +
dir->dd_nextloc);
^
libc/misc/dirent/__readdir.c:25:12: note: each undeclared identifier
is reported only once for each function it appears in
libc/misc/dirent/__readdir.c:25:27: error: expected expression
before ')' token
de = (__DIRENT_TYPE *) (((char *) dir->dd_buf) +
dir->dd_nextloc);
^
libc/misc/dirent/__readdir.c:28:27: error: request for member
'd_reclen' in something not a structure or union
dir->dd_nextloc += de->d_reclen;
^
libc/misc/dirent/__readdir.c:31:26: error: request for member
'd_off' in something not a structure or union
dir->dd_nextoff = de->d_off;
^
libc/misc/dirent/__readdir.c:34:13: error: request for member
'd_ino' in something not a structure or union
} while (de->d_ino == 0);
^
In file included from <command-line>:0:0:
libc/misc/dirent/readdir64.c: At top level:
./include/libc-symbols.h:426:25: error: '__EI___READDIR' aliased to
undefined symbol '__GI___READDIR'
extern __typeof (name) __EI_##name __attribute__((alias
(__hidden_asmname1 (,#local))))
^
./include/libc-symbols.h:429:29: note: in expansion of macro
'__hidden_ver1'
# define hidden_def(name) __hidden_ver1(__GI_##name, name, name);
^
./include/libc-symbols.h:497:32: note: in expansion of macro
'hidden_def'
# define libc_hidden_def(name) hidden_def (name)
^
libc/misc/dirent/readdir64.c:22:1: note: in expansion of macro
'libc_hidden_def'
...
best regards
Waldemar