Commit Graph

6743 Commits

Author SHA1 Message Date
Corinna Vinschen 7b4b41ab3e * cygheap.cc (cwcsdup): New function.
(cwcsdup1): New function.
	* cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR.
	(cwcsdup): Declare.
	(cwcsdup1): Declare.
	* registry.cc (get_registry_hive_path): Use WCHAR instead of char
	throughout.
	(load_registry_hive): Ditto.
	* registry.h (get_registry_hive_path): Change declaration accordingly.
	(load_registry_hive): Ditto.
	* sec_helper.cc (cygpsid::string): New method returning PWCHAR.
	* security.h (cygpsid::string): Declare.
	* syscalls.cc (seteuid32): Convert local name var to WCHAR.
	* uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers
	to WCHAR.  Call sys_wcstombs_alloc to generate puserprof buffer.

	* winsup.h: Fix comment.
	(NT_MAX_PATH): New definition for maximum internal path length.
	Use throughout where appropriate.
	* include/limits.h (PATH_MAX): Set to 4096 as on Linux.
2008-02-14 16:47:11 +00:00
Christopher Faylor 4616253751 * configure.in: Remove non-working options.
* configure: Regenerate.
2008-02-14 00:49:47 +00:00
Christopher Faylor b40597cb2e * syscalls.cc (_isatty): Define as an alias to isatty to override newlib
version.
* thread.cc (pthread_kill): Deal with signal 0 as per POSIX and also avoid
manipulating an invalid thread.
2008-02-13 17:21:05 +00:00
Corinna Vinschen a9414ca6d8 * posix.sgml: Move llrint, llrintf, llrintl, lrintl, rintl, wcstol,
wcstoll, wcstoul, wcstoull, wcsxfrm from unimplemented to implemented
	POSIX interfaces.
	Change headline of "GNU extensions" to "GNU and Linux extensions".
	Add fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, lgetxattr,
	listxattr, llistxattr, lremovexattr, lsetxattr, removexattr, setxattr,
	wcpcpy and wcpncpy to list of implemented GNU functions.
2008-02-13 14:50:39 +00:00
Corinna Vinschen 5cb998e66c * cygtls.cc (_cygtls::init_exception_handler): Revert patch
from 2005-12-02.
        * exceptions.cc (stack_info::walk): Add workaround for NT 5.2
        64 bit OSes.
        * wincap.h (wincaps::has_restricted_stack_args): New element.
        * wincap.cc: Implement above element throughout.
        (wincapc::init): Reset has_restricted_stack_args if not running
        under WOW64.
2008-02-13 09:42:22 +00:00
Chris Sutcliffe 025ce65fcb 2008-02-02 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/specstrings.h (IN, OUT, OPTIONAL): Remove.
  * include/windef.h (IN, OUT, OPTIONAL): Define.
2008-02-12 01:31:52 +00:00
Corinna Vinschen dbc81478fa * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): Remove unused
attr.
	(fhandler_disk_file::fsetxattr): Ditto.
	* include/attr/xattr.h: New file.
2008-02-11 19:03:36 +00:00
Corinna Vinschen 6542ddc3be * dcrt0.cc (dll_crt0_1): Fix typo in call to sys_wcstombs.
* miscfuncs.cc (next_char): Initialize ret to keep gcc happy.
2008-02-11 16:39:06 +00:00
Corinna Vinschen 8eb981a37c Fix ChangeLog entry. 2008-02-10 15:44:12 +00:00
Corinna Vinschen 50450dcc5f * Makefile.in (DLL_OFILES): Add ntea.o.
* cygwin.din (getxattr, listxattr, removexattr, setxattr, lgetxattr,
	llistxattr, lremovexattr, lsetxattr, fgetxattr, flistxattr,
	fremovexattr, fsetxattr): Export Linux extended attribute functions.
	Sort.
	* errno.cc (errmap): Add mappings for ERROR_EAS_DIDNT_FIT,
	ERROR_EAS_NOT_SUPPORTED, ERROR_EA_LIST_INCONSISTENT,
	ERROR_EA_TABLE_FULL, ERROR_FILE_CORRUPT, ERROR_INVALID_EA_NAME.
	* fhandler.h (class fhandler_base): Declare new fgetxattr and
	fsetxattr methods.
	(class fhandler_disk_file): Ditto.
	* fhandler.cc (fhandler_base::fgetxattr): New method.
	(fhandler_base::fsetxattr): New method.
	* fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): New method.
	(fhandler_disk_file::fsetxattr): New method.
	* ntdll.h (STATUS_EA_TOO_LARGE): Define.
	(STATUS_NONEXISTENT_EA_ENTRY): Define.
	(STATUS_NO_EAS_ON_FILE): Define.
	* ntea.cc (read_ea): Rewrite for long pathnames and for using with
	Linux extended attribute functions.
	(write_ea): Ditto.
	(getxattr_worker): New static function.
	(getxattr): New function.
	(lgetxattr): New function.
	(fgetxattr): New function.
	(listxattr): New function.
	(llistxattr): New function.
	(flistxattr): New function.
	(setxattr_worker): New static function.
	(setxattr): New function.
	(lsetxattr): New function.
	(fsetxattr): New function.
	(removexattr): New function.
	(lsetxattr): New function.
	(fsetxattr): New function.
	* security.h (read_ea): Change declaration according to above changes.
	(write_ea): Ditto.
	* include/cygwin/version.h: Bump API minor version.
