Does fwrite call any lock internally?
In solaris when I attached dbx to one of the running stacks, I found the call to fwrite leading to __lll_lock_wait()? In what scenario will this happen? Does fwrite internally tries to acquire a lock? the standards that I looked through (C99 and POSIX) do say nothing about locked or unlocked IO concerning fwrite . On my linux system their is a not very precise mentioning of locking in the man page: For non-locking counterparts, see unlocked_stdio(3). and effectively, there is a fwrite_unlocked function. Standard unlocked functions in POSIX are only getc_unlocked() , getchar_unlocked() , putc