On Dienstag, 22. Februar 2022 14:21:52 CET Peter Maydell wrote: > On Thu, 17 Feb 2022 at 16:43, Christian Schoenebeck > > <qemu_...@crudebyte.com> wrote: > > diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h > > index d1660d67fa..ce12f64853 100644 > > --- a/include/qemu/osdep.h > > +++ b/include/qemu/osdep.h > > @@ -805,6 +805,19 @@ static inline int > > platform_does_not_support_system(const char *command)> > > } > > #endif /* !HAVE_SYSTEM_FUNCTION */ > > > > +/** > > + * Duplicate directory entry @dent. > > + * > > + * It is highly recommended to use this function instead of open coding > > + * duplication of @c dirent objects, because the actual @c struct @c > > dirent + * size may be bigger or shorter than @c sizeof(struct dirent) > > and correct + * handling is platform specific (see gitlab issue #841). > > + * > > + * @dent - original directory entry to be duplicated > > + * @returns duplicated directory entry which should be freed with > > g_free() > > + */ > > +struct dirent *qemu_dirent_dup(struct dirent *dent); > > Hi; I just noticed this has landed in git recently. > Please don't add new prototypes to osdep.h -- it is > a header included by every single C file in the tree, so > making it bigger slows down compilation. osdep.h is supposed > to contain only: > * things which everybody needs > * things without which code would work on most platforms but > fail to compile or misbehave on a minority of host OSes > (ie system incompatibility handling) > > This prototype is neither of those -- please find or create a more > appropriate header file for it, that can be included only by the > source files that actually need it. > > thanks > -- PMM
Good to know, because the pending Darwin series would have added stuff to osdep.h as well: https://lore.kernel.org/qemu-devel/20220220165056.72289-10-wwco...@gmail.com/ We'll find a different place. Thanks! Best regards, Christian Schoenebeck