linux - Is file object local to every process or System wide? -
as linux device driver developer in idea file object local structure every process , address available in fd table corresponding fd. when came across section 5.6 in linux programming interface michale kerrisk states that two different file descriptors refer same open file description share file offset value. therefore, if file offset changed via 1 file descriptor (as consequence of calls read(), write(), or lseek()), change visible through other file descriptor. applies both when 2 file descrip tors belong same process , when belong different processes. i befuddled...kindly 1 me improve understanding. each process have own file descriptor table, , each time file open() ed yields separate file description. there sanity there! the exception when file descriptor duplicated, either within process (via dup() ) or across processes (by 1 process fork() ing copy same fds, or passing file descriptor through unix domain socket). when happens, 2 descriptors end sha