Blame lib/utils_io.h

Packit Service a9384c
/*
Packit Service a9384c
 * utils - miscellaneous I/O utilities for cryptsetup
Packit Service a9384c
 *
Packit Service a9384c
 * Copyright (C) 2004 Jana Saout <jana@saout.de>
Packit Service a9384c
 * Copyright (C) 2004-2007 Clemens Fruhwirth <clemens@endorphin.org>
Packit Service a9384c
 * Copyright (C) 2009-2020 Red Hat, Inc. All rights reserved.
Packit Service a9384c
 * Copyright (C) 2009-2020 Milan Broz
Packit Service a9384c
 *
Packit Service a9384c
 * This program is free software; you can redistribute it and/or
Packit Service a9384c
 * modify it under the terms of the GNU General Public License
Packit Service a9384c
 * as published by the Free Software Foundation; either version 2
Packit Service a9384c
 * of the License, or (at your option) any later version.
Packit Service a9384c
 *
Packit Service a9384c
 * This program is distributed in the hope that it will be useful,
Packit Service a9384c
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a9384c
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service a9384c
 * GNU General Public License for more details.
Packit Service a9384c
 *
Packit Service a9384c
 * You should have received a copy of the GNU General Public License
Packit Service a9384c
 * along with this program; if not, write to the Free Software
Packit Service a9384c
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Packit Service a9384c
 */
Packit Service a9384c
Packit Service a9384c
#ifndef _CRYPTSETUP_UTILS_IO_H
Packit Service a9384c
#define _CRYPTSETUP_UTILS_IO_H
Packit Service a9384c
Packit Service a9384c
#include <sys/types.h>
Packit Service a9384c
Packit Service a9384c
ssize_t read_buffer(int fd, void *buf, size_t length);
Packit Service a9384c
ssize_t read_buffer_intr(int fd, void *buf, size_t length, volatile int *quit);
Packit Service a9384c
ssize_t write_buffer(int fd, const void *buf, size_t length);
Packit Service a9384c
ssize_t write_buffer_intr(int fd, const void *buf, size_t length, volatile int *quit);
Packit Service a9384c
ssize_t write_blockwise(int fd, size_t bsize, size_t alignment,
Packit Service a9384c
			void *orig_buf, size_t length);
Packit Service a9384c
ssize_t read_blockwise(int fd, size_t bsize, size_t alignment,
Packit Service a9384c
		       void *orig_buf, size_t length);
Packit Service a9384c
ssize_t write_lseek_blockwise(int fd, size_t bsize, size_t alignment,
Packit Service a9384c
			      void *buf, size_t length, off_t offset);
Packit Service a9384c
ssize_t read_lseek_blockwise(int fd, size_t bsize, size_t alignment,
Packit Service a9384c
			     void *buf, size_t length, off_t offset);
Packit Service a9384c
Packit Service a9384c
#endif