merge job rusage and pending reason support

This commit is contained in:
Rongsong Shen 2025-12-16 14:36:28 +08:00
parent 30824ae5ea
commit cb0c7fe9e7
82 changed files with 4280 additions and 2561 deletions

View file

@ -2,6 +2,7 @@
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include "mylock.h"
@ -850,3 +851,41 @@ int xce_runtask_req(endpoint_t* ep, xce_taskrun_t* runinfo)
return xce_request(ep, &request);
}
int xce_set_pend_reason_req(endpoint_t* ep, xce_preason_set_t* reasons)
{
/* clang-format off */
xce_request_t request = {
.opcode = OPCode_setpreason,
.body_which = Request_body_preasonmsg,
.body = {
.preasonmsg = reasons
}
};
/* clang-format on */
if ((ep == NULL) || (reasons == NULL)) {
return -EINVAL;
}
return xce_request(ep, &request);
}
int xce_clear_reason_req(endpoint_t* ep, xce_clear_reason_t* reason)
{
/* clang-format off */
xce_request_t request = {
.opcode = OPCode_clrpreason,
.body_which = Request_body_clrpreasonmsg,
.body = {
.clrpreasonmsg = reason
}
};
/* clang-format on */
if ((ep == NULL) || (reason == NULL)) {
return -EINVAL;
}
return xce_request(ep, &request);
}