From 5ec9ea21a369a5e25fb0fad61535879bba153976 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 22 Oct 2003 20:32:20 +0000 Subject: [PATCH] * external.cc (cygwin_internal): Add CW_GET_ERRNO_FROM_WINERROR handling. * include/cygwin/version.h: Bump API minor number. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_ERRNO_FROM_WINERROR. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/external.cc | 6 ++++++ winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/include/sys/cygwin.h | 3 ++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 94a122f57..4dd246e1d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2003-10-22 Corinna Vinschen + + * external.cc (cygwin_internal): Add CW_GET_ERRNO_FROM_WINERROR + handling. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_GET_ERRNO_FROM_WINERROR. + 2003-10-22 Corinna Vinschen * Makefile.in: Add $(LIBSERVER) rule. diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 49e430518..114a3de7c 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -259,6 +259,12 @@ cygwin_internal (cygwin_getinfo_types t, ...) char *filename = va_arg (arg, char *); return check_ntsec (filename); } + case CW_GET_ERRNO_FROM_WINERROR: + { + int error = va_arg (arg, int); + int deferrno = va_arg (arg, int); + return geterrno_from_win_error (error, deferrno); + } default: return (DWORD) -1; } diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index c4c3c9edb..0e26b0840 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -220,13 +220,14 @@ details. */ 94: Export getopt, getopt_long, optarg, opterr, optind, optopt, optreset, __check_rhosts_file, __rcmd_errstr. 95: Export shmat, shmctl, shmdt, shmget. + 96: CW_GET_ERRNO_FROM_WINERROR addition to external.cc */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 95 +#define CYGWIN_VERSION_API_MINOR 96 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index 36c3f53b1..d2e1a4171 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -72,7 +72,8 @@ typedef enum CW_CYGWIN_PID_TO_WINPID, CW_EXTRACT_DOMAIN_AND_USER, CW_CMDLINE, - CW_CHECK_NTSEC + CW_CHECK_NTSEC, + CW_GET_ERRNO_FROM_WINERROR } cygwin_getinfo_types; #define CW_NEXTPID 0x80000000 /* or with pid to get next one */