[BACK]Return to test-mkstemps.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

File: [cvsweb.bsd.lv] / mandoc / test-mkstemps.c (download)

Revision 1.1, Sun Sep 19 15:05:39 2021 UTC (2 years, 6 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6, HEAD

Test availability of mkstemps(3) and provide a fallback implementation
in case it is missing; needed for SUN Solaris 10.

#include <stdlib.h>
#include <unistd.h>

int
main(void)
{
	char	filename[] = "/tmp/temp.XXXXXX.suffix";

	if (mkstemps(filename, 7) == -1)
		return 1;
	return unlink(filename) == -1;
}