/* Wait to leave a state. This will eventually need interrupt locking etc */
static int sock_wait_leave(struct socket *s, uint8_t flag, uint8_t state)
{
- do {
+ while (s->s_state == state)
/* FIXME: return EINPROGRESS not EINTR for SS_CONNECTING */
if (psleep_flags(s, flag))
return -1;
- /* Protocol state check */
- } while (s->s_state == state);
return 0;
}
/* Wait to enter a state. This will eventually need interrupt locking etc */
static int sock_wait_enter(struct socket *s, uint8_t flag, uint8_t state)
{
- do {
+ while (s->s_state != state)
/* FIXME: return EINPROGRESS not EINTR for SS_CONNECTING */
if (psleep_flags(s, flag))
return -1;
- /* Protocol state check */
- } while (s->s_state == state);
return 0;
}
struct sockinfo {
uint8_t af;
- uint8_t pf;
uint8_t type;
+ uint8_t pf;
uint8_t priv;
};
}
s++;
}
- return -EAFNOSUPPORT;
+ udata.u_error = EAFNOSUPPORT;
+ return -1;
}
#undef af
#undef fd
/*******************************************
-getsockaddrs(fd, addr) Function 95
+getsockaddrs(fd, type, addr) Function 95
int fd;
+int type;
struct sockaddr_*in addr;
********************************************/
#define fd (int16_t)udata.u_argn