Commit Graph

5813 Commits

Author SHA1 Message Date
Corinna Vinschen 7ab59dee94 * fhandler_disk_file.cc (DIR_NUM_ENTRIES): New define determining
minimum number of dir entries which fit into the readdir cache.
	(DIR_BUF_SIZE): Define globally as size of readdir cache.
	(struct __DIR_cache): New structure used for readdir caching on NT.
	(d_dirname): Accessor for struct __DIR_cache, use throughout.
	(d_pos): Ditto.
	(d_cache): Ditto.
	(fhandler_disk_file::opendir): Allocate __d_dirname to contain readdir
	cache on NT.
	(fhandler_disk_file::readdir): Use buf as pointer into readdir cache.
	Implement readdir caching.
2006-01-28 13:41:22 +00:00
Corinna Vinschen fa3ffdd01a * include/sys/dirent.h (struct dirent): Revert misguided attempt to
rename __d_unused1 to __d_fd.
2006-01-28 10:34:11 +00:00
Joshua Daniel Franklin acfdfc9ffb Move cocom to the build requirements. 2006-01-28 02:12:32 +00:00
Corinna Vinschen 9e5f45ed6f * autoload.cc (NtQueryDirectoryFile): Define.
* dir.cc (__opendir_with_d_ino): Just call opendir.
	(opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling.
	(readdir_worker): Only try generating d_ino if it's 0.
	Utilize namehash of directories fhandler.  Call readdir_get_ino to
	generate d_ino for "..".
	(seekdir64): Keep dirent_set_d_ino flag.
	* fhandler.h (enum dirent_states): Add dirent_get_d_ino.
	(class fhandler_disk_file): Declare new private methods readdir_helper
	and readdir_9x.
	* fhandler_disk_file.cc (path_conv::hasgood_inode): New method to
	evaluate if a filesystem has reliable inode numbers.
	(fhandler_base::fstat_by_handle): Accomodate structure member name
	change from IndexNumber to FileId.
	(fhandler_base::fstat_helper): Call hasgood_inode here.
	(fhandler_disk_file::opendir): Call fhaccess only for real files.
	Don't append '*' to __d_dirname here, move to readdir_9x.  On NT,
	open directory handle here.  Set dirent_get_d_ino and dirent_set_d_ino
	flags according to wincap and filesystem.
	(fhandler_disk_file::readdir_helper): New method to implement readdir
	postprocessing only once.
	(readdir_get_ino_by_handle): New static function.
	(readdir_get_ino): New function to centralize inode number evaluation
	in case inode number hasn't been returned by NtQueryDirectoryFile.
	(fhandler_disk_file::readdir): Move old functionality to readdir_9x.
	Call readdir_9x when on 9x/Me.  Implement NT specific readdir here.
	(fhandler_disk_file::readdir_9x): Move 9x specific readdir here.
	(fhandler_disk_file::seekdir): Accomodate new NT readdir method.
	(fhandler_disk_file::closedir): Ditto.
	(fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment.
	(fhandler_cygdrive::opendir): Call get_namehash to prepare later
	correct evaluation of d_ino.
	(fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate
	drive's d_ino by calling readdir_get_ino.
	* fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and
	dirent_saw_dot_dot to avoid seeing . and .. entries twice.
	* fhandler_process.cc (fhandler_process::readdir): Ditto.
	* fhandler_registry.cc (fhandler_registry::readdir): Ditto.
	* ntdll.h (STATUS_INVALID_PARAMETER): New define.
	(STATUS_INVALID_LEVEL): New define.
	(struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to
	FileId (as in Nebbitt).
	* path.h (path_conv::hasgood_inode): Now implemented in
	fhandler_disk_file.cc.
	* wincap.h (wincaps::has_fileid_dirinfo): New element.
	* wincap.cc: Implement above element throughout.
	* winsup.h (readdir_get_ino): Add declaration.
	* include/sys/dirent.h (struct dirent): Slightly rename structure
	members to accomodate changes.
	Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of
	__opendir_with_d_ino.
2006-01-27 21:50:42 +00:00
Christopher Faylor e7a9c71d62 * spawn.cc (spawn_guts): Fix potential handle leak when failing exec. 2006-01-27 06:08:05 +00:00
Christopher Faylor e1bfb483ea * exceptions.cc (inside_kernel): Fix to return true if we can't get the name of
the DLL for the given memory block since we are not in kernel code.
2006-01-27 06:06:06 +00:00
Joshua Daniel Franklin 90c01ac9df Add top-level README 2006-01-27 05:37:13 +00:00
Joshua Daniel Franklin aba373611c * faq-programming.xml (faq.programming.ipc): Add new FAQ about
cygserver and its relation to the "Bad system call" error.
* faq-setup.xml (faq.setup.uninstall-all): Mention postgresql.
* overview2.sgml: Update security info on shared memory.
2006-01-27 04:52:16 +00:00
Corinna Vinschen 50a7955aa6 * fhandler.cc (fhandler_base::open): Fix bug in argument order to
InitializeObjectAttributes call.
2006-01-26 16:58:53 +00:00
Joshua Daniel Franklin 2ceb32d95a * faq-programming.xml (faq.programming.building-cygwin): Add
list of packages required for building and exact check instructions.
* faq-setup.xml (faq.setup.uninstall-service): New instructions
on uninstalling a cygwin service.
(faq.setup.uninstall-all): Reference new service uninstall FAQ.
2006-01-26 04:39:04 +00:00
Christopher Faylor 4207eed323 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix test for
dirent_isroot to use the correct boolean operator.
2006-01-26 02:54:54 +00:00
Danny Smith c40776e5a2 * include/winnt.h (DECLSPEC_SELECTANY): Define. 2006-01-26 01:55:39 +00:00
Danny Smith a62ec6b340 2006-01-25 Filip Navara <xnavara@volny.cz>
* include/winnt.h (DECLSPEC_ALIGN): Define.
2006-01-26 01:22:07 +00:00
Corinna Vinschen 6fbc5c2a9b * faq-setup.xml (faq.setup.snapshots): Rename DLL using Windows tools. 2006-01-25 10:57:19 +00:00
Christopher Faylor 742e27bed8 * ntdll.h: (temporarily?) Add more functions for querying directory. 2006-01-25 05:57:20 +00:00
Christopher Faylor aac74926dd * dir.cc (readdir_worker): Turn off expensive inode calculation. 2006-01-24 19:03:20 +00:00
Corinna Vinschen 4aac2d2709 * fhandler_process.cc (fhandler_process::fill_filebuf): Disable
stripping the .exe suffix from the link target in PROCESS_EXE and
	PROCESS_EXENAME case.
	* path.cc (realpath): Tack on .exe suffix if necessary.
2006-01-24 17:40:55 +00:00
Corinna Vinschen 26d27a276f * fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder
to determine remote file systems with reliable inode numbers.  Add
	longish comment.
2006-01-24 12:32:33 +00:00
Danny Smith 3784b87b32 * include/commctrl.h: Correct spelling of 'compatibility' in
comments.
	* include/setupapi.h: Likewise.
	* include/ws2tcpip.h: Likewise.
2006-01-24 02:19:28 +00:00
Danny Smith e5e6a33128 2006-01-24 Danny Smith <dannysmith@users.sourceforge.net>
* include/ddk/winddk.h (KeGetCurrentKPCR): Support -masm=intel.

2006-01-24  Jiri Malak  <Jiri.Malak@iol.cz>

	WATCOM compatibility changes.
	* include/ddk/ntddk.h (DECL_IMPORT): Define using __declspec,
	rather than __attribute__.
	(DECL_EXPORT): Likewise.
	* include/ddk/winddk.h (DDKAPI): Avoid using __attribute__.
	(DDKFASTAPI): Likewise.
	(DDKCDECLAPI): Likwise.
	(KeGetCurrentKPCR): Provide __WATCOMC__ syntax for inline code.
2006-01-24 01:02:31 +00:00
Corinna Vinschen 543c43d84d * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Reset
inheritance for duplicated socket.
2006-01-23 15:10:57 +00:00
Danny Smith cfd86743ff 2006-01-23 Brandon Sneed <brandon@redf.net>
* setupapi.def: Add all CM_* functions defined in ddk/cfgmgr32.h
	to exports.
2006-01-23 08:10:32 +00:00
Christopher Faylor d96d3ec910 . 2006-01-21 04:41:57 +00:00
Christopher Faylor 868fb2ff69 * include/cygwin/version.h: Bump API minor number to 151.
* dir.cc (__opendir_with_d_ino): New function.
(opendir): Set flag if we should be calculating inodes.
(readdir_worker): Calculate d_ino by calling stat if the user has asked for it.
(seekdir64): Maintain all persistent flag settings.
* fhandler.h (dirent_states): Add dirent_set_d_ino.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes to
dirent structure.
* fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
* include/sys/dirent.h (struct dirent): Coalesce two similar structures.
Remove all threads of the apparently highly confusing references to inodes.
Add support for calculating a real inode if __USE_EXPENSIVE_CYGWIN_D_INO is
defined.
2006-01-21 02:24:17 +00:00
Christopher Faylor 90e1ee2b25 * include/sys/dirent.h: Add comments for people who are REALLY confused about
whether they should be using something called __invalid_d_ino or not.
2006-01-20 16:04:40 +00:00
Corinna Vinschen 1ef48340d5 * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output.
(fhandler_socket::release): Add debug output for WSAEventSelect failure.
	(fhandler_socket::ioctl): Always cancel WSAEventSelect before switching
	to blocking mode.  Only set nonblocking flag if ioctlsocket call
	succeeded.  Only print new socket state if ioctlsocket call succeeded.
2006-01-20 10:22:38 +00:00
Christopher Faylor 3c09c0fb25 * cygcheck.cc (common_paths): Add "patch". 2006-01-19 21:16:38 +00:00
Christopher Faylor 101b3cb01a * cygcheck.cc (init_paths): Record first_nonsys_path.
(find_on_path): Start on first nonsys path when !search_sysdirs.
2006-01-19 20:17:11 +00:00
Christopher Faylor ecd4fba273 white space 2006-01-19 18:57:41 +00:00
Christopher Faylor 7b55b34c5e * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check posix path for
root rather than windows path.
2006-01-19 18:55:07 +00:00
Christopher Faylor 9025f2aa7d * dir.cc (readdir_worker): Fill in invalid fields with -1. Accommodate name
change from __ino32 to __invalid_ino32.
* include/sys/dirent.h (__invalid_ino32): Rename from __ino32.  Don't define
unused d_type macros.
2006-01-19 05:34:39 +00:00
Joshua Daniel Franklin 96f5988e31 Remove references to and files from old texinfo FAQ. 2006-01-19 02:44:17 +00:00
Chris Sutcliffe 79e60dfa66 2006-01-18 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* Makefile.in: Bump cygwin build number.
2006-01-19 00:32:21 +00:00
Christopher Faylor d0236d66d9 * heap.cc (heap_init): Remove Sleep. 2006-01-18 20:40:52 +00:00
Corinna Vinschen 339306c5ec * net.cc (rresvport): Remove extern declaration. 2006-01-18 18:37:35 +00:00
Corinna Vinschen 06a5dd435e * autoload.cc (rresvport): Remove.
* net.cc (last_used_rrecvport): New global shared variable.
	(cygwin_rresvport): Implement rresvport without using rresvport from
	wsock32.
2006-01-18 18:24:33 +00:00
Christopher Faylor 25ef7a93b6 Wasn't going to check this in but since it did get checked in, here's a ChangeLog. 2006-01-18 16:11:53 +00:00
Christopher Faylor 14a4d5989a bad_keywords 2006-01-18 15:57:56 +00:00
Corinna Vinschen 3b5d71b3a2 * include/cygwin/socket.h (struct sockaddr_storage): Fix typo in
ss_family member name.
2006-01-18 15:37:23 +00:00
Dave Korn 79f24ec37d * cygpath.cc (dowin): Remove stray debugging printf statement. 2006-01-18 12:34:59 +00:00
Chris Sutcliffe 7c9feabf98 2006-01-17 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/w32api.h: Increment version to 3.6.
        * Makefile.in: Ditto.
2006-01-17 18:56:12 +00:00
Christopher Faylor 4d7c0b51bf copyright 2006-01-17 15:37:13 +00:00
Corinna Vinschen 3d7e89f8a2 * Makefile.in: Replace etcdir with sysconfdir. 2006-01-17 12:33:46 +00:00
Christopher Faylor 05ee4328f2 * include/cygwin/version.h: Bump DLL minor version number to 20. 2006-01-17 03:49:04 +00:00
Christopher Faylor 6ac6bb392a fix minor typo 2006-01-16 19:52:21 +00:00
Corinna Vinschen 95dc88409d * configure.in: Add AC_PROG_INSTALL handling.
* configure: Regenerate.
	* Makefile.in (install): Install CYGWIN_LICENSE.
2006-01-16 17:48:36 +00:00
Corinna Vinschen d0f3c2dd3b * CYGWIN_LICENSE: Fix contact information. 2006-01-16 14:57:34 +00:00
Corinna Vinschen 8581551218 * Makefile.in (cygcheck.exe): Do not link against libwininet.a.
* cygcheck.cc (pInternetCloseHandle): Define global function pointer.
	(display_internet_error): Use it.
	(package_grep): Attempt to load wininet.dll at runtime.  Call WinInet
	API through function pointers throughout.
2006-01-15 09:29:02 +00:00
Corinna Vinschen 053d5eed93 * cygcheck.cc (dump_sysinfo): Convert k32 to HMODULE. 2006-01-13 15:36:29 +00:00
Corinna Vinschen 71f98c4caa * uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname
member to see when running under WOW64.
2006-01-13 14:00:10 +00:00
Corinna Vinschen 67066cabad * cygcheck.cc (dump_sysinfo): Convert osname to const and remove casts
in subsequent assignments.  Recognize Longhorn/Vista and report as not
	yet supported.  Recognize when running under WOW64 and report native
	CPU type.  Slightly rearrange \n printing.
2006-01-13 13:39:05 +00:00
Corinna Vinschen 494139ffe3 * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on
Windows 2000 and above. Clarify the comment about IP_TOS and move
	to the place where the magic happens.
	(get_ifconf): Remove unused code.
	* wincap.h (wincaps::has_disabled_user_tos_setting): New element.
	* wincap.cc: Implement above element throughout.
2006-01-13 10:18:31 +00:00
Joshua Daniel Franklin b22830942a * faq-setup.xml (faq.setup.setup): Correct URL typo.
(faq.setup.snapshots): Clarify.
2006-01-13 03:55:23 +00:00
Christopher Faylor 951bd8e9f1 * cygcheck.cc: Replace ` with ' throughout. 2006-01-12 17:43:53 +00:00
Corinna Vinschen f68671330f * wincap.cc: New file.
* wincap.h: New file.
	* Makefile.in: Accomodate having our own wincap implementation now.
2006-01-12 16:59:15 +00:00
Corinna Vinschen 0ae86d187c * Update copyrights. 2006-01-12 15:53:51 +00:00
Corinna Vinschen d855cf1ec8 * doctool.c (scan_directory): Ignore "CVS" directories. 2006-01-12 11:31:55 +00:00
Christopher Faylor 9287bcd534 * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize ttys >=
0.
2006-01-12 05:17:12 +00:00
Christopher Faylor 750874d33d * fhandler.h (set_console_state_for_spawn): Whackamole the argument back to a
bool.
* spawn.cc (spawn_guts): Ditto, i.e., once again call
set_console_state_for_spawn with an indication of whether we're about to start
a cygwin process.
* fhandler_console.cc (set_console_state_for_spawn): Don't set the console
state if we know we're starting a cygwin process or if we're using a "real"
tty.
2006-01-12 05:03:15 +00:00
Christopher Faylor 9156ef9120 copyright 2006-01-12 04:52:51 +00:00
Christopher Faylor 904305952b copyright 2006-01-12 04:41:06 +00:00
Danny Smith 3683edc658 * include/wincrypt.h (WINADVAPI): Add to prototypes of
advapi32.dll functions.
2006-01-11 23:19:16 +00:00
Danny Smith cf8fbc710f * include/winsock2.h (struct sockaddr_storage): Use RFC 2553
names for padding size constants.
2006-01-11 22:56:05 +00:00
Danny Smith 16442a4a8f * include/aclapi.h (WINADVAPI): Add to prototypes.
* include/winreg.h (WINADVAPI): Likewise.
	* include/winsvc.h (WINADVAPI): Likewise.
2006-01-11 22:49:06 +00:00
Corinna Vinschen b773a592d3 * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
* init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker.
	Call wincap.init here before doing anything else.  Use wincap.is_wow64
	to determine if we're running in a WOW64 emulator.
	* mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's
	apparently not supported.
	(mmap64): Don't create mappings beyond EOF, which would need to use
	AT_ROUND_TO_PAGE, on WOW64.
	* wincap.cc (wincap): Throw into the .cygwin_dll_common section.
	(wincapc::init): Determine if running in WOW64 and set wow_64 flag.
	* wincap.h (class wincapc): Add wow64 member.
	(wincapc::is_wow64): New method.
2006-01-10 18:11:32 +00:00
Christopher Faylor 23de77b72b * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in model
name.
2006-01-10 16:49:28 +00:00
Christopher Faylor 4c8650efd8 . 2006-01-10 14:49:20 +00:00
Christopher Faylor 5da5f949d8 * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is done prior
to check for command.com/cmd.com.  Don't bother setting CREATE_SUSPENDED flag
for a MS-DOS process since it doesn't work anyway.  Avoid calling remember()
when the child process has already exited.
(av::fixup): Explicitly set cygexec flag to falseon a 16 bit process.
2006-01-10 02:39:22 +00:00
Corinna Vinschen e3786825c0 Check FreeBSD upstream changes and apply important patches.
* sysv_sem.cc (__semctl): Check copyin return value (from 1.76).
	* sysv_shm.cc (shminit): Actually use the iterating variable in the
	for loop when trying to avoid overflow (from 1.102).
2006-01-09 15:10:14 +00:00
Corinna Vinschen 104fffd24d * include/getopt.h (getopt_long_only): Declare. 2006-01-09 12:41:54 +00:00
Corinna Vinschen 6c5da6783c * cygwin.din: Export getsubopt.
* include/cygwin/version.h: Bump API minor version.
2006-01-09 12:37:08 +00:00
Christopher Faylor 0b7094d95d * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling
terminal to a process when duped.  Linux doesn't do this, so we won't either.
2006-01-08 21:34:00 +00:00
Christopher Faylor 3e45d281b3 * environ.cc (spenvs[]): windir -> WINDIR. 2006-01-08 20:10:51 +00:00
Christopher Faylor b5c8e33120 * fhandler_console.cc (fhandler_console::need_invisible): Remove duplicate
test.
2006-01-07 18:00:19 +00:00
Christopher Faylor 85c804ec4b * fhandler.h (set_console_state_for_spawn): Eliminate argument from
declaration.
* fhandler.cc (set_console_state_for_spawn): Eliminate argument from
definition.  Always check for invisible console.
(fhandler_console::need_invisible): Don't do anything if the windows station is
already not visible.
* spawn.cc (spawn_guts): Accommodate change of argument to
set_console_state_for_spawn.
2006-01-07 17:57:26 +00:00
Christopher Faylor 1b00002744 * sigproc.cc (no_signals_available): Use existence of signal thread handle to
figure out if we can actually send signals rather than relying on my_sendsig.
(hwait_sig): Make static.
(sigproc_init): Don't set my_sendsig to anything special.  Use new global
static hwait_sig.
(wait_sig): Set hwait_sig to NULL when we are exiting.
2006-01-05 22:38:51 +00:00
Christopher Faylor 2ea1dced21 * cygcheck.cc (dump_sysinfo): Report the failing drive to prevent having to
guess.
2006-01-05 18:31:26 +00:00
Christopher Faylor b39b8c14fa * include/getopt.h: Accommodate recent unfortunate newlib changes. 2006-01-05 17:35:14 +00:00
Christopher Faylor 4cf4fd4d1c (fix ChangeLog and check in remaining files)
* sigproc.cc (sigproc_init): Move clearing of sync_startup here to lessen the
likelihood of trying to deal with non-cygwin threads in dll_entry.
* fhandler_console: Fix set_console_state_for_spawn comment.
2006-01-05 16:26:22 +00:00
Christopher Faylor 32f0697595 * cygtls.cc (_cygtls::remove): Don't output debugging info if this isn't a
cygwin thread.
2006-01-05 16:23:19 +00:00
Christopher Faylor c29df6c375 * spawn.cc (spawn_guts): Invert the argument to set_console_state_for_spawn. 2006-01-05 16:21:14 +00:00
Christopher Faylor 4c3faa85ce * fhandler_console.cc (fhandler_console::need_invisible): Only try to open
"CygwinInvisible" windows station if opening of default station fails.  Use
CloseWindowStation to close window station handle.
2006-01-05 03:58:19 +00:00
Christopher Faylor faec62caaf * fhandler_console.cc (fhandler_console::need_invisible): Open up the security
of the newly created windows station.
2006-01-05 00:49:17 +00:00
Danny Smith 4b2985b50b 2006-01-05 Michael Gerdau <mgd@technosis.de>
* include/winbase.h (WINADVAPI): Define.
2006-01-04 20:59:28 +00:00
Christopher Faylor 01b7635538 * path.cc (dot_special_chars): Add ", <, >, and |. 2006-01-04 16:20:30 +00:00
Christopher Faylor d58ca0b320 * fhandler_console.cc (beep): Use MB_OK which is documented as using the
default bell rather than -1 which seems to behave differently on different
versions of Windows.
2006-01-04 04:47:19 +00:00
Christopher Faylor 4c15746236 * fhandler_process.cc (fhandler_process::readdir): Add missing argument to
syscall_printf.
* fhandler_console.cc (fhandler_console::need_invisible): Use made-up name for
windows station rather than asking Windows to create one for us.
* spawn.cc (spawn_guts): Don't mess with console if we're detaching.
2006-01-04 03:43:55 +00:00
Christopher Faylor a4b5f2b383 * include/winuser.h (CreateWindowStation): Correctly identify first argument as
constant.
(CreateWindowStation@): Ditto.
2006-01-04 03:42:18 +00:00
Christopher Faylor adcff8d159 * dir.cc (readdir_worker): Minor code cleanup.
* fhandler_console.cc (beep): Use a more Windows-generic wav file if the beep
is missing.  Use a more foolproof way to find out whether we should be
recreating the missing key.
* registry.h (reg_key::_disposition): New field.
(reg_key::created): New function.
* registry.cc (reg_key::reg_key): Set _disposition to zero by default.
(reg_key::build_key): Fill in _disposition field.
2006-01-03 17:44:26 +00:00
Christopher Faylor 825d0b9385 * dir.cc (readdir_worker): Ensure that saw_dot flags are updated when not
handling inodes.
2006-01-03 15:42:56 +00:00
Dimitri Papadopoulos 5d09b46dc3 * include/uxtheme.h [_WIN32_WINNT >= 0x0501]
(TMT_*, BT_*): Add constants.
2006-01-03 09:04:07 +00:00
Christopher Faylor e76625eadb * fhandler_console.cc (beep): New function. Restores missing "Default Beep",
if necessary.
(fhandler_console::write_normal): Use beep().
2006-01-03 01:15:29 +00:00
Christopher Faylor 29b35f7a84 * dcrt0.cc (_dll_crt0): Move more leftover debugging stuff.
(cygwin_dll_init): Remove unneeded initializations.  Call _dll_crt0 rather than
dll_crt0_1.
* dcrt0.cc (_dll_crt0): Move more leftover debugging stuff.
(cygwin_dll_init): Remove unneeded initializations.  Call _dll_crt0 rather than
dll_crt0_1.
2006-01-02 15:48:29 +00:00
Corinna Vinschen 8584a9df5f * syslog.cc: Include sys/un.h instead of sys/socket.h.
(syslogd_inited): Convert to enum type noting the exact result of
	trying to connect to syslog daemon.  Use this way throughout.
	(connect_syslogd): New static function taking over the task to
	connect to syslog socket.  Use correct struct sockaddr_un instead of
	struct sockaddr.
	(try_connect_syslogd): Call connect_syslogd.  If write fails on
	connection oriented socket, try to reconnect to syslog socket and
	try to write again.
2006-01-02 13:05:57 +00:00
Corinna Vinschen d05c10aecd Bump copyright dates. 2006-01-02 13:01:42 +00:00
Christopher Faylor 7f9832e774 * cygload/README: Delete.
* cygload/cygload.cc: Move to winsup.api.  Add comments from README.
* cygload/cygload.h: Move to winsup.api.
* cygload/cygload.exp: Move to winsup.api.
* Makefile.in: Remove cygload.
* winsup.api/winsup.exp: If a .exp file is detected, run it rather than using
standard compile.
* winsup.api/resethand.c (main): Use printf to print status or expect thinks
something is wrong.
2006-01-02 06:15:58 +00:00
Christopher Faylor b0b9ccf618 * winsup.api/resethand.c (main): Remove core dump flag from exit status. 2006-01-02 04:01:22 +00:00
Christopher Faylor 590129475b * winsup.api/resethand.c (main): Coerce argument to pointer to stop gcc
complaint.
2006-01-02 03:45:32 +00:00
Christopher Faylor 3bfd1c5e8c * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not started
from a cygwin process - just like the good-old-days of B20.
2006-01-02 03:14:56 +00:00
Christopher Faylor 68f62c98f9 add copyright 2006-01-02 02:57:54 +00:00
Christopher Faylor d0d1b89700 add missing ChangeLog entry 2006-01-02 02:55:50 +00:00
Christopher Faylor 7a32aefe79 * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which caused
this function to always return prematurely.
2006-01-02 02:55:14 +00:00
Christopher Faylor 74c29a5e9a * winsup.api/resethand.c: Use SIGSEGV for the signal to test. 2006-01-01 18:02:54 +00:00
Christopher Faylor 031d1aa40f * winsup.api/resethand.c: New file. 2006-01-01 17:26:52 +00:00
Christopher Faylor 4eab146fc7 * exceptions.cc (sigpacket::process): Pass actual reference to signal's
sigaction structure to setup_handler.
2006-01-01 17:15:01 +00:00
Christopher Faylor a14d65557a * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
* include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
* dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
2006-01-01 16:51:29 +00:00
Corinna Vinschen a89b700926 * syslog.cc (vklog): Never log kernel messages using the vsyslog
interface.
2006-01-01 16:17:55 +00:00
Corinna Vinschen cceba5593d * syslog.cc (vsyslog): Decrement len if trailing \n has been removed.
Add \n when writing to stderr if LOG_PERROR option is set.
2005-12-31 14:16:49 +00:00
Corinna Vinschen 1b68dd91cf * include/cygwin/in.h: Drop including stdint.h. Move definition
of in_port_t and in_addr_t to top of file and use throughout. Use
	sa_family_t type where appropriate.
	(struct in6_addr): Change `unsigned char' to `uint8_t'.
	(struct sockaddr_in6): Add sin6_scope_id member. Add comments.
	* include/cygwin/socket.h: Include stdint.h.  Move definition of
	socklen_t to top of file.  Define sa_family_t.  Define struct
	sockaddr_storage as per SUSv3.
	* include/sys/un.h: Include cygwin/socket.h.  Use sa_family_t type.
2005-12-31 13:07:43 +00:00
Corinna Vinschen cf2af34b70 * include/winsock2.h: Don't define struct sockaddr_storage when
building Cygwin.
2005-12-31 13:07:22 +00:00
Christopher Faylor b88d641c62 * relnotes.texinfo: Remove entry about hyperthreaded processor. 2005-12-30 19:28:26 +00:00
Christopher Faylor 2e99d150d4 * faq-problems.html: Remove entry about hyperthreaded processor. 2005-12-30 19:26:07 +00:00
Christopher Faylor b0cc168954 * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Use strace
method rather than accessing field directly.
(fhandler_tty_common::__release_output_mutex): Ditto.
2005-12-29 21:10:50 +00:00
Christopher Faylor 5d97040501 *** cygwin DLL Changes:
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
(child_info::dwProcessId): Delete.
(child_info::straced): New variable.
(child_info::handle_fork): New member function.
* dcrt0.cc (in_forkee): New global variable.
(__cygwin_user_data::forkee): Mark as obsolete.
(do_global_ctors): Use in_forkee rather than user_data->forkee.
(get_cygwin_startup_info): Ditto.  Deal with new straced field to allow strace
to deal with children of attached processes.
(initial_env): Accommodate changes to strace::hello.
(child_info_fork::handle_fork): Rename from plain old 'handle_fork'.  Move
alloc_stack() call elsewhere.
(dll_crt0_0): Fill out more of user_data.  Reference handle_fork via fork_info.
Add some debugging output.
(_dll_crt0): Don't wait for sync thread if sync_startup is invalid.  Zero
sync_startup here.  Call alloc_stack() here, if appropriate.
(dll_crt0_1): Use in_forkee rather than user_data->forkee.
(dll_crt0): Ditto.
* malloc_wrapper.cc (malloc_init): Ditto.
* dll_init.cc (in_forkee): Remove local static version of this variable.
(dll_list::load_after_fork): Don't set in_forkee here.
* external.cc (cygwin_internal): Use strace method rather than accessing field
directly.
* fhandler.cc (fhandler_base::read): Ditto.
* fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto.
* fork.cc (frok::parent): Invoke strace write_childpid to communicate with
potential strace.
(child_copy): Add more detail to debugging output.
* init.cc (calibration_id): New static variable.
(prime_threads): Set sync_startup to invalid handle if we already know about
thread_func_ix.  Use static calibration_id to hold calibration thread id.
* munge_threadfunc (munge_threadfunc): Don't try to debug if we don't find
threadfunc_ix.
(dll_entry): Avoid calling munge_threadfunc and _cygtls::remove on non-cygwin
threads invoked during process startup.
* pinfo.cc (set_myself): Always call strace.hello here regardless of DEBUGGING.
* sigproc.cc (child_info::child_info): Remove spurious handling of dwProcessId.
Set straced as appropriate.
* spawn.cc (spawn_guts): Rename ciresrv to ch.  Invoke strace write_childpid to
communicate with potential strace.
* strace.cc: Include child_info.h.
(strace::hello): Remove inited test.  Use active() method to test if strace has
been activated.  Handle case where we are started before
(mypid): New function.
(strace::vsprntf): Try to deal more intelligently with case where progname may
not be filled out.  Put pid in parentheses if it is a windows pid rather than a
cygwin pid.  myself has been filled out.
(strace::write_childpid): New function for notifying strace about the creation
of children.
(strace::vprntf): Use strace method rather than accessing field directly.
(strace_printf): Ditto.
(strace::wm): Ditto.
* winsup.h (in_forkee): Declare.
* include/sys/strace.h (strace::write_childpid): Declare new function.
(strace::attached): Define new function.
(strace::active): Ditto.
(strace::active_val): Ditto.
(_STRACE_ON): Delete.
(_STRACE_OFF): Ditto.
(define_strace0): Use strace method rather than accessing field directly.
(strace_printf_wrap): Ditto.
(strace_printf_wrap1): Ditto.

*** cygwin utils changes:
* strace.cc (nprocesses): Make static global.
(quiet): New variable.
(strace_active): Ditto.
(add_child): Increment nprocesses here.  Don't add a child if it is already
added (windows bug?).  Report on child if not quiet.
(get_child): Just return NULL if child not found.
(remove_child): Report on child if not quiet.
(attach_process): Don't complain if given a windows process.  Use windows pid
in error.
(handle_output_debug_string): Issue error if trying to manipulate a process
that we don't know about.  Handle _STRACE_CHILD_PID - attach to reported child
when we get this.
(proc_child): Move nprocesses to file scope.  Report on exceptions.
(longopts): Implement "--quiet".
(opts): Implement "-q".
(main): Manipulate quiet flag.
* utils.sgml (strace): Add words describing '-q'.
2005-12-29 20:46:34 +00:00
Christopher Faylor 10e4168d84 * cygcheck.cc (common_apps): Add crontab, vi, vim. 2005-12-29 19:23:46 +00:00
Christopher Faylor 77ae8757f7 * environ.cc (win_env::add_cache): Don't add variables to the environment
during initialization.
2005-12-29 03:46:56 +00:00
Corinna Vinschen 20e84812d2 * exceptions.cc (_cygtls::handle_exceptions): Drop redundant `break'. 2005-12-27 20:47:49 +00:00
Corinna Vinschen de6c4c6a5f * ChangeLog: Add linebreaks. 2005-12-27 20:23:48 +00:00
Corinna Vinschen a5912e6dbc * exceptions.cc (inside_kernel): Rename from interruptible.
Accommodate change throughout file.
2005-12-27 20:20:09 +00:00
Corinna Vinschen 4f12275501 * exceptions.cc (interruptible): New function, code stripped from
_cygtls::interrupt_now.
	(_cygtls::handle_exceptions): Handle STATUS_DATATYPE_MISALIGNMENT as
	SIGBUS error.  Differ between unmapped memory (SEGV_MAPERR) and access
	violation (SEGV_ACCERR) in case of STATUS_ACCESS_VIOLATION.  Write
	kernel log message in case of uncatched STATUS_ACCESS_VIOLATION.
	(_cygtls::interrupt_now): Just call interruptible now instead of
	evaluating interruptibility here.
2005-12-27 20:07:59 +00:00
Corinna Vinschen 19556072f6 Add missing ChangeLog entry. 2005-12-27 20:01:29 +00:00
Corinna Vinschen 9e68bb7b50 * path.cc (path_conv::check): Rework loop removing trailing dots
and spaces.

	* syslog.cc (vklog): Set facility to LOG_KERN if not set.
2005-12-27 18:10:49 +00:00
Christopher Faylor 192af6e283 white space 2005-12-26 21:23:05 +00:00
Christopher Faylor a16b738dd5 * dcrt0.cc (__api_fatal): Simplify to just use strace mechamisms.
(do_exit): Move minimal_printf...
* pinfo.cc (pinfo::exit): ...into here.
* strace.cc (strace::vprntf): Guarantee output to the console when
system_printf/api_fatal.
* heap.cc (heap_init): Wait a second before issuing an error when
ERROR_INVALID_ADDRESS since this is probably due to a CTRL-C handler sneaking
in, using the memory that we want to use for the heap, and, eventually exiting.
2005-12-26 19:34:59 +00:00
Christopher Faylor c675040a06 typo 2005-12-25 18:15:02 +00:00
Christopher Faylor dcd0465b2b * cygtls.cc (_cygtls::handle_threadlist_exception): Make an error fatal.
* cygtls.h (sockaddr_in): Use header rather than defining our own structure.
* exceptions.cc (_cygtls::interrupt_setup): Use exact contents of sa_mask
rather than assuming tht current sig should be masked, too.
(_cygtls::call_signal_handler): Use more aggressive locking.
* gendef (_sigbe): Wait until later before releasing incyg.
(_sigreturn): Remove more arguments to accommodate quasi-sa_sigaction support.
(_sigdelayed): Push arguments for sa_sigaction.  More work needed here.
* signal.cc (sigaction): Implement SA_NODEFER.
* tlsoffsets.h: Regenerate.

* sigproc.cc (wait_sig): Use default buffer size of Windows 9x complains.
* pinfo.cc (_onreturn::dummy_handle): Remove.
(_onreturn::h): Make this a pointer.
(_onreturn::~_onreturn): Detect whether pointer is NULL rather than value is
NULL.
(_onreturn::_onreturn): Set h to NULL initially.
(_onreturn::no_close_p_handle): Set h to NULL.
(winpids::add): Initialize onreturn with value from p.hProcess immediately.
2005-12-23 22:50:20 +00:00
Christopher Faylor ede284de5f * fork.cc (fork): Honor error return from sig_send. Don't continue with fork
if we couldn't suspend signals.
* sigproc.cc (sig_send): Set sigCONT event when we see __SIGNOHOLD.
(wait_sig): Remove holding_signals.  Create pipe with a buffer which will
theoretically cause blocking if there is nothing reading on the pipe.  Wait for
sigCONT at end of loop when we have a __SIGHOLD.
2005-12-23 01:24:14 +00:00
Corinna Vinschen 52792a770d * fhandler.h (fhandler_base::issymlink): New method.
* syscalls.cc (open): Handle O_NOFOLLOW flag.
	* include/fcntl.h (_FNOFOLLOW): New define.
	(O_NOFOLLOW): Ditto.
	* include/cygwin/version.h: Bump API minor number.
2005-12-22 16:45:15 +00:00
Danny Smith db55f91dc0 * lib/ws2_32.c: New file, defining IPv6 constants.
* Makefile.in (SOURCES): Add ws2_32.c
	(EXTRA_OBJS): Add ws2_32.o.
2005-12-22 07:47:10 +00:00
Christopher Faylor de935f6d9f whitespace cleanup to force snapshot. 2005-12-22 05:57:54 +00:00
Christopher Faylor 718dee922f * pinfo.cc (winpids::add): Increment nelem when winpid is true since we don't
care if it's a cygwin process in that case.
2005-12-22 05:26:14 +00:00
Christopher Faylor 3962fad137 fix ya typo 2005-12-22 05:23:51 +00:00
Christopher Faylor 67cd42db4c * pinfo.cc (winpids::release): Fix typo. 2005-12-22 05:11:44 +00:00
Christopher Faylor f3ea02b1cf * pinfo.cc (pinfo::init): Clarify comment slightly.
(_onreturn): New helper class.
(winpids:add): Remove copied stuff.  Try to put process handle into pinfo in
question and use _onreturn class to control when to close it.
(winpids::release): Remove use of copied array.  Free procinfo when hProc is
NULL.  Otherwise call release and call CloseHandle on hProc.
* pinfo.h (winpids::copied): Remove throughout class.
2005-12-22 03:16:36 +00:00
Christopher Faylor 9981546a7c * pinfo.cc (pinfo::init): Remove spurious low_priority_sleep. 2005-12-21 19:39:53 +00:00
Christopher Faylor 01032746d1 * spawn.cc (spawn_guts): Hide the window whenever ctty == -1, not just when we
have no console.
2005-12-21 17:20:43 +00:00
Christopher Faylor 247ac234f4 * cygheap.cc (init_cygheap::manage_console_count): Revert previous change.
Handle this a different way.
* external.cc (cygwin_internal): Accommodate extra hook_or_detect_cygwin
argument.
* hookapi.cc (cygwin_internal): Fill in subsys variable with the subsystem of
the executable.
* spawn.cc (av::iscui): New variable.
(spawn_guts): Hide window when we don't have a console and this isn't
NT/XP/2003.
(av::fixup): Set iscui flag.
* winsup.h (hook_or_detect_cygwin): Accommodate extra argument.
2005-12-21 17:14:34 +00:00
Christopher Faylor d4c8d84da6 * cygheap.cc (init_cygheap::manage_console_count): Don't call FreeConsole on
9x/Me.
2005-12-21 16:09:25 +00:00
Corinna Vinschen 2df1714182 * (fhandler_disk_file::fchown): Remove execute bits from "sensible"
permissions.  Use same setting as in symlink.
2005-12-21 13:37:28 +00:00
Corinna Vinschen 0786c42a9c * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix inode number
debug output.
	(fhandler_disk_file::fchown): Always set sensible permission values
	when creating the ACL for symlinks.
2005-12-21 13:01:27 +00:00
Danny Smith 94692f408c 2005-12-21 Michael Jung <mjung@iss.tu-darmstadt.de>
* lib/user32.def (PrivateExtractIconsA@32,
	PrivateExtractIconsW@32): Define.
	* lib/shell32.c (IID_IShellLinkDataList): Add GUID.
2005-12-21 08:09:08 +00:00
Corinna Vinschen c5a3166fc5 * winsup.h (flush_file_buffers): Define as inline function.
* miscfuncs.cc (flush_file_buffers): Remove.
2005-12-20 20:34:28 +00:00
Corinna Vinschen 56c07aa2ce * winsup.h (flush_file_buffers): Declare new function.
(FLushFileBuffers): New define.
	* miscfuncs.cc (flush_file_buffers): Define new function.
2005-12-20 20:19:55 +00:00
Christopher Faylor 7c578a4fa0 * fhandler.h (fhandler_termios::fixup_after_exec): Make non-inlined.
* fhandler_termios.cc (fhandler_termios::fixup_after_exec): Don't call
fixup_after_fork if close_on_exec'ed.
2005-12-20 18:14:42 +00:00
Christopher Faylor 98da134d62 * cygtls.h (_cygtls::interrupt_now): Subsume interruptible().
(interruptible): Delete.
(setup_handler): Remove interruptible call and just use return from
interrupt_now.
2005-12-20 00:31:50 +00:00
Christopher Faylor 7a01aa546d * fhandler.h (set_console_state_for_spawn): Add an argument to the declaration.
* fhandler_console.cc (set_console_state_for_spawn): Ditto for the definition.
Only set invisible console for non-cygwin process.  Remove debugging leftover.
* spawn.cc (spawn_guts): Pass argument denoting whether this is a cygwin
process to set_console_state_for_spawn and only call this function when
exec'ing.
2005-12-19 19:04:14 +00:00
Corinna Vinschen 14df41c155 * dump_setup.cc (package_find): Fix is_alias computation for "/usr/lib". 2005-12-19 16:58:33 +00:00
Corinna Vinschen edd79f2da4 * mmap.cc (fhandler_dev_zero::mmap): Call VirtualFree(MEM_RELEASE)
with zero length parameter, otherwise it fails.
	(fhandler_dev_zero::munmap): Ditto.
2005-12-19 15:25:23 +00:00
Christopher Faylor 1219debe0c fix minor typo. 2005-12-19 05:08:20 +00:00
Christopher Faylor 65438ec635 * fhandler.h (fhandler_pipe::fixup_in_child): Declare new function.
(fhandler_console::invisible_console): Declare new variable.
(fhandler_console::need_invisible): Ditto.
(fhandler_console::has_a): Ditto.
* fhandler_console.cc (set_console_state_for_spawn): Eliminate return value.
Set up an invisible console if necessary prior to spawning.
(fhandler_console::invisible_console): Define.
* fhandler_tty.cc (fhandler_tty_slave::open): Use
fhandler_console::invisible_console to setup an invisible console.
* pipe.cc (fhandler_pipe::fixup_in_child): Define new function from
fixup_after_exec.
(fhandler_pipe::fixup_after_exec): Use fixup_in_child when appropriate.
(fhandler_pipe::fixup_after_fork): Ditto.
* spawn.cc (handle): Reorganize and modernize a little.
(spawn_guts): Rely on set_console_state_for_spawn to set the console into the
right state but don't create the process with "detached" flag if we have no
controlling tty since that confuses 'cmd'.
* dtable.cc (dtable::stdio_init): Don't set console as controlling terminal if
we have an invisible console.
* sigproc.cc (child_info::sync): Use correct name in ForceCloseHandle1.
2005-12-19 04:34:13 +00:00
Christopher Faylor ca9271d1b6 * include/sys/dirent.h: Change __deprecated_d_ino to __invalid_d_ino throughout
to make things a little clearer.
* dir.cc (readdir_worker): Reflect above change.
2005-12-19 04:00:41 +00:00
Christopher Faylor ad02bb70e3 * winsup.h (child_copy): Change prototype to match new functionality.
* cygheap.cc (cygheap_fixup_in_child): Accommodate new child_copy arguments.
* dcrt0.cc (dll_data_start): Move definition here from fork.
(dll_data_end): Ditto.
(dll_bss_start): Ditto.
(dll_bss_end): Ditto.
(handle_fork): New function.  Called when forked to deal with fork issues and
copy data to this process from the parent.
(dll_crt0_0): Call handle_fork when _PROC_FORK condition.
(dll_crt0): Don't copy user_data when we've forked.  Don't zero first element
of main_environment ever.
(cygwin_dll_init): Ditto.
* fork.cc (child_copy): Rename from fork_copy and change arguments so that each
pair of things to copy gets its own descriptor.
(frok::child): Remove fixup_mmaps_after_fork call here.  Move to handle_fork in
dcrt0.cc.
(frok::parent): Use child_copy rather than fork_copy and accommodate changes in
parameters.
* exceptions.cc (setup_handler): Delay test of whether we're locked until after
GetThreadContext has been called since there are apparently cases where
SuspendThread does not cause an immediate thread suspension.
2005-12-17 04:36:39 +00:00
Christopher Faylor 6ba157bb2e * init.cc (dll_entry): Call prime_threads after dll_crt0_0 to avoid conflicts
between heap allocation and thread stack allocation.
2005-12-16 20:40:03 +00:00
Christopher Faylor fd01d14ab1 * hookapi.cc (putmem): Remove query of previous memory protection since we get
that for free the first time we call VirtualProtect.
2005-12-16 18:10:10 +00:00
Corinna Vinschen 8b1ba065a6 * mmap.cc (fhandler_dev_zero::fixup_mmap_after_fork): Use
system_printf like any other fixup_mmap_after_fork.
2005-12-15 09:04:28 +00:00
Christopher Faylor bc0d578d39 * cygcheck.cc (common_apps): Add a few more binaries to look for. 2005-12-15 03:36:14 +00:00
Corinna Vinschen 64ee06c782 Fix unforgivable spelling error in ChangeLog. 2005-12-14 20:04:16 +00:00
Corinna Vinschen ba31e832be * fhandler.cc (ACCFLAGS): Remove macro.
(fhandler_base::get_default_fmode): Use O_ACCMODE instead of ACCFLAGS
	and or'ed read/write flags.
	(fhandler_base::open_9x): Use O_ACCMODE instead of or'ed read/write
	flags.
	(fhandler_base::open): Ditto.
	* fhandler_disk_file.cc (fhandler_base::open_fs): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
	* fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
2005-12-14 16:38:22 +00:00
Corinna Vinschen e3d14af155 * fhandler.cc (fhandler_base::open_9x): Handle O_SYNC and O_DIRECT
flags.
	(fhandler_base::open): Ditto.
	* fhandler_floppy.cc (fhandler_dev_floppy::open): Don't allocate devbuf
	in O_DIRECT case.
	* fhandler_raw.cc (fhandler_dev_raw::ioctl): Don't allow buffer
	changes in O_DIRECT case.  Allow returning a buffer size 0, which
	indicates O_DIRECT.
	* fhandler_tape.cc (fhandler_dev_tape::open): Use O_SYNC flag to
	hand down the !buffer_writes case.  Don't allocate devbuf in O_DIRECT
	case.
	(fhandler_dev_tape::raw_read): Don't mess with devbuf if it's NULL.
	* include/fcntl.h: Define _FDIRECT, O_DIRECT, O_DSYNC and O_RSYNC.
	* include/cygwin/version.h: Bump API minor version.
2005-12-14 15:54:33 +00:00
Christopher Faylor 2c8fd40695 * cygtls.cc (_cygtls::remove): Don't bother if we're exiting.
* sigproc.cc (_cygtls::remove_wq): Ditto.
2005-12-13 16:01:57 +00:00
Christopher Faylor 1f3a4b8496 * fhandler_tty.cc (fhandler_tty::open): Enhance comment. 2005-12-13 14:47:18 +00:00
Corinna Vinschen 4c848934fe * fhandler_tty.cc (fhandler_tty::open): Close newly created window
station after switching to original window station.
2005-12-13 09:07:12 +00:00
Christopher Faylor 82f423291b * fhandler_tty.cc (fhandler_tty::open): Add a comment. 2005-12-13 05:43:30 +00:00
Joshua Daniel Franklin 3220aed354 * faq-programming.xml: Add note about struct stat64. 2005-12-13 05:32:43 +00:00
Christopher Faylor 56b5372519 * times.cc (hires_ms::usecs): Subtract from slop from system time or we'll
always end up priming the pump.
2005-12-13 02:55:11 +00:00
Christopher Faylor d090ee8081 * times.cc (systime): Correct precision referenced in comment.
* fhandler_tty.cc (fhandler_tty_slave::open): Don't free original windows
station since that will cause strange problems displaying fonts.  Reset windows
station to original station after creating console.
* times.cc (hires_ms::usecs): Only reprime when calculated time is less than
system time.
2005-12-13 02:02:51 +00:00
Christopher Faylor becfe4e93e * include/winuser.h (WINSTA_ALL_ACCESS): Define. 2005-12-13 01:24:36 +00:00
Christopher Faylor 678a9510df * pinfo.cc (winpids::add): Don't copy procinfo when there is no cygwin process
associated with the pid, i.e., procinfo == NULL.
2005-12-13 00:54:32 +00:00
Christopher Faylor c9da5a2183 * times.cc (hires_ms::usecs): Correct order when checking if high precision
time is <= current time.
2005-12-13 00:43:46 +00:00
Christopher Faylor a300f5fd14 correct ChangeLog 2005-12-12 19:10:02 +00:00
Christopher Faylor 363934dc9b * pinfo.cc (size_copied): New convenience macro.
(winpids::add): Alias the element that we are working on for slightly better
clarity.  Honor the "make_copy" flag.
(winpids::release): Free and zero procinfo field if it was allocated via
malloc.
(winpids::~winpids): Free copied array.
* pinfo.h (class pinfo): Make winpids class a friend.
(winpids::make_copy): New field.
(winpids::copied): New array.
(winpids::reset): Reset npids after releasing pinfos or suffer a memory leak.
(winpids::winpids): Try harder to allocate all fields in the class.
2005-12-12 18:43:31 +00:00
Corinna Vinschen 75a22c880a * autoload.cc (GetSystemTimes): Remove. 2005-12-12 14:27:16 +00:00
Corinna Vinschen e96abae130 * fhandler_proc.cc (format_proc_uptime): Drop usage of GetSystemTimes.
Use NtQuerySystemInformation to evaluate uptime and idle_time from
	all CPU's processor times.  Fallback to GetTickCount.
2005-12-12 12:18:14 +00:00
Corinna Vinschen 2193d02b4d * mmap.cc (gen_create_protect): Always generate WRITECOPY protection
for private maps.
	(fixup_mmaps_after_fork): Fix calculation of WRITECOPY protection for
	VirtualProtect.  Add some words to the comment.
2005-12-12 10:00:32 +00:00
Christopher Faylor 4e8e54543e * winsup.api/ltp/dup03.c (cleanup): Fix longstanding off-by-one error when
setting array element to -1.
2005-12-11 22:31:00 +00:00
Christopher Faylor 4989ff286d fix typo. 2005-12-11 17:30:53 +00:00
Christopher Faylor 9b020020ec * dirent.h: Change the rest of the d_ino's to __deprecated_d_ino. 2005-12-10 23:25:24 +00:00
Christopher Faylor 3ab689126c * malloc.cc: Update to version 2.8.3.
* cygmalloc.h (MSPACE): Remove unneeded definition.
2005-12-10 17:09:58 +00:00
Danny Smith 3f8edcbdb1 * lib/kernel32.def (CreateFiberEx): Correct suffix. 2005-12-09 07:49:40 +00:00
Danny Smith 4d6c08adfe 2005-12-09 Huw Davies <hdavies@users.sourceforge.net>
Danny Smith <dannysmith@users.sourceforge.net>

	* lib/msxml-uuid.c: New file to generate UUIDs for
	MSXML interfaces.
	* lib/Makefile.in (UUID_OBJS): Add msxml-uuid.o.

Add missing ChangeLog entries for 2005-12-07 commits.
2005-12-09 04:59:24 +00:00
Corinna Vinschen 7d6fde96de * fhandler_raw.cc (fhandler_dev_raw::ioctl): Only allow 0, 1 or a
multiple of 512 as new buffersize.
2005-12-08 10:55:29 +00:00
Corinna Vinschen ddd62ccbd4 * fhandler_socket.cc (fhandler_socket::recvfrom): Mask flags with
MSG_WINMASK for Windows socket calls.
	(fhandler_socket::recvmsg): Ditto.
	(fhandler_socket::sendmsg): Ditto.
2005-12-08 10:13:57 +00:00
Christopher Faylor 6c9a5ebbfc * hires.h (hires_ms::initime_ms): Delete.
(hires_ms::initime_us): Just define as LONGLONG.
(hires_ms::uptime): New function.
* select.cc (select_stuff::wait): Use gtod for timing to attempt to avoid
windows 32 bit wraparound.
* times.cc (systime): New function.
(times): Replace GetTickCount with gtod.uptime.
(hires_us::prime): Use systime() to calculate system time rather than calling
GetSystemTimeAsFileTime directly.
(hires_ms::prime): Ditto.  Eliminate initime_ms.
(hires_ms::usecs): Try harder to detect wraparound.
* fhandler_proc.cc (format_proc_partitions): Set drive_size to zero to avoid a
compiler warning.
2005-12-07 22:28:49 +00:00
Corinna Vinschen c09178b052 * fhandler_proc.cc (format_proc_partitions): Use modern IOCTLs
to determine drive size as far as possible.
2005-12-07 20:32:27 +00:00
Danny Smith 14d2d90cff * include/winbase.h (GetDevicePowerState): Add prototype.
* lib/kernel32.def (GetDevicePowerState): Correct suffix.
2005-12-07 20:27:09 +00:00
Danny Smith 8696d63606 2005-12-07 Brian Gunlogson <gmb300@users.sourceforge.net>
* include/winuser.h (GetClassLongPtr{AW}): Guard prototypes with _WIN64.
	Define as macro if !_WIN64.
	(SetClassLongPtr{AW}): Likewise.
	(GCLP_*): Add GetClassLongPtr defines.
	* lib/user32.def (GetClassLongPtr{AW}): Remove stubs.
	(SetClassLongPtr{AW}): Likewise.
2005-12-07 20:17:39 +00:00
Corinna Vinschen db58e35d94 * fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix INVALID_PARAMETER
condition.  Only copy devbuf to buf if buf is non-NULL.
2005-12-07 19:01:29 +00:00
Corinna Vinschen bb4e8382c5 * fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix setting devbuf
when rd_parm is 0 or 1.
2005-12-07 18:35:29 +00:00
Corinna Vinschen 46bcbf8ce0 * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Fix test for
valid file position at EOM.
2005-12-07 18:11:10 +00:00
Christopher Faylor 383840a908 * include/cygwin/stdlib.h: Guard compilation of *unsetenv* in newlib. 2005-12-07 15:17:43 +00:00
Corinna Vinschen 5a101414ed * exceptions.cc (_cygtls::handle_exceptions): In case of a
STATUS_ACCESS_VIOLATION, check if the page is a mmaped page beyond
	a file's EOF.  Generate SIGBUS instead of SIGSEGV then.
	* mmap.cc (__PROT_ATTACH): New define.
	(__PROT_FILLER): Ditto.
	(fh_anonymous): Rename from fh_paging_file;
	(fh_disk_file): New global static variable.
	(attached): New inline function.
	(filler): Ditto.
	(gen_create_protect): Split off from gen_protect to use the file's
	access mode to create mapping always with maximum allowed protections.
	(gen_protect): Accomodate pages attached beyond EOF.  Use symbolic
	values instead of numerics when possible.  Drop create parameter.
	(gen_access): Use file's access mode instead of protection.
	(CreateMapping9x): Create named mapping names so that different
	creation access modes result in different mappings.
	(CreateMappingNT): Only reserve attached pages, don't commit them.
	(MapViewNT): Ditto.  Set AT_ROUND_TO_PAGE for all non-NULL base
	addresses.
	(mmap_func_t): Define CreateMapping and MapView function pointers
	with additional openflags parameter.
	(class mmap_record): Add openflags member.
	(mmap_record::mmap_record): Add openflags parameter.
	(mmap_record::get_openflags): New accessor.
	(mmap_record::attached): Call global attached function.
	(mmap_record::filler): Call global filler function.
	(mmap_record::gen_create_protect): Call global gen_create_protect
	function.
	(mmap_record::gen_protect): Drop create parameter.
	(mmap_record::alloc_fh): Set fhandler's access flags.
	(list::search_record): Accomodate filler pages.
	(list::set): Use inode number as hash value.
	(map::get_list_by_fd): Check hash value against file's inode number.
	(mmap_is_attached_page): New function to evaluate if a given address
	is on a attached page.  Called from _cygtls::handle_exceptions.
	(mmap_worker): New function to do mapping and bookkeeping in a
	single call.
	(mmap64): Use roundup2 to round length to pagesize alignment.
	Initialize global fhandlers.  Simplify anonymous initialization.
	Add SUSv3 compatible check of file open mode vs. requested protection.
	Try creating new file handles to allow maximum page protection.
	Allow creating attached pages in case of mapping beyond EOF.
	Close new file handle if one has been created.
	(munmap): Align len to pagesize.
	(msync): Rework argument checks. Align len to pagesize.
	(mprotect): Ditto.  Accomodate attached pages.
	(mlock): Use roundup/rounddown macros instead of homemade expressions.
	(munlock): Add page alignment as in mlock.
	(fhandler_dev_zero::munmap): Fix unmapping of non-private mappings.
	(fhandler_dev_zero::fixup_mmap_after_fork): Accomodate filler pages.
	(fixup_mmaps_after_fork): Don't fail if attached pages couldn't be
	created in child.  Avoid superfluous call to VirtualFree.  Check for
	original allocation protection to fix PAGE_WRITECOPY protection.
	* ntdll.h: Revert deletion of AT_ROUND_TO_PAGE define.
	* winsup.h (mmap_is_attached_page): Declare.
2005-12-07 11:16:47 +00:00
Christopher Faylor e5a0cf2415 * include/cygwin/stdlib.h: New file.
* environ.cc (unsetenv): Change to return -1 on input error.
* include/cygwin/version.h: Add more description to latest api bump.
2005-12-05 22:30:03 +00:00
Christopher Faylor c34aee9b23 * dir.cc (readdir_workdir): Only fill out d_ino when linked into older app.
* include/cygwin/version.h: Bump api minor number to 147, reflecting
obsolescence of d_ino.
(CYGWIN_VERSION_USER_API_VERSION_COMBINED): New convenience macro.
(CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): New convenience macro.
2005-12-05 21:02:53 +00:00
Christopher Faylor 4535b5961f revert accidental checkin 2005-12-05 20:30:40 +00:00
Christopher Faylor 09b0109620 Remove unneeded whitespace.
* cygtls.cc (_cygtls::set_state): Delete.
(_cygtls::reset_exception): Ditto.
(_cygtls::init_thread): Set initialized state directly here.
(_cygtls::push): Remove exception argument.  Don't treat exceptions specially.
* cygtls.h (_cygtls::push): Ditto.
(_cygtls::isinitialized): Don't treat exceptions specially.
(_cygtls::reset_exception): Delete.
(_cygtls::set_state): Ditto.
(_cygtls::handle_exceptions): Don't push ebp on the stack prior to calling
sig_send.  Just set incyg instead.
(_cygtls::interrupt_setup): Accommodate _cygtls::push argument change.
(_cygtls::interrupt_now): Ditto.
(setup_handler): Don't treat exceptions specially.
* gendef (longjmp): Always zero incyg flag.
2005-12-05 20:20:18 +00:00
Christopher Faylor 801d6cc753 * strace.cc (show_usecs): Renamed from 'usecs'.
(main): Use show_usecs rather than usecs.  Toggle delta if '-u' is specified.
(handle_output_debug_string): Avoid printing microsecond timestamp if
show_usecs == 0.
* utils.sgml (strace): Add words to describe '-u'.
2005-12-05 16:39:06 +00:00
Corinna Vinschen 9fc0d14410 * environ.cc (spenvs): Add "windir" as an "always export" variable
to accomodate WinSock on Windows 95.
2005-12-04 21:47:03 +00:00
Christopher Faylor 3829215776 fix description 2005-12-04 19:24:10 +00:00
Joshua Daniel Franklin 33cf0e5519 * faq-setup.xml: Add note about clean_setup.pl.
* faq-using.xml: Remove unnecessary line of elisp.
2005-12-04 03:55:28 +00:00
Christopher Faylor 49085f6f16 * include/exceptions.h (exception_list): Revert previous change. Windows
doesn't care.
(exception_handler): Use real exception_list parameter type rather than void *
* tlsoffsets.h: Regenerate.
* cygtls.h (_cygtls::handle_exceptions): Use real exception_list parameter type
rather than void *.
(handle_threadlist_exception): Ditto.
(init_exception_handler): Ditto.
* cygtls.cc (_cygtls::handle_threadlist_exception ): Ditto.
(_cygtls::init_exception_handler): Add kludge to terminate linked list with a
loop, which seems to solve problem of RtlUnwind causing problems
* exceptions.cc (rtl_unwind): Use real exception_list parameter type rather
than void *.
(_cygtls::handle_exceptions): Ditto.
2005-12-03 05:01:51 +00:00