Commit Graph

3089 Commits

Author SHA1 Message Date
Corinna Vinschen b575e059ac * mtinfo.h (mtinfo_drive::error): Fix argument bug in debug_printf call. 2005-08-22 16:12:01 +00:00
Christopher Faylor acc12b15a1 add missing entry 2005-08-20 06:21:20 +00:00
Christopher Faylor d9a2276435 * cygerrno.h (geterrno_from_win_error): Change declaration to default to using
GetLastError and EACCESS.
* cygwin.din: Export readdir_r.
* include/cygwin/version.h: Bump API version number to 138.
* syscalls.cc (readdir_worker): New function, renamed from old readdir()
function.
(readdir): Use readdir_worker.
(readdir_r): New function.
* fhandler.h (fhandler_base::readdir): Accommodate second argument indicating
dirent buffer.
(fhandler_disk_file::readdir): Ditto.
(fhandler_cygdrive::readdir): Ditto.
(fhandler_proc::readdir): Ditto.
(fhandler_netdrive::readdir): Ditto.
(fhandler_registry::readdir): Ditto.
(fhandler_process::readdir): Ditto.
* fhandler.cc (fhandler_base::readdir): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto.
* fhandler_cygdrive.cc (fhandler_cygdrive::readdir): Ditto.
* fhandler_proc.cc (fhandler_proc::readdir): Ditto.
* fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto.
* fhandler_registry.cc (fhandler_registry::readdir): Ditto.
* fhandler_process.cc (fhandler_process::readdir): Ditto.
2005-08-20 06:19:55 +00:00
Christopher Faylor 683ef95392 * fhandler.h (dirent_states): Add dirent_saw_proc.
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Fill in "proc" if it is
the root dir and it is missing.
2005-08-19 16:29:43 +00:00
Christopher Faylor 358063ace3 * fhandler.h (dirent_states): Add dirent_isroot, dirent_saw_cygdrive,
dirent_saw_dev.
* dir.cc (opendir): Don't zero __flags here.  Push that responsibility to
opendir methods.
(seekdir): Preserve dirent_isrrot in __flags.
(rewinddir): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Set dirent_isroot
appropriately.
(fhandler_disk_file::readdir): Fill in "cygdrive" and "dev" if it is the root
dir and they are missing.
* fhandler_process.cc (fhandler_process::opendir): Set __flags here.
* fhandler_virtual.cc (fhandler_virtual::opendir): Set __flags here.
2005-08-19 16:18:42 +00:00
Christopher Faylor babc4e5424 * winsup.h (create_pipe): Declare new function.
(CreatePipe): New define.
* miscfuncs.cc (create_pipe): Define new function.
2005-08-19 14:56:48 +00:00
Christopher Faylor 4f3e6ff17b * fhandler.h (fhandler_tty_common::lseek): Declare new method.
(fhandler_tty_slave::lseek): Delete old method.
(fhandler_tty_master::lseek): Delete old method.
* fhandler_tty.cc (fhandler_tty_common::lseek): Define new method.
2005-08-18 20:17:10 +00:00
Corinna Vinschen abebe87c40 * fhandler_socket.cc (fhandler_socket::recvfrom): Always initialize
ret to 0.
	(fhandler_socket::recvmsg): Ditto.
2005-08-18 13:14:15 +00:00
Corinna Vinschen d71805725f * errno.cc (strerror): Check errnum for underflow. 2005-08-18 08:35:19 +00:00
Christopher Faylor 0d339267ec * dcrt0.cc (dll_crt0_1): Tweak debugging stuff.
* fhandler_tty.cc (fhandler_tty_common::close): Rearrange the code so that the
master end of the input and output pipes is closed before signalling an EOF
event to the slave.
(fhandler_pty_master::close): Likewise.
2005-08-17 16:10:48 +00:00
Corinna Vinschen 447419497d * init.cc (respawn_wow64_process): Make inline function. Remove
"noreturn" attribute.  Add additional check if parent process is
	actually a 64 bit process.
	(dll_entry): Only test WOW64 processes with a stack in the usual
	"dangerous" process space area.
