summaryrefslogtreecommitdiff
path: root/userland/libc/stdio/tmpnam.c
blob: 3fe93faca04c96a0725ae8ccc3ca7661b6689029 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char *tmpnam(char *s) {
  assert(!s);
  s = malloc(100);
  strcpy(s, "/tmp.XXXXXX");
  mkstemp(s);
  return s;
}