On Sun, Apr 26, 2020 at 5:32 PM Dmitry Kozlyuk <dmitry.kozl...@gmail.com> wrote: > > On 2020-04-26 17:02 GMT+0530 Jerin Jacob wrote: > > > +/** > > > + * Get absolute path to the directory where permanent data can be stored. > > > + * > > > + * @return > > > + * Statically allocated string on success, NULL on failure. > > > + */ > > > +const char * > > > +eal_permanent_data_path(void); > > > > Do windows have PATH_MAX kind of macro? I think, it is better API > > consumer allocates > > the memory of size PATH_MAX and implementation fills it, instead of, > > the static scheme. > > This API falls in line with rte_eal_get_runtime_dir() and other > eal_filesystem.h functions, that use static scheme. Logically, its result > never changes. It is race-free and is only called during initialization. What > you propose can be done, but are there any benefits?
I thought who will free that memory? It looks like libc creating a static memory for this item. so, your current eal_permanent_data_path() declarations looks good to me. > > While we're at it, don't these declarations belong to eal_filesystem.h? I > left them in eal_private.h, because eal_filesystem.h is mostly Unix-specific. Understood, Leaving that decision to EAL maintainers. > > -- > Dmitry Kozlyuk