summaryrefslogtreecommitdiffstats
path: root/libc/include
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-09-05 16:12:42 -0700
committerElliott Hughes <enh@google.com>2014-09-05 16:12:42 -0700
commitf0e9458ea596227720fa745df15f5357f6c0c8f6 (patch)
tree5e544cbf962cd1264d9670ca03563e18d12f4bef /libc/include
parent5beddb7d642524ecb6655ab2823caf2add679917 (diff)
downloadbionic-f0e9458ea596227720fa745df15f5357f6c0c8f6.zip
bionic-f0e9458ea596227720fa745df15f5357f6c0c8f6.tar.gz
bionic-f0e9458ea596227720fa745df15f5357f6c0c8f6.tar.bz2
Don't expose non-standard basename_r and dirname_r in LP64.
Bug: 17407423 Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/libgen.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/libc/include/libgen.h b/libc/include/libgen.h
index c5fc76a..9dcec75 100644
--- a/libc/include/libgen.h
+++ b/libc/include/libgen.h
@@ -33,24 +33,15 @@
__BEGIN_DECLS
-/* our version of dirname/basename don't modify the input path */
-extern char* dirname (const char* path);
-extern char* basename(const char* path);
+/* On Android these don't modify their input, and use thread-local storage for their results. */
+extern char* basename(const char*);
+extern char* dirname(const char*);
-/* special thread-safe Bionic versions
- *
- * if 'buffer' is NULL, 'bufflen' is ignored and the length of the result is returned
- * otherwise, place result in 'buffer'
- *
- * at most bufflen-1 characters written, plus a terminating zero
- *
- * return length of result, or -1 in case of error, with errno set to:
- *
- * ERANGE: buffer is too short
- * ENAMETOOLONG: the result is too long for a valid path
- */
-extern int dirname_r(const char* path, char* buffer, size_t bufflen);
-extern int basename_r(const char* path, char* buffer, size_t bufflen);
+#if !defined(__LP64__)
+/* These non-standard functions are not needed on Android; basename and dirname use thread-local storage. */
+extern int dirname_r(const char*, char*, size_t);
+extern int basename_r(const char*, char*, size_t);
+#endif
__END_DECLS