summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * fhandler_socket.cc: Update copyright.Corinna Vinschen2006-07-133-2/+7
| | | | * include/pthread.h: Ditto.
* * mmap.cc (mmap64): Drop MAP_NORESERVE flag for non-anonymous,Corinna Vinschen2006-07-132-3/+24
| | | | | | | | non-private mappings. (mmap_record::unmap_pages): Only check noreserve flag which now implies anonymous and private. (mprotect): Ditto. (fixup_mmaps_after_fork): Ditto.
* * exceptions.cc (_cygtls::handle_exceptions): Call newCorinna Vinschen2006-07-134-18/+48
| | | | | | | | | | mmap_is_attached_or_noreserve_page function in case of access violation and allow application to retry access on noreserve pages. * mmap.cc (mmap_is_attached_or_noreserve_page): Changed from mmap_is_attached_page. Handle also noreserve pages now. Change comment accordingly. * winsup.h (mmap_is_attached_or_noreserve_page): Declare instead of mmap_is_attached_page.
* * mmap.cc (mmap_record::alloc_page_map): Don't call VirtualProtectCorinna Vinschen2006-07-122-1/+6
| | | | on maps created with MAP_NORESERVE.
* * include/pthread.h: Define PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT andCorinna Vinschen2006-07-122-3/+10
| | | | PTHREAD_PRIO_PROTECT only if _POSIX_THREAD_PRIO_INHERIT is defined.
* * libc/inet_addr.c: Define __INSIDE_CYGWIN_NET__.Corinna Vinschen2006-07-103-0/+7
| | | | * libc/inet_network.c: Ditto.
* * fhandler_socket.cc (fhandler_socket::wait): Disable SA_RESTARTCorinna Vinschen2006-07-072-0/+9
| | | | handling for now.
* * Makefile.in (DLL_OFILES): Add inet_addr.o and inet_network.o.Corinna Vinschen2006-07-076-52/+378
| | | | | | | | | | | | | * autoload.cc (inet_addr): Drop definition. (inet_ntoa): Ditto. * net.cc: Forward declare cygwin_inet_aton and cygwin_inet_ntop. (cygwin_inet_ntoa): Call cygwin_inet_ntop instead of Winsock inet_ntoa. (cygwin_inet_addr): Remove here. (cygwin_inet_aton): Ditto. (cygwin_inet_network): Ditto. * libc/inet_addr.c: New file implementing cygwin_inet_aton and cygwin_inet_addr. * libc/inet_network.c: New file implementing cygwin_inet_network.
* * hookapi.cc: Add comment headerChristopher Faylor2006-07-064-6/+27
| | | | | | | | | (putmem): Make static. (get_export): Ditto. (rvadelta): Ditto. Don't assume that a section which ends where the import_rva begins is the import list. * child_info.h: Update copyright. * fork.cc: Ditto.
* * sortdin: Ignore all leading underscores when deriving a sort key.Christopher Faylor2006-07-053-64/+69
| | | | * cygwin.din: Resort.
* * sortdin: New program.Christopher Faylor2006-07-053-201/+240
| | | | * cygwin.din: Sort.
* * fhandler.h (fhandler_socket::wait): Reset default timeout to 10ms.Corinna Vinschen2006-07-052-1/+5
|
* * path.cc (path_conv::check): Ignore has_ea setting, it's always unsetCorinna Vinschen2006-07-052-39/+11
| | | | | | | | | at this point anyway. (get_symlink_ea): Remove. (set_symlink_ea): Remove. (symlink_worker): Drop writing symlink into NTFS extended attributes. (symlink_info::check): Drop reading symlinks from NTFS extended attributes.
* * libc/rexec.cc (cygwin_rexec): Obvious (?) fix to correct a gcc warning - setChristopher Faylor2006-07-052-2/+6
| | | | port to zero first thing in the function.
* * signal.cc (signal): Set sa_mask to sig.Christopher Faylor2006-07-042-1/+5
|
* * Makefile.in (DLL_OFILES): Add rexec.o.Corinna Vinschen2006-07-045-64/+430
| | | | | | | | | | * autoload.cc (inet_network): Drop definition. (rexec): Ditto. * net.cc (rexec): Drop extern declaration. (inet_network): Ditto. (cygwin_inet_network): Implement using inet_addr. (cygwin_rexec): Remove. * libc/rexec.cc: New file.
* * fhandler_socket.cc (fhandler_socket::listen): Allow listening onCorinna Vinschen2006-07-042-3/+22
| | | | unbound INET socket.
* * fhandler.h (fhandler_socket::wait): Set default timeout to INFINITE.Corinna Vinschen2006-07-042-1/+5
|
* * autoload.cc (NtQueryEaFile): Define.Corinna Vinschen2006-07-038-302/+199
| | | | | | | | | | | | | | | | | | | | | | | (NtSetEaFile): Define. * fhandler.cc (fhandler_base::open): Use appropriate open flags in query case when allow_ntea is set. * ntdll.h (struct _FILE_GET_EA_INFORMATION): Define. (struct _FILE_FULL_EA_INFORMATION): Define. (NtQueryEaFile): Declare. (NtSetEaFile): Declare. * ntea.cc (read_ea): Rename from NTReadEA and rewrite using NtQueryEaFile. (write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile. * path.cc (get_symlink_ea): Make static. Add handle parameter to accomodate new read_ea call. (set_symlink_ea): Make static. Add handle parameter to accomodate new write_ea call. (symlink_worker): Call set_symlink_ea while file is still open. (symlink_info::check): Call get_symlink_ea after file has been opened. * security.cc (get_file_attribute): Accomodate new read_ea call. (set_file_attribute): Accomodate new write_ea call. * security.h (read_ea): Change declaration accordingly. (write_ea): Ditto.
* * fhandler.h (class dev_console): Add `metabit' indicating theCorinna Vinschen2006-07-036-3/+106
| | | | | | | | | | | | | current meta key mode. * fhandler_console.cc (fhandler_console::read): Set the top bit of the character if metabit is true. * fhandler_console.cc (fhandler_console::ioctl): Implement KDGKBMETA and KDSKBMETA commands. * fhandler_tty.cc (process_ioctl): Support KDSKBMETA. (fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the master. * include/cygwin/kd.h: New file for the meta key mode. * include/sys/kd.h: New file.
* * include/stdint.h (UINT8_C, UINT16_C): Unsigned types smallerCorinna Vinschen2006-07-032-3/+8
| | | | than int promote to signed int.
* * net.cc (cygwin_sendto): Define appropriate parameters usingCorinna Vinschen2006-07-034-27/+50
| | | | | | | | | | | | | | | | socklen_t type according to SUSv3. (cygwin_recvfrom): Ditto. (cygwin_setsockopt): Ditto. (cygwin_getsockopt): Ditto. (cygwin_connect): Ditto. (cygwin_accept): Ditto. (cygwin_bind): Ditto. (cygwin_getsockname): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * include/cygwin/socket.h (socklen_t): Typedef and define. * include/sys/socket.h: Declare socket functions using socklen_t type.
* * include/cygwin/version.h: Bump DLL minor version number to 21.Christopher Faylor2006-07-022-3/+7
|
* * net.cc (cygwin_sendto): Allow zero-sized packets.Corinna Vinschen2006-06-302-3/+7
| | | | (cygwin_sendmsg): Ditto.
* Revert patches from 2005-10-22 and 2006-06-14 to use event drivenCorinna Vinschen2006-06-264-67/+84
| | | | | | | | | | | | | | | | | accept and connect back to using select: * fhandler.h (class fhandler_socket): Remove accept_mtx. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop initializing accept_mtx. (fhandler_socket::accept): Drop event handling. (fhandler_socket.cc (fhandler_socket::connect): Ditto. (fhandler_socket::dup): Drop accept_mtx handling. (fhandler_socket::listen): Ditto. (fhandler_socket::prepare): Ditto. (fhandler_socket::release): Ditto. (fhandler_socket::close): Ditto. * net.cc (cygwin_accept): Revert to calling cygwin_select to implement interuptible accept. (cygwin_connect): Ditto for connect.
* * fhandler_fifo.cc (fhandler_fifo::open): Release process lock and grab aChristopher Faylor2006-06-234-4/+56
| | | | | | system-wide mutex to prevent a deadlock and a race. * sync.h (lock_process): Make fhandler_fifo a friend. * smallprint.c (__small_vsprintf): Cosmetic change.
* * cygwin.din: Export __srget_r, __swbuf_r.Corinna Vinschen2006-06-153-1/+9
| | | | * include/cygwin/version.h: Bump API minor number to 156.
* * fhandler.h (class fhandler_socket): Add private mutex handleCorinna Vinschen2006-06-143-1/+49
| | | | | | | | | | | | accept_mtx. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize accept_mtx to NULL. (fhandler_socket::dup): Duplicate accept_mtx, if available. (fhandler_socket::listen): Create accept_mtx before trying to listen. (fhandler_socket::prepare): Wait for accept_mtx if available to serialize accepts on the same socket. (fhandler_socket::release): Release accept_mtx. (fhandler_socket::close): Close accept_mtx on successful closesocket.
* * fhandler_tty.cc (fhandler_pty_master::close): Always closeChristopher Faylor2006-06-122-12/+11
| | | | from_master/to_master since we always have copies of these handles.
* * include/sys/wait.h: Move definition of wait constants from here...Corinna Vinschen2006-06-124-22/+46
| | | | | * include/cygwin/wait.h: ...to here. New file. * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3.
* * heap.cc (heap_init): Only commit if allocsize is not zero.Corinna Vinschen2006-06-122-1/+5
|
* * net.cc (fdsock): Disable raising buffer sizes. Add comment toCorinna Vinschen2006-06-122-2/+18
| | | | explain why.
* * ioctl.cc (ioctl): Accommodate change in reported pty master device number.Christopher Faylor2006-06-043-5/+13
| | | | * select.cc (peek_pipe): Ditto.
* * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like.Christopher Faylor2006-06-043-63/+69
| | | | * tlsoffsets.h: Regenerate.
* fix wordingChristopher Faylor2006-06-031-1/+2
|
* * cygthread.cc (cygthread::terminate_thread): In debugging output, use name ofChristopher Faylor2006-06-035-25/+35
| | | | | | | | | | | | | | | | | | | | thread being terminated rather than thread doing terminating. * fhandler.h (fhandler_pty_master::slave): Delete. (fhandler_pty_master::get_unit): Ditto. (fhandler_pty_master::setup): Change argument declaration to accommodate new usage. * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave assignment. Pass argument to setup indicating that this is a tty. (fhandler_tty_slave::open): Use dev() method rather than referencing pc.dev directly. (fhandler_pty_master::open): Don't create archetype based on ptym device number. Set device number to use DEV_TTYM_MAJOR and tty number. Pass argument to setup indicating that this is a pty. (fhandler_pty_master::setup): Change single argument to a flag indicating whether we're creating a pty and use appropriately. Calculate 't' variable here rather than in caller. * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather than referencing pc.dev directly.
* * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here.Christopher Faylor2006-06-039-77/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (dll_crt0_1): Reflect renaming from tty_init to tty::init_session. (do_exit): Reflect moving of tty_terminate into tty_list. * exceptions.cc (events_init): Move tty_mutex stuff elsewhere. * fhandler_console.cc (set_console_title): Use lock_ttys class. * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output more accurate. * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of attach_tty into tty_list class. Don't attempt to grab master end of pty if master doesn't exist. (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list class. Use lock_ttys::release to release mutex. Improve debugging output. (fhandler_pty_master::setup): Remove if 0'ed block. Fix argument to SetNamedPipeHandleState. * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid. Improve debugging. Add temporary debugging. * tty.cc (tty_list::init_session): New function. (tty::init_session): Rename from tty_init. Reflect move of attach_tty to tty_list class. (tty::create_master): Rename from create_tty_master. (tty_list::attach): Rename from attach_tty. Reflect renaming of connect_tty to connect. Ditto for allocate_tty. (tty_terminate): Delete. (tty_list::terminate): Subsume tty_terminate. Use lock_ttys rather than manipulating mutex directly. (tty_list::allocate): Rename from allocate_tty. Use lock_ttys rather than manipulating mutex directly. Don't set sid here since linux apparently doesn't do this. Reflect move of create_tty_master into tty. (lock_ttys::lock_ttys): Define new constructor. (lock_ttys::release): New function. * tty.h (tty::exists): Return false immediately if !master_pid. (tty::set_master_closed): Define new function. (tty::create_master): Ditto. (tty::init_session): Ditto. (tty_list::mutex): New field. (tty_list::allocate): Define new function. (tty_list::connect): Ditto. (tty_list::attach): Ditto. (tty_list::init_session): Ditto. (lock_ttys): New class. (tty_init): Delete declaration. (tty_terminate): Ditto. (attach_tty): Ditto. (create_tty_master): Ditto.
* * Makefile.in (libdl.a): New library.Christopher Faylor2006-06-032-1/+8
|
* * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if we don'tChristopher Faylor2006-06-032-6/+29
| | | | | | | | | | own them. (fhandler_pty_master::setup): Make sure that original handle is closed when changing inheritance. (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to arch value always. (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master when close_on_exec.
* * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code.Christopher Faylor2006-06-035-36/+26
| | | | | | | | | | | | * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've run fixup_after_exec. * dtable.cc (dtable::fixup_after_exec): Add debugging output. * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of to_master. (fhandler_tty_common::close): Remove obsolete code. (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done in dtable's fixup_after_exec. (revisit later?) (fhandler_pty_master::fixup_after_exec): Ditto.
* (check in missing ChangeLog lines)Christopher Faylor2006-06-031-0/+6
| | | | | | | | * tlsoffsets.h: Regenerate. * dcrt0.cc (break_here): Define unconditionally for use elsewhere. Call DebugBreak, if appropriate. (initial_env): Rely on break_here() to call DebugBreak. * exceptions.cc (try_to_debug): Ditto.
* * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision with theChristopher Faylor2006-06-035-68/+74
| | | | call chain.
* * fhandler.cc (fhandler_base::fixup_after_exec): Declare here.Christopher Faylor2006-06-028-333/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline. (fhandler_termios::fixup_after_fork): Delete declaration. (fhandler_termios::fixup_after_exec): Ditto. (fhandler_tty_common::inuse): Remove. (fhandler_tty_common::dup): Delete declaration. (fhandler_tty_common::fixup_after_fork): Ditto. (fhandler_tty_slave::fixup_after_exec): Declare new function. (fhandler_pty_master::dwProcessId): New variable. (fhandler_pty_master::from_master): Ditto. (fhandler_pty_master::to_master): Ditto. (fhandler_pty_master::setup): New function. (fhandler_pty_master::fixup_after_fork): Ditto. (fhandler_pty_master::fixup_after_exec): Ditto. * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete definition. (fhandler_termios::fixup_after_fork): Ditto. * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master setup function rather than obsolete tty::common_init. Delete obsolete inuse setting. (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here. (fhandler_tty_slave::open): Change debugging output for clarity. Check for different things when doing a sanity check on the tty. Reflect the fact that master_pid now is the cygwin pid rather than the windows pid. Use "arch" rather than "archetype" for consistency. (fhandler_tty_slave::close): Close inuse here. (fhandler_tty_slave::dup): Remove old if 0'ed code. (fhandler_pty_master::dup): New function. Handles pty master archetype. (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific fields. (fhandler_pty_master::open): Implement using archetypes, similar to slave. Use fhandler_pty_master setup function rather than obsolete tty::common_init. Don't set inuse. (fhandler_tty_common::close): Don't deal with inuse. Delete old if 0'ed code. (fhandler_pty_master::close): Implement using archetypes. Close from_master and to_master. (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag here since everything uses archetypes now. (fhandler_tty_common::fixup_after_fork): Delete definition. (fhandler_tty_slave::fixup_after_exec): Define new function. (fhandler_pty_master::setup): New function, derived from tty::common_init. (fhandler_pty_master::fixup_after_fork): New function. (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size. * tty.cc (tty_list::terminate): Close individual handles from tty_master. (tty::master_alive): Delete. (tty::make_pipes): Ditto. (tty::common_init): Ditto. * tty.h (tty::from_slave): Delete. (tty::to_slave): Ditto. (tty::common_init): Delete declaration. (tty::make_pipes): Ditto. (tty::master_pid): Define as pid_t since it is now a cygwin pid.
* * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here. Let theChristopher Faylor2006-06-028-22/+75
| | | | | | | | | | | | | | | | | | | | caller do that. * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here to allow fixup_after_exec functions to use it. * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with *crt0_1 functions. * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls before seeing if it is initialized. * gendef (_sigfe_maybe): Ditto. * dcrt0.cc (dll_crt0_1): Remove static, use just one argument. * dll_init.cc (dllcrt0_info): New structure. (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that we'll always be assured of having something like a tls. (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0. Unconditionally call _my_tls.init_exception_handler now that we are assured of having a tls. Change variable name from "linking" to "linked". * winsup.h (dll_crt0_1): Declare. (dll_dllcrt0_1): Ditto.
* * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.Christopher Faylor2006-05-312-1/+8
|
* * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork errors.Christopher Faylor2006-05-292-3/+8
|
* * sigproc.cc (child_info::proc_retry): Mask all of the bits we're interestedChristopher Faylor2006-05-292-1/+6
| | | | in, which includes bits above and below 0xc0000000.
* Put an underscore in front of the "active" in "strace.active".Christopher Faylor2006-05-281-1/+1
|
* white spaceChristopher Faylor2006-05-2819-91/+91
|
* * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with fork.Christopher Faylor2006-05-272-2/+10
| | | | | Semi-revert it but change name of variable to something that makes better sense.