Hi tech@, Since both the return value of sizeof() and pread()'s parameter require size_t type, I think using size_t instead of int to be size's type should be more appropriate. Thanks!
Index: ldd.c =================================================================== RCS file: /cvs/src/libexec/ld.so/ldd/ldd.c,v retrieving revision 1.22 diff -u -p -r1.22 ldd.c --- ldd.c 27 Oct 2017 16:47:08 -0000 1.22 +++ ldd.c 15 Sep 2018 01:50:16 -0000 @@ -96,7 +96,8 @@ doit(char *name) { Elf_Ehdr ehdr; Elf_Phdr *phdr; - int fd, i, size, status, interp=0; + int fd, i, status, interp=0; + size_t size; char buf[PATH_MAX]; struct stat st; void * dlhandle; -- Best Regards Nan Xiao