Lines Matching refs:wfile
114 int wlog_open(struct wlog_file *wfile, int trunc, int mode) in wlog_open() argument
128 wfile->w_afd = open(wfile->w_file, oflags, mode); in wlog_open()
131 if (wfile->w_afd == -1) { in wlog_open()
134 wfile->w_file, oflags, mode, strerror(errno)); in wlog_open()
143 if ((wfile->w_rfd = open(wfile->w_file, oflags)) == -1) { in wlog_open()
146 wfile->w_file, oflags, strerror(errno)); in wlog_open()
147 close(wfile->w_afd); in wlog_open()
148 wfile->w_afd = -1; in wlog_open()
160 int wlog_close(struct wlog_file *wfile) in wlog_close() argument
162 close(wfile->w_afd); in wlog_close()
163 close(wfile->w_rfd); in wlog_close()
193 int wlog_record_write(struct wlog_file *wfile, struct wlog_rec *wrec, in wlog_record_write() argument
220 if (write(wfile->w_afd, wbuf, reclen) == -1) { in wlog_record_write()
223 wfile->w_file, wbuf, reclen, strerror(errno)); in wlog_record_write()
226 offset = lseek(wfile->w_afd, 0, SEEK_CUR) - reclen; in wlog_record_write()
230 wfile->w_file, strerror(errno)); in wlog_record_write()
235 if ((lseek(wfile->w_rfd, offset, SEEK_SET)) == -1) { in wlog_record_write()
238 wfile->w_file, offset, strerror(errno)); in wlog_record_write()
241 if ((write(wfile->w_rfd, wbuf, reclen)) == -1) { in wlog_record_write()
244 wfile->w_file, wbuf, reclen, in wlog_record_write()
262 int wlog_scan_backward(struct wlog_file *wfile, int nrecs, in wlog_scan_backward() argument
270 fd = wfile->w_rfd; in wlog_scan_backward()
279 wfile->w_file, strerror(errno)); in wlog_scan_backward()
286 wfile->w_file, strerror(errno)); in wlog_scan_backward()
314 wfile->w_file, offset, strerror(errno)); in wlog_scan_backward()