Lines Matching refs:histfd
68 static int histfd = -1; variable
542 if (histfd != -1) { in sethistfile()
544 (void)close(histfd); in sethistfile()
545 histfd = -1; in sethistfile()
587 if (histfd != -1) { in histsync()
652 if (svmode == HIST_STORE && histfd != -1) in histsave()
749 histfd = savefd(fd); in hist_init()
750 if (histfd != fd) in hist_init()
753 mksh_lockfd(histfd); in hist_init()
755 histfsize = lseek(histfd, (off_t)0, SEEK_END); in hist_init()
763 MAP_FILE | MAP_PRIVATE, histfd, (off_t)0); in hist_init()
786 if (fstat(histfd, &sb) >= 0 && in hist_init()
838 if (write(histfd, sprinkle, 2) != 2) { in hist_init()
843 histfsize = lseek(histfd, (off_t)0, SEEK_END); in hist_init()
845 mksh_unlkfd(histfd); in hist_init()
909 mksh_lockfd(histfd); in writehistfile()
910 sizenow = lseek(histfd, (off_t)0, SEEK_END); in writehistfile()
925 MAP_FILE | MAP_PRIVATE, histfd, (off_t)0); in writehistfile()
940 if (cmd && !writehistline(histfd, lno, cmd)) { in writehistfile()
945 histfsize = lseek(histfd, (off_t)0, SEEK_END); in writehistfile()
946 mksh_unlkfd(histfd); in writehistfile()
967 if (histfd >= 0) { in hist_finish()
968 mksh_unlkfd(histfd); in hist_finish()
969 (void)close(histfd); in hist_finish()
971 histfd = -1; in hist_finish()