2005-08-14 19:48:07 +00:00
Christopher Faylor b4ec184199 fix typo 2005-08-11 17:18:18 +00:00
Christopher Faylor 205a575188 * fhandler_serial.cc (fhandler_serial::tcgetattr): Return current baud rate
regardless of current DTR state.
2005-08-11 17:03:18 +00:00
Christopher Faylor b21413b304 * dcrt0.cc: Remove ld_preload declaration.
* winsup.h: Move ld_preload declaration here.
* fork.cc (fork_child): Call ld_preload() before returning.
2005-08-11 16:30:48 +00:00
Christopher Faylor ff7bdd11f5 * child_info. (CURR_CHILD_INFO_MAGIC): Refresh.
(child_info::child_info()): New constructor.
(child_info_spawn::child_info_spawn()): Ditto.
(child_info_spawn::operator new): New operator.
(child_info_spawn::set): New function.
* spawn.cc (av()): New constructor.
(av::operator new): New operator.
(av::set): New function.
(spawn_guts): Reorganize so that classes which allocates are defined early in
the function so that it can be properly cleaned up after an efault.  Set errno
to E2BIG in the event of a SEGV situation.
2005-08-11 16:13:30 +00:00
Christopher Faylor d4c8f095ba * include/sys/cdefs.h: Remove extra line. 2005-08-08 18:54:28 +00:00
Corinna Vinschen 2ab8ea6738 * security.cc (get_reg_security): New static function.
(get_nt_object_security): Call get_reg_security for registry keys
	to circumvent problems with predefined registry keys.
2005-08-08 16:30:15 +00:00
Corinna Vinschen af925fe4fa * fhandler_process.cc (fhandler_process::open): Allow opening of
/proc/<pid>/fd for reading.
	* fhandler_registry.cc (fhandler_registry::open): Ditto for registry
	keys.
2005-08-08 15:33:32 +00:00
Christopher Faylor 6e8cac2638 * include/sys/cdefs.h (__CONCAT): Define.
* include/elf.h: New file.
* include/sys/elf32.h: Ditto.
* include/sys/elf64.h: Ditto.
* include/sys/elf_common.h: Ditto.
* include/sys/elf_generic.h: Ditto.
2005-08-08 15:00:39 +00:00
Christopher Faylor 2e82c9355f * cygwin.sc: Use simpler method to align .cygheap.
* dllfixdbg: Just copy .stab and .stabstr sections when making cygwin1.dbg,
rather than relying on objcopy to keep only the debug sections since objcopy
seems to get it wrong.
* dtable.cc (build_fh_pc): Check setting fh to fhandler_nodevice for NULL, too.
2005-08-08 13:53:05 +00:00
Corinna Vinschen a8b939adc7 * ftw.c: Include winsup.h.
* nftw.c: Ditto.
	* include/ftw.h: Guard declarations appropriately.
2005-08-08 13:39:56 +00:00
Corinna Vinschen e6ae6cd338 * Makefile.in (DLL_OFILES): Add fts.o, ftw.o, nftw.o.
* cygwin.din: Export fts_children, fts_close, fts_get_clientptr,
	fts_get_stream, fts_open, fts_read, fts_set, fts_set_clientptr,
	ftw, nftw.
	* fts.c: New file, imported from FreeBSD.
	* ftw.c: Ditto.
	* nftw.c: Ditto.
	* include/fts.h: Ditto.
	* include/ftw.h: Ditto.
	* include/cygwin/version.h: Bump API minor number.
2005-08-08 09:45:42 +00:00
Christopher Faylor 6a7bea70f0 * Makefile.in (dtable_CFLAGS): Use -fomit-frame-pointer and -fcheck-new.
* cygheap.cc (cmalloc): Only emit system_printf warnings on failure if
DEBUGGING.
(crealloc): Ditto.
(ccalloc): Ditto.
* dtable.cc (build_fh_name): Treat NULL return from cnew as indicative of
EMFILE condition.
(build_fh_dev): Ditto.
(dtable::dup_worker): Handle NULL return from build_fh_pc.
(dtable::vfork_child_dup): Trust dup_worker to set errno.
* fhandler.h (fhandler_base::new): Mark as nothrow.
2005-08-08 04:06:07 +00:00
Christopher Faylor cbda22eb63 * dllfixdbg: New perl script.
* configure.in: Detect objcopy, objdump, strip.
* configure: Regenerate.
* Makefile.in: Pass target objcopy/objdump to new dllfixdbg script.  Remove
previous perl check.
* cygwin.sc: Add .gnu_debuglink_overlay section for eventual replacement with
.gnu_debuglink section.  Revert move of cygheap to end of image.
2005-08-08 02:27:43 +00:00
Corinna Vinschen 1e0cb9ee0a * Makefile.in: Allow previous patch to work in a 64 bit environment. 2005-08-07 09:21:09 +00:00
Christopher Faylor 82eaabf521 * Makefile.in: Warn when end of cygheap is not on 64k boundary.
* cygwin.sc: Try harder to ensure that cygheap is on a 64k boundary.  Move
cygheap to end of image to stop interference from unstripped debug regions.
2005-08-07 02:38:13 +00:00
Christopher Faylor 244f5a27a6 * include/endian.h: Move everything into this file and define things more like
linux.
* include/cygwin/types.h: Include endian.h.
* include/sys/dirent.h: Define DT_* types and conversion macros.
* pinfo.cc (pinfo::init): Remove special handling for PID_ALLPIDS and execed
code, even though it probably still isn't quite right.
2005-08-06 23:00:06 +00:00
Corinna Vinschen 7d7e7a21b1 * thread.cc (pthread::create(3 args)): Make bool.
(pthread_null::create): Ditto.
	(pthread::create(4 args)): Check return of inner create rather than
	calling is_good_object().
	* thread.h: Ditto.
