From 93b9103f7383d400616d222606c294e07b16e1aa Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Sat, 1 Mar 2008 18:30:38 +0000 Subject: Import dnbd* from the former openslx-contrib repo as of revision 92. openslx-contrib is currently read only and will get removed in some days. git-svn-id: http://svn.openslx.org/svn/openslx/contrib/dnbd2/trunk@1592 95ad53e4-c205-0410-b2fa-d234c58c8868 --- server/file.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 server/file.h (limited to 'server/file.h') diff --git a/server/file.h b/server/file.h new file mode 100644 index 0000000..720cf9b --- /dev/null +++ b/server/file.h @@ -0,0 +1,28 @@ +/* + * server/file.h - Functions to work with files. + */ + + +/* + * Open a file and test it with stat. + * + * Returns: File descriptor on success or -1 on failure. + */ +int file_open(char *filename); + + +/* + * Store in @size the size in bytes of the file pointed to by @fd. + * + * Returns: 0 on success -1 on failure; + * + */ +int file_getsize(int fd, off_t *size); + + +/* + * Copy @size bytes of @fd, starting at @pos, into @buf. + * + * Returns: 0 on success -1 on failure. + */ +int file_read(int fd, void *buf, size_t size, off_t pos); -- cgit v1.2.3-55-g7522