summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
...
* * ntdll.h (SharedUserData): Add volatile qualifier. This fixes aCorinna Vinschen2012-03-203-6/+17
| | | | possible infinite loop in hires_ms::timeGetTime_ns.
* * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.Christopher Faylor2012-03-209-111/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (child_info::rd_proc_pipe): Declare new field. (child_info::wr_proc_pipe): Ditto. (child_info::prefork): Declare new function, derived from previous pinfo version. * dcrt0.cc (child_info_fork::handle_fork): Close previous wr_proc_pipe when appropriate and assign new one from passed-in child_info block. (child_info_spawn::handle_spawn): Assign our wr_proc_pipe handle from passed-in child_info block. * fork.cc (child_info::prefork): Define new function. (frok::child): Clear rd_proc_pipe and wr_proc_pipe so they will not be closed by the child_info destructor. (frok::parent): Use child_info prefork handling, outside of retry loop. Set rd_proc_pipe in child's pinfo after successful CreateProcess. Eliminate postfork call. * globals.cc (my_wr_proc_pipe): Define/declare new variable. * pinfo.cc (pinfo::pending_rd_proc_pipe): Delete. (pinfo::pending_wr_proc_pipe): Ditto. (pinfo::prefork): Ditto. (pinfo::postfork): Ditto. (pinfo::postexec): Ditto. (pinfo::wait): Assume that rd_proc_pipe is set up correctly prior to call. (_pinfo::alert_parent): Replace "wr_proc_pipe" with "my_wr_proc_pipe". * pinfo.h (_pinfo::_wr_proc_pipe): Delete declaration. (_pinfo::set_rd_proc_pipe): Define new function. (pinfo::pending_rd_proc_pipe): Delete declaration. (pinfo::pending_wr_proc_pipe): Ditto. (pinfo::prefork): Ditto. (pinfo::postfork): Ditto. (pinfo::postexec): Ditto. (pinfo::wr_proc_pipe): Ditto. * sigproc.cc (child_info::child_info): Clear rd_proc_pipe and wr_proc_pipe. (child_info::cleanup): Close rd_proc_pipe and wr_proc_pipe if necessary. (child_info_fork::child_info_fork): Set forker_finished to NULL by default. (child_info_spawn::child_info_spawn): Use my_wr_proc_pipe rather than myself->wr_proc_pipe. (child_info::sync): Ditto. (child_info_spawn::cleanup): Call child_info::cleanup. * spawn.cc (child_info_spawn::worker): Remove call to myself.prefork(). Set wr_proc_pipe when execing or set up new rd_proc_pipe/wr_proc_pipe via child_info::prefork when spawning. Remove call to pinfo::postexec. Set rd_proc_pipe in child pinfo when spawning. Use my_wr_proc_pipe rather than myself->wr_proc_pipe. Remove call to postfork.
* * pinfo.cc (pinfo_init): Cosmetic change: unset "destroy" for myself.Christopher Faylor2012-03-203-8/+28
| | | | | | | | | (pinfo::wait): Change some comments. (pinfo::prefork): Move a comment. (pinfo::postfork): Set pending_*_pipe variables to NULL if closed. (pinfo::postexec): Use right name when closing handle. (_pinfo::alert_parent): Ditto. * sigproc.h (hold_everything): Remove debugging label.
* * cygserver_ipc.h: Include sigproc.h for signal_arrived declaration.Christopher Faylor2012-03-192-1/+6
|
* * cygprops.h: Use #pragma once.Christopher Faylor2012-03-195-22/+33
| | | | | | | * mkglobals_h: Ditto for generated globals.h file. * globals.cc: Use specific NO_GLOBALS_H flag to control inclusion of globals.h. * winsup.h: Honor NO_GLOBALS_H to control inclusion of globals.h. Make clear_procimptoken extern inline so that it is only defined when needed.
* * thread.cc (cancelable_wait): Don't malloc tbi, just make it a structCorinna Vinschen2012-03-192-5/+9
| | | | on the stack to avoid memory leak.
* * pinfo.cc (pinfo::wait): Handle case where prefork was not called prior toChristopher Faylor2012-03-192-5/+14
| | | | | calling wait(). This is the case when we are reabsorbing processes after being execed.
* * fork.cc (lock_signals): Move to sigproc.h.Christopher Faylor2012-03-167-169/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (lock_pthread): Ditto. (hold_everything): Ditto. (frok::parent): Call myself.prefork() just before calling CreateProcess. Call myself.postfork () on function exit. * pinfo.cc (pinfo::pending_rd_proc_pipe): Define. (pinfo::pending_wr_proc_pipe): Ditto. (_pinfo::dup_proc_pipe): Delete. (pinfo::wait): Move pipe creation into pinfo::prefork. Set pipe variables from pending_*. (_pinfo::sync_proc_pipe): Delete. (_pinfo::proc_pipe_owner): Ditto. (pinfo::prefork): Define new function. (pinfo::postfork): Ditto. (pinfo::postexec): Ditto. (_pinfo::alert_parent): Remove obsolete call to sync_proc_pipe. (_pinfo::dup_proc_pipe): Delete declaration. (_pinfo::sync_proc_pipe): Ditto. (pinfo::pending_rd_proc_pipe): Declare. (pinfo::pending_wr_proc_pipe): Ditto. (pinfo::prefork): Declare new function. (pinfo::postfork): Ditto. (pinfo::postexec): Ditto. (pinfo::wr_proc_pipe): Define new wrapper function. * sigproc.h: Include "sync.h". Move locking functions from fork to here. * spawn.cc (child_info_spawn::worker): Delete now-unneeded requirement to record orig_wr_proc_pipe. Call hold_everything prior to doing anything. Call myself.prefork() if spawning. Replace wr_proc_pipe synchronization with call to myself.postexec(). Call myself.postfork() if not execing. * sync.h: Replace #ifdef wrapper with "#pragma once".
* * hookapi.cc (hook_or_detect_cygwin): Change condition when to useCorinna Vinschen2012-03-132-11/+19
| | | | | importRVAMaxSize or importRVASize for the mapping size. Make sure to map never more than the section size. Change comments accordingly.
* * include/netdb.h (h_errno): Add self-referencing macro and comment.Corinna Vinschen2012-03-132-0/+7
|
* Christopher Faylor <me.cygwin2012@cgf.cx>Christopher Faylor2012-03-123-1/+22
| | | | | | | | | | | * fhandler.h (wait_return): Add overlapped_nullread. * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Detect zero-byte read as a special case. (fhandler_base_overlapped::raw_read): Keep looping when zero-byte read detected without EOF. (fhandler_base_overlapped::raw_write): Quiet gcc warning by adding overlapped_nullread to switch statement even though it will never actually be hit.
* * dtable.cc (fh_alloc): Treat pc.dev as unsigned.Christopher Faylor2012-03-103-5/+9
| | | | | * fhandler_console.cc (fhandler_console::set_unit): Use lock always to avoid races between competing cygwin processes running on the console.
* * hookapi.cc (find_first_notloaded_dll): Fix a compiler warning.Corinna Vinschen2012-03-092-1/+5
|
* * hookapi.cc (rvadelta): Add parameter to return maximum availableCorinna Vinschen2012-03-092-18/+110
| | | | | | | | | | | | size from start of import RVA table to end of section. (find_first_notloaded_dll): Take big executables into account. Use offset and size computation as in hook_or_detect_cygwin, just simpler. (hook_or_detect_cygwin): Return NULL rather than false througout. Change computation of required mapping size to take non-gcc compilers into account. Explain the differences and what we do against them. Don't alloca buf if fn is NULL. Never use buf if fn is NULL. Fix name and address in previous ChangeLog entry.
* * net.cc (call_gaa): New thread function to call GetAdaptersAddresses.Corinna Vinschen2012-03-082-15/+56
| | | | | (get_adapters_addresses): Call call_gaa. If necessary, call it as child thread. Explain why that's necessary.
* * path.cc (readlink): Avoid calling strlen() twice.Corinna Vinschen2012-03-082-1/+6
|
* * Throughout, replace usage of w32api's min with MIN from sys/param.h.Corinna Vinschen2012-03-0812-25/+38
|
* * pinfo.cc (_pinfo::dup_proc_pipe): Reorganize to provide more information forChristopher Faylor2012-03-074-15/+29
| | | | | | | | failing condition. (pinfo::wait): Pass name of function to dup_proc_pipe. Eliminate error check for dup_proc_pipe since it never actually returned an error. * pinfo.h (_pinfo::dup_proc_pipe): Add an argument. * spawn.cc (child_info_spawn::worker): Pass name of function to dup_proc_pipe.
* * glob.cc (MAXPATHLEN): Reinstantiate with a value of 8192.Corinna Vinschen2012-03-072-0/+7
|
* * pinfo.cc (_pinfo::dup_proc_pipe): Fix order of arguments in debugCorinna Vinschen2012-03-052-1/+6
| | | | output.
* * init.cc (dll_entry): Move wincap.init call back from here...Corinna Vinschen2012-03-053-3/+8
| | | | * dcrt0.cc (dll_crt0_0): ...to here.
* * cygheap.h (enum fcwd_version_t): Move here from path.cc.Corinna Vinschen2012-03-053-192/+226
| | | | | | | | | | (class fcwd_access_t): Ditto. Only declare methods. (class cwdstuff): Move fast_cwd_ptr and fast_cwd_version from shared DLL section here. * path.cc: Keep fcwd_access_t method definitions. (fcwd_access_t::fast_cwd_version): New method. (find_fast_cwd_pointer): Change comment. Mention test on W8CP. (cwdstuff::init): Initialize fast_cwd_ptr and fast_cwd_version.
* * dll_init.cc (dll_list::operator[]): Extend comment a bit more toCorinna Vinschen2012-03-052-1/+21
| | | | explain previous patch.
* * dll_init.cc (dll_list::alloc): Compare linked DLLs by basename only.Corinna Vinschen2012-03-042-4/+41
| | | | | | | | | | Explain why. Add code to check if a DLL with the same basename but different path is the same DLL. Bail out if not. (in_load_after_fork): New static NO_COPY bool to allow to differ between linked and loaded DLL at fork. (dll_list::load_after_fork): Set in_load_after_fork accordingly. (dll_dllcrt0_1): Don't treat DLL as linked if in_load_after_fork is set. Drop test for in_forkee.
* * dll_init.cc: Revert pathname changes from 2012-02-08.Corinna Vinschen2012-03-043-13/+57
| | | | | | | (dll_list::operator[]): Add long comment to explain the misery. (dll_list::alloc): Skip long pathname prefix potentially returned by GetModuleFileNameW. * dll_init.h (dll_list::find_by_modname): Add back declaration.
* * winver.rc: Bump copyright date.Corinna Vinschen2012-03-042-1/+5
|
* * fhandler_console.cc (fhandler_console::dup): Only set ctty when we haven'tChristopher Faylor2012-03-034-4/+26
| | | | | | | | | specifically called setsid. * fhandler_tty.cc (fhandler_pty_slave::dup): Ditto. Also add comment documenting research into rxvt problem. * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Don't check specifically for myself->ctty == -1. Test for > 0 as that is the correct test. (fhandler_termios::sigflush): Ditto.
* * flock.cc (allow_others_to_sync): Reorder conditional expression toCorinna Vinschen2012-03-022-6/+12
| | | | | check for DACL presence first, since otherwise dacl pointer value is undefined. Add comment.
* * flock.cc (allow_others_to_sync): Use RtlGetDaclSecurityDescriptorCorinna Vinschen2012-03-022-2/+22
| | | | | rather than accessing the SECURITY_DESCRIPTOR structure directly. Take no DACL and NULL DACL into account.
* Fix typo in ChangeLog entryCorinna Vinschen2012-03-021-1/+1
|
* * fhandler_console.cc (fhandler_console::input_tcsetattr): RevertCorinna Vinschen2012-03-022-4/+10
| | | | | | | prevois patch. (fhandler_console::open_setup): Install Ctrl-C handler here, if this console is the controlling tty and the process hasn't been started by a Cygwin process.
* * fhandler_console.cc (fhandler_console::input_tcsetattr): Set theCorinna Vinschen2012-03-022-0/+9
| | | | | state of the Ctrl-C handler depending on the setting of ENABLE_PROCESSED_INPUT.
* tcgetsid: fix return typeEric Blake2012-02-286-9/+19
| | | | | | | | * include/sys/termios.h (tcgetsid): Fix return type. * termios.cc (tcgetsid): Likewise. * fhandler_termios.cc (fhandler_termios::tcgetsid): Likewise. * fhandler.h (fhandler_base): Likewise. * fhandler.cc (fhandler_base::tcgetsid): Likewise.
* * cygtls.cc (well_known_dlls): Add shlwapi.dll.Corinna Vinschen2012-02-282-0/+5
|
* * cygtls.cc (dll_cmp): New comparison function for bsearch.Corinna Vinschen2012-02-273-13/+93
| | | | | | (well_known_dlls): New array containing well-known DLLs. (_cygtls::call2): Add code for BLODA detection. * net.cc (fdsock): Ditto.
* Drop "potentially" from latest ChangeLog entry.Corinna Vinschen2012-02-261-1/+1
|
* * environ.cc (enum settings): Add setbool. Rename justset to setdwordCorinna Vinschen2012-02-263-9/+26
| | | | | | | | | to avoid future problems. (struct parse_thing): Change all justset to setbool for bool variables. (parse_options): Add a case for setbool setting for bool variables since justset (now setdword) always writes a DWORD value, thus potentially overwriting adjacent memory locations. * external.cc (cygwin_internal): Drop extern declaration.
* * environ.cc (dos_file_warning): Drop declaration.Corinna Vinschen2012-02-265-16/+27
| | | | | | | | | | | | | | | | | (ignore_case_with_glob): Ditto. (allow_winsymlinks): Ditto. (reset_com): Move definition to globals.cc. (struct parse_thing): Add "detect_bloda" option. * fhandler_serial.cc (fhandler_serial::open): Drop (incorrect) declaration of reset_com. * globals.cc (ignore_case_with_glob): Move definition into C++-only block. (dos_file_warning): Define. (allow_winsymlinks): Define. (reset_com): Define. (detect_bloda): Define. * path.cc (dos_file_warning): Drop definition here. (allow_winsymlinks): Drop definition here.
* * flock.cc (LOCK_DIR_NAME_FMT): Define.Corinna Vinschen2012-02-262-45/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | (LOCK_DIR_NAME_LEN): Define. (LOCK_DIR_NAME_DEV_OFF): Define. (LOCK_DIR_NAME_INO_OFF): Define. (LOCK_OBJ_NAME_FMT): Define. Add comment. (class lockf_t): Use bitsize-explicit types. Declare from_obj_name, (class inode_t): Make use, unuse and inuse methods public. Add a lock argument to get method declaration. (inode_t::get): Add lock argument. Only lock node if lock arg is true. (inode_t::inode_t): Use LOCK_DIR_NAME_FMT as format string. (lockf_t::from_obj_name): New method to generate lockf_t content from lock event object basename. (inode_t::get_all_locks_list): Just call from_obj_name here and copy result into final lockf_t. (create_lock_obj_attr): Use LOCK_OBJ_NAME_FMT as format string. (create_lock_in_parent): New thread function to create lockf_t structure in parent process. (delete_lock_in_parent): New thread function to reap stale BSD locks in parent process. (lockf_t::create_lock_obj): Try to duplicate lock object handle into parent process and call create_lock_in_parent as parent remote thread. (lockf_t::del_lock_obj): Call delete_lock_in_parent as parent remote thread. (fhandler_disk_file::lock): Add lock arg to inode_t::get call.
* * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 12.Christopher Faylor2012-02-252-1/+5
|
* *** empty log message ***Corinna Vinschen2012-02-251-0/+12
|
* Document pldd.Yaakov Selkowitz2012-02-241-0/+2
|
* Document scandirat.Yaakov Selkowitz2012-02-221-0/+2
|
* * cygwin.din (scandirat): Export.Yaakov Selkowitz2012-02-226-3/+34
| | | | | | | * posix.sgml (std-gnu): Add scandirat. * syscalls.cc (scandirat): New function. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * include/sys/dirent.h (scandirat): Declare.
* * shared.cc (shared_info::init_obcaseinsensitive): Check actual stateCorinna Vinschen2012-02-214-14/+53
| | | | | | of case sensitivity on post-Windows 2000 systems. * wincap.h (wincaps::kernel_is_always_casesensitive): New element. * wincap.cc: Implement above element throughout.
* * flock.cc (inode_t::del_my_locks): Drop useless counter lc. CloseCorinna Vinschen2012-02-203-5/+15
| | | | | | lock object handle explicitely in case of called during fork. Add comment to explain why. * fork.cc (frok::child): Drop declaration of fixup_lockf_after_fork.
* * timer.cc (getitimer): Don't create another local ret variable inCorinna Vinschen2012-02-172-4/+8
| | | | | timer_gettime calling branch. Simplify conditional since timer_gettime always returns 0 or -1 anyway.
* * ntdll.h (struct _PEB): Add EnvironmentUpdateCount member.Corinna Vinschen2012-02-175-20/+66
| | | | | | | * spawn.cc (child_info_spawn::worker): Speed up job recognition. Expand comment to explain every little detail and so we never forget. * wincap.h (wincaps::has_program_compatibility_assitant): New element. * wincap.cc: Implement above element throughout.
* * mount.cc (get_disk_type): Drop unneeded toupper call. Convert caseCorinna Vinschen2012-02-172-6/+11
| | | | constants to wide chars.
* *** empty log message ***Corinna Vinschen2012-02-161-1/+5
|