2008-02-10 15:43:04 +00:00
Corinna Vinschen bebb25961c * libc/ftw.cc (ftw): Allow nfds < 0 for glibc compatibility.
* libc/nftw.c (nftw): Ditto.
2008-02-10 15:19:08 +00:00
Corinna Vinschen 30bd87b827 Fix typo in latest ChangeLog entry. 2008-02-07 20:38:39 +00:00
Corinna Vinschen 4248960e2f * dtable.cc (dtable::init_std_file_from_handle): Set access to
read/write of handle is connected to a tty or console.
	* fhandler_dsp.cc (fhandler_dev_dsp::dup): Set open flags correctly
	after duplicating from archetype.
	* fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
	(fhandler_pty_master::dup): Ditto.
2008-02-07 18:59:40 +00:00
Corinna Vinschen 62688407cb * bsd_helper.cc: Replace %E __small_printf format specifier with %lu
and call to GetLastError throughout.
	* bsd_mutex.cc: Ditto.
	* sysv_sem.cc (semget): Replace %X __small_printf format specifier
	with %llx.
2008-02-06 22:30:38 +00:00
Corinna Vinschen 93591f4200 * miscfuncs.cc (next_char): Fix typos in comment.
* strfuncs.cc: Remove cygserver guards.
2008-02-06 22:04:16 +00:00
Corinna Vinschen fb7331e34c Remove dependency from Cygwin internal code.
* Makefile.in (CYGWIN_OBJS): Remove smallprint.o.
	(cygserver.exe): Remove strfuncs.o
	(strfuncs.o): Drop rule.
	* bsd_log.cc (_vlog): Use snprintf/vsnprintf instead of
	__small_sprintf/__small_vsprintf.
	* sysv_sem.cc (seminit): Use sys_malloc instead of malloc.  Use
	snprintf instead of __small_sprintf.
	(semunload): Free the above allocated sema_mtx names here.
2008-02-06 22:01:30 +00:00
Corinna Vinschen 4b65f19045 * fhandler.h (fhandler_console::trunc_buf): Add to use as cache for
truncated multibyte characters on input.
	(fhandler_console::write_replacement_char): Declare new method.
	* fhandler_console.cc (CONVERT_LIMIT): Raise to 64K.
	(fhandler_console::fhandler_console): Initialize trunc_buf.
	(ERR): Define as independent value again.
	(fhandler_console::write_replacement_char): New method to print
	replacement chars.
	(fhandler_console::write_normal): Add handling for truncated multibyte
	sequences.  Call next_char instead of pathetic CharNextExA function.
	Don't change src, rather just work with found later on.
	* miscfuncs.cc (is_cp_multibyte): Move here from strfuncs.cc.
	Don't call Windows function, restrict to well-known ANSI/OEM codepages
	and UTF-8.
	(next_char): Call CharNextExA only for doublebyte codepages.
	Implement for UTF-8 here.
	* strfuncs.cc (is_cp_multibyte): Move to miscfuncs.cc.
	* winsup.h (next_char): Declare.
	* include/limits.h (MB_LEN_MAX): Set to maximum value of MB_CUR_MAX
	as defined by newlib for now.
