#define NO_WAITER_MSG \ "****\n" \ "There are currently no UML consoles waiting for port connections.\n" \ "Either disconnect from one to make it available or activate some more\n" \ "by enabling more consoles in the UML /etc/inittab.\n" \ "****\n"
if (um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt,
IRQF_SHARED, "telnetd", conn) < 0) {
printk(KERN_ERR "port_accept : failed to get IRQ for " "telnetd\n"); goto out_free;
}
if (atomic_read(&port->wait_count) == 0) {
os_write_file(fd, NO_WAITER_MSG, sizeof(NO_WAITER_MSG));
printk(KERN_ERR "No one waiting for port\n");
}
list_add(&conn->list, &port->pending); return 1;
mutex_lock(&ports_mutex);
list_for_each(ele, &ports) {
port = list_entry(ele, struct port_list, list); if (port->port == port_num) goto found;
}
port = kmalloc(sizeof(struct port_list), GFP_KERNEL); if (port == NULL) {
printk(KERN_ERR "Allocation of port list failed\n"); goto out;
}
fd = port_listen_fd(port_num); if (fd < 0) {
printk(KERN_ERR "binding to port %d failed, errno = %d\n",
port_num, -fd); goto out_free;
}
if (um_request_irq(ACCEPT_IRQ, fd, IRQ_READ, port_interrupt,
IRQF_SHARED, "port", port) < 0) {
printk(KERN_ERR "Failed to get IRQ for port %d\n", port_num); goto out_close;
}
/* This is done here because freeing an IRQ can't be done * within the IRQ handler. So, pipe_interrupt always ups * the semaphore regardless of whether it got a successful * connection. Then we loop here throwing out failed * connections until a good one is found.
*/
um_free_irq(TELNETD_IRQ, conn);
if (conn->fd >= 0) break;
os_close_file(conn->fd);
kfree(conn);
}
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.