int _vtlog(constchar* fmt, va_list args) { char buf[256]; struct iovec tx_iov = {buf, 1};
ipc_msg_t tx_msg = {1, &tx_iov, 0, NULL};
va_list ap; int ret; int slen;
/* Print to stderr as normal */
va_copy(ap, args);
ret = vfprintf(stderr, fmt, ap);
va_end(ap); if (ret < 0) { return ret;
}
/* Send over IPC */ if (ipc_printf_handle == INVALID_IPC_HANDLE) { return0;
}
va_copy(ap, args); /* use filtered version for consistency with stderr logging */
ret = vsnprintf_filtered(buf + 1, sizeof(buf) - 1, fmt, ap);
va_end(ap);
ret = handle_set_create(); if (ret < 0) {
TLOGI("failed to create handle set: %d\n", ret); return ret;
}
hset = ret;
/* create control port and just wait on it */ for (; test_count; test_count--) {
test = *tests++;
ret = port_create(
test->port_name, 1, MAX_PORT_BUF_SIZE,
IPC_PORT_ALLOW_NS_CONNECT | IPC_PORT_ALLOW_TA_CONNECT); if (ret < 0) {
TLOGI("failed to create port %s: %d\n", test->port_name, ret); return ret;
}
test->_port_handle = (handle_t)ret;
evt.handle = test->_port_handle;
evt.cookie = test;
ret = handle_set_ctrl(hset, HSET_ADD, &evt); if (ret < 0) {
TLOGI("failed to add %s to handle set: %d\n", test->port_name, ret); return ret;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.