On Thu, Apr 29, 2021 at 08:00:14PM +0300, Andy Shevchenko wrote: > On Thu, Apr 29, 2021 at 03:07:49PM +0200, Bartosz Golaszewski wrote: > > On Thu, Apr 29, 2021 at 1:23 PM Andy Shevchenko > > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote: > > > On Thu, Apr 29, 2021 at 11:47:33AM +0200, Bartosz Golaszewski wrote: ... > > > > +/* We don't have mkdtempat()... :( */ > > > > > > But we have tmpnam() / tmpnam_r(), why to reinvent it below? > > > > > > > Because of this: > > > > $man tmpnam_r > > ... > > The created pathname has a directory prefix P_tmpdir. > > ... > > > > And this: > > > > ./stdio.h:120:# define P_tmpdir "/tmp" > > Still you may advance the pointer by the length of P_tmpdir + 1. There is also tempnam(). -- With Best Regards, Andy Shevchenko