2005-08-05 16:14:41 +00:00
Corinna Vinschen c8f07ce787 * fhandler_tty.cc (fhandler_tty_slave::tcflush): Return either 0 or -1. 2005-08-05 16:11:21 +00:00
Corinna Vinschen 8cba692063 * thread.cc (pthread_cond_timedwait): Check abstime for validity
according to SUSv3.  Rewrite timeout check and waitlength calculation
	to avoid overflow problems.
2005-08-05 11:31:33 +00:00
Corinna Vinschen 723d64e667 * include/sys/termios.h: Define TIOCMBIS and TIOCMBIC.
* fhandler.h (class fhandler_serial): Declare switch_modem_lines.
	* fhandler_serial.cc (fhandler_serial::switch_modem_lines): New
	static function to set or clear DTR and/or RTS.
	(fhandler_serial::ioctl): Use switch_modem_lines for TIOCMSET
	and new TIOCMBIS and TIOCMBIC.
	* include/cygwin/version.h: Bump API minor number.
2005-08-02 09:17:15 +00:00
Christopher Faylor 88c5a50f9f * fhandler_disk_file.cc (fhandler_base::pread): Don't move file offset pointer
after I/O.
(fhandler_base::pwrite): Ditto.
2005-07-29 17:26:10 +00:00
Christopher Faylor 7d7d09aee8 * fhandler.h (fhandler_base::pread): Declare new function.
(fhandler_base::pwrite): Ditto.
(fhandler_disk_file::pread): Ditto.
(fhandler_disk_file::pwrite): Ditto.
* fhandler.cc (fhandler_base::pread): Define new function.
(fhandler_base::pwrite): Ditto.
* fhandler_disk_file.cc (fhandler_base::pread): Ditto.
(fhandler_base::pwrite): Ditto.
* syscalls.cc (pread): Define new function.
(pwrite): Ditto.
* cygwin.din: Export pread, pwrite.
* include/sys/ioctl.h: Guard some _IO* declarations to avoid conflict with
socket.h.
2005-07-29 17:04:46 +00:00
Christopher Faylor 728b9af5c9 * include/sys/ioctl.h: Add some linux defines. 2005-07-29 15:26:18 +00:00
Christopher Faylor b78b8f53ae * pinfo.cc (pinfo::init): Put back accidentally removed debug_printf. 2005-07-29 14:33:50 +00:00
Christopher Faylor 2b3fc7325c * cygthread.cc (cygthread::simplestub): Wait for h to be filled out by main
thread before assigning it.
2005-07-29 14:29:33 +00:00
Christopher Faylor 40c125cf38 * pinfo.cc (pinfo::init): Sleep before retrying open_shared(). 2005-07-29 14:25:28 +00:00
Christopher Faylor f834829dee * fork.cc (fork_parent): Fix null deref if pinfo creation fails. 2005-07-29 14:22:56 +00:00
Christopher Faylor 4fe79f1c97 * cygmalloc.h (MSPACES): Define. This dropped through the cracks after the
last malloc update.
* dcrt0.cc: Fix a comment.
* malloc.cc (internal_malloc): Fix definition so that it can be safely coerced.
2005-07-28 17:03:34 +00:00
Christopher Faylor 09b490911c * include/cygwin/in.h (INET_ADDRSTRLEN): Add new definition. 2005-07-27 17:35:18 +00:00
Christopher Faylor efc7accc9d * gendef: Use nocr to remove \r's from input. gendef (nocr): New function. 2005-07-27 16:16:51 +00:00
Christopher Faylor a3c024d6ea * fhandler_clipboard.cc (fhandler_dev_clipboard::close): Set membuffer to NULL.
(fhandler_dev_clipboard::fixup_after_exec): Don't call close here.  Just set
variables directly.
2005-07-27 14:33:09 +00:00
Christopher Faylor 0a911c4e6d * include/byteswap.h: New file. 2005-07-26 00:55:42 +00:00
Christopher Faylor 33e7a6bb89 * include/cygwin/types.h: Define loff_t. 2005-07-25 21:46:36 +00:00
Christopher Faylor e8454a3400 * child_info.h (child_info::sync): Pass pid and HANDLE rather than using pinfo.
(child_info::child_info): Accept an argument controlling whether to create
proc_subproc.
(child_info_spawn::child_info_spawn): Ditto.
* sigproc.cc (child_info::child_info): Ditto.
(child_info_spawn::child_info_spawn): Ditto.
(child_info::sync): Use passed in pid and HANDLE.
* fork.cc (fork_parent): Reflect additional arguments required for
child_info::sync.
* hookapi.cc (hook_or_detect_cygwin): Rename.  Change so that NULL 'fn'
argument just returns "true", indicating that program uses cygwin1.dll.
* spawn.cc (av::win16_exe): New element.
* spawn.cc (av::iscygwin): New element.
(av::fixup): New function.
(spawn_guts): Protect against SEGV.  Use fixup function to detect when it is
safe to wait for a spawned (as opposed to an execed) program.  Reflect changes
in child_info::sync arguments.
* external.cc (cygwin_internal): Reflect function renaming to
hook_or_detect_cygwin.
* cygheap.cc (cygheap_fixup_in_child): Close handle after debug fixup has been
done to prevent false positives in handle collision.
* exceptions.cc (try_to_debug): Notify debugger if already being debugged.
2005-07-17 00:51:03 +00:00
Christopher Faylor f79359a5bc * path.cc (mount): Only check win32_path when we know we need it. 2005-07-09 17:15:38 +00:00
Corinna Vinschen 4cc9a82e3e * cygwin.din (getline): Export.
(getdelim): Export.
	* include/sys/stdio.h (getline): Replace macro with function prototype.
	(getdelim):  Likewise.
	* include/cygwin/version.h: Bump API minor number.
