From 5f97dd2c44662784d63e62862a38ef7164d8758e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Jul 2007 15:28:30 +0000 Subject: Translate all file descriptors received from assuan. --- common/sysutils.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'common/sysutils.h') 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 -- cgit v1.2.3