Lines Matching refs:cf
103 libxl__carefd *cf = 0; in libxl__carefd_record() local
106 cf = libxl__zalloc(&ctx->nogc_gc, sizeof(*cf)); in libxl__carefd_record()
107 cf->fd = fd; in libxl__carefd_record()
108 XEN_LIST_INSERT_HEAD(&carefds, cf, entry); in libxl__carefd_record()
109 return cf; in libxl__carefd_record()
114 libxl__carefd *cf = 0; in libxl__carefd_opened() local
118 cf = libxl__carefd_record(ctx, fd); in libxl__carefd_opened()
121 return cf; in libxl__carefd_opened()
139 libxl__carefd *cf, *cf_tmp; in libxl_postfork_child_noexec() local
144 XEN_LIST_FOREACH_SAFE(cf, &carefds, entry, cf_tmp) { in libxl_postfork_child_noexec()
145 if (cf->fd >= 0) { in libxl_postfork_child_noexec()
146 r = close(cf->fd); in libxl_postfork_child_noexec()
150 " (perhaps of another libxl ctx)", cf->fd); in libxl_postfork_child_noexec()
152 free(cf); in libxl_postfork_child_noexec()
187 int libxl__carefd_close(libxl__carefd *cf) in libxl__carefd_close() argument
189 if (!cf) return 0; in libxl__carefd_close()
191 int r = cf->fd < 0 ? 0 : close(cf->fd); in libxl__carefd_close()
193 XEN_LIST_REMOVE(cf, entry); in libxl__carefd_close()
195 free(cf); in libxl__carefd_close()
200 int libxl__carefd_fd(const libxl__carefd *cf) in libxl__carefd_fd() argument
202 if (!cf) return -1; in libxl__carefd_fd()
203 return cf->fd; in libxl__carefd_fd()