static void gdb_accept(void *opaque)

{

    GDBState *s;

    struct sockaddr_in sockaddr;

    socklen_t len;

    int val, fd;



    for(;;) {

        len = sizeof(sockaddr);

        fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len);

        if (fd < 0 && errno != EINTR) {

            perror("accept");

            return;

        } else if (fd >= 0) {

            break;

        }

    }



    /* set short latency */

    val = 1;

    setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&val, sizeof(val));



    s = &gdbserver_state;

    memset (s, 0, sizeof (GDBState));

    s->env = first_cpu; /* XXX: allow to change CPU */

    s->fd = fd;

    gdb_has_xml = 0;



    gdb_syscall_state = s;



    fcntl(fd, F_SETFL, O_NONBLOCK);

}

static void gdb_accept(void *opaque)

{

    GDBState *s;

    struct sockaddr_in sockaddr;

    socklen_t len;

    int val, fd;



    for(;;) {

        len = sizeof(sockaddr);

        fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len);

        if (fd < 0 && errno != EINTR) {

            perror("accept");

            return;

        } else if (fd >= 0) {

            break;

        }

    }



    

    val = 1;

    setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&val, sizeof(val));



    s = &gdbserver_state;

    memset (s, 0, sizeof (GDBState));

    s->env = first_cpu; 

    s->fd = fd;

    gdb_has_xml = 0;



    gdb_syscall_state = s;



    fcntl(fd, F_SETFL, O_NONBLOCK);

}

static void FUNC_0(void *VAR_0)

{

    GDBState *s;

    struct sockaddr_in VAR_1;

    socklen_t len;

    int VAR_2, VAR_3;



    for(;;) {

        len = sizeof(VAR_1);

        VAR_3 = accept(gdbserver_fd, (struct VAR_1 *)&VAR_1, &len);

        if (VAR_3 < 0 && errno != EINTR) {

            perror("accept");

            return;

        } else if (VAR_3 >= 0) {

            break;

        }

    }



    

    VAR_2 = 1;

    setsockopt(VAR_3, IPPROTO_TCP, TCP_NODELAY, (char *)&VAR_2, sizeof(VAR_2));



    s = &gdbserver_state;

    memset (s, 0, sizeof (GDBState));

    s->env = first_cpu; 

    s->VAR_3 = VAR_3;

    gdb_has_xml = 0;



    gdb_syscall_state = s;



    fcntl(VAR_3, F_SETFL, O_NONBLOCK);

}

static void FUNC_0(void *VAR_0)
{ GDBState *s; struct sockaddr_in VAR_1; socklen_t len; int VAR_2, VAR_3; for(;;) { len = sizeof(VAR_1); VAR_3 = accept(gdbserver_fd, (struct VAR_1 *)&VAR_1, &len); if (VAR_3 < 0 && errno != EINTR) { perror("accept"); return; } else if (VAR_3 >= 0) { break; } } VAR_2 = 1; setsockopt(VAR_3, IPPROTO_TCP, TCP_NODELAY, (char *)&VAR_2, sizeof(VAR_2)); s = &gdbserver_state; memset (s, 0, sizeof (GDBState)); s->env = first_cpu; s->VAR_3 = VAR_3; gdb_has_xml = 0; gdb_syscall_state = s; fcntl(VAR_3, F_SETFL, O_NONBLOCK); }