Commit Graph

2506 Commits

Author SHA1 Message Date
Danny Smith 76f28487ee * mingwex/math/files.txt: Remove inadvertantly added file. 2002-09-19 23:05:27 +00:00
Christopher Faylor 580e99a151 Cleanup calls to CreateFile throughout.
* dcrt0.cc (__api_fatal): Correctly check for failing return from CreateFile.
* assert.cc (__assert): Don't check return value from CreateFile for NULL.
* fhandler_console.cc (set_console_state_for_spawn): Ditto.
* fork.cc (fork_parent): Ditto.
2002-09-19 15:12:48 +00:00
Danny Smith 776044d554 * include/string.h (_strerror): Move into #ifndef
__STRICT_ANSI__ block.
2002-09-19 05:35:30 +00:00
Christopher Faylor 468b26c591 * cygcheck.cc: Include sys/time.h rather than time.h to avoid a compiler error. 2002-09-19 03:48:19 +00:00
Christopher Faylor 5bf785a017 * cygthread.cc (cygthread::initialized): Avoid copying on fork or some threads
may not end up in the pool.
(cygthread::new): Avoid race when checking for initialized.  Add debugging
code.
* fhandler.cc (fhandler_base::raw_read): Add case for ERROR_INVALID_HANDLE due
to Win95 directories.
(fhandler_base::open): Handle errors due to Win95 directories.
(fhandler_base::close): Add get_nohandle () test.
(fhandler_base::set_close_on_exec): Ditto.
(fhandler_base::fork_fixup): Ditto.
(fhandler_base::lock): Change error code to Posix EINVAL.
(fhandler_base::dup): If get_nohandle (), set new value to INVALID_HANDLE_VALUE
instead of NULL.
* fhandler_disk_file.cc (fhandler_disk_file::fstat): Call fstat_by_name if
get_nohandle ().  Remove extraneous element from strpbrk.
(fhandler_disk_file::open): Remove test for Win95 directory.
* fhandler_random.cc (fhandler_dev_random::open): Add set_nohandle ().
* fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
* fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
(fhandler_dev_zero::close): Delete.
* fhandler.h (class fhandler_dev_zero): Ditto.
2002-09-19 03:30:20 +00:00
Danny Smith 57dfd574a7 2002-09-18 Eric R. Krause <ekrause_98@users.sourceforge.net>
* include/winuser.h (DS_SHELLFONT): Define.
2002-09-19 00:01:18 +00:00
Danny Smith 41cb3243c5 * include/time.h (__need_NULL): Define before including
stddef.h.  Thanks to: R�diger Dehmel  <de@lmnet.de>.
2002-09-17 21:36:02 +00:00
Danny Smith e58d89280b 2002-09-17 Daniel Schlyder <daniel@dascdev.net>
* include/winnt.h (VER_SUITE_BLADE): Define.
2002-09-17 21:21:48 +00:00
Christopher Faylor 4ddb62e794 * cygcheck.cc: Reorder includes to avoid compiler error. 2002-09-17 17:13:21 +00:00
Robert Collins 9f06b64aa9 2002-09-17 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (pthread_key::set): Preserve GetLastError(). Reported
        by Thomas Pffaf.
2002-09-17 10:01:49 +00:00
Robert Collins f1f1379560 2002-09-17 Robert Collins <rbtcollins@hotmail.com>
This work inspires by Thomas Pfaff's pthread_fork patch (1).
        * fork.cc (fork_child): Remove MTinterface fixup call, it's
        adsorbed by pthread::atforkchild.
        Rename __pthread_atforkchild to pthread::atforkchild to give
        access to private members.
        (fork_parent): Rename __pthread_atforkparent to
        pthread::atforkparent to give it access to private members.
        Ditto for __pthread_atforkprepare.
        * thread.cc: Fix some formatting problems throughout.
        (MTinterface::fixup_before_fork): Implement.
        (MTinterface::fixup_after_fork): Fix pthread_keys.
        (pthread_key::keys): Implement.
        (pthread_key::fixup_before_fork): Ditto.
        (pthread_key::fixup_after_fork): Ditto.
        (pthread_key::pthread_key): Add to pthread_key::keys.
        (pthread_key::~pthread_key): Remove from pthread_key::keys.
        (pthread_key::saveKeyToBuffer): Implement.
        (pthread_key::recreateKeyFromBuffer): Ditto.
        (pthread::atforkprepare): Prepare all MT classes for fork.
        (pthread::atforkchild): And fix them up afterwards.
        * thread.h (pthread_key): Buffer the key value during
        fork in fork_buf.
        List the keys needing to be fixed up in a linked list with
        head pthread_key::keys.
        (pthread): Move atfork cygwin internal calls into the class.
        (MTInterface): Provide a fixup_before_fork for objecst that
        need to save state.
        (__pthread_atforkprepare): Remove.
        (__pthread_atforkparent): Remove.
        (__pthread_atforkchild): Remove.
