diff options
| author | Igor Pashev <pashev.igor@gmail.com> | 2012-11-02 20:15:39 +0400 |
|---|---|---|
| committer | Igor Pashev <pashev.igor@gmail.com> | 2012-11-02 20:15:39 +0400 |
| commit | b13154de3eca5ba28fbb4854d916cd0be5febeed (patch) | |
| tree | 30f2e9e89ab71a2df837076ac68c3ba770230294 /include/fileutils.h | |
| download | util-linux-upstream.tar.gz | |
Imported Upstream version 2.22upstream/2.22upstream
Diffstat (limited to 'include/fileutils.h')
| -rw-r--r-- | include/fileutils.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/fileutils.h b/include/fileutils.h new file mode 100644 index 0000000..cf29e1b --- /dev/null +++ b/include/fileutils.h @@ -0,0 +1,23 @@ +#ifndef UTIL_LINUX_FILEUTILS +#define UTIL_LINUX_FILEUTILS + +extern int xmkstemp(char **tmpname, char *dir); + +static inline FILE *xfmkstemp(char **tmpname, char *dir) +{ + int fd; + FILE *ret; + fd = xmkstemp(tmpname, dir); + if (fd == -1) { + return NULL; + } + if (!(ret = fdopen(fd, "w+"))) { + close(fd); + return NULL; + } + return ret; +} + +extern int get_fd_tabsize(void); + +#endif /* UTIL_LINUX_FILEUTILS */ |
