2 * Bacula low level File I/O routines. This routine simulates
3 * open(), read(), write(), and close(), but using native routines.
4 * I.e. on Windows, we use Windows APIs.
6 * Kern Sibbald, April MMIII
12 Copyright (C) 2000-2003 Kern Sibbald and John Walker
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License as
16 published by the Free Software Foundation; either version 2 of
17 the License, or (at your option) any later version.
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
24 You should have received a copy of the GNU General Public
25 License along with this program; if not, write to the Free
26 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
35 void binit(BFILE *bfd)
40 int bopen(BFILE *bfd, const char *pathname, int flags, mode_t mode)
42 return bfd->fid = open(pathname, flags, mode);
45 int bclose(BFILE *bfd)
47 int stat = close(bfd->fid);
52 ssize_t bread(BFILE *bfd, void *buf, size_t count)
54 return read(bfd->fid, buf, count);
57 ssize_t bwrite(BFILE *bfd, void *buf, size_t count)
59 return write(bfd->fid, buf, count);
62 int is_bopen(BFILE *bfd)
67 off_t blseek(BFILE *bfd, off_t offset, int whence)
69 return lseek(bfd->fid, offset, whence);