From 9bc846bd3d5fc13eb28b4ddece0ecfc52caf898a Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 8 Nov 2000 20:36:37 +0000 Subject: * environ.cc (_addenv): malloc space for setenv if cygwin1.dll is used in conjunction with older binaries. (environ_init): Ditto. * external.cc (get_cygdrive_info): New function. * external.cc (get_cygdrive_prefixes): Change to use get_cygdrive_info but toss the user and system flags. * external.cc (cygwin_internal): Add new CW_GET_CYGDRIVE_INFO case. * path.cc (mount_info::get_cygdrive_prefixes): Remove method. * path.cc (mount_info::get_cygdrive_info): New method. Actually, get_cygdrive_info is really an enhanced version of get_cygdrive_prefixes renamed to get_cygdrive_info that also gets the user and system flags. * shared_info.h (get_cygdrive_prefixes): Remove method. * shared_info.h (get_cygdrive_info): New method. * include/cygwin/version.h: Bump minor API version due to adding CW_GET_CYGDRIVE_INFO to cygwin_internal. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_CYGDRIVE_INFO. --- winsup/cygwin/external.cc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/external.cc') diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 0199aedd3..cf026eb20 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -88,13 +88,24 @@ fillout_pinfo (pid_t pid, int winpid) } static DWORD -get_cygdrive_prefixes (char *user, char *system) +get_cygdrive_info (char *user, char *system, char *user_flags, + char *system_flags) { shared_info *info = cygwin_getshared(); - int res = info->mount.get_cygdrive_prefixes(user, system); + int res = info->mount.get_cygdrive_info (user, system, user_flags, + system_flags); return (res == ERROR_SUCCESS) ? 1 : 0; } +static DWORD +get_cygdrive_prefixes (char *user, char *system) +{ + char user_flags[MAX_PATH]; + char system_flags[MAX_PATH]; + DWORD res = get_cygdrive_info (user, system, user_flags, system_flags); + return res; +} + extern "C" DWORD cygwin_internal (cygwin_getinfo_types t, ...) { @@ -151,6 +162,15 @@ cygwin_internal (cygwin_getinfo_types t, ...) init_exceptions ((exception_list *) arg); return 0; + case CW_GET_CYGDRIVE_INFO: + { + char *user = va_arg (arg, char *); + char *system = va_arg (arg, char *); + char *user_flags = va_arg (arg, char *); + char *system_flags = va_arg (arg, char *); + return get_cygdrive_info (user, system, user_flags, system_flags); + } + default: return (DWORD) -1; } -- cgit v1.2.3