diff --git a/source3/include/proto.h b/source3/include/proto.h index 6ff2854ca26..39a5d03d763 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -512,6 +512,8 @@ int interpret_protocol(const char *str,int def); char *automount_lookup(TALLOC_CTX *ctx, const char *user_name); char *automount_lookup(TALLOC_CTX *ctx, const char *user_name); bool process_exists(const struct server_id pid); +bool processes_exist(const struct server_id *pids, int num_pids, + bool *results); const char *uidtoname(uid_t uid); char *gidtoname(gid_t gid); uid_t nametouid(const char *name); diff --git a/source3/lib/util.c b/source3/lib/util.c index f547ec2a564..9b9d34c22f4 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -657,6 +657,72 @@ bool process_exists(const struct server_id pid) #endif } +bool processes_exist(const struct server_id *pids, int num_pids, + bool *results) +{ + struct server_id *remote_pids = NULL; + int *remote_idx = NULL; + bool *remote_results = NULL; + int i, num_remote_pids; + bool result = false; + + remote_pids = talloc_array(talloc_tos(), struct server_id, num_pids); + if (remote_pids == NULL) { + goto fail; + } + remote_idx = talloc_array(talloc_tos(), int, num_pids); + if (remote_idx == NULL) { + goto fail; + } + remote_results = talloc_array(talloc_tos(), bool, num_pids); + if (remote_results == NULL) { + goto fail; + } + + num_remote_pids = 0; + + for (i=0; i