GDB (xrefs)
Classes | Typedefs | Functions
filestuff.h File Reference

Go to the source code of this file.

Classes

struct  gdb_file_deleter
 

Typedefs

typedef std::unique_ptr< FILE, gdb_file_deletergdb_file_up
 

Functions

void notice_open_fds (void)
 
void mark_fd_no_cloexec (int fd)
 
void unmark_fd_no_cloexec (int fd)
 
void close_most_fds (void)
 
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_socketpair_cloexec (int domain, int style, int protocol, int filedes[2])
 
int gdb_socket_cloexec (int domain, int style, int protocol)
 
int gdb_pipe_cloexec (int filedes[2])
 
struct cleanupmake_cleanup_close (int fd)
 

Typedef Documentation

◆ gdb_file_up

typedef std::unique_ptr<FILE, gdb_file_deleter> gdb_file_up

Definition at line 59 of file filestuff.h.

Function Documentation

◆ close_most_fds()

void close_most_fds ( void  )

Definition at line 216 of file filestuff.c.

References do_close(), and fdwalk().

Referenced by fork_inferior(), pipe_open(), and shell_escape().

◆ gdb_fopen_cloexec()

gdb_file_up gdb_fopen_cloexec ( const char *  filename,
const char *  opentype 
)

◆ gdb_open_cloexec()

int gdb_open_cloexec ( const char *  filename,
int  flags,
unsigned long  mode 
)

◆ gdb_pipe_cloexec()

int gdb_pipe_cloexec ( int  filedes[2])

◆ gdb_socket_cloexec()

int gdb_socket_cloexec ( int  domain,
int  style,
int  protocol 
)

Definition at line 359 of file filestuff.c.

References SOCK_CLOEXEC, and socket_mark_cloexec().

Referenced by gdb_connect_sync_socket(), and net_open().

◆ gdb_socketpair_cloexec()

int gdb_socketpair_cloexec ( int  domain,
int  style,
int  protocol,
int  filedes[2] 
)

Definition at line 338 of file filestuff.c.

References _, gdb_assert_not_reached, SOCK_CLOEXEC, and socket_mark_cloexec().

Referenced by gdb_pipe(), linux_mntns_get_helper(), and pipe_open().

◆ make_cleanup_close()

struct cleanup* make_cleanup_close ( int  fd)

◆ mark_fd_no_cloexec()

void mark_fd_no_cloexec ( int  fd)

Definition at line 176 of file filestuff.c.

References do_mark_open_fd().

Referenced by darwin_pre_ptrace().

◆ notice_open_fds()

void notice_open_fds ( void  )

Definition at line 168 of file filestuff.c.

References do_mark_open_fd(), and fdwalk().

Referenced by captured_main_1().

◆ unmark_fd_no_cloexec()

void unmark_fd_no_cloexec ( int  fd)

Definition at line 184 of file filestuff.c.

References _, gdb_assert_not_reached, and open_fds.

Referenced by darwin_ptrace_him().