Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mktemp POSIX (and Linux) divergence



Hi!

Our mktemp man page says:

RETURN VALUES
     The mktemp() and mkdtemp() functions return a pointer to the template on
     success and NULL on failure.

But POSIX[1] (and Linux) say:

    The mktemp() function shall return the pointer template. If a unique name cannot be created, template shall point to a null string.

where 'null string' is[2]

      3.146 Empty String (or Null String)

      A string whose first byte is a null byte

So NetBSD's mktemp returns NULL on error, while Linux returns a
pointer to string of length 0.

I think mktemp has been removed from POSIX in the meantime, but should
we switch to the POSIX behaviour?

 Thomas


[1] https://pubs.opengroup.org/onlinepubs/009695399/functions/mktemp.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html


Home | Main Index | Thread Index | Old Index