sync: Add NDK sync.h and libsync

The new header provides an updated interface to libsync appropriate
for the NDK. Clients use existing syscalls where possible (e.g. poll()
instead of sync_wait()), and the remaining functions return structures
used in mainline Linux kernels rather than the Android staging sync
framework.

Over time, framework clients will be migrated to using the NDK
interface, which will eventually replace the current internal
interface. The only difference is the header will be named
<android/sync.h> in the NDK and <sync/sync.h> internally.

Bug: 35138793
Test: sync-unit-tests on bullhead
Change-Id: Ieb3649b80565393e26b604416158438d32c2a256
diff --git a/libsync/libsync.map.txt b/libsync/libsync.map.txt
new file mode 100644
index 0000000..daa28ae
--- /dev/null
+++ b/libsync/libsync.map.txt
@@ -0,0 +1,32 @@
+#
+# Copyright 2017 The Android Open Source Project
+#
+# 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.
+#
+
+LIBSYNC {
+  global:
+    sync_merge; # introduced=26
+    sync_get_fence_info; # introduced=26
+    sync_free_fence_info; # introduced=26
+  local:
+    *;
+};
+
+LIBSYNC_PLATFORM {
+  global:
+    sync_wait;
+    sync_fence_info;
+    sync_pt_info;
+    sync_fence_info_free;
+} LIBSYNC_PLATFORM;