2005-07-09 08:22:39 +00:00
Corinna Vinschen 2f5de4af55 * cygwin.din (__getline): Export.
(__getdelim): Export.
	* include/sys/stdio.h (getline): Define as __getline.
	(getdelim): Define as __getdelim.
	* include/cygwin/version.h: Bump API minor number.
2005-07-08 08:24:13 +00:00
Christopher Faylor 0c55f6ed60 Eliminate (void) cast on standalone function calls throughout. 2005-07-06 20:05:03 +00:00
Christopher Faylor d3b593aa44 * dcrt0.cc (cygwin_exit): Mark as "noreturn".
* sigproc.cc (child_info::ready): Don't signal parent that we are a cygwin
process if we are dynamically loaded.
2005-07-05 20:20:48 +00:00
Christopher Faylor 57000a5d5c * malloc.cc: Update to version 2.8.2. 2005-07-05 15:11:49 +00:00
Corinna Vinschen 4ae72e8c0e * fhandler_tape.cc (fhandler_dev_tape::close): Don't do "extra stuff"
when we know we're execing.
2005-07-05 07:28:52 +00:00
Christopher Faylor 2f9ae2ed94 Change foo (void) to foo () for all c++ functions throughout. Remove all
fhandler_*::dump functions throughout.
* fhandler.h (fhandler_dev_mem::close): Remove pass-through function in favor
of virtual method.
(handler_dev_raw::close): Ditto.
(fhandler_dev_clipboard::fixup_after_exec): New method.
* fhandler_dev_mem.cc (fhandler_dev_mem::close): Eliminate pass through
* fhandler_dev_raw.cc (fhandler_dev_raw::close): Ditto.
* fhandler_clipboard.cc (fhandler_dev_clipboard::close): Don't go to extra
effort when execing.
(fhandler_dev_clipboard::fixup_after_exec): New function.
* fhandler_console.cc (fhandler_console::close): Don't do "extra stuff" when we
know we're execing.
* fhandler_disk_file.cc (fhandler_disk_file::close): Ditto.
* fhandler_dsp.cc (fhandler_dev_dsp::close): Ditto.
* fhandler_fifo.cc (fhandler_fifo.cc::close): Ditto.  function in favor of base
function.
* fhandler_random.cc (fhandler_dev_random::close): Ditto.
* fhandler_registry.cc (fhandler_registry::close): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::close): Ditto.
* fhandler_virtual.cc (fhandler_virtual::close): Ditto.
* pinfo.cc (proc_waiter): Remove unneeded hExeced declaration.
* sigproc.cc: Ditto.
* winsup.h (hExeced): Define here.
* fhandler_virtual.cc (fhandler_virtual::fixup_after_exec): Just call close()
to reinitialize things to known state.
2005-07-05 03:16:46 +00:00
Christopher Faylor 26edeb6a7f * cygtls.h (_cygtls): Perform minor reformatting.
* winsup.h (close_all_files): Reflect argument change.
* dtable.cc (close_all_files): Ditto.
* dtable.h: Ditto.
* fhandler.h: Ditto.
* spawn.cc (spawn_guts): Move close_all_files back to its original location in
first P_OVERLAY test but use argument denoting that handles are only supposed
to be closed, not released (more work to be done here).
* syscalls.cc (close_all_files): Take an argument denoting whether to release
closed files or not.
* path.cc (symlink): Change argument names to reflect linux man page.
(symlink_worker): Ditto.  Also appropriately set ENOENT for empty strings.
2005-07-05 02:05:07 +00:00
Corinna Vinschen 0740b418fc * cygheap.h (struct init_cygheap): Delete cygwin_regname member.
* external.cc (cygwin_internal): Use cygpsid::get_id for
	CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID.
	Turn CW_SET_CYGWIN_REGISTRY_NAME and CW_GET_CYGWIN_REGISTRY_NAME
	into noops.
