Merge "Update to v6.6 kernel headers." into main
diff --git a/libc/Android.bp b/libc/Android.bp
index 1fd8847..174ecd9 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -641,7 +641,6 @@
 // automatically included.
 cc_library_static {
     defaults: ["libc_defaults"],
-    tidy_disabled_srcs: ["upstream-*/**/*.c"],
     srcs: [
         // These two depend on getentropy, which isn't in libc_ndk.a.
         "upstream-openbsd/lib/libc/crypt/arc4random.c",
diff --git a/libc/include/dlfcn.h b/libc/include/dlfcn.h
index a8066a9..0425031 100644
--- a/libc/include/dlfcn.h
+++ b/libc/include/dlfcn.h
@@ -46,8 +46,31 @@
 } Dl_info;
 
 void* _Nullable dlopen(const char* _Nullable __filename, int __flag);
+
+/**
+ * [dlclose(3)](http://man7.org/linux/man-pages/man3/dlclose.3.html)
+ * decrements the reference count for the given shared library (and
+ * any libraries brought in by that library's DT_NEEDED entries).
+ *
+ * If a library's reference count hits zero, it may be unloaded.
+ * Code that relies on this is not portable, and may not work on
+ * future versions of Android.
+ *
+ * dlclose() is dangerous because function pointers may or may not
+ * be rendered invalid, global data may or may not be rendered invalid,
+ * and memory may or may not leak. Code with global constructors is
+ * especially problematic. Instead of dlclose, prefer to leave the
+ * library open or, if cleanup is necessary, dlopen() the library in
+ * a child process which can later be killed by the parent or call
+ * exit() itself.
+ *
+ * Returns 0 on success, and returns -1 on failure, in which case
+ * dlerror() can be used to retrieve the specific error.
+ */
 int dlclose(void* _Nonnull __handle);
+
 char* _Nullable dlerror(void);
+
 /* (RTLD_DEFAULT is null for LP64, but -1 for LP32) */
 void* _Nullable dlsym(void* __BIONIC_COMPLICATED_NULLNESS __handle, const char* _Nullable __symbol);
 /* (RTLD_DEFAULT is null for LP64, but -1 for LP32) */
diff --git a/libc/include/time.h b/libc/include/time.h
index 31c2050..45c5c34 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -115,7 +115,7 @@
  * was interrupted by a signal, `errno` will be `EINTR` and `remainder` will be
  * the amount of time remaining.
  */
-int nanosleep(const struct timespec* _Nonnull __request, struct timespec* _Nullable __remainder);
+int nanosleep(const struct timespec* _Nonnull __duration, struct timespec* _Nullable __remainder);
 
 /**
  * [asctime(3)](http://man7.org/linux/man-pages/man3/asctime.3p.html) formats
@@ -371,7 +371,7 @@
  * If the sleep was interrupted by a signal, the return value will be `EINTR`
  * and `remainder` will be the amount of time remaining.
  */
-int clock_nanosleep(clockid_t __clock, int __flags, const struct timespec* _Nonnull __request, struct timespec* _Nullable __remainder);
+int clock_nanosleep(clockid_t __clock, int __flags, const struct timespec* _Nonnull __duration, struct timespec* _Nullable __remainder);
 
 /**
  * [clock_settime(2)](http://man7.org/linux/man-pages/man2/clock_settime.2.html)