Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!husc6!rice!sun-spots-request From: anand@amax.npac.syr.edu (Rangachari Anand) Newsgroups: comp.sys.sun Subject: Problem with lockf on SunOS 3.5 Keywords: SunOS Message-ID: <4114@kalliope.rice.edu> Date: 25 Jun 89 15:18:03 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 39 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 49, message 8 of 11 The following program works perfectly on SunOS 4.0. When run on 3.5 the following things happen. 1. The program hangs. The process can not be killed even with kill -9 2. The daemon lockd dies. The program is shown below: #include #include #include main() { int fd, res; fd = open("foo", O_WRONLY | O_CREAT); if (fd == -1) { perror("t1"); exit(0); } res = lockf(fd, F_LOCK, (long) 1); if (res == -1) { perror("t1"); exit(0); } printf("Lockf returns %d\n", res); res = lockf(fd, F_ULOCK, (long) 1); if (res == -1) { perror("t1"); exit(0); } printf("Lockf returns %d\n", res); res = lockf(fd, F_TEST, (long) 1); if (res == -1) { perror("t1"); exit(0); } printf("Lockf returns %d\n", res); } Does any one know what causes this problem. R.Anand Internet: anand@amax.npac.syr.edu Bitnet: ranand@sunrise