mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-07 09:26:26 +00:00
utils: add lxc_cloexec()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
f749d524f1
commit
b499121f1f
@ -241,6 +241,11 @@ static inline int memfd_create(const char *name, unsigned int flags) {
|
|||||||
extern int memfd_create(const char *name, unsigned int flags);
|
extern int memfd_create(const char *name, unsigned int flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline int lxc_set_cloexec(int fd)
|
||||||
|
{
|
||||||
|
return fcntl(fd, F_SETFD, FD_CLOEXEC);
|
||||||
|
}
|
||||||
|
|
||||||
/* Struct to carry child pid from lxc_popen() to lxc_pclose().
|
/* Struct to carry child pid from lxc_popen() to lxc_pclose().
|
||||||
* Not an opaque struct to allow direct access to the underlying FILE *
|
* Not an opaque struct to allow direct access to the underlying FILE *
|
||||||
* (i.e., struct lxc_popen_FILE *file; fgets(buf, sizeof(buf), file->f))
|
* (i.e., struct lxc_popen_FILE *file; fgets(buf, sizeof(buf), file->f))
|
||||||
|
Loading…
Reference in New Issue
Block a user