AP_HAL: Socket: add set_cloexec

This commit is contained in:
Peter Barker 2018-06-08 14:12:35 +10:00 committed by Andrew Tridgell
parent 574a2b3652
commit 584c5d5806
2 changed files with 9 additions and 0 deletions

View File

@ -110,6 +110,14 @@ void SocketAPM::set_blocking(bool blocking)
}
}
/*
set cloexec state
*/
void SocketAPM::set_cloexec()
{
fcntl(fd, F_SETFD, FD_CLOEXEC);
}
/*
send some data
*/

View File

@ -39,6 +39,7 @@ public:
bool bind(const char *address, uint16_t port);
void reuseaddress();
void set_blocking(bool blocking);
void set_cloexec();
void set_broadcast(void);
ssize_t send(const void *pkt, size_t size);