#ifndef FILESTUFF_H
#define FILESTUFF_H
+#include <dirent.h>
+
/* Note all the file descriptors which are open when this is called.
These file descriptors will not be closed by close_most_fds. */
extern struct cleanup *make_cleanup_close (int fd);
+struct gdb_dir_deleter
+{
+ void operator() (DIR *dir) const
+ {
+ closedir (dir);
+ }
+};
+
+/* A unique pointer to a DIR. */
+
+typedef std::unique_ptr<DIR, gdb_dir_deleter> gdb_dir_up;
+
#endif /* FILESTUFF_H */