Jorge Lucangeli Obes | 0b20877 | 2017-04-19 14:15:46 -0400 | [diff] [blame^] | 1 | /* system.h |
| 2 | * Copyright (C) 2017 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 | * Wrappers for system functionality. |
| 17 | */ |
| 18 | |
| 19 | #ifndef _SYSTEM_H_ |
| 20 | #define _SYSTEM_H_ |
| 21 | |
| 22 | #include <sys/types.h> |
| 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
| 28 | int lock_securebits(void); |
| 29 | |
| 30 | unsigned int get_last_valid_cap(void); |
| 31 | |
| 32 | int config_net_loopback(void); |
| 33 | |
| 34 | int setup_pipe_end(int fds[2], size_t index); |
| 35 | int setup_and_dupe_pipe_end(int fds[2], size_t index, int fd); |
| 36 | |
| 37 | int write_pid_to_path(pid_t pid, const char *path); |
| 38 | int write_proc_file(pid_t pid, const char *content, const char *basename); |
| 39 | |
| 40 | int setup_mount_destination(const char *source, const char *dest, uid_t uid, |
| 41 | uid_t gid); |
| 42 | |
| 43 | #ifdef __cplusplus |
| 44 | }; /* extern "C" */ |
| 45 | #endif |
| 46 | |
| 47 | #endif /* _SYSTEM_H_ */ |