9 char *__randname(char *);
11 int __mkostemps(char *template, int len, int flags)
13 size_t l = strlen(template);
14 if (l<6 || len>l-6 || memcmp(template+l-len-6, "XXXXXX", 6)) {
19 flags -= flags & O_ACCMODE;
20 int fd, retries = 100;
22 __randname(template+l-len-6);
23 if ((fd = open(template, flags | O_RDWR | O_CREAT | O_EXCL, 0600))>=0)
25 } while (--retries && errno == EEXIST);
27 memcpy(template+l-len-6, "XXXXXX", 6);
31 weak_alias(__mkostemps, mkostemps);
32 weak_alias(__mkostemps, mkostemps64);