summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket.cc
Commit message (Collapse)AuthorAgeFilesLines
* * fhandler_socket.cc (get_inet_addr): Only test the file for being aCorinna Vinschen2010-04-131-14/+32
| | | | | | socket after opening it. Retry if opening failed with sharing violation. Explain why we do this. (fhandler_socket::bind): Create file with no sharing allowed.
* * fhandler_socket.cc (fhandler_socket::wait_for_events): Remove call toCorinna Vinschen2010-03-301-4/+1
| | | | sig_dispatch_pending.
* * fhandler_socket.cc (fhandler_socket::evaluate_events): Make eraseCorinna Vinschen2010-03-221-11/+12
| | | | | | | | | | | | | | | | | const in parameter list. (fhandler_socket::wait_for_events): Take a DWORD flags value instead of just a bool. Call evaluate_events with erase flag according to MSG_PEEK value in flags. Replace check for dontwait with check for MSG_DONTWAIT in flags. (fhandler_socket::connect): Call wait_for_events with 0 flags value. (fhandler_socket::accept4): Ditto. (fhandler_socket::recv_internal): Save flags in wait_flags. Drop dontwait variable. Call wait_for_events with wait_flags. (fhandler_socket::send_internal): Save MSG_DONTWAIT flag in wait_flags and call wait_for_events with wait_flags as argument. Drop dontwait variable. * fhandler.h (class fhandler_socket): Change second parameter in declaration of wait_for_events to const DWORD.
* * fhandler_socket.cc (fhandler_socket::accept4): Reset async flagCorinna Vinschen2010-01-161-1/+1
| | | | on accepted socket.
* * fhandler_socket.cc (fhandler_socket::accept4): Set nonblockingCorinna Vinschen2010-01-151-2/+1
| | | | | flag exactly according to flags, as on Linux. * net.cc (cygwin_accept): Maintain BSD semantics here.
* * cygwin.din (accept4): Export.Corinna Vinschen2010-01-151-3/+7
| | | | | | | | | | | | | | | | | | | * fhandler.h (fhandler_socket::accept4): Rename from accept. Take additional flag parameter. * fhandler_socket.cc (fhandler_socket::accept4): Ditto. Handle SOCK_NONBLOCK and SOCK_CLOEXEC flags. * net.cc (cygwin_socket): Handle SOCK_NONBLOCK and SOCK_CLOEXEC flags in type. Check for invalid flag values. (socketpair): Ditto. (cygwin_accept): Accommodate renaming of fhandler_socket::accept function to accept4. (accept4): New function. * posix.sgml: Mention accept4 as GNU extensions. * include/cygwin/socket.h (SOCK_NONBLOCK): Define. (SOCK_CLOEXEC): Define. (_SOCK_FLAG_MASK): Define when building Cygwin. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * include/sys/socket.h (accept4): Declare.
* * fhandler.h (fhandler_socket::wait_for_events): Drop parameter defaultCorinna Vinschen2009-12-281-3/+3
| | | | | | | | value. * fhandler_socket.cc (fhandler_socket::connect): Add false as second parameter to wait_for_events call. (fhandler_socket::accept): Ditto. (fhandler_socket::send_internal): Fix typo in call to wait_for_events.
* Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcessCorinna Vinschen2009-12-181-5/+7
| | | | | | | | | | | | according to context. Throughout, replace hMainThread with GetCurrentThread/NtCurrentThread according to context. * dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to hMainProc. Drop duplication of GetCurrentThread to hMainThread. * dtable.cc (dtable::stdio_init): Remove useless comment. * globals.cc (hMainProc): Remove. (hMainThread): Remove. * ntdll.h (NtCurrentProcess): Define. (NtCurrentThread: Define.
* * fhandler_socket.cc (send_internal): Don't split datagram messagesCorinna Vinschen2009-12-021-4/+10
| | | | | | | into pieces. * syslog.cc (vsyslog): Set default facility to LOG_USER if it hasn't been set yet.
* * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): AddCorinna Vinschen2009-11-231-3/+4
| | | | | | | | socket handle value to debug output. (fhandler_socket::fixup_after_fork): Ditto. Make new socket handle OVERLAPPED, just as if it has been created with socket(). * net.cc (fdsock): Close duplicated socket and explain why. Disable the entire WSADuplicateSocket test for now and explain why.
* * fhandler_socket.cc (fhandler_socket::set_close_on_exec): Only callCorinna Vinschen2009-11-231-2/+7
| | | | fhandler_base::set_close_on_exec for inheritable sockets.
* Reintegrate socket duplication via WSADuplicateSocket/WSASocket.Corinna Vinschen2009-11-171-6/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc (WSADuplicateSocketW): Define. (WSASocketW): Define. * dtable.cc (dtable::release): Call dec_need_fixup_before if necessary. (dtable::fixup_before_fork): New function. (dtable::fixup_before_exec): New function. * dtable.h (class dtable): Add member cnt_need_fixup_before. Add declarations for above new functions. (dtable::dec_need_fixup_before): New inline method. (dtable::inc_need_fixup_before): New inline method. (dtable::need_fixup_before): New inline method. * fhandler.h (fhandler_base::fixup_before_fork_exec): New virtual method. (fhandler_base::need_fixup_before): New virtual method. (class fhandler_socket): Add member prot_info_ptr. (fhandler_socket::init_fixup_before): Declare. (fhandler_socket::need_fixup_before): New inline method. (fhandler_socket::fixup_before_fork_exec): Declare. (fhandler_socket::fixup_after_exec): Declare. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize prot_info_ptr to NULL. (fhandler_socket::~fhandler_socket): Free prot_info_ptr conditionally. (fhandler_socket::init_fixup_before): New method. (fhandler_socket::fixup_before_fork_exec): Ditto. (fhandler_socket::fixup_after_fork): Use WSASocketW to duplicate socket if necessary. (fhandler_socket::fixup_after_exec): New method. (fhandler_socket::dup): Use fixup_before_fork_exec/fixup_after_fork to duplicate socket if necessary. * fork.cc (frok::parent): Start child suspended if some fhandler needs fixup before fork. If so, call dtable::fixup_before_fork after CreateProcess and resume child. * net.cc (fdsock): Try to find out if socket needs fixup before and initialize socket accordingly. Add HUGE comment to explain what happens and why. * spawn.cc (spawn_guts): Start child suspended if some fhandler needs fixup before exec. If so, call dtable::fixup_before_exec after CreateProcess.
* * sec_helper.cc (security_descriptor::free): If sd_size is 0, callCorinna Vinschen2009-10-301-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | LocalFree instead of ::free. * sec_acl.cc: Throughout replace old ACE flag definitions with current definitions as used in MSDN man pages. * security.cc: Ditto. * fhandler.cc (fhandler_base::open): Make sure file has really been just created before fixing file permissions. Add S_JUSTCREATED attribute to set_file_attribute call. * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Always create dir with default security descriptor and fix descriptor afterwards. Add S_JUSTCREATED flag to set_file_attribute call. * fhandler_socket.cc (fhandler_socket::bind): Ditto for AF_LOCAL socket files. * path.cc (symlink_worker): Ditto for symlinks. * security.cc (get_file_sd): Call GetSecurityInfo rather than NtQuerySecurityObject. Explain why. Change error handling accordingly. (alloc_sd): Skip non-inherited, non-standard entries in ACL if S_JUSTCREATED attribute is set. Explain why. Minor format fixes. * security.h (S_JUSTCREATED): New define. (security_descriptor::operator=): New operator.
* * fhandler_disk_file.cc (fhandler_disk_file::link): Only append .lnkCorinna Vinschen2009-10-121-0/+2
| | | | | | | if the original device had one, too. Add comment. * fhandler_socket.cc (fhandler_socket::fstat): Always return a size of 0 on sockets.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Always callCorinna Vinschen2009-09-291-1/+1
| | | | WSARecv on SOCK_STREAM sockets.
* * autoload.cc (WSARecv): Define.Corinna Vinschen2009-09-221-6/+22
| | | | | * fhandler_socket.cc (fhandler_socket::recv_internal): Call WSARecv instead of WSARecvFrom if no name parameter is given. Explain why.
* * (fhandler_socket::getsockname): Fix length returned for unboundCorinna Vinschen2009-08-141-2/+2
| | | | | | | | AF_LOCAL sockets. (fhandler_socket::getpeername): Ditto. * net.cc (socketpair): Don't set sun_path and peer_sun_path to make sure getsockname and getpeername return the correct values for AF_LOCAL sockets.
* * fhandler_socket.cc (fhandler_socket::accept): Use sizeof ratherCorinna Vinschen2009-08-131-16/+18
| | | | | | | | then constant size. Truncate returned data, but return full address length as per POSIX. (fhandler_socket::getsockname): Truncate returned data, but return full address length as per POSIX. (fhandler_socket::getpeername): Ditto.
* * fhandler.h (class fhandler_socket): Add peer_sun_path member.Corinna Vinschen2009-08-131-24/+69
| | | | | | | | | | | | | | | | | | | (fhandler_socket::set_peer_sun_path): New method. (fhandler_socket::get_peer_sun_path): New method. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize peer_sun_path to NULL. (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary. (fhandler_socket::dup): Duplicate peer_sun_path. (fhandler_socket::accept): Ditto. Return fake unbound peer content and len in case of AF_LOCAL sockets. (fhandler_socket::getsockname): Always use local sockaddr_storage to store socket address and copy over to incoming address. Handle every namelen correctly per POSIX. (fhandler_socket::getpeername): Ditto. Add code path to return correct value for AF_LOCAL sockets. (fhandler_socket::set_peer_sun_path): New method. * net.cc (socketpair): Set peer_sun_path to empty string, just like sun_path.
* * fhandler_socket.cc (fhandler_socket::accept): Always use localCorinna Vinschen2009-08-121-18/+9
| | | | | | sockaddr_storage to store peer address and copy over to incoming peer address if available. Truncate data as necessary according to POSIX.
* * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem size ifChristopher Faylor2009-08-041-1/+1
| | | | | | | | the length exceeds it. * net.cc (fdsock): Use 65535 as window size, just like the comment says or we run into problems with DuplicateHandle. * path.cc (patch_conv::check): Use set_path to set invalid filename. * path.h (path_conv::path_conv): Ditto.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabufCorinna Vinschen2009-07-061-10/+13
| | | | and wsacnt to references. Fix handling of WSAEMSGSIZE.
* * fhandler.h (class fhandler_socket): Add class members and methodsCorinna Vinschen2009-07-011-4/+13
| | | | | | | | | | | | | | | | to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes. * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members. (fhandler_socket::send_internal): Check for SO_SNDBUF size and restrict send to 1 byte less per KB 823764. Leave loop immediately if WSASendMsg has been used. * net.cc (fdsock): Change comment again. Set buffer sizes to 65536. Store values in fhandler_socket. (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in fhandler_socket. (cygwin_sendto): Drop call to sig_dispatch_pending. (cygwin_recvfrom): Ditto. (cygwin_recvmsg): Ditto. (cygwin_sendmsg): Ditto.
* * net.cc (fdsock): Set default socket buffer sizes to 65520. ChangeCorinna Vinschen2009-06-301-2/+2
| | | | | | comment accordingly. * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum send size to 65520 as well.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsgCorinna Vinschen2009-06-171-1/+1
| | | | as NO_COPY.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelenCorinna Vinschen2009-06-131-1/+6
| | | | pointer to NULL if name pointer is NULL. Explain why.
* * fhandler.h (fhandler_socket::wait_for_events): Take additionalCorinna Vinschen2009-03-091-13/+13
| | | | | | | | | | | parameter "dontwait". * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the socket is non-blocking if dontwait is true. (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to set the wait_for_events dontwait parameter. (fhandler_socket::send_internal): Ditto. Optimize code slightly. * include/cygwin/socket.h (MSG_DONTWAIT): Define. * include/cygwin/version.h: Bump API minor number.
* * autoload.cc (WSAIoctl): Reintroduce.Corinna Vinschen2009-01-201-59/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (WSASendMsg): Define. * fhandler.h (class fhandler_socket): Change definition of recv_internal and send_internal to take WSAMSG pointer as parameter. * fhandler_socket.cc (WSAID_WSARECVMSG): Define. (LPFN_WSARECVMSG): Define. (WSASendMsg): Declare. (get_ext_funcptr): New function to fetch address of WSARecvMsg. (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter. Change code accordingly. If control information is requested, fetch address of WSARecvMsg and use that instead of WSARecvFrom. (fhandler_socket::recvfrom): Change return type to ssize_t as declared in fhandler.h. Accommodate changes to recv_internal. (fhandler_socket::recvmsg): Ditto. Make sure that control information is only requested if system, address family, and socket type support it. (fhandler_socket::send_internal): Take just a LPWSAMSG parameter and the flags. Change code accordingly. If control information is provided, use WSASendMsg instead of WSASendTo. (fhandler_socket::sendto): Drop useless comment. Accommodate changes to send_internal. (fhandler_socket::sendmsg): Ditto. Make sure that control information is only provided if system, address family, and socket type support it. * wincap.h (wincaps::has_recvmsg): New element. (wincaps::has_sendmsg): New element * wincap.cc: Implement above elements throughout. * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment of type struct cmsghdr.
* Remove unneeded whitespace.Christopher Faylor2008-11-261-1/+1
| | | | | | | | | | | | | | | | * fhandler_fifo.cc (fhandler_fifo::open): Rework to cause errno to be set to ENXIO when opening a fifo write/nonblocking. * environ.cc (ucreqenv): Rename to ucenv. Move code from old ucenv here and conditionalize it on create_upcaseenv. (ucenv): Delete. (environ_init): Fix compiler warning by moving create_upcaseenv test to ucenv. Don't bother checking for child_proc_info when calling ucenv since it is assumed to be NULL at the point where the function is called. * path.cc (symlink_worker): Turn off MS-DOS path warnings when dealing with devices since the device handler passes in a translated MS-DOS path. * sec_auth.cc (lsaprivkeyauth): Avoid variable initialization which causes a compiler error. * fhandler_netdrive.cc: Update copyright.
* * cygheap.cc (creturn): Reorganize to avoid a new compiler warning/error.Christopher Faylor2008-09-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dtable.cc (handle_to_fn): Ditto. * fhandler_console.cc (fhandler_console::read): Ditto. (fhandler_console::scroll_screen): Ditto. (dev_console::set_color): Ditto. * fhandler_dsp.cc (fhandler_dev_dsp::write): Ditto. (fhandler_dev_dsp::read): Ditto. * fhandler_tape.cc (mtinfo_drive::get_status): Ditto. * hookapi.cc (find_first_notloaded_dll): Ditto. * mmap.cc (msync): Ditto. * pipe.cc (pipesync::pipesync): Ditto. * sec_acl.cc (getace): Ditto. * sec_auth.cc (create_token): Ditto. (lsaauth): Ditto. * select.cc (peek_pipe): Ditto. * spawn.cc (av::fixup): Ditto. * syscalls.cc (popen): Ditto. * tty.cc (tty::init_session): Ditto. * uinfo.cc (pwdgrp::load): Ditto. * fhandler.cc (fhandler_base::setup_overlapped): Ditto. (fhandler_base::wait_overlapped): Rename second use of res variable to wres or errors are not returned correctly. * dcrt0.cc: Remove obsolete variable. * dll_init.cc (release_upto): Fix typo involving incorrect use of '|'. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Avoid a compiler warning regarding coercing type-punned variables. (fhandler_base::fstat_by_name): Ditto. fhandler_fifo.cc (fhandler_fifo::open_nonserver): Fix = vs. == typo. (fhandler_fifo::wait): Add all conditions to switch statement to avoid a compiler warning. * fhandler_process.cc: Avoid unneeded initialization of variables to zero. (fhandler_socket::listen): Add braces around initializer. * flock.cc (inode_t::get_all_locks_list): Reorganize to avoid a compiler warning. Fix problem with EWOULDBLOCK error return. * path.cc (GUID_shortcut): Use braces around struct initializer. (cygwin_conv_path): Reorganize to avoid a compiler warning. * random.cc (dummy): Mark variable as volatile to avoid a "used uninitialized" warning. * libc/getopt.c: Mark some variables as dllexport although gcc doesn't seem to do the right thing with them. * libc/minires-os-if.c (get_registry_dns_items): Coerce some function arguments to avoid a compiler warning.
* * external.cc (cygwin_internal): Call set_security_attribute withCorinna Vinschen2008-08-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | additional path_conv argument. * fhandler.cc (fhandler_base::open): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Never set DOS R/O attribute when using ACLs. (fhandler_disk_file::mkdir): Ditto. Set security descriptor on remote dirs after creating the dir, same as in fhandler_base::open. * fhandler_socket.cc (fhandler_socket::bind): Ditto for remote AF_LOCAL socket files. * path.cc (symlink_worker): Ditto. for remote symlinks. * security.cc (alloc_sd): Take additional path_conv argument. Accommodate throughout. Drop setting FILE_WRITE_EA/FILE_READ_EA flags unconditionally (was only necessary for "ntea"). Don't set FILE_READ_ATTRIBUTES and FILE_WRITE_ATTRIBUTES unconditionally on Samba. Add comment to explain. Drop useless setting of STANDARD_RIGHTS_WRITE, it's in FILE_GENERIC_WRITE anyway. Remove FILE_READ_ATTRIBUTES bit from FILE_GENERIC_EXECUTE so as not to enforce read permissions on Samba. (set_security_attribute): Take additional path_conv argument. * security.h (set_security_attribute): Change prototype accordingly.
* * fhandler_socket.cc (fhandler_socket::send_internal): Send never moreCorinna Vinschen2008-07-271-33/+47
| | | | | | | then 64K bytes at once. For blocking sockets, loop until entire data has been sent or an error occurs. (fhandler_socket::sendto): Drop code which sends on 64K bytes. (fhandler_socket::sendmsg): Ditto.
* Throughout drop allow_ntsec and allow_smbntsec handling.Corinna Vinschen2008-07-141-1/+1
| | | | | | | | | | | | | | | | * environ.cc (set_ntsec): Remove. (set_smbntsec): Remove. (known): Remove ntsec and smbntsec options. * external.cc (check_ntsec): Return true if no filename is given. * mount.cc (oopts): Add "acl" and "noacl" options. Set MOUNT_NOACL flag accordingly. (fillout_mntent): Handle MOUNT_NOACL flag. * path.h (enum path_types): Add PATH_NOACL. * security.cc (allow_ntsec): Remove. (allow_smbntsec): Remove. * security.h (allow_ntsec): Drop declaration. (allow_smbntsec): Drop declaration. * include/sys/mount.h (MOUNT_NOACL): Define.
* * autoload.cc (GetExtendedTcpTable): Define.Corinna Vinschen2008-07-141-19/+56
| | | | | | | | | * fhandler_socket.cc (address_in_use): Take const struct sockaddr pointer as argument. Implement additional AF_INET6 table check. (fhandler_socket::bind): Drop AF_INET test before calling address_in_use. * net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if called with unsupported af_family.
* * fhandler_socket.cc (fhandler_socket::bind): Don't run explicitCorinna Vinschen2008-07-081-5/+17
| | | | | | | | | | local socket test in SO_REUSEADDR case on systems supporting enhanced socket security. Explain why. Only call address_in_use for AF_INET sockets. * net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR on systems supporting enhanced socket security. Add comment. * wincap.h (wincaps::has_enhanced_socket_security): New element. * wincap.cc: Implement above element throughout.
* * Makefile.in (DLL_OFILES): Add kernel32.o.Corinna Vinschen2008-04-211-28/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc (WSACloseEvent): Remove. (WSACreateEvent): Remove. * cygheap.cc (cygheap_init): Drop initializing shared_prefix. * cygheap.h (struct init_cygheap): Drop shared_prefix and shared_prefix_buf members. * fhandler_socket.cc (sock_shared_name): New static function. (search_wsa_event_slot): Convert name buffers to WCHAR. Call NtCreateMutant/NtOpenMutant to create mutexes in session local namespace. (fhandler_socket::init_events): Ditto. Fix debug output. (fhandler_socket::release_events): Close mutexes using NtClose. (fhandler_socket::dup): Ditto. * kernel32.cc: New file, implementing Win32 calls in a Cygwin-specific way. * mmap.cc (MapView): Make static. * ntdll.h: Fix status code sorting. (STATUS_OBJECT_NAME_EXISTS): Define. (SEMAPHORE_QUERY_STATE): Define. (CYG_SHARED_DIR_ACCESS): Define. (CYG_MUTANT_ACCESS): Define. (CYG_EVENT_ACCESS): Define. (CYG_SEMAPHORE_ACCESS): Define. (enum _PROCESSINFOCLASS): Define ProcessSessionInformation. (struct _PROCESS_SESSION_INFORMATION): Define. (NtCreateSemaphore): Declare. (NtOpenSemaphore): Declare. * flock.cc: Use CYG_xxx_ACCESS access masks where appropriate. * posix_ipc.cc (ipc_mutex_init): Use native functions to create mutex. Create in cygwin-shared subdir. (ipc_cond_init): Ditto for event. (ipc_mutex_close): Use NtClose. (ipc_cond_close): Ditto. (mq_open): Drop "cyg" prefix from mqh_uname. * shared.cc (CYG_SHARED_DIR_ACCESS): Drop definition here. (_cygwin_testing): Declare extern on file level. (get_shared_parent_dir): Change name of shared directory. Add name to api_fatal output. (get_session_parent_dir): New function. (shared_name): Simplify. (shared_info::initialize): Call get_session_parent_dir. * shared_info.h (get_session_parent_dir): Declare. * smallprint.cc (__small_vswprintf): Fix bug in multibyte string conversion. * thread.cc (semaphore::semaphore): Align semaphore name to object names in posix IPC functions. * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
* Revert thinko in previous patch.Corinna Vinschen2008-04-181-8/+13
| | | | | | | | | | * fhandler.h (struct wsa_event): Move back from wsa_event.h to here. * fhandler_socket.cc (NUM_SOCKS): Ditto. (wsa_events): Move back from cygwin_shared to here. Accommodate throughout. (socket_serial_number): Ditto. * shared_info.h: Accommodate above changes. * wsa_event.h: Remove.
* * fhandler.h (-struct wsa_event): Move to wsa_event.h. IncludeCorinna Vinschen2008-04-181-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wsa_event.h instead. * fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h. (wsa_events): Move from DLL shared area to cygwin_shared shared memory. Accommodate throughout. (socket_serial_number): Ditto. * fhandler_tape.cc (mt): Ditto. (mtinfo_init): Remove. (mt): Define as cygwin_shared->mt. * flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove. (FLOCK_INODE_DIR_ACCESS): Move up in file. (FLOCK_MUTANT_ACCESS): Ditto. (FLOCK_EVENT_ACCESS): Ditto. (get_lock_parent_dir): Remove. (inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle. Add a "flock-" prefix to file's lock directory name for clarity. * mtinfo.h (mtinfo_init): Drop declaration. * net.cc (last_used_bindresvport): Move from DLL shared area to cygwin_shared shared memory. (cygwin_bindresvport_sa): Accommodate above change. * sec_helper.cc (_everyone_sd): Move here from flock.cc. * security.h (SD_MIN_SIZE): Ditto. (everyone_sd): Ditto. * shared.cc (cygwin_shared_area): Remove. (cygwin_shared_h): New handle. (get_shared_parent_dir): New static function. (shared_name): Drop session_local argument. Call get_shared_parent_dir here. Add cygwin-shared subdir to object name. (offsets): Reinstantiate SH_CYGWIN_SHARED member. (open_shared): Revert change from 2007-03-29 for systems supporting SeCreateGlobalPrivilege. (shared_info::initialize): Call mtinfo's initialize here. (memory_init): Drop call to mtinfo_init. * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. (CURR_SHARED_MAGIC): Ditto. (class shared_info): Add members for global socket and tape info sharing. (enum shared_locations): Reinstantiate SH_CYGWIN_SHARED. (get_shared_parent_dir): Declare. (shared_name): Drop session_local argument from declaration. * wsa_event.h: New file. Move definitions of NUM_SOCKS and struct wsa_event here.
* * fhandler_socket.cc (fhandler_socket::close): Disable enforcedCorinna Vinschen2008-04-161-2/+6
| | | | lingering since the original problem can no longer be reproduced.
* Remove unneeded header files from source files throughout.Christopher Faylor2008-04-071-4/+0
|
* * Fix copyright dates.Corinna Vinschen2008-04-011-1/+1
|
* * fhandler_socket.cc: Create shared objects session local throughout.Corinna Vinschen2008-03-271-4/+6
| | | | | | * shared.cc (shared_name): Add argument to allow opening session local shared memory. * shared_info.h (shared_name): Change declaration accordingly.
* * fhandler_socket.cc (fhandler_socket::sendto): Never send more thanCorinna Vinschen2008-03-071-6/+17
| | | | | 64K. Add comment to explain why. (fhandler_socket::sendmsg): Ditto.
* Perform whitespace cleanup throughout.Christopher Faylor2008-02-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards compatibility. (check_sanity_and_sync): Ditto. * winsup.h (SIGTOMASK): Ditto. Just use constant in signal calculation. * include/cygwin/version: Remove backwards signal mask compatibility define. * path.cc (symlink_info::check_sysfile): Cosmetic change. * registry.cc (get_registry_hive_path): Remove unneeded variable. * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and use either main sigmask or current thread sigmask. (set_process_mask): Ditto. (sighold): Ditto. (sigrelse): Ditto. (sigset): Ditto. (set_process_mask_delta): Ditto. (_cygtls::call_signal_handler): Ditto. * fhandler_process.cc (format_process_status): Ditto. * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. * pinfo.h (class pinfo): Ditto. * select.cc (pselect): Ditto. * signal.cc (sigprocmask): Ditto. (abort): Ditto. (sigpause): Ditto. (sigsend): Ditto. (wait_sig): Ditto. * thread.h (pthread::parent_tls): New member. * thread.cc (pthread::pthread): Record parent_tls here. (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
* * fhandler_registry.cc: Use NAME_MAX + 1 instead of CYG_MAX_PATHCorinna Vinschen2007-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | throughout for subkey name buffer size. * fhandler_socket.cc (search_wsa_event_slot): Use MAX_PATH instead of CYG_MAX_PATH for mutext name buffer size. (fhandler_socket::init_events): Ditto. * fhandler_virtual.cc (fhandler_virtual::opendir): Check path length against PATH_MAX instead of against CYG_MAX_PATH. * registry.cc (get_registry_hive_path): Use PATH_MAX instead of CYG_MAX_PATH for registry value path buffer size. * shared.cc (open_shared): Use MAX_PATH instead of CYG_MAX_PATH for shared memory name buffer size. * thread.cc (semaphore::semaphore): Use MAX_PATH instead of CYG_MAX_PATH for semaphore name buffer size. * uinfo.cc (cygheap_user::env_userprofile): Use PATH_MAX instead of CYG_MAX_PATH for temporary path name buffer size. * winf.h (LINE_BUF_CHUNK): Define as MAX_PATH * 2. * include/sys/dirent.h: Include sys/limits.h. Define name buffer sizes using NAME_MAX.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Add MSG_WAITALLCorinna Vinschen2007-11-281-9/+44
| | | | | | | | handling. Use explicit flag values instead of MSG_WINMASK. (fhandler_socket::send_internal): Use explicit flag values instead of MSG_WINMASK. * include/cygwin/socket.h (MSG_WINMASK): Remove definition. (MSG_WAITALL): Define.
* * fhandler_socket.cc (fhandler_socket::bind): Open file for deletion,Corinna Vinschen2007-10-101-17/+24
| | | | | | too. Don't write to file and especially don't close handle if file couldn't be created. Set delete disposition if writing failed, instead of calling unlink_nt.
* * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Handle S_IFSOCKCorinna Vinschen2007-08-161-4/+1
| | | | | | mode bit by setting the SYSTEM attribute. * fhandler_socket.cc (fhandler_socket::fchmod): Add S_IFSOCK mode bit when calling fhandler_disk_file::fchmod. Don't set attributes here.
* * path.h (path_conv::operator char *): Delete.Corinna Vinschen2007-08-161-1/+3
| | | | | | | | | | | | | (path_conv::operator const char *): Delete. * dlfcn.cc: Throughout, replace path_conv::operator char * and path_conv::operator const char * by call to path_conv::get_win32 for easier transition to UNICODE_PATHs. * fhandler_socket.cc: Ditto. * hookapi.cc: Ditto. * path.cc: Ditto. * spawn.cc: Ditto. * syscalls.cc: Ditto. * uinfo.cc: Ditto.
* * fhandler_socket.cc (get_inet_addr): Use NT native functions forCorinna Vinschen2007-08-151-21/+41
| | | | | | accessing the file representing the local socket. (fhandler_socket::bind): Ditto. * ntdll.h: Declare NtReadFile.