1f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle/*
2f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * Copyright (C) 2010 The Android Open Source Project
3f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle *
4f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * Licensed under the Apache License, Version 2.0 (the "License");
5f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * you may not use this file except in compliance with the License.
6f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * You may obtain a copy of the License at
7f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle *
8f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle *      http://www.apache.org/licenses/LICENSE-2.0
9f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle *
10f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * Unless required by applicable law or agreed to in writing, software
11f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * distributed under the License is distributed on an "AS IS" BASIS,
12f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * See the License for the specific language governing permissions and
14f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle * limitations under the License.
15f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle */
16f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle
17f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle#ifndef FDPOOL_H
18f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle#define FDPOOL_H
19f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle
20f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttlestruct pooled_fd {
21f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle  struct pooled_fd *prev;
22f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle  struct pooled_fd *next;
23f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle  int fd;
24f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle};
25f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle
26f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttlevoid fdpool_init(struct pooled_fd *pfd);
27f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttleint fdpool_open(struct pooled_fd *pfd, const char *pathname, int flags);
28f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttlevoid fdpool_close(struct pooled_fd *pfd);
29f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle
30f79b2dff1024db4f6326f3422236bed169dd902fThomas Tuttle#endif
31