2002-09-17 09:12:36 +00:00
Danny Smith cbb704cf60 * include/shlobj.h (SHGetSpecialFolderPath[AW]): Add _WIN32_IE guard.
Correct prototype for wide version.
	(SHGetFolderPath): Add comment on shfolder.dll library.
	(SHGetFolderLocation): Add prototyope for WinME and W2K.
	(SHGetFolderPathAndSubDir[AW]): Add prototypes for XP.
2002-09-17 03:08:11 +00:00
Christopher Faylor d04cf16c52 * init.cc: Cleanup slightly and remove obsolete code. 2002-09-16 16:09:54 +00:00
Robert Collins 4e78617321 2002-09-11 Robert Collins <rbtcollins@hotmail.com>
* 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.
2002-09-16 10:53:29 +00:00
Danny Smith 0812076923 * lib/shell32.def (SHGetFolderPath[AW]): Add comment.
* lib/shfolder.def: New file.
2002-09-16 10:28:16 +00:00
Danny Smith fbf3d133ce 2002-09-16 Ranjit Matthew <rmathew@hotmail.com>
* include/stdio.h: Correct comment about directory separator.
2002-09-16 09:44:06 +00:00
Joshua Daniel Franklin 98467dae59 Add final newlines to utils 2002-09-15 19:24:37 +00:00
Joshua Daniel Franklin 9b566b9695 2002-09-12 Igor Pechtchanski <pechtcha@cs.nyu.edu>
* cygpath.cc (options) New global variable.
	(main) Make short options global for easier change.
	(print_version) Add a missing newline.
2002-09-15 15:19:49 +00:00
Christopher Faylor 53217744a3 fix typo 2002-09-13 13:05:52 +00:00
Christopher Faylor 3e6ae531dd fix typo 2002-09-13 13:01:28 +00:00
Corinna Vinschen 8934e4707d * syscalls.cc (seteuid32): Treat ILLEGAL_UID invalid.
(setegid32): Treat ILLEGAL_GID invalid.
2002-09-13 09:00:28 +00:00
Danny Smith 139b31f7ac * include/sys/time.h (timeval): Add struct definition and
associated macros (copied from w32api/include/winsock.h).
2002-09-12 10:34:54 +00:00
Danny Smith 3f7b89caf1 * include/winsock.h (timeval): Guard struct and associated
macros with _TIMEVAL_DEFINED.
	* include/winsock2.h (timeval): Likewise.
2002-09-12 10:11:05 +00:00
Corinna Vinschen 5a8746b732 * grp.cc (initgroups): Call groups::clear_supp to free the
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.
2002-09-11 10:37:11 +00:00
Corinna Vinschen 22f8000733 * ntsec.html: Add chapter for switching user context w/o password. 2002-09-11 08:39:04 +00:00
Danny Smith 848791f9bc * lib/shell32.def: Add missing stubs. 2002-09-11 00:10:13 +00:00
Christopher Faylor 02fa38279f * fhandler_tty.cc (fhandler_tty_slave::open): Don't protect input/output
handles since they are not properly manipulated later.
* tty.cc (tty::make_pipes): Ditto.
2002-09-08 19:35:41 +00:00
Earnie Boyd de3387b304 * include/windef.h (WINVER): Add documentation.
(_WIN32_WINNT): Ditto.
	Special thanks to Paul Schmidt <paul@tricattechnologies.com>
