• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2012, 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 
17 #ifndef _FILEFD_PORTABLE_H_
18 #define _FILEFD_PORTABLE_H_
19 
20 /*
21  * Maintaining a list of special file descriptors in lib-portable
22  * which are maintained across a execve() via environment variables.
23  * See portable/arch-mips/filefd.c for details.
24  */
25 enum filefd_type {
26     UNUSED_FD_TYPE = 0,
27     EVENT_FD_TYPE,
28     INOTIFY_FD_TYPE,
29     SIGNAL_FD_TYPE,
30     TIMER_FD_TYPE,
31     MAX_FD_TYPE
32 };
33 
34 extern __hidden void filefd_opened(int fd, enum filefd_type fd_type);
35 extern __hidden void filefd_closed(int fd);
36 extern __hidden void filefd_CLOEXEC_enabled(int fd);
37 extern __hidden void filefd_CLOEXEC_disabled(int fd);
38 extern __hidden void filefd_disable_mapping(void);
39 
40 extern int WRAP(close)(int fd);
41 extern int WRAP(read)(int fd, void *buf, size_t count);
42 extern int WRAP(pipe2)(int pipefd[2], int portable_flags);
43 
44 #endif /* _FILEFD_PORTABLE_H_ */
45