8 int __mkostemps(char *template, int len
, int flags
)
10 size_t l
= strlen(template);
11 if (l
<6 || len
>l
-6 || memcmp(template+l
-len
-6, "XXXXXX", 6)) {
16 flags
-= flags
& O_ACCMODE
;
17 int fd
, retries
= 100;
19 __randname(template+l
-len
-6);
20 if ((fd
= open(template, flags
| O_RDWR
| O_CREAT
| O_EXCL
, 0600))>=0)
22 } while (--retries
&& errno
== EEXIST
);
24 memcpy(template+l
-len
-6, "XXXXXX", 6);
28 weak_alias(__mkostemps
, mkostemps
);