summaryrefslogtreecommitdiffstats
path: root/base/include/android-base
diff options
context:
space:
mode:
Diffstat (limited to 'base/include/android-base')
-rw-r--r--base/include/android-base/unique_fd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/base/include/android-base/unique_fd.h b/base/include/android-base/unique_fd.h
index 869e60f58..c32331180 100644
--- a/base/include/android-base/unique_fd.h
+++ b/base/include/android-base/unique_fd.h
@@ -95,4 +95,14 @@ using unique_fd = unique_fd_impl<DefaultCloser>;
} // namespace base
} // namespace android
+template <typename T>
+int close(const android::base::unique_fd_impl<T>&)
+#if defined(__clang__)
+ __attribute__((__unavailable__(
+#else
+ __attribute__((__error__(
+#endif
+ "close called on unique_fd"
+ )));
+
#endif // ANDROID_BASE_UNIQUE_FD_H