blob: cf29e1b83d15a56f7c1eb2e718ee71f01b8a043d [file] [log] [blame]
bigbiff bigbiffe60683a2013-02-22 20:55:50 -05001#ifndef UTIL_LINUX_FILEUTILS
2#define UTIL_LINUX_FILEUTILS
3
4extern int xmkstemp(char **tmpname, char *dir);
5
6static inline FILE *xfmkstemp(char **tmpname, char *dir)
7{
8 int fd;
9 FILE *ret;
10 fd = xmkstemp(tmpname, dir);
11 if (fd == -1) {
12 return NULL;
13 }
14 if (!(ret = fdopen(fd, "w+"))) {
15 close(fd);
16 return NULL;
17 }
18 return ret;
19}
20
21extern int get_fd_tabsize(void);
22
23#endif /* UTIL_LINUX_FILEUTILS */