Stay organized with collections
Save and categorize content based on your preferences.
Sync
Summary
Functions
sync_file_info
Declared in android/sync.h
struct sync_file_info * sync_file_info(
int32_t fd
)
Retrieve detailed information about a sync file and its fences.
The returned sync_file_info must be freed by calling sync_file_info_free().
Available since API level 26.
sync_file_info_free
Declared in android/sync.h
void sync_file_info_free(
struct sync_file_info *info
)
Free a struct sync_file_info structure.
Available since API level 26.
sync_get_fence_info
Declared in android/sync.h
struct sync_fence_info * sync_get_fence_info(
const struct sync_file_info *info
)
Get the array of fence infos from the sync file's info.
The returned array is owned by the parent sync file info, and has info->num_fences entries.
Available since API level 26.
sync_merge
Declared in android/sync.h
int32_t sync_merge(
const char *name,
int32_t fd1,
int32_t fd2
)
Merge two sync files.
This produces a new sync file with the given name which has the union of the two original sync file's fences; redundant fences may be removed.
If one of the input sync files is signaled or invalid, then this function may behave like dup(): the new file descriptor refers to the valid/unsignaled sync file with its original name, rather than a new sync file.
The original fences remain valid, and the caller is responsible for closing them.
Available since API level 26.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-11-19 UTC.
[null,null,["Last updated 2024-11-19 UTC."],[],[],null,["# Sync\n====\n\nSummary\n-------\n\n| ### Functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| [sync_file_info](#group___sync_1gae2158ed0a67f008ca7056843363fc11a)`(int32_t fd)` | `struct sync_file_info *` Retrieve detailed information about a sync file and its fences. |\n| [sync_file_info_free](#group___sync_1gaedfc944a2b93b36cbd71e5c9299e0efb)`(struct `[sync_file_info](/ndk/reference/group/sync#group___sync_1gae2158ed0a67f008ca7056843363fc11a)` *info)` | `void` Free a struct sync_file_info structure. |\n| [sync_get_fence_info](#group___sync_1gadb88bc37b7c7588437c33e820acd214d)`(const struct `[sync_file_info](/ndk/reference/group/sync#group___sync_1gae2158ed0a67f008ca7056843363fc11a)` *info)` | `struct sync_fence_info *` Get the array of fence infos from the sync file's info. |\n| [sync_merge](#group___sync_1gaacf3feda171ae19eeb29f6dac8faf5bb)`(const char *name, int32_t fd1, int32_t fd2)` | `int32_t` Merge two sync files. |\n\nFunctions\n---------\n\n### sync_file_info\n\nDeclared in `android/sync.h` \n\n```scdoc\nstruct sync_file_info * sync_file_info(\n int32_t fd\n)\n``` \nRetrieve detailed information about a sync file and its fences.\n\nThe returned sync_file_info must be freed by calling [sync_file_info_free()](/ndk/reference/group/sync#group___sync_1gaedfc944a2b93b36cbd71e5c9299e0efb).\n\nAvailable since API level 26. \n\n### sync_file_info_free\n\nDeclared in `android/sync.h` \n\n```scdoc\nvoid sync_file_info_free(\n struct sync_file_info *info\n)\n``` \nFree a struct sync_file_info structure.\n\nAvailable since API level 26. \n\n### sync_get_fence_info\n\nDeclared in `android/sync.h` \n\n```gdscript\nstruct sync_fence_info * sync_get_fence_info(\n const struct sync_file_info *info\n)\n``` \nGet the array of fence infos from the sync file's info.\n\nThe returned array is owned by the parent sync file info, and has info-\\\u003enum_fences entries.\n\nAvailable since API level 26. \n\n### sync_merge\n\nDeclared in `android/sync.h` \n\n```gdscript\nint32_t sync_merge(\n const char *name,\n int32_t fd1,\n int32_t fd2\n)\n``` \nMerge two sync files.\n\nThis produces a new sync file with the given name which has the union of the two original sync file's fences; redundant fences may be removed.\n\nIf one of the input sync files is signaled or invalid, then this function may behave like dup(): the new file descriptor refers to the valid/unsignaled sync file with its original name, rather than a new sync file.\n\nThe original fences remain valid, and the caller is responsible for closing them.\n\nAvailable since API level 26."]]