Hi, I've been working with dl_iterate_phdr(3) recently, and noticed a missing detail from our manual page: when the callback returns non-zero, iteration stops. This is documented in the Linux manual page, and I've also verified this behaviour in our code:
dlfcn.c: ---8<--- for (object = _dl_objects; object != NULL; object = object->next) { ... retval = callback(&info, sizeof (struct dl_phdr_info), data); if (retval) break; } --->8--- Any objections to the following change? Index: dl_iterate_phdr.3 =================================================================== RCS file: /cvs/src/share/man/man3/dl_iterate_phdr.3,v retrieving revision 1.4 diff -u -p -r1.4 dl_iterate_phdr.3 --- dl_iterate_phdr.3 5 Jun 2013 03:42:03 -0000 1.4 +++ dl_iterate_phdr.3 24 Aug 2018 09:19:02 -0000 @@ -34,6 +34,11 @@ for each shared object, passing it infor program headers and the .Fa data argument. +Iteration continues until either there are no more objects to +iterate over, or until +.Fa callback +returns a non-zero value. +.Pp The information about the program headers is passed in a structure that is defined as: .Bd -literal -- Best Regards Edd Barrett http://www.theunixzoo.co.uk