2002-09-07 16:47:35 +00:00
Christopher Faylor 788d78be79 whitespace 2002-09-06 04:39:49 +00:00
Christopher Faylor 4898f75e37 * winsup.h (_WIN32_WINNT): Protect. 2002-09-06 04:30:46 +00:00
Christopher Faylor 5c0469b45c * winsup.h (_WIN32_WINNT): Define. 2002-09-06 04:21:30 +00:00
Danny Smith 53a514ef33 * lib/Makefile.in (TEST_OPTIONS): Define WINVER to 0x0666. 2002-09-06 03:24:06 +00:00
Earnie Boyd 6f28fb6195 * include/_mingw.h: Increment version to 2.3.
Makefile.in: Ditto.
2002-09-05 14:27:29 +00:00
Earnie Boyd 31736d1768 * mingwex/fegetenv.c: Change to \n line endings.
* mingwex/vsnprintf.c: Ditto.
	* mingwex/vsnwprintf.c: Ditto.
2002-09-05 11:51:26 +00:00
Danny Smith 1730adee69 2002-09-04 Kevin Chase <kevincha99@hotmail.com>
* include/winbase.h (AllocateUserPhysicalPages,
	MapUserPhysicalPages, MapUserPhysicalPagesScatter,
	FreeUserPhysicalPages): Add prototypes.
	* lib/kernel32.def: Add function stubs for above.
2002-09-04 22:20:52 +00:00
Christopher Faylor ca558bf047 some edits 2002-09-04 15:17:24 +00:00
Christopher Faylor 090b3abf87 first draft 2002-09-04 15:14:14 +00:00
Christopher Faylor 3947b56661 fix typo 2002-09-04 14:56:56 +00:00
Corinna Vinschen 03dc3df581 * Makefile.in (DLL_OFILES): Drop shortcut.o.
* 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.
2002-09-04 13:11:29 +00:00
Corinna Vinschen 4d147a03bd * fhandler.h (fhandler_socket::read): Remove method.
(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.
2002-09-04 09:39:35 +00:00
Danny Smith 3573883f9d 2002-09-03 Ren� M�ller Fonseca <fonseca@users.sourceforge.net>
* include/winuser.h (IDTRYAGAIN,IDCONTINUE): Add defines.
	Add WINVER guards for dialog box command id defines.
2002-09-03 22:29:11 +00:00
Earnie Boyd 20fb0cc513 * include/wincon.h (GetConsoleWindow): Add _WIN32_WINNT >= 0x0500 guard. 2002-09-03 16:25:54 +00:00
Corinna Vinschen 4a311951a5 * cygwin.din: Revert exporting new wchar functions.
* include/cygwin/version.h: Change comment for API minor 62.
2002-09-03 12:26:51 +00:00
Christopher Faylor bdfeb17915 * dcrt0.cc (dll_crt0_1): Remove getpagesize() call.
* shared.cc (memory_init): Move it here.
2002-09-02 06:00:59 +00:00
Danny Smith 169618f29f * mingwex/math/hypotl.c: Replace with version based on cephes
library.
2002-09-02 03:00:37 +00:00
Christopher Faylor c8bef40026 * fhandler_proc.cc: Add <sys/param.h> include.
(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.
2002-08-31 16:37:51 +00:00
Christopher Faylor af598a3b09 * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Set "don't need
ready for read" flag.
(fhandler_tty_slave::read): Don't do anything special with vtime when vmin ==
0.
2002-08-31 03:41:43 +00:00
Christopher Faylor 7a1174dcf2 (inspired by a patch from Egor Duda)
* 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.
2002-08-31 03:35:50 +00:00
Christopher Faylor f80e156de9 Christopher Faylor <cgf@redhat.com>
* tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available.  Call
FindWindow in a loop.
2002-08-30 16:03:52 +00:00
Christopher Faylor 91edb60487 * include/wincon.h: Define GetConsoleWindow(void). 2002-08-30 15:58:06 +00:00