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>
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);
+}
_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);