Closed djwatson closed 8 years ago
A simple implementation would be to piggy-back off tsk->socket's poll e.g.
static unsigned int tls_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait) {
struct tls_sock *tsk;
tsk = tls_sk(sock->sk);
return tsk->socket->ops->poll(tsk->socket->file, tsk->socket, wait);
I was thinking about the same approach. We have to keep in mind, that we are above TCP/UDP. E.g. for POLLERR
we should consider even errors during decryption (etc).
For now it will be probably OK to return ENOTSUPP for unsupported cases IMHO.
Just a note regarding POLLPRI
in TCP - there should be implemented OOB support in tcp_read_sock()
once we switch to it (see #21).
For writes, this approach should work fine. For reads, tcp does the wakeup via the original sk_data_ready, so we would need to make sure we call it in the right places
A custom callback tls_data_ready
just spawns a worker and calls the original sk_data_ready
to wake up possibly waiting recipient. The issue here I see is the asynchronous decryption that can make poll(2)
tricky to implement for some events.
Poll isn't currently supported. Related, it looks like recvmsg / sendmsg don't block in blocking mode.