Hewlett Packard Interview Question
Software Engineer / DevelopersYour interviewer was not 100% correct. Locks are at the level of the file and are advisory in nature. That means only software that checks for flocks will abide by them. Locking is useful for server software as on all UNIX systems to my knowledge, flock() is carried across fork(). fcntl() will support advisory record locking. Also, look at vipw for an example of "locking" is implemented for system tools.
fcntl?
- Anonymous July 21, 2010