From 590ad4793f9da405614e83710db7f426a8a3bc5e Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 18 Aug 2010 19:15:37 +0000 Subject: [PATCH] * external.cc (CW_SETCWD): New option. * include/cygwin/version.h: Bump api minor to 231. * include/sys/cygwin.h (CW_SETCWD): Define. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/external.cc | 6 ++++++ winsup/cygwin/include/cygwin/version.h | 3 ++- winsup/cygwin/include/sys/cygwin.h | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5bca572b7..547f0b139 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2010-08-18 Christopher Faylor + + * external.cc (CW_SETCWD): New option. + * include/cygwin/version.h: Bump api minor to 231. + * include/sys/cygwin.h (CW_SETCWD): Define. + 2010-08-18 Corinna Vinschen * syscalls.cc (rename): Fix renaming file-based devices. diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index e01c9fea6..53ce5b1b8 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -515,6 +515,12 @@ cygwin_internal (cygwin_getinfo_types t, ...) } break; + case CW_SETCWD: + { + cygheap->cwd.cwd_lock.acquire (); + PWCHAR cwd = cygheap->cwd.win32.Buffer; + res = !SetCurrentDirectoryW (cwd); + } default: set_errno (ENOSYS); } diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 6a28b7bf6..9b885d580 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -390,12 +390,13 @@ details. */ 228: CW_STRERROR added. 229: Add mkostemp, mkostemps. 230: Add CLOCK_MONOTONIC. + 231: CW_SETCWD */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 230 +#define CYGWIN_VERSION_API_MINOR 231 /* 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 d6df27df9..158fa0db1 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -149,7 +149,8 @@ typedef enum CW_INT_SETLOCALE, CW_CVT_MNT_OPTS, CW_LST_MNT_OPTS, - CW_STRERROR + CW_STRERROR, + CW_SETCWD } cygwin_getinfo_types; /* Token type for CW_SET_EXTERNAL_TOKEN */