This post:
Empty or "flush" a file descriptor without read()?
, says that it is possible to do a lseek()
on a fd you don't want to read from, thereby avoiding unnecessary copying, but this does not apply to fds I create with timerfd_create()
. Why is this so and does there exist a workaround (except to use read()
, which works).
I try to do lseek()
like this:
lseek(fd, 0, SEEK_END);
And strerror()
returned Illegal seek
. Again, read(fd, buffer, 8)
works.