Android-cuttlefish cvd tool
Classes | Namespaces | Typedefs | Functions | Variables
unique_fd.h File Reference
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
Include dependency graph for unique_fd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  android::base::unique_fd_impl< Closer >
 
struct  android::base::DefaultCloser
 
struct  android::base::borrowed_fd
 

Namespaces

namespace  android
 
namespace  android::base
 

Typedefs

using android::base::unique_fd = unique_fd_impl< DefaultCloser >
 

Functions

template<typename Closer >
bool android::base::Pipe (unique_fd_impl< Closer > *read, unique_fd_impl< Closer > *write, int flags=O_CLOEXEC)
 
template<typename Closer >
bool android::base::Socketpair (int domain, int type, int protocol, unique_fd_impl< Closer > *left, unique_fd_impl< Closer > *right)
 
template<typename Closer >
bool android::base::Socketpair (int type, unique_fd_impl< Closer > *left, unique_fd_impl< Closer > *right)
 
FILE * android::base::Fdopen (unique_fd &&ufd, const char *mode)
 
DIR * android::base::Fdopendir (unique_fd &&ufd)
 
template<typename T >
int close (const android::base::unique_fd_impl< T > &) __attribute__((__unavailable__("close called on unique_fd")))
 
template<typename T >
FILE * fdopen (const android::base::unique_fd_impl< T > &, const char *mode) __attribute__((__unavailable__("fdopen takes ownership of the fd passed in
 
template<typename T >
DIR * fdopendir (const android::base::unique_fd_impl< T > &) __attribute__((__unavailable__("fdopendir takes ownership of the fd passed in
 

Variables

either dup the unique_fd
 
either dup the or use android::base::Fdopen to pass ownership
 

Function Documentation

◆ close()

template<typename T >
int close ( const android::base::unique_fd_impl< T > &  )

◆ fdopen()

template<typename T >
FILE * fdopen ( const android::base::unique_fd_impl< T > &  ,
const char *  mode 
)

◆ fdopendir()

template<typename T >
DIR * fdopendir ( const android::base::unique_fd_impl< T > &  )

Variable Documentation

◆ ownership

either dup the or use android::base::Fdopendir to pass ownership

◆ unique_fd

either dup the unique_fd