1 #include <sys/types.h> 2 #include <sys/file.h> 3 #include <fcntl.h> 4 main()5 void main() 6 { 7 flock(0,LOCK_EX | LOCK_UN | LOCK_NB); 8 } 9