I'm not calling these sys calls, anyone knows why they're being called ?

I have simple sample code below. When I compile and check it with truss I get some ioctl and fstat calls that I never used in mycode. How this can be happened?
When I use a similiar code in a production environment (with a lot of connections), there is some significant increase in Kernel sys usage caused by these unknown calls.
code:
fp=fopen("MYFILE","r");
if (fseek(fp, 0L, SEEK_SET) == -1)
printf("err\n");
return(0);
c=fgetc(fp);
fclose(fp);
cc is Forte[tm] Developer 7 EA with latest updates
OS : Solaris 2.7 on Sparc Ultra 10 with lates updates
compile: cc -xdepend -xarch=v9 ./myprog.c
truss -fade ./a.out
0.0297 open("MYFILE", O_RDONLY) = 3
0.0312 ioctl(1, TCGETA, 0xFFFFFFFF7FFFE93C) = 0     -----> WHO'S CALLING
0.0316 lseek(3, 0, SEEK_SET)=0
0.0319 fstat(3, 0xFFFFFFFF7FFFF8F0) = 0          -----> WHO'S CALLING
0.0323 ioctl(3, TCGETA, 0xFFFFFFFF7FFFF82C) Err#25 ENOTTY -----> WHO'S CALLING
0.0327 read(3, " XXXXXXXXXXXXXXXXXXXXX :".., 8192) = 8192
0.0331 lseek(3, 0xFFFFFFFFFFFFE001, SEEK_CUR) = 1
0.0334 close(3) = 0
Best Regards,
Levent

Hi Alan,
I did what you said and here is the results.
before changes:
syscall seconds calls errors
_exit            .00       1
read .01 89
write .01 31
open .02 100 4
close .00 100
unlink .00 1
chdir .00 1
time .00 23
brk .00 6
stat .00 84 1
lseek .00 82
getpid .00 1
setuid .00 1
fstat .01 91
access .00 1
setgid .00 1
ioctl .00 84 84
execve .00 1
fcntl .00 90
poll .00 16
lstat .00 82
readlink .00 82 81
sigaction .00 3
mmap .00 28
munmap .00 8
memcntl .00 7
uname .00 1
sysconfig .00 1
llseek .00 85
resolvepath .00 1
getdents64 .00 11
fstat64 .02 173
open64 .00 3
so_socket .00 1
connect .00 1 1
shutdown .00 1
getpeername .00 1
getsockopt .00 4
setsockopt .00 2
sys totals: .07 1299 171
usr time: .03
elapsed: .45
after changes:
syscall seconds calls errors
_exit            .00       1
read .01 88
write .00 31
open .00 100 4
close .01 100
unlink .00 1
chdir .00 1
time .00 23
brk .00 6
stat .00 83 1
lseek .00 81
getpid .00 1
setuid .00 1
fstat .00 91
access .00 1
setgid .00 1
ioctl .00 2 2
execve .00 1
fcntl .00 8
poll .00 16
lstat .01 82
readlink .00 1
sigaction .00 3
mmap .00 28
munmap .00 8
memcntl .01 7
uname .00 1
sysconfig .00 1
llseek .00 84
resolvepath .00 1
getdents64 .01 11
fstat64 .00 9
open64 .00 3
so_socket .00 1
connect .00 1 1
shutdown .00 1
getpeername .00 1
getsockopt .00 4
setsockopt .00 2
sys totals: .05 886 8
usr time: .02
elapsed: .48
As you can see above figures show that I have a small amount ioctl and fstat64 (tested on 32bit binaries) calls now.
Thanks a lot,

Similar Messages

Maybe you are looking for

  • Read  in loop

    Hi all ,       I have one internal table itab1 as mblnr    zeile   vgbel   lifnr 11     1     z           08 11     2     z           77 11     3     z           76 11     4     z           75 11     5     z           08 12        1     z           7

  • 4s won't charge after upgrading to iOS 7 :(

    My phone was FINE after upgrading to iOS 7 last night. Today when I went into work, it was also fine and charged correctly. It wasn't until after I got the "do you want iphone to trust this computer?" and I said NO. I wasn't sure what this meant, I j

  • Creative MP3 Players and Car Au

    Hello, I'm a newbie and I don't know a lot about MP3 players so I hope you can help me out. I have a brand new Kenwood car audio with an USB cable to plug your MP3 player in. My friend's Samsung MP3 player doesn't work, after some research I find out

  • Table with fields containig more thn 300 characters

    Hello Friends, i want to create one ZTABLE and intht i want a field tht can store more thn 300 characters. i have used string data type for the same but while activating the table its giving me error saying : " Table contains more than 3 long string

  • ITunes Match deleted ALL my playlists

    About 6 weeks ago or so, I noted that one of my favourite playlists on iTunes Match had disappeared.  I had absolutely no idea how this could happen as this is a Cloud based service with an integrated back-up.  Now - today - I find that ALL my playli