8 char *__randname(char *);
10 int __mkostemps(char *template, int len, int flags)
12 size_t l = strlen(template);
13 if (l<6 || len>l-6 || memcmp(template+l-len-6, "XXXXXX", 6)) {
18 flags -= flags & O_ACCMODE;
19 int fd, retries = 100;
21 __randname(template+l-len-6);
22 if ((fd = open(template, flags | O_RDWR | O_CREAT | O_EXCL, 0600))>=0)
24 } while (--retries && errno == EEXIST);
26 memcpy(template+l-len-6, "XXXXXX", 6);
30 weak_alias(__mkostemps, mkostemps);
31 weak_alias(__mkostemps, mkostemps64);