Re: Question about the IO::File->open method
- From: Darren Dunham <ddunham@xxxxxxxxxxxxxxxx>
- Date: Fri, 26 Aug 2005 23:19:12 GMT
Keith Thompson <kst-u@xxxxxxx> wrote:
> "Martin Jost" <Martin.Jost@xxxxxxxxxxx> writes:
>> Two methods to get at that come to mind:
>> 1. RTFS (if it isn't documented)
>> 2. Use trace, strace, truss (whatever it is called on Solaris) to
>> trace sample-programs.
> The latter won't help. A call to fopen() won't show up in truss
> output, since fopen() isn't a system call; fopen() works by invoking
> open(), which is a system call.
You can use -u to trace libraries.
Try 'truss -t open -u libc:*open ...' on it.
On my test program using fopen...
$ cat /tmp/open.c
#include <stdio.h>
main()
{
FILE *f;
f = fopen("/tmp/out", "r" );
}
$ truss -t open -u libc:*open ./open
open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT
open("/usr/lib/libc.so.1", O_RDONLY) = 3
open("/usr/lib/libdl.so.1", O_RDONLY) = 3
open("/usr/platform/SUNW,Ultra-30/lib/libc_psr.so.1", O_RDONLY) = 3
-> libc:fopen(0x106a0, 0x106b0, 0x10400, 0x300)
open("/tmp/out", O_RDONLY) = 3
<- libc:fopen() = 0xff3402b4
--
Darren Dunham ddunham@xxxxxxxx
Senior Technical Consultant TAOS http://www.taos.com/
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
.
- Follow-Ups:
- Re: Question about the IO::File->open method
- From: Doomster
- Re: Question about the IO::File->open method
- References:
- Question about the IO::File->open method
- From: Doomster
- Re: Question about the IO::File->open method
- From: Martin Jost
- Re: Question about the IO::File->open method
- From: Keith Thompson
- Question about the IO::File->open method
- Prev by Date: Re: Question about the IO::File->open method
- Next by Date: Net::POP3 with SSL
- Previous by thread: Re: Question about the IO::File->open method
- Next by thread: Re: Question about the IO::File->open method
- Index(es):
Relevant Pages
|