|
GDBserver
|
#include "common-defs.h"#include "filestuff.h"#include "gdb_vecs.h"#include <fcntl.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <algorithm>#include <dirent.h>Go to the source code of this file.
Macros | |
| #define | O_CLOEXEC 0 |
| #define | SOCK_CLOEXEC 0 |
Functions | |
| static int | fdwalk (int(*func)(void *, int), void *arg) |
| static int | do_mark_open_fd (void *ignore, int fd) |
| void | notice_open_fds (void) |
| void | mark_fd_no_cloexec (int fd) |
| void | unmark_fd_no_cloexec (int fd) |
| static int | do_close (void *ignore, int fd) |
| void | close_most_fds (void) |
| static void | mark_cloexec (int fd) |
| static void | maybe_mark_cloexec (int fd) |
| int | gdb_open_cloexec (const char *filename, int flags, unsigned long mode) |
| gdb_file_up | gdb_fopen_cloexec (const char *filename, const char *opentype) |
| int | gdb_pipe_cloexec (int filedes[2]) |
| static void | do_close_cleanup (void *arg) |
| struct cleanup * | make_cleanup_close (int fd) |
Variables | |
| static std::vector< int > | open_fds |
| static int | trust_o_cloexec |
| #define O_CLOEXEC 0 |
Definition at line 44 of file filestuff.c.
Referenced by gdb_fopen_cloexec(), gdb_open_cloexec(), and gdb_pipe_cloexec().
| #define SOCK_CLOEXEC 0 |
Definition at line 48 of file filestuff.c.
| void close_most_fds | ( | void | ) |
Definition at line 216 of file filestuff.c.
References do_close(), and fdwalk().
Referenced by fork_inferior().
|
static |
|
static |
Definition at line 403 of file filestuff.c.
Referenced by make_cleanup_close().
|
static |
Definition at line 159 of file filestuff.c.
References open_fds.
Referenced by mark_fd_no_cloexec(), and notice_open_fds().
|
static |
Definition at line 65 of file filestuff.c.
References errno.
Referenced by close_most_fds(), and notice_open_fds().
| gdb_file_up gdb_fopen_cloexec | ( | const char * | filename, |
| const char * | opentype | ||
| ) |
Definition at line 296 of file filestuff.c.
References alloca(), errno, maybe_mark_cloexec(), and O_CLOEXEC.
Referenced by command_from_pid(), commandline_from_pid(), linux_common_core_of_thread(), linux_proc_get_int(), linux_proc_pid_get_state(), linux_proc_tid_get_name(), linux_xfer_osdata_cpus(), linux_xfer_osdata_modules(), linux_xfer_osdata_msg(), linux_xfer_osdata_sem(), linux_xfer_osdata_shm(), and print_sockets().
| int gdb_open_cloexec | ( | const char * | filename, |
| int | flags, | ||
| unsigned long | mode | ||
| ) |
Definition at line 283 of file filestuff.c.
References maybe_mark_cloexec(), and O_CLOEXEC.
Referenced by linux_mntns_access_fs(), linux_mntns_open_cloexec(), and mnsh_handle_open().
| int gdb_pipe_cloexec | ( | int | filedes[2] | ) |
Definition at line 373 of file filestuff.c.
References _, gdb_assert_not_reached, mark_cloexec(), maybe_mark_cloexec(), and O_CLOEXEC.
| struct cleanup* make_cleanup_close | ( | int | fd | ) |
Definition at line 413 of file filestuff.c.
References do_close_cleanup(), make_cleanup_dtor(), xfree(), and XNEW.
Referenced by linux_mntns_access_fs().
|
static |
Definition at line 236 of file filestuff.c.
References F_GETFD, fcntl, FD_CLOEXEC, and trust_o_cloexec.
Referenced by gdb_pipe_cloexec(), and maybe_mark_cloexec().
| void mark_fd_no_cloexec | ( | int | fd | ) |
Definition at line 176 of file filestuff.c.
References do_mark_open_fd().
|
static |
Definition at line 259 of file filestuff.c.
References mark_cloexec(), and trust_o_cloexec.
Referenced by gdb_fopen_cloexec(), gdb_open_cloexec(), and gdb_pipe_cloexec().
| void notice_open_fds | ( | void | ) |
Definition at line 168 of file filestuff.c.
References do_mark_open_fd(), and fdwalk().
Referenced by captured_main().
| void unmark_fd_no_cloexec | ( | int | fd | ) |
Definition at line 184 of file filestuff.c.
References _, gdb_assert_not_reached, and open_fds.
|
static |
Definition at line 153 of file filestuff.c.
Referenced by do_close(), do_mark_open_fd(), and unmark_fd_no_cloexec().
|
static |
Definition at line 230 of file filestuff.c.
Referenced by mark_cloexec(), and maybe_mark_cloexec().
1.8.14