8 char *__randname(char *);
10 int __mkostemps(char *template, int len, int flags)
12 if (len < 0) return EINVAL;
14 size_t l = strlen(template)-len;
15 if (l < 6 || strncmp(template+l-6, "XXXXXX", 6)) {
21 int fd, retries = 100;
23 __randname(template+l-6);
24 if ((fd = open(template, flags | O_RDWR | O_CREAT | O_EXCL, 0600))>=0)
26 if (errno != EEXIST) return -1;
31 weak_alias(__mkostemps, mkostemps);
32 weak_alias(__mkostemps, mkostemps64);