1 #include <u.h> 2 #include <libc.h> 3 4 int 5 opentemp(char *template) 6 { 7 int fd; 8 9 fd = mkstemp(template); 10 if(fd < 0) 11 return -1; 12 remove(template); 13 return fd; 14 } 15