Return to test-mkstemps.c CVS log | 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 (3 years ago) by schwarze
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; }