2005-07-04 08:44:06 +00:00
Christopher Faylor aaa4ee1b89 * thread.cc (pthread_mutex::init): Remove unneeded efault/mutex check. 2005-07-03 04:05:00 +00:00
Christopher Faylor 9d2a12f47a add missing ChangeLog entries 2005-07-03 03:44:56 +00:00
Christopher Faylor 4c157aa9e5 * thread.h (verifyable_object_state verifyable_object_isvalid): Delete function
declaration that should have been static.
* thread.cc (verifyable_object_state verifyable_object_isvalid): Make inline
static.
(pthread*::is_good_object): Move to directly after verifyable_object_state
verifyable_object_isvalid and make inline.
2005-07-03 03:25:19 +00:00
Christopher Faylor 893ac8e03c Replace valid memory checks with new myfault class "exception handling", almost
everywhere.  Leave some thread.cc stuff alone for now.
* cygtls.h: Kludge some definitions to avoid including a problematic windows
header.
(_cygtls::_myfault): New entry.
(_cygtls::_myfault_errno): Ditto.
(_cygtls::fault_guarded): New function.
(_cygtls::setup_fault): Ditto.
(_cygtls::return_from_fault): Ditto.
(_cygtls::clear_fault): Ditto.
(myfault): New class.
* exceptions.cc (handle_exceptions): Handle case of guarded fault in system
routine.
* gendef: Add another entry point for setjmp that the compiler doesn't know
about and won't complain about.
* gentls_offsets: Just include windows.h rather than kludging a HANDLE def.
* miscfuncs.cc (check_null_str): Delete.
(check_null_empty_str): Ditto.
(check_null_empty_str_errno): Ditto.
(check_null_str_errno): Ditto.
(__check_null_invalid_struct): Ditto.
(__check_null_invalid_struct_errno): Ditto.
(__check_invalid_read_ptr): Ditto.
(__check_invalid_read_ptr_errno): Ditto.
(dummytest): New function.
(check_iovec_for_read): Delete.
(chec_iovec): Rename from check_iovec_for_write.  Take a read/write parameter.
* tlsoffsets.h: Regenerate.
* winsup.h: Remove check_* declarations.
(check_iovec_for_read): Delete declaration.  Turn into a define instead.
(check_iovec_for_write): Ditto.
(check_iovec): New declaration.
* thread.h: Use ifdef guard name consistent with other header files.
2005-07-03 02:40:30 +00:00
Christopher Faylor 3513b0478a * include/cygwin/version.h: Bump DLL minor number to 19. 2005-07-03 02:03:58 +00:00
Corinna Vinschen f2abf3173b * fhandler.cc (fhandler_base::readv): Use malloc/free instead of alloca.
(fhandler_base::writev): Ditto.
2005-06-30 17:00:10 +00:00
Christopher Faylor 5b3e1f7358 * cygerrno.h: Make multi-inclusion safe.
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Deal with EINTR.
* dcrt0.cc (dll_crt0_0): Accommodate init_console_handler argument change.
* winsup.h: Ditto.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
* exceptions.cc (init_console_handler): Ditto.  Ignore console events if we're
not attached to a terminal.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
* wincap.cc: Implement has_null_console_handler_routine throughout.
* wincap.h: Ditto.
2005-06-30 02:52:14 +00:00
Christopher Faylor 87e8bd37a0 * autoload.cc (LoadDLLprime): Use a more descriptive name for autoload text
sections.
* cygwin.sc: Ditto.
2005-06-29 23:05:41 +00:00
Corinna Vinschen f1fb564952 * fhandler_disk_file.cc (fhandler_disk_file::facl): Add missing break. 2005-06-27 14:18:13 +00:00
Corinna Vinschen 677ded600c * path.cc (path_conv::check): Don't strip trailing dots and spaces
at the start of the path.
2005-06-24 09:15:05 +00:00
Corinna Vinschen 3b12a57cb6 * fhandler.cc (rootdir): Don't set errno.
* syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed.
2005-06-24 09:12:15 +00:00
Corinna Vinschen d9c1b93d19 * fhandler.h (class fhandler_dev_tape): Add declaration for
fixup_after_fork and set_close_on_exec.
	* fhandler_tape.cc (fhandler_dev_tape::open): Create mt_mtx mutex
	inheritable.
	(fhandler_dev_tape::close): Close mt_mtx.
	(fhandler_dev_tape::dup): Duplicate mt_mtx and mt_evt as necessary.
	(fhandler_dev_tape::fixup_after_fork): New method.
	(fhandler_dev_tape::set_close_on_exec): New method.