2008-02-06 18:24:50 +00:00
Corinna Vinschen a7197550f3 * autoload.cc (CharToOemA): Remove.
(CharNextExA): Define.
	* environ.cc (codepage_init): Un-static.  Set active_codepage to
	active codepage.  Default to ansi regardless of buf pointer.
	* fhandler.h (dev_console::get_console_cp): New method.
	(dev_console::con_to_str): Change declaration according to new
	implementation.
	(dev_console::str_to_con): Ditto.
	* fhandler_console.cc (cp_convert): Remove.
	(dev_console::con_to_str): Redefine to take WCHAR as incoming console
	char.
	(dev_console::get_console_cp): Return correct codepage according to
	alternate_charset_active setting.
	(dev_console::str_to_con): Redefine to create WCHAR buffer for console
	output.
	(fhandler_console::read): Read console input as WCHARs.
	(base_chars): Fix typo in comment.
	(fhandler_console::char_command): Save and restore console output
	buffer using UNICODE functions.
	(fhandler_console::write_normal): Convert to write output in UNICODE.
	Use CharNextExA to recognize multibyte characters in input.  Workaround
	problem with UTF-8 and MultiByteToWideChar.  Simplify the loop for
	printing "normal" characters.
	* strfuncs.cc (active_codepage): New variable to store active codepage.
	(get_cp): Call codepage_init() if active_codepage is uninitialized.
	Just return active_codepage.
	(is_cp_multibyte): New function.
	* winsup.h (active_codepage): Declare.
	(codepage_init): Declare.
	(is_cp_multibyte): Declare.
2008-02-05 17:37:10 +00:00
Corinna Vinschen 5556c6209f * Makefile.in: Don't link strfuncs.o from the Cygwin build dir.
Build it again with __OUTSIDE_CYGWIN__ defined.
2008-02-04 12:02:26 +00:00
Corinna Vinschen 340e2fa504 * smallprint.cc (__small_vsprintf): Use HEAP_NOTHEAP for type.
* strfuncs.cc (sys_wcstombs_alloc): Guard use of ccalloc
	to !__OUTSIDE_CYGWIN__ for use in cygserver.
	(sys_mbstowcs_alloc): Ditto.
2008-02-04 12:00:19 +00:00
Chris Sutcliffe 4df557d94a 2008-02-01 Brian Dessent <brian@dessent.net>
* Makefile.in: Add rules to generate multiple versions of libmoldname.a for
        the different runtime versions.
2008-02-02 14:14:49 +00:00
Chris Sutcliffe efab44e052 2008-02-02 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/specstrings.h: new file, move pseudo modifiers from windef.h.
        * include/windef.h (__in, __inout, __in_opt, __in_bcound, __in_ecount,
        __out, __out_ecount_part, __struct_bcount, __field_ecount_opt,
        __out_bcount_opt): Move to specstrings.h.
2008-02-02 13:19:23 +00:00
Corinna Vinschen 301d14d242 * miscfuncs.cc (cygwin_wcsncasecmp): Never access more than n
characters.
	(cygwin_strncasecmp): Ditto.  Fix for strings longer than n.
2008-02-01 13:11:57 +00:00
Corinna Vinschen c69d873f31 * string.h: Re-enable inline strcasematch and strncasematch
implementations and rename to ascii_strcasematch/ascii_strncasematch.
	* dcrt0.cc: Replace str[n]casematch with ascii_str[n]casematch where
	applicable.
	* environ.cc: Ditto.
	* fhandler_process.cc: Ditto.
	* hookapi.cc: Ditto.
	* path.cc: Ditto.
	* spawn.cc: Ditto.
	* strace.cc: Ditto.
	* syscalls.cc: Ditto.
	* uinfo.cc: Ditto.
	* winf.cc: Ditto.
