![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Software Security Discussing software security algorithms, tricks, vulnerabilities |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| 4294967296 Join Date: Mar 2002 Location: /proc/1
Posts: 378
Rep Power: 7 Reputation:
10 | Monitoring fopen()/fprintf() Question to GURUs : How to monitor fopen()/fprintf(). OS - RedHat 7.3 (2.4.20-18.7.cern) Give some hints, please. P.S. I am already looking through coreutils sources (to find out how 'tail -f' is implemented). ![]()
__________________ Free your mind and your OS will follow |
| | |
| | #2 |
| Главный Лысый | lsof - pomozhet dlya fopen - a.
__________________ Ruben Muradyan Technical Director PanARMENIAN Network: Armenian News ---------------------------------------------------- Лысина - это полянка, вытоптанная мыслями. ---------------------------------------------------- |
| | |
| | #3 | |
| Честный Кот Join Date: Apr 2004 Location: Yerevan
Posts: 1,715
Rep Power: 5 Reputation:
86 | В принципе можно даже использовать strace. Беда лишь в том, что fopen/fprintf не являются непосредственно системными вызовами (fopen() вызывает в свою очередь open(), а fprintf() вызывает write(), кажется). Но, зная этот факт, можно сделать так: strace -p <pid> -e trace=open,write где <pid> - номер исследуемого процесса. Quote:
....................................... With --follow (-f), tail defaults to following the file descriptor, which means that even if a tail'ed file is renamed, tail will continue to track its end. This default behavior is not desirable when you really want to track the actual name of the file, not the file descrip- tor (e.g., log rotation). Use --follow=name in that case. That causes tail to track the named file by reopening it periodically to see if it has been removed and recreated by some other program. ......................................... Короче говоря: tail использует механизм тайм-аутов, и проверяет статус файла через определенный период времени. Просто и эффективно. И tail не attach-ается к какому-либо процессу (как деляет strace), и не лезет в ядро. Так что перехватывать вызовы чтобы понять, как устроен tail - нет резона. ![]()
__________________ Честный Кот ------------------------------------------------------ Еще не жаль огня, и Бог хранит меня... (с) А. Макаревич Когда я трезв, я - Муму и Герасим, мама; А так я - Война и Мир. (c) БГ Last edited by Reckon_ : Nov 29, 2004 at 17:49. | |
| | |
| | #4 | |
| 4294967296 Join Date: Mar 2002 Location: /proc/1
Posts: 378
Rep Power: 7 Reputation:
10 | 2 Pascal: Spasibo ![]() 2 Reckon_: Tebe toje spasibo Quote:
__________________ Free your mind and your OS will follow | |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Monitoring and Evaluation Coordinator - Civic Advocacy Support Program | PsilocybeLarvae | Jobs | 0 | Nov 10, 2004 11:12 |
| Monitor / AAA NGOC | PsilocybeLarvae | Jobs | 0 | Jul 13, 2004 11:50 |
| Development Program Specialist | Gayka | Jobs | 0 | Apr 29, 2003 09:03 |