path: root/discover/paths.h
diff options
authorNeelesh Gupta <>2013-09-12 19:56:54 +0530
committerJeremy Kerr <>2013-09-25 14:56:50 +0800
commitce1875fe6d550803879cad4ed168229e154c0d3c (patch)
treeca0d411d7bd451e3d760a8b0b60f0e33bcea46e5 /discover/paths.h
parent1972d9cfcc5300cd8cb2f587d9bc5f856322ae8f (diff)
discover: Add an asynchronous version of load_url
A new load_url_async() function handles retrieving the resources by forking an external process which currently blocks the parent waiting for the process to complete. This patch modifies the load_*() functions to handle it asynchronously by providing the exit callback and returning without waiting for the child process to exit. Signed-off-by: Jeremy Kerr <> Signed-off-by: Neelesh Gupta <>
Diffstat (limited to 'discover/paths.h')
1 files changed, 5 insertions, 0 deletions
diff --git a/discover/paths.h b/discover/paths.h
index 20a2249..93788e9 100644
--- a/discover/paths.h
+++ b/discover/paths.h
@@ -16,7 +16,12 @@ char *join_paths(void *alloc_ctx, const char *a, const char *b);
const char *mount_base(void);
+typedef void (*load_url_callback)(void *data, int *status);
/* Load a (potentially remote) file, and return a guaranteed-local name */
+char *load_url_async(void *ctx, struct pb_url *url, unsigned int *tempfile,
+ load_url_callback url_cb);
char *load_url(void *ctx, struct pb_url *url, unsigned int *tempfile);
#endif /* PATHS_H */
OpenPOWER on IntegriCloud