2008-02-01 12:37:51 +00:00
Corinna Vinschen 1597484cb5 * dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to current
codepage.
	* environ.cc (set_file_api_mode): Always set file api to ANSI if not
	using the OEM codepage.
	(codepage_init): Allow "utf8" codepage.
	* fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and
	cast as needed.  Always convert input to wide char and write
	CF_UNICODETEXT to clipboard.
	(fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and
	convert to current codepage if CYGWIN_NATIVE format is not available.
	* fhandler_console.cc: Drop redundant undef.
	* smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING
	to current codepage for printing.
	* strfuncs.cc: Use PWCHAR throughout.
	(get_cp): Return CP_UTF8 for utf8_cp codepage setting.
	(sys_wcstombs): Allow NULL target buffer.
	(sys_wcstombs_alloc): New function.
	(sys_mbstowcs_alloc): Ditto.
	* winsup.h (codepage_type): Add utf8_cp.
	(HEAP_NOTHEAP): Define.
	(sys_wcstombs_alloc): Declare.
	(sys_mbstowcs_alloc): Declare.
2008-01-31 20:26:01 +00:00
Corinna Vinschen 8e87af7ed0 * cygheap.h (struct cwdstuff): Add dir member to store cwd handle.
(cwdstuff::get_handle): New method.
	* path.cc (cwdstuff::set): When doit is true, always try to get
	directory handle.  Fail if duplicating handle fails.  Store handle
	in dir.  Fix potential SEGV when setting drive_length.
2008-01-31 14:18:49 +00:00
Brandon Sneed 341b9607bd 2008-01-30 Brandon Sneed <nivenh@sourceware.org>
* lib/bthprops.def: new file, bluetooth imports.
2008-01-30 09:39:16 +00:00
Brandon Sneed 051085cfd4 2008-01-30 Brandon Sneed <nivenh@sourceware.org>
* include/windef.h (__in, __inout, __in_opt, __in_bcound, __in_ecount,
	__out, __out_ecount_part, __struct_bcount, __field_ecount_opt,
	__out_bcount_opt): Defined additional pseudo-modifiers.
2008-01-30 09:18:22 +00:00
Brandon Sneed 2815ad8faf 2008-01-29 Brandon Sneed <nivenh@sourceware.org>
* include/ras.h (RAS_MaxDnsSuffix): corrected typo, was RAX_MaxDnsSuffix.
	(RASENTRYA, RASENTRYW): Added members (dwfOptions2, dwfOptions3, szDnsSuffix,
	dwTcpWindowSize, szPrerequisitePbk, szPrerequisiteEntry, dwRedialCount,
	dwRedialPause.
2008-01-30 00:47:35 +00:00
Brandon Sneed e917b0bc44 2008-01-29 Brandon Sneed <nivenh@sourceware.org>
* include/winnt.h (SYSTEM_POWER_CONDITION): typedef.
	* include/winuser.h (PBT_POWERSETTINGCHANGE, DEVICE_NOTIFY_WINDOW_HANDLE,
	DEVICE_NOTIFY_SERVICE_HANDLE): define.
	* include/winuser.h (LPCGUID, HPOWERNOTIFY, POWERBROADCAST_SETTING): typedefs.
	* include/winuser.h (GUID_POWERSCHEME_PERSONALITY, GUID_MIN_POWER_SAVINGS,
	GUID_MAX_POWER_SAVINGS, GUID_TYPICAL_POWER_SAVINGS, GUID_ACDC_POWER_SOURCE,
	GUID_BATTERY_PERCENTAGE_REMAINING, GUID_IDLE_BACKGROUND_TASK,
	GUID_SYSTEM_AWAYMODE, GUID_MONITOR_POWER_ON): added externs for GUIDs.
	* include/winuser.h (RegisterPowerSettingNotification,
	UnregisterPowerSettingNotification): Add prototypes.
	* lib/user32.def: Added imports for the above prototypes.
	* lib/Makefile.in: Added build support for power-uuid.c.
	* lib/power-uuid.c: New file containing power GUID definitions.
2008-01-29 21:18:49 +00:00
Brandon Sneed 458430dc16 * include/ras.h (RAS_MaxDnsSuffix): define. 2008-01-29 20:40:32 +00:00
Brandon Sneed 249d08dc1d Added new PSAPI defines and exports 2008-01-29 20:34:43 +00:00
Corinna Vinschen cb8686370b * path.cc: Fix Samba version in comment. 2008-01-28 12:19:30 +00:00
Corinna Vinschen ca74821574 * path.cc (fs_info::update): Fix old-style Samba test to support
recent as well as upcoming Samba releases.
2008-01-24 17:29:29 +00:00
Corinna Vinschen 4a96b0aa85 * ntdll.h (struct _FILE_FS_OBJECTID_INFORMATION): Define.
* path.cc (struct smb_extended_info): Define.
	(fs_info::update): Request object id info to get Samba information.
	Set flags according to new implementation.
	* path.h (struct fs_info): Add samba_version to status_flags.
	Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG.
2008-01-22 17:43:22 +00:00
Corinna Vinschen 755f6f8f65 * fhandler_disk_file.cc (fhandler_disk_file::link): Open file with
READ_CONTROL for Vista/Longhorn's sake.
2008-01-21 14:51:55 +00:00
Corinna Vinschen ebe9d9b2ea * Makefile.in (install-libs): Overwrite newlib's libg.a with symlink
to libcygwin.a.
2008-01-15 17:42:10 +00:00
Corinna Vinschen 8b5f4dbabc * Makefile.in (DLL_OFILES): Remove memmem.o.
* memmem.cc: Remove in favor of newlib implementation.
2008-01-15 13:45:42 +00:00
Corinna Vinschen 2652ae1036 * cygcheck.cc (dump_sysinfo): Always try to get a OSVERSIONINFOEX
first.  Load kernel32.dll earlier.  Make osname a buffer.  Simplify
	Non-NT code.  Use GetProductInfo in Vista/2008 case.  Clean up
	non-Vista version info.  Exit early if not on NT.
2008-01-13 13:41:45 +00:00
Corinna Vinschen 094f2e6fca * fhandler.h: Update copyright.
* include/limits.h: Ditto.
2008-01-07 16:51:54 +00:00
Christopher Faylor 43fb5c93b1 * fhandler.h (fhandler_base::is_tty): Make bool.
(fhandler_serial::is_tty): Ditto.
(fhandler_termios::is_tty): Ditto.
(fhandler_base::is_slow): Return bool value.
(fhandler_socket::is_slow): Ditto.
(fhandler_serial::is_slow): Ditto.
(fhandler_console::is_slow): Ditto.
(fhandler_tty_common::is_slow): Ditto.
(fhandler_tty_master::is_slow): Ditto.
(fhandler_dev_null::is_slow): Ditto.
2008-01-06 18:37:20 +00:00
Christopher Faylor eaf70af08a * include/limits.h (TTY_NAME_MAX): Increase size to same as linux to allow for
(at least) null terminating byte for "/dev/console".
2008-01-06 18:31:35 +00:00
Christopher Faylor e1ab5e688c * tty.cc: Update copyright.
* pipe.cc: Ditto.
2008-01-01 19:07:36 +00:00
Christopher Faylor 8528ecbde8 * newsym: First stab at understanding data as well as functions.
* pipe.cc (fhandler_pipe::init): Move more intelligence here.
(fhandler_pipe::create): Simplify based on above change.

* tty.cc (tty_list::allocate): Remove non-NT code.
2008-01-01 18:51:23 +00:00
Dave Korn b918632a2a * cygwin.din (_f_llrint, _f_llrintf, _f_llrintl, _f_lrint, _f_lrintf,
_f_lrintl, _f_rint, _f_rintf, _f_rintl):  Export fast *rint* functions.
	(lrint, lrintf, rint, rintf):  Redirect exports to alias _f_ versions.
	(llrint, llrintf, llrintl, lrintl, rintl):  Add exports aliasing _f_*
	versions likewise.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR):  Bump.
2007-12-30 21:12:08 +00:00
Dave Korn 9c4d008ca5 * bloda.cc (enum bad_app): Add BYTEMOBILE.
(dodgy_app_detects[]):  Add FILENAME entry to detect bmnet.dll.
	(big_list_of_dodgy_apps[]):  Add description for BYTEMOBILE.
2007-12-29 19:26:56 +00:00
Dave Korn e1e00b3373 * faq-using.xml (faq.using.bloda): New entry.
(faq.using.firewall, faq.using.anti-virus):  Link to faq.using.bloda.
	* faq-setup.xml (faq.setup.hang):  Likewise link to faq.using.bloda.
2007-12-29 18:20:13 +00:00
Chris Sutcliffe 87b42b7738 2007-12-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/_mingw.h: Increment version to 3.14.
2007-12-28 00:33:04 +00:00
Chris Sutcliffe 533209165e 2007-12-27 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/w32api.h: Increment version to 3.11.
        * Makefile.in: Ditto.
2007-12-28 00:32:27 +00:00
Corinna Vinschen 04cb518d64 * fhandler.h (class fhandler_dev_random): Add dummy_offset member.
* fhandler_random.cc (fhandler_dev_random::lseek): Fake seeking
	capability as on Linux.
2007-12-22 13:26:47 +00:00