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

  • Using a variable as part of a url

    Hi Thanks for checking in!. I am trying to define one folder in a url as a variable //Here is what my code looks like before I try to use a variable as part of the url. And this works just fine. var nextImage:String = "events/1.jpg"; this.loaderTarge

  • Which Thermalright chipset cooler for X58 Pro?

    I'm looking to replace the terrible stock IOH heatsink for a Thermalright one but I don't want to impede the placement of graphics cards.  Should I go with the Thermalright HR-05 IFX or the HR-05-SLI IFX?  Does anyone have any experience with this? 

  • CSS 11500 Re-balance services after service failure

    We have 3 servers in our server farm and under normal circumstances wish to balance them unevenly such that the 3rd server only gets a small proportion of the traffic. The other two should be equally balanced. (Say 45, 45, 10). When one of the prime

  • Could anyone please tell me how to expalin an informatica project in interview..

    Hi Narayan, As you provided below points abt project explanation - i have added generic explanation about project. But my explanation is not proper. Request you to please guide  me in right direction and add some point from your side which will help

  • DNL_CUST_PROD1 is in Running status for Delta Mat Grp - SRM 7.0

    Hi Experts , We are configuring SRM7.0 with ECC6 ( Ehp4) having Classic Scenario We already done initial upload of all Mat Type , Mat Grps, Material  & Service Master data successfully. Now one Mat Grp is added in ECC, and I am tring to replicate thi