summaryrefslogtreecommitdiffstats
path: root/common/sysutils.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-07-12 17:28:30 +0200
committerWerner Koch <wk@gnupg.org>2007-07-12 17:28:30 +0200
commit5f97dd2c44662784d63e62862a38ef7164d8758e (patch)
treec5db7a48d285d1d67c6b21d97f35f30d2058595e /common/sysutils.h
parentTypo fixes. (diff)
downloadgnupg2-5f97dd2c44662784d63e62862a38ef7164d8758e.tar.xz
gnupg2-5f97dd2c44662784d63e62862a38ef7164d8758e.zip
Translate all file descriptors received from assuan.
Diffstat (limited to 'common/sysutils.h')
-rw-r--r--common/sysutils.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/common/sysutils.h b/common/sysutils.h
index cc7a50d03..42bf58b9c 100644
--- a/common/sysutils.h
+++ b/common/sysutils.h
@@ -20,13 +20,28 @@
#ifndef GNUPG_COMMON_SYSUTILS_H
#define GNUPG_COMMON_SYSUTILS_H
+/* Because we use system handles and not libc low level file
+ descriptors on W32, we need to declare them as HANDLE (which
+ actually is a plain pointer). This is required to eventually
+ support 64 bits Windows systems. */
+#ifdef HAVE_W32_SYSTEM
+typedef void *gnupg_fd_t;
+#define GNUPG_INVALID_FD ((void*)(-1))
+#else
+typedef int gnupg_fd_t;
+#define GNUPG_INVALID_FD (-1)
+#endif
+
+
void trap_unaligned (void);
int disable_core_dumps (void);
int enable_core_dumps (void);
const unsigned char *get_session_marker (size_t *rlen);
/*int check_permissions (const char *path,int extension,int checkonly);*/
void gnupg_sleep (unsigned int seconds);
-int translate_sys2libc_fd (int fd, int for_write);
+int translate_sys2libc_fd (gnupg_fd_t fd, int for_write);
+int translate_sys2libc_fd_int (int fd, int for_write);
+
#ifdef HAVE_W32_SYSTEM