2005-06-22 19:59:19 +00:00
Corinna Vinschen 2a770b2a6f * security.cc (get_initgroups_sidlist): Drop special_pgrp parameter.
(get_setgroups_sidlist): Avoid duplicate groups in group list.
	(create_token): Remove special_pgrp local variable.  Accomodate
	change to get_initgroups_sidlist call.
2005-06-21 20:38:05 +00:00
Corinna Vinschen 4adc3db74e * uinfo.cc (uinfo_init): Call reimpersonate to set the main thread's
impersonation token.
2005-06-21 20:09:31 +00:00
Corinna Vinschen 74041a3a74 * fhandler_proc.cc (format_proc_partitions): Only list recognized
partitions.  Use partition number given by PartitionNumber member.
2005-06-20 19:58:26 +00:00
Corinna Vinschen fa2d9fc528 * glob.c: (glob0): New local variable `limit`. Use in calls to glob1
and globextend.
	(glob1): Add `limit' parameter.
	(glob2): Ditto.
	(glob3): Ditto.
	(globextend): Ditto. Implement GLOB_LIMIT handling.
	* include/glob.h (GLOB_LIMIT): New define.
	* include/cygwin/version.h: Bump API minor number.
2005-06-18 19:04:25 +00:00
Christopher Faylor 91717fb806 * wincap.h (wincaps::detect_win16_exe): Declare.
(wincapc::detect_win16_exe): Implement.
* wincap.cc: Populate detect_win16_exe where appropriate.
* spawn.cc (spawn_guts): Only go out of the way to detect 16-bit apps on
systems which are flummoxed by them.
2005-06-18 01:36:18 +00:00
Christopher Faylor 2bc6be1eda * spawn.cc (spawn_guts): Detect when executing a 16-bit application and avoid
setting the process pipe since this causes conniptions in Windows 9x.
2005-06-18 01:27:06 +00:00
Corinna Vinschen b3ba5059da * cygwin.din (inet_pton): Export.
(inet_ntop): Export.
	* net.cc (cygwin_inet_pton): Implement inet_pton for AF_INET for now.
	(cygwin_inet_ntop): Implement inet_ntop for AF_INET for now.
	* include/arpa/inet.h (inet_pton): Declare.
	(inet_ntop): Declare.
	* include/cygwin/version.h: Bump API minor number.
2005-06-17 20:01:59 +00:00
Corinna Vinschen 29b111ce59 * fhandler.h (fhandler_union): Add missing members corresponding to
fhandler_fifo and fhandler_netdrive.
2005-06-17 11:44:45 +00:00
Corinna Vinschen ec3b136a64 * syscalls.cc (statvfs): Handle the case when GetDiskFreeSpaceEx
succeeds but GetDiskFreeSpace fails by faking bytes-per-sector and
	sectors-per-cluster values.
2005-06-16 15:46:40 +00:00
Christopher Faylor 7a9b2d82ec add missing entry 2005-06-15 22:51:05 +00:00
Christopher Faylor a9c461626e * cygthread.cc (cygthread::detach): Fix debugging output.
* dcrt0.cc (dll_crt0_1): Create signal_arrived early -- before any filename
manipulation.
* sigproc.cc (sigproc_init): Don't create signal_arrived here.
* fork.cc (fork_child): Ditto.
2005-06-15 22:50:31 +00:00
Christopher Faylor 0fc9cf11f8 * path.cc (path_conv::check): Always reset to FH_FS when component != 0 and
FH_NETDRIVE to fix problems with strict case checking.
2005-06-14 23:52:53 +00:00
Corinna Vinschen 3925b4afc4 * fhandler_socket.cc (fhandler_socket::recvmsg): Avoid SEGV in OpenSSH
when trying to pass file descriptor by setting msg->msg_accrightslen
	to 0.
2005-06-12 12:01:09 +00:00
Christopher Faylor 88cbbd450e * Makefile.in: Avoid initial heap allocation since cygwin has its own heap. 2005-06-11 21:00:23 +00:00
Christopher Faylor b945228cb6 * fhandler_console.cc (fhandler_console::read): Fix a compiler warning. 2005-06-11 05:09:25 +00:00
Christopher Faylor 8556456790 * include/pthread.h: Change PTHREAD_MUTEX_DEFAULT to PTHREAD_MUTEX_NORMAL.
Revert PTHREAD_MUTEX_INITIALIZER to PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
since that is actually closer to what linux does.
* thread.h (cw_cancel_action): New enum.
(cancelable_wait): Use cw_cancel_action as third argument.
* thread.cc (cancelable_wait): Ditto.  Don't wait for cancel if cancel_action
== cw_no_cancel.
(pthread::create): Don't wait for cancel event since that is racy.
(pthread_mutex::pthread_mutex): Set default to PTHREAD_MUTEX_ERRORCHECK.
(pthread_mutexattr::pthread_mutexattr): Ditto.
(pthread_mutex::_lock): Tell cancelable_wait not to wait for cancellation
event.
(semaphore::_timedwait): Accommodate change in cancelable_wait args.
(pthread::join): Ditto.
2005-06-11 04:56:36 +00:00
Corinna Vinschen b4177338e1 * fhandler_socket.cc (fhandler_socket::sendto): Always initialize
ret to 0.
	(fhandler_socket::sendmsg): Ditto.
2005-06-10 21:47:24 +00:00
Corinna Vinschen 5680109cf6 * cygwin.din (imaxabs): Export.
(imaxdiv): Export.
	(llabs): Export.
	(lldiv): Export.
	(strtoimax): Export.
	(strtoumax): Export.
	* include/inttypes.h (imaxabs): Activate declaration.
	(imaxdiv): Ditto.
	(strtoimax): Ditto.
	(strtoumax): Ditto.
	* include/cygwin/version.h: Bump API minor.
2005-06-10 12:11:35 +00:00
Christopher Faylor 1b96f7da45 * cygthread.cc (cygthread::detach): Improve diagnostics for what should be an
impossible failure condition.
2005-06-09 23:48:08 +00:00
Christopher Faylor 9a91777205 * cygtls.h (_local_storage::setmode_file): New element.
(_local_storage::setmode_mode): New element.
* tlsoffsets.h: Regenerate.
* cygwin.din (setmode): Define as cygwin_getmode.
* syscalls.cc (setmode_helper): Use setmode_* variables from tls rather than
using unthreadsafe static.
(setmode): Break out fwalk stuff.
(cygwin_setmode): New function.  Put fwalk stdio stuff here.
2005-06-09 22:33:57 +00:00
Christopher Faylor fa0dcd0d65 * thread.cc (pthread_mutex::_lock): Use cancelable_wait rather than
WaitForSingleObject.
2005-06-09 20:59:59 +00:00
Christopher Faylor 85cd5c3d57 * cygwin.sc: Place .cygwin_dll_common in a more sensible spot. 2005-06-09 20:46:00 +00:00
Christopher Faylor 0acb042081 * cygwin.sc: Place .cygwin_dll_common.
* init.cc (threadfunc_ix): Use a more common name for the section name.
2005-06-09 19:29:27 +00:00
Christopher Faylor 8891625cbf * include/pthread.h (PTHREAD_MUEXT_INITIALIZER): Change to
PTHREAD_NORMAL_MUTEX_INITIALIZER_NP to be closer to linux default.
2005-06-09 15:30:44 +00:00
Christopher Faylor abf60784be * thread.cc (cancelable_wait): No-op change to make sure that res is always a
valid WFMO return.
2005-06-09 05:14:02 +00:00
Christopher Faylor ed364fa9fb Change pthread::cancelable_wait to just cancelable_wait, throughout.
* thread.h (cw_sig_wait): New enum.
(fast_mutex::lock): Use cancelable_wait with resumable signal.
(cancelable_wait): Change fourth argument to cw_sig_wait enum.
* thread.cc (cancelable_wait): Ditto.  Loop on signal detection if fourth
argument == cw_sig_resume.
2005-06-09 05:11:51 +00:00
Christopher Faylor a63c42932e * cygwin.sc: Apparently nonloading sections need to go last. 2005-06-08 20:56:34 +00:00
Christopher Faylor ad96f0997b * cygwin.sc: Restore resource and reloc sections and use more modern syntax for
stabs sections.
2005-06-08 20:18:23 +00:00
Christopher Faylor 7273344558 * environ.cc (spenvs): Remove cut/paste error which associated CYGWIN_DEBUG
with HOME.
2005-06-08 15:42:58 +00:00
Corinna Vinschen ce132d0ffd * security.cc (cygwin_logon_user): Run LogonUser in the primary
process token context.  Fix potential handle leak.
2005-06-08 10:06:17 +00:00
Corinna Vinschen 7311cc1f0c * pinfo.cc (pinfo::init): Define sa_buf as PSECURITY_ATTRIBUTES and
allocate dynamically.
	(pinfo::set_acl): Replace sa_buf by dynamically allocated acl_buf.
	* sec_acl.cc (setacl): Allocate acl dynamically.
	* sec_helper.cc (sec_acl): Add test for alignment of acl when
	DEBUGGING is defined.
	(__sec_user): Same for sa_buf.
	* security.cc (verify_token): Define sd_buf as PSECURITY_DESCRIPTOR
	and allocate dynamically.
	(alloc_sd): Allocate acl dynamically.
	security.h (sec_user_nih): Change first parameter to
	SECURITY_ATTRIBUTES *.
	(sec_user): Ditto.
	* sigproc.cc (wait_sig): Define sa_buf as PSECURITY_ATTRIBUTES and
	allocate dynamically.
	* syscalls.cc (seteuid32): Define dacl_buf as PACL and allocate
	dynamically.
	* uinfo.cc (cygheap_user::init): Define sa_buf as PSECURITY_ATTRIBUTES
	and allocate dynamically.
	* winbase.h (ilockincr): Mark first argument of inline assembly as
	earlyclobber.
	(ilockdecr): Ditto.
2005-06-07 19:31:42 +00:00
Christopher Faylor b739751db9 * cygthread.cc (cygthread::detach): Make error message a little more detailed.
* fhandler.cc (fhandler_base::raw_read): Ditto for debug message.
* dcrt0.cc (do_exit): Add some more synchronization tests.
* fhandler_fifo.cc (fhandler_fifo::dup): Don't duplicate a nonexistent handle.
Use derived return value rather than always retuning 0.
* fhandler_netdrive.cc (fhandler_netdrive::exists): Wnet -> WNet.
* winsup.h (exit_states): Add a couple of new exit states.
2005-06-07 18:41:31 +00:00
Christopher Faylor 405e757cf9 reformat ChangeLog entry slightly. 2005-06-06 21:12:00 +00:00