summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-02-13 21:35:07 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:09:13 +0200
commit7e33c4f58264b404630fdb8c47780a6fc67671b6 (patch)
tree876d3b0e1389e480a24c0ec5a84216924e57c1a1 /gettext-tools
parent0f6d226d4b8f633d84d5559511db0883a7fa4d4d (diff)
downloadexternal_gettext-7e33c4f58264b404630fdb8c47780a6fc67671b6.zip
external_gettext-7e33c4f58264b404630fdb8c47780a6fc67671b6.tar.gz
external_gettext-7e33c4f58264b404630fdb8c47780a6fc67671b6.tar.bz2
Move lib/safe-read.h to gettext-tools/lib/safe-read.h.
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/lib/safe-read.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gettext-tools/lib/safe-read.h b/gettext-tools/lib/safe-read.h
new file mode 100644
index 0000000..cbe6e0b
--- /dev/null
+++ b/gettext-tools/lib/safe-read.h
@@ -0,0 +1,25 @@
+/* An interface to read() that retries after interrupts.
+ Copyright (C) 2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include <stddef.h>
+
+#define SAFE_READ_ERROR ((size_t) -1)
+
+/* Read up to COUNT bytes at BUF from descriptor FD, retrying if interrupted.
+ Return the actual number of bytes read, zero for EOF, or SAFE_READ_ERROR
+ upon error. */
+extern size_t safe_read (int fd, void *buf, size_t count);