David 'Digit' Turner | e2762c4 | 2011-03-16 14:21:28 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | #ifndef ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H |
| 17 | #define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H |
| 18 | |
| 19 | /* Try to open a new Qemu fast-pipe. This function returns a file descriptor |
| 20 | * that can be used to communicate with a named service managed by the |
| 21 | * emulator. |
| 22 | * |
| 23 | * This file descriptor can be used as a standard pipe/socket descriptor. |
| 24 | * |
| 25 | * 'pipeName' is the name of the emulator service you want to connect to. |
| 26 | * E.g. 'opengles' or 'camera'. |
| 27 | * |
| 28 | * On success, return a valid file descriptor |
| 29 | * Returns -1 on error, and errno gives the error code, e.g.: |
| 30 | * |
| 31 | * EINVAL -> unknown/unsupported pipeName |
| 32 | * ENOSYS -> fast pipes not available in this system. |
| 33 | * |
| 34 | * ENOSYS should never happen, except if you're trying to run within a |
| 35 | * misconfigured emulator. |
| 36 | * |
| 37 | * You should be able to open several pipes to the same pipe service, |
| 38 | * except for a few special cases (e.g. GSM modem), where EBUSY will be |
| 39 | * returned if more than one client tries to connect to it. |
| 40 | */ |
| 41 | extern int qemu_pipe_open(const char* pipeName); |
| 42 | |
| 43 | #endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_PIPE_H */ |