int pmiWrite(int sec, int usec) { int sts; if (current == NULL) return PM_ERR_NOCONTEXT; if (current->result == NULL) return current->last_sts = PMI_ERR_NODATA; if (sec < 0) { pmtimevalNow(¤t->result->timestamp); } else { current->result->timestamp.tv_sec = sec; current->result->timestamp.tv_usec = usec; } if ((sts = check_timestamp()) == 0) { sts = _pmi_put_result(current, current->result); current->last_stamp = current->result->timestamp; } pmFreeResult(current->result); current->result = NULL; return current->last_sts = sts; }
int pmiPutResult(const pmResult *result) { if (current == NULL) return PM_ERR_NOCONTEXT; return current->last_sts = _pmi_put_result(current, current->result); }
int pmiPutResult(const pmResult *result) { int sts; if (current == NULL) return PM_ERR_NOCONTEXT; current->result = (pmResult *)result; if ((sts = check_timestamp()) == 0) { sts = _pmi_put_result(current, current->result); current->last_stamp = current->result->timestamp; } current->result = NULL; return current->last_sts = sts; }
int pmiWrite(int sec, int usec) { int sts; if (current == NULL) return PM_ERR_NOCONTEXT; if (current->result == NULL) return current->last_sts = PMI_ERR_NODATA; if (sec < 0) { __pmtimevalNow(¤t->result->timestamp); } else { current->result->timestamp.tv_sec = sec; current->result->timestamp.tv_usec = usec; } if (current->result->timestamp.tv_sec < current->last_stamp.tv_sec || (current->result->timestamp.tv_sec == current->last_stamp.tv_sec && current->result->timestamp.tv_usec < current->last_stamp.tv_usec)) { fprintf(stderr, "Fatal Error: timestamp "); printstamp(stderr, ¤t->result->timestamp); fprintf(stderr, " not greater than previous valid timestamp "); printstamp(stderr, ¤t->last_stamp); fputc('\n', stderr); sts = PMI_ERR_BADTIMESTAMP; } else { sts = _pmi_put_result(current, current->result); current->last_stamp = current->result->timestamp; } pmFreeResult(current->result); current->result = NULL; return current->last_sts = sts; }