+ /*
+ * Replace lockf() with fcntl() and a fixed start
+ * value. We should already be at EOF.
+ */
+ if ((fl.l_start = lseek(fileno(fp), 0, SEEK_CUR)) < 0)
+ return NULL;
+ fl.l_len = 0;
+ fl.l_whence = SEEK_SET;
+ fl.l_type = F_WRLCK;
+ if (fcntl(fileno(fp), F_SETLKW, &fl) == -1)