libxl: Introduce libxl__fd_set_cloexec

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Anthony PERARD committed 2011-09-29 16:06:02 +01:00
1 parent 0c49cf7d49
commit acb8458e25
2 files changed
+14

No files matched your search

+13
View File
@@ -242,3 +242,16 @@ int libxl__file_reference_unmap(libxl_file_reference *f)
return ERROR_FAIL;
}
int libxl__fd_set_cloexec(int fd)
{
int flags = 0;
if ((flags = fcntl(fd, F_GETFD)) == -1) {
flags = 0;
}
if ((flags & FD_CLOEXEC)) {
return 0;
}
return fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
}
+1
View File
@@ -384,6 +384,7 @@ _hidden int libxl__error_set(libxl__gc *gc, int code);
_hidden int libxl__file_reference_map(libxl_file_reference *f);
_hidden int libxl__file_reference_unmap(libxl_file_reference *f);
_hidden int libxl__fd_set_cloexec(int fd);
_hidden int libxl__e820_alloc(libxl_ctx *ctx, uint32_t domid, libxl_domain_config *d_config);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.