summaryrefslogtreecommitdiffstats
path: root/osi/include
diff options
context:
space:
mode:
authorScott James Remnant <keybuk@google.com>2015-04-02 15:22:29 -0700
committerScott James Remnant <keybuk@google.com>2015-04-02 16:46:16 -0700
commit47d68ee6229ccec3deeaaf694fa86438d97333a4 (patch)
treeaf6ba6c81f9d74ee2eb2b55eca0e7f65d9b7cf0e /osi/include
parent15050770d16ebe2a66b01b0bec7dda7dfb8a0e02 (diff)
downloadandroid_system_bt-47d68ee6229ccec3deeaaf694fa86438d97333a4.tar.gz
android_system_bt-47d68ee6229ccec3deeaaf694fa86438d97333a4.tar.bz2
android_system_bt-47d68ee6229ccec3deeaaf694fa86438d97333a4.zip
osi: add compat code for glibc
glibc doesn't declare strlcpy(), strlcat() or gettid(). Add a header of compatibility routines that only get included when compiling on this. Change-Id: I889ac7f1d22cf7056757890fcff0403107488d62
Diffstat (limited to 'osi/include')
-rw-r--r--osi/include/compat.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/osi/include/compat.h b/osi/include/compat.h
new file mode 100644
index 000000000..02e13e397
--- /dev/null
+++ b/osi/include/compat.h
@@ -0,0 +1,35 @@
+/******************************************************************************
+ *
+ * Copyright 2015 Google, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************/
+
+#pragma once
+
+#include <features.h>
+#include <sys/types.h>
+
+#if __GLIBC__
+
+/* Get thread identification. */
+pid_t gettid(void);
+
+/* Copy src to string dst of size siz. */
+size_t strlcpy(char *dst, const char *src, size_t siz);
+
+/* Appends src to string dst of size siz. */
+size_t strlcat(char *dst, const char *src, size_t siz);
+
+#endif