1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * sync abstraction 3*4882a593Smuzhiyun * Copyright 2015-2016 Collabora Ltd. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Based on the implementation from the Android Open Source Project, 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * Copyright 2012 Google, Inc 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * Permission is hereby granted, free of charge, to any person obtaining a 10*4882a593Smuzhiyun * copy of this software and associated documentation files (the "Software"), 11*4882a593Smuzhiyun * to deal in the Software without restriction, including without limitation 12*4882a593Smuzhiyun * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13*4882a593Smuzhiyun * and/or sell copies of the Software, and to permit persons to whom the 14*4882a593Smuzhiyun * Software is furnished to do so, subject to the following conditions: 15*4882a593Smuzhiyun * 16*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be included in 17*4882a593Smuzhiyun * all copies or substantial portions of the Software. 18*4882a593Smuzhiyun * 19*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20*4882a593Smuzhiyun * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22*4882a593Smuzhiyun * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 23*4882a593Smuzhiyun * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 24*4882a593Smuzhiyun * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25*4882a593Smuzhiyun * OTHER DEALINGS IN THE SOFTWARE. 26*4882a593Smuzhiyun */ 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun #ifndef SELFTESTS_SYNC_H 29*4882a593Smuzhiyun #define SELFTESTS_SYNC_H 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun #define FENCE_STATUS_ERROR (-1) 32*4882a593Smuzhiyun #define FENCE_STATUS_ACTIVE (0) 33*4882a593Smuzhiyun #define FENCE_STATUS_SIGNALED (1) 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun int sync_wait(int fd, int timeout); 36*4882a593Smuzhiyun int sync_merge(const char *name, int fd1, int fd2); 37*4882a593Smuzhiyun int sync_fence_size(int fd); 38*4882a593Smuzhiyun int sync_fence_count_with_status(int fd, int status); 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun #endif 41