}
while(netat_ready() && n < udata.u_count) {
+ if (s->s_iflag & SI_SHUTR)
+ break;
uputc(netat_byte(), udata.u_base++);
n++;
}
- if (n)
+ if (n || (s->s_iflag & SI_SHUTR))
return n;
s->s_iflag &= ~SI_DATA;
netat_wake();
used(flag);
while(n < udata.u_count) {
- if (sockets[0].s_state == SS_CLOSED) {
+ if (sockets[0].s_state == SS_CLOSED || (sockets[0].s_iflag & SI_SHUTW)) {
udata.u_error = EPIPE;
ssig(udata.u_ptab, SIGPIPE);
return -1;
return udata.u_count;
}
+arg_t net_shutdown(struct socket *s, uint8_t flag)
+{
+ s->s_iflag |= flag;
+ netat_wake();
+ return 0;
+}
+
struct netdevice net_dev = {
0,
"at0",
n = netn_copyout(s);
if (n == 0xFFFF)
return -1;
- if (n)
+ if (n || (s->s_iflag & SI_SHUTR))
return n;
s->s_iflag &= ~SI_DATA;
/* Could do with using timeouts here to be clever for non O_NDELAY so
}
while (t < udata.u_count) {
- if (s->s_state == SS_CLOSED) {
+ if (s->s_state == SS_CLOSED || (s->s_iflag & SI_SHUTW)) {
udata.u_error = EPIPE;
ssig(udata.u_ptab, SIGPIPE);
return -1;
return udata.u_count;
}
+arg_t net_shutdown(struct socket *s, uint8-t flag)
+{
+ s->s_iflag |= flag;
+ wakeup_all(s);
+ return 0;
+}
+
/* Gunk we are still making up */
struct netdevice net_dev = {
0,
netstat = s->s_num;
st = status(s);
- if (s->s_state == SS_CLOSED)
+ if (s->s_state == SS_CLOSED || (s->s_iflag & SI_SHUTW)) {
+ udata.u_error = EPIPE;
break;
+ }
/* Error or EOF */
if (st & 0xC0)
}
/* It broke mummy ! */
irqrestore(irq);
- if (n)
+ if (n) {
+ s->s_error = udata.u_error;
+ udata.u_error = 0;
return n;
+ }
err_xlate(s);
if (udata.u_error == EPIPE)
ssig(udata.u_ptab, SIGPIPE);
return -1;
}
+arg_t net_shutdown(struct socket *s, uint8_t flag)
+{
+ s->s_iflag |= flag;
+ wakeup_all(s);
+ return 0;
+}
+
/* Gunk we are still making up */
struct netdevice net_dev = {
0,