Introduce api to track fd ownership in libc.
Add two functions to allow objects that own a file descriptor to
enforce that only they can close their file descriptor.
Use them in FILE* and DIR*.
Bug: http://b/110100358
Test: bionic_unit_tests
Test: aosp/master boots without errors
Test: treehugger
Change-Id: Iecd6e8b26c62217271e0822dc3d2d7888b091a45
diff --git a/libc/Android.bp b/libc/Android.bp
index 4fc3484..44b0b68 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -1265,7 +1265,6 @@
"bionic/clock_getcpuclockid.cpp",
"bionic/clock_nanosleep.cpp",
"bionic/clone.cpp",
- "bionic/close.cpp",
"bionic/connect.cpp",
"bionic/ctype.cpp",
"bionic/dirent.cpp",
@@ -1278,6 +1277,7 @@
"bionic/faccessat.cpp",
"bionic/fchmod.cpp",
"bionic/fchmodat.cpp",
+ "bionic/fdsan.cpp",
"bionic/ffs.cpp",
"bionic/fgetxattr.cpp",
"bionic/flistxattr.cpp",