Re: how tail waits for file to appear again?

2023-02-19 Thread Maksim Rodin
Hello, Thank you for your advice! After I ran this tool and again read tail sources and `man kqueue` more carefully I hope I now have a better understanding how it is done it tail. While all the files opened with tail are in place kqueue is called with zero timeout which makes it just wait for

Re: how tail waits for file to appear again?

2023-02-17 Thread Robert Klein
Hi, for the OpenBSD version, see kevent(2) and grep the source for kevent, kqueue, and EV_SET. BSD 4.4 used select(2) because it was faster than sleep (you can find the sources e.g. on github). Best regards Robert On Fri, 17 Feb 2023 08:23:13 +0300 Maksim Rodin wrote: > Hello, > Sorry if I

Re: how tail waits for file to appear again?

2023-02-17 Thread Stuart Henderson
On 2023-02-17, Maksim Rodin wrote: >> > I was able to reproduce watching for new data and truncation of the >> > file using "kqueue" but I do not quite understand how the original tail >> > watches when the file appears again after deletion or renaming. > I am sorry that I could not be clear

Re: how tail waits for file to appear again?

2023-02-17 Thread Maksim Rodin
> > I was able to reproduce watching for new data and truncation of the > > file using "kqueue" but I do not quite understand how the original tail > > watches when the file appears again after deletion or renaming. I am sorry that I could not be clear enough in my words above. I meant I already

Re: how tail waits for file to appear again?

2023-02-17 Thread Mike Fischer
> Am 17.02.2023 um 06:23 schrieb Maksim Rodin : > > Hello, > Sorry if I chose the wrong place to ask such a question. > I have been learning C for a couple of months and along with reading > "C Primer Plus" by Stephen Prata and doing some exercises from it I took > a hard (for me) task to