1 /* This file is part of GDBM, the GNU data base manager.
2 Copyright (C) 2011 Free Software Foundation, Inc.
4 GDBM is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
9 GDBM is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with GDBM. If not, see <http://www.gnu.org/licenses/>. */
20 /* Read exactly SIZE bytes of data into BUFFER. Return value is 0 on
21 success, GDBM_FILE_EOF, if not enough data is available, and
22 GDBM_FILE_READ_ERROR, if a read error occurs. In the latter case
23 errno keeps actual system error code. */
25 _gdbm_full_read (GDBM_FILE dbf, void *buffer, size_t size)
30 ssize_t rdbytes = __read (dbf, ptr, size);
35 return GDBM_FILE_READ_ERROR;
45 /* Write exactly SIZE bytes of data from BUFFER tp DBF. Return 0 on
46 success, and GDBM_FILE_READ_ERROR on error. In the latter case errno
47 will keep actual system error code. */
49 _gdbm_full_write (GDBM_FILE dbf, void *buffer, size_t size)
54 ssize_t wrbytes = __write (dbf, ptr, size);
59 return GDBM_FILE_WRITE_ERROR;
64 return GDBM_FILE_WRITE_ERROR;