summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * init.cc: Cleanup slightly and remove obsolete code.Christopher Faylor2002-09-165-30/+21
|
* 2002-09-11 Robert Collins <rbtcollins@hotmail.com>Robert Collins2002-09-165-66/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * init.cc (dll_entry): On thread detach, if the thread hasn't exit()ed, do so. * pthread.cc (pthread_getsequence_np): Remove the __pthread_getsequence_np wrapper. This requires errno.h. * thread.cc (pthread::self): Instantiate a new pthread object when called and none exists. return a NULL object if instantiation fails. (pthread::precreate): Factor out common code. (pthread::postcreate): Ditto. (pthread::create): Ditto. (pthread::exit): Remove the TLS value when we exit to prevent double exits. (MTinterface::Init): Bugfix - don't mark the TLS index as created if one was not allocated. Apply Extract Method to move pthread specific initialisation into pthread. (pthread::initMainThread): Extracted method from MTinterface::Init. (pthread::setTlsSelfPointer): Extracted method from various pthread calls, to make reading those functions easier. (pthread::setThreadIdtoCurrent): Ditto. (pthread::cancel_self): Bring into the .cc file, it's only used within the class. (pthread::getThreadId): Ditto. (pthread::thread_init_wrapper): Apply Extract Method to the TLS setting logic. (pthread::isGoodObject): Extracted method from various pthread wrapper calls, for clarity of reading. (pthread::getsequence_np): Converted from __pthread_getsquence_np. (__pthread_create): Apply Extract Method to the object validation. (__pthread_cancel): Ditto. (__pthread_join): Ditto. (__pthread_detach): Ditto. (__pthread_suspend): Ditto. (__pthread_continue): Ditto. (__pthread_getschedparam): Ditto. (__pthread_getsequence_np): Remove. (__pthread_setschedparam): Apply Extract Method to the object validation. (pthreadNull::getNullpthread): New method, return the pthreadNull object. (pthreadNull::pthreadNull): Private constructor to prevent accidental use. (pthreadNull::~pthreadNull): Prevent compile warnings. (pthreadNull::create): Override pthread behaviour. (pthreadNull::exit): Ditto. (pthreadNull::cancel): Ditto. (pthreadNull::testcancel): Ditto. (pthreadNull::setcancelstate): Ditto. (pthreadNull::setcanceltype): Ditto. (pthreadNull::push_cleanup_handler): Ditto. (pthreadNull::pop_cleanup_handler): Ditto. (pthreadNull::getsequence_np): Ditto. (pthreadNull::_instance): Ditto. * thread.h (pthread): Declare pre- and post-create. Move GetThreadId to private scope and rename to getThreadId. Move setThreadIdtoCurrent to private scope. Make create virtual. Make ~pthread virtual. Declare initMainThread. Declare isGoodObject. Make exit virtual. Make cancel virtual. Make testcancel virtual. Make setcancelstate virtual. Make setcanceltype virtual. Make push_cleanup_handler virtual. Make pop_cleanup_handler virtual. Declare getsequence_np. Declare setTlsSelfPointer. (pthreadNull): New null object class for pthread. (__pthread_getsequence_np): Remove.
* fix typoChristopher Faylor2002-09-131-1/+1
|
* fix typoChristopher Faylor2002-09-131-1/+1
|
* * syscalls.cc (seteuid32): Treat ILLEGAL_UID invalid.Corinna Vinschen2002-09-132-6/+19
| | | | (setegid32): Treat ILLEGAL_GID invalid.
* * grp.cc (initgroups): Call groups::clear_supp to free theCorinna Vinschen2002-09-114-3/+21
| | | | | | | supplementary group sids that may have been set by setgroups. * security.cc (cygsidlist::free_sids): Also zero the class members. * security.h (groups::clear_supp): New. Rename cygsidlist_unknown to cygsidlist_empty.
* * fhandler_tty.cc (fhandler_tty_slave::open): Don't protect input/outputChristopher Faylor2002-09-083-4/+8
| | | | | handles since they are not properly manipulated later. * tty.cc (tty::make_pipes): Ditto.
* whitespaceChristopher Faylor2002-09-061-4/+4
|
* * winsup.h (_WIN32_WINNT): Protect.Christopher Faylor2002-09-062-0/+6
|
* * winsup.h (_WIN32_WINNT): Define.Christopher Faylor2002-09-062-0/+6
|
* some editsChristopher Faylor2002-09-041-32/+43
|
* first draftChristopher Faylor2002-09-041-0/+55
|
* fix typoChristopher Faylor2002-09-041-1/+1
|
* * Makefile.in (DLL_OFILES): Drop shortcut.o.Corinna Vinschen2002-09-046-200/+95
| | | | | | | | * path.cc: Move all shortcut functions from shortcut.c to here. (check_shortcut): Implement without using COM interface. * path.h: Move definition of SHORTCUT_HDR_SIZE to here. * shortcut.c: Remove. * shortcut.h: Ditto.
* * fhandler.h (fhandler_socket::read): Remove method.Corinna Vinschen2002-09-044-113/+324
| | | | | | | | | | | | | | | | | (fhandler_socket::write): Ditto. (fhandler_socket::readv): New method. (fhandler_socket::writev): Ditto. (fhandler_socket::recvmsg): Add new optional argument. (fhandler_socket::sendmsg): Ditto. * fhandler.cc (fhandler_socket::read): Remove method. (fhandler_socket::write): Ditto. (fhandler_socket::readv): New method. (fhandler_socket::writev): Ditto. (fhandler_socket::recvmsg): Use win32's scatter/gather IO where possible. (fhandler_socket::sendmsg): Ditto. * net.cc (cygwin_recvmsg): Check the msghdr's iovec fields. (cygwin_sendmsg): Ditto. Add omitted sigframe.
* * cygwin.din: Revert exporting new wchar functions.Corinna Vinschen2002-09-033-55/+6
| | | | * include/cygwin/version.h: Change comment for API minor 62.
* * dcrt0.cc (dll_crt0_1): Remove getpagesize() call.Christopher Faylor2002-09-023-2/+6
| | | | * shared.cc (memory_init): Move it here.
* * fhandler_proc.cc: Add <sys/param.h> include.Christopher Faylor2002-08-313-16/+24
| | | | | | | | | | (format_proc_uptime): Use KernelTime and UserTime only as they include the other counters. (format_proc_stat): KernelTime includes IdleTime, so subtract IdleTime from KernelTime. Make number of 'jiffies' per second same as HZ define. * fhandler_process.cc: Add <sys/param.h> include. (format_process_stat): Make number of 'jiffies' per second same as HZ define. Use KernelTime and UserTime only to calculate start_time.
* * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Set "don't needChristopher Faylor2002-08-312-2/+5
| | | | | | ready for read" flag. (fhandler_tty_slave::read): Don't do anything special with vtime when vmin == 0.
* (inspired by a patch from Egor Duda)Christopher Faylor2002-08-315-45/+22
| | | | | | | | * select.cc (fhandler_tty_slave::ready_for_read): Remove. * fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration. * fhandler_tty.cc (fhandler_tty_slave::read): Don't do anything special with vtime when vmin == 0. * autoload.cc (GetConsoleWindow): Correct parameter count.
* Christopher Faylor <cgf@redhat.com>Christopher Faylor2002-08-303-3/+14
| | | | | * tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available. Call FindWindow in a loop.
* * miscfuncs.cc (check_iovec_for_read): Don't check buffer when zero lengthChristopher Faylor2002-08-308-130/+288
| | | | | | | | | | | | | | | | | | | | iov_len. (check_iovec_for_write): Ditto. * fhandler.h (fhandler_base::readv): New method. (fhandler_base::writev): Ditto. * fhandler.cc (fhandler_base::readv): New method. (fhandler_base::writev): Ditto. * syscalls.cc (_read): Delegate to readv(2). (_write): Ditto, mutatis mutandi. (readv): Rewrite, based on the old _read code, to use the new fhandler_base::readv method. Improve access mode handling and ensure all calls reach the final strace statement. (writev): Ditto, mutatis mutandi. * include/sys/uio.h (struct iovec): Change field types to match SUSv3. * winsup.h (check_iovec_for_read): New function. (check_iovec_for_write): Ditto. * miscfuncs.cc (check_iovec_for_read): Ditto. (check_iovec_for_write): Ditto.
* Sigh, mbsrtowcs was still missing...Corinna Vinschen2002-08-301-0/+2
|
* * cygwin.din: Add more prototypes for new wchar functions in newlib.Corinna Vinschen2002-08-302-0/+18
|
* * cygwin.din: Add prototypes for new wchar functions in newlib.Corinna Vinschen2002-08-303-1/+45
| | | | * include/cygwin/version.h: Bump API minor number.
* * poll.cc (poll): Peek sockets ready for read to see if there'sCorinna Vinschen2002-08-292-1/+28
| | | | actually data.
* * cygthread.cc (hthreads): Remove unneeded global.Christopher Faylor2002-08-293-14/+72
| | | | | | | | | | (cygthread::simplestub): New static member function. (cygthread::runner): Don't set hthreads. (cygthread::freerange): New member function. (cygthread::operator new): Call freerange if all cygwin slots are used up. (cygthread::exit_thread): Don't mess with event if freerange thread. (cygthread::detach): Ditto. * cygthread.h (class cygthread): Declare new member functions and variables.
* removeChristopher Faylor2002-08-291-0/+0
|
* removeChristopher Faylor2002-08-281-29/+0
|
* * malloc.cc: Protect some definitions to avoid a compile time warning.Christopher Faylor2002-08-282-0/+8
|
* * cygwin.din: Export getc_unlocked, getchar_unlocked,Corinna Vinschen2002-08-283-1/+17
| | | | | putc_unlocked, putchar_unlocked functions. * include/cygwin/version.h: Bump api minor.
* * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flagsCorinna Vinschen2002-08-284-3/+26
| | | | | | | | | not understood by WinSock. (fhandler_socket::sendto): Ditto. If WinSock sendto() returns WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL isn't set in flags. * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL. * include/cygwin/version.h: Bump API minor number.
* * poll.cc (poll): Eliminate erroneous POLLERR conditional.Corinna Vinschen2002-08-282-2/+4
|
* fragging mumble bruggum newlibChristopher Faylor2002-08-281-0/+0
|
* * fhandler_socket.cc (fhandler_socket::check_peer_secret_event):Corinna Vinschen2002-08-274-25/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Fix strace message. (fhandler_socket::connect): Remove sigframe. (fhandler_socket::accept): Ditto. (fhandler_socket::getsockname): Ditto. (fhandler_socket::getpeername): Ditto. (fhandler_socket::recvfrom): Ditto. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendto): Ditto. (fhandler_socket::sendmsg): Ditto. (fhandler_socket::close): Ditto. (fhandler_socket::ioctl): Ditto. * ioctl.cc (ioctl): Add sigframe. *net.cc (cygwin_sendto): Ditto. (cygwin_recvfrom): Ditto. (cygwin_recvfrom): Ditto. (cygwin_connect): Ditto. (cygwin_shutdown): Ditto. (cygwin_getpeername): Ditto. (cygwin_accept): Ditto. Improve strace message. (cygwin_getsockname): Ditto. Ditto. (cygwin_recvmsg): Ditto. Ditto. (cygwin_sendmsg): Fix strace message.
* * child_info.h: Add _PROC_WHOOPS enum value.Christopher Faylor2002-08-277-19/+42
| | | | | | | | | | | | | | | (CURR_CHILD_INFO_MAGIC): Update. (child_info::magic): Make 'long'. * cygheap.h: Export _cygheap_start. * cygheap.cc: Don't declare _cygheap_start. * cygmagic: Use cksum to produce checksums. Append 'U' to end of checksum. * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer. (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin version. Set child_proc_info to NULL when _PROC_WHOOPS. (multiple_cygwin_problem): If child_info specific problem, then set child_proc_info type to _PROC_WHOOPS. * shared_info.h (CURR_MOUNT_MAGIC): Update. (CURR_SHARED_MAGIC): Ditto.
* * fhandler.h (fhandler_socket::recvfrom): Fix prototype.Corinna Vinschen2002-08-265-24/+51
| | | | | | | | | | | | | | | | | | | | | | | (fhandler_socket::sendto): Ditto. * fhandler_socket.cc (fhandler_socket::recvfrom): Ditto. (fhandler_socket::sendto): Ditto. * include/sys/socket.h (recv): Fix prototype. (recvfrom): Ditto. (send): Ditto. (sendto): Ditto. * net.cc (cygwin_sendto): Ditto. Improve strace message (cygwin_recvfrom): Ditto. Ditto. (cygwin_setsockopt): Improve strace message. (cygwin_getsockopt): Ditto. (cygwin_connect): Ditto. (cygwin_accept): Ditto. (cygwin_bind): Ditto. (cygwin_getsockname): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Fix prototype. (cygwin_send): Ditto. (cygwin_recvmsg): Improve strace message. (cygwin_sendmsg): Ditto.
* * sec_acl.cc (getacl): Check ace_sid == well_known_world_sidCorinna Vinschen2002-08-263-170/+108
| | | | | | | | | | before owner_sid and group_sid so that well_known_world_sid means "other" even when owner_sid and/or group_sid are Everyone. * security.cc (get_attribute_from_acl): Created from code common to get_nt_attribute() and get_nt_object_attribute(), with same reordering as in getacl() above. (get_nt_attribute): Call get_attribute_from_acl(). (get_nt_object_attribute): Ditto.
* * Makefile.in (cygcheck.exe): Make a -mno-cygwin program.Christopher Faylor2002-08-264-17/+43
| | | | | | * cygrun.c (main): Export CYGWIN=ntsec unless otherwise set. * shared.cc (shared_name): Only add build date to shared name when *testing*.
* * Makefile.in (DLL_IMPORTS): Move libuuid.a and libshell32.a to list ratherChristopher Faylor2002-08-252-6/+14
| | | | | than referring to them via -l. Add DLL imports last in link line for new-cygwin.dll and cygrun.exe.
* * pinfo.h (pinfo::remember): Arrange for destructor call if proc_subprocChristopher Faylor2002-08-193-5/+17
| | | | | | returns error. * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses NZOMBIES element.
* * pwdgrp.h (pwdgrp_read::pwdgrp_read): Remove.Corinna Vinschen2002-08-192-13/+10
| | | | | | (pwdgrp_read::~pwdgrp_read): Ditto. (pwdgrp_read::open): Reset fh to NULL instead of INVALID_HANDLE_VALUE. (pwdgrp_read::close): Ditto.
* * fhandler.h (fhandler_console::send_winch_maybe): New method.Christopher Faylor2002-08-194-25/+45
| | | | | | | | | * fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed code. (fhandler_console::send_winch_maybe): Define new method. (fhandler_console::read): Use send_winch_maybe where appropriate. (fhandler_console::init): Just call all tcsetattr rather than output_tcsetattr. * select.cc (peek_console): Reorganize so that send_winch_maybe is called for everything but keyboard input.
* * perthread.h (vfork_save): Add ctty, sid, pgid, exitval fields.Christopher Faylor2002-08-189-19/+99
| | | | | | | | | | | | | | | | | (vfork_save::restore_pid): New method. (vfork_save::restore_exit): New method. * fork.cc (vfork): Save ctty, sid, pgid and restore them when returning to "parent". Use exitval field if exiting but never created a new process. * syscalls.cc (setsid): Detect when in "vfork" and force an actual fork so that pid will be allocated (UGLY!). (getsid): New function. * dcrt0.cc (do_exit): Use vfork_save::restore_exit method for returning from a vfork. * spawn.cc (spawnve): Use vfork_save::{restore_pid,restore_exit} methods for returning from vfork. * cygwin.din: Export getsid. * include/cygwin/version.h: Bump api minor number. * malloc.cc: #ifdef sYSTRIm for when MORECORE_CANNOT_TRIM is true.
* * cygmalloc.h (MORECORE_CANNOT_TRIM): Define.Christopher Faylor2002-08-182-1/+4
|
* * sigproc.cc (sigCONT): Define.Christopher Faylor2002-08-185-16/+32
| | | | | | | | | * sigproc.h (sigCONT): Declare. (wait_sig): Create sigCONT event here. * exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather than stopping thread. (sig_handle): Set sigCONT event as appropriate on SIGCONT rather than calling ResumeThread.
* * malloc.cc: Update to 2.7.2.Christopher Faylor2002-08-183-10/+19
| | | | | * malloc_wrapper.cc (malloc_init): Call user level mallocs to determine if the malloc has been wrapped.
* fix typoChristopher Faylor2002-08-171-1/+1
|
* Missed this commit in last checkin.Christopher Faylor2002-08-161-74/+149
|
* * winsup.h: Remove malloc_*lock functions.Christopher Faylor2002-08-162-3/+4
|