Commit Graph

2738 Commits

Author SHA1 Message Date
Earnie Boyd 51e1a2f296 * include/malloc.h (_alloca): Add definition.
(alloca): Ditto.
2002-12-12 21:00:57 +00:00
Corinna Vinschen 24f7d30fa9 * Makefile.common: Define MINGW_LDFLAGS.
* configure.in: Reorder SUBDIRS to have mingw before cygwin.
	* configure: Regenerate from configure.in.
	* cygwin/Makefile.in: Add MINGW_LDFLAGS when linking cygrun.exe.
2002-12-12 10:34:12 +00:00
Danny Smith a6af7dbdc3 * include/shlobj.h (IShellLinkW::GetPath): Correct prototype. 2002-12-12 09:51:38 +00:00
Christopher Faylor 6d14741177 whitespace 2002-12-12 03:09:38 +00:00
Christopher Faylor 1d380f593a * cygthread.h (cygthread::stack_ptr): New element.
(cygthread::detach): Accept a "wait_for_signal" argument.
(cygthread::terminate_thread): New function.
* cygthread.cc (cygthread::stub): Set stack pointer argument.
(cygthread::terminate_thread): New function.  Forcibly terminate thread.
(cygthread::detach): Optionally wait for signals and kill thread when signal
arrives.
* exceptions.cc (signal_exit): Set signal_arrived prior to exiting to wake up
anything blocking on signals.
* fhandler.h (fhandler_base::set_r_no_interrupt): Change to accept bool
argument.
(fhandler_pipe::ready_for_read): Declare.
* pipe.cc (pipeargs): New structure.
(read_pipe): New thread stub wrapper for normal pipe read.
(fhandler_pipe::read): Modify to call reader in a cygthread, terminating on
signal, as appropriate.
* select.cc (fhandler_pipe::ready_for_read): Define new function.
2002-12-11 04:00:04 +00:00
Corinna Vinschen 231a60c73a * net.cc (free_protoent_ptr): Add missing free() for base structure.
(free_servent_pt): Ditto.
	(free_hostent_pt): Ditto.
2002-12-10 16:36:36 +00:00
Corinna Vinschen bb241345b1 * netdb.cc (parse_alias_list, parse_services_line)
(parse_protocol_line): Change strtok calls to strtok_r.
2002-12-10 13:27:15 +00:00
Corinna Vinschen d6ffc07588 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org>
* pwdgrp.h (pwdgrp_check::pwdgrp_state): Replace by
	pwdgrp_check::isinitializing ().
	(pwdgrp_check::isinitializing): Create.
	* passwd.cc (grab_int): Change type to unsigned, use strtoul and
	set the pointer content to 0 if the field is invalid.
	(parse_pwd): Move validity test after getting pw_gid.
	(read_etc_passwd): Replace "passwd_state <= " by
	passwd_state::isinitializing ().
	(internal_getpwuid): Ditto.
	(internal_getpwnam): Ditto.
	(getpwent): Ditto.
	(getpass): Ditto.
	* grp.cc (parse_grp): Use strtoul for gr_gid and verify the validity.
	(read_etc_group): Replace "group_state <= " by
	group_state::isinitializing ().
	(internal_getgrgid): Ditto.
	(getgrent32): Ditto.
	(internal_getgrent): Ditto.

2002-12-10  Pierre Humblet <pierre.humblet@ieee.org>

	* security.h: Move declarations of internal_getgrent,
	internal_getpwsid and internal_getgrsid to pwdgrp.h.
	* pwdgrp.h: Declare internal_getpwsid, internal_getpwnam,
	internal_getpwuid, internal_getgrsid, internal_getgrgid,
	internal_getgrnam, internal_getgrent and internal_getgroups.
	Delete "emulated" from enum pwdgrp_state.
	(pwdgrp_check::isuninitialized): Create.
	(pwdgrp_check::pwdgrp_state): Change state to initializing
	rather than to uninitialized.
	(pwdgrp_read::gets): Remove trailing CRs.
	* passwd.cc (grab_string): Don't look for NLs.
	(grab_int): Ditto.
	(parse_pwd): Don't look for CRs. Return 0 if entry is too short.
	(search_for): Delete.
	(read_etc_passwd): Simplify tests to actually read the file.
	Set state to loaded before making internal_getpwXX calls.
	Replace search_for calls by equivalent internal_pwgetXX calls.
	(internal_getpwsid): Use passwd_state.isuninitialized to decide
	to call read_etc_passwd.
	(internal_getpwuid): Create.
	(internal_getpwnam): Create.
	(getpwuid32): Simply call internal_getpwuid.
	(getpwuid_r32): Call internal_getpwuid.
	(getpwnam): Simply call internal_getpwnam.
	(getpwnam_r): Call internal_getpwnam.
	* grp.cc (parse_grp): Don't look for CRs. Adjust blank space.
	(add_grp_line): Adjust blank space.
	(class group_lock): Ditto.
	(read_etc_group): Simplify tests to actually read the file.
	Set state to loaded before making internal_getgrXX calls.
	Replace getgrXX calls by equivalent internal calls.
	(internal_getgrsid): Use group_state.isuninitialized to decide
	to call read_etc_group.
	(internal_getgrgid): Create.
	(internal_getgrnam): Create.
	(getgroups32): Simply call internal_getgrgid.
	(getgrnam32): Simply call internal_getgrnam.
	(internal_getgrent): Call group_state.isuninitialized.
	(internal_getgroups): Create from the former getgroups32, using
	two of the four arguments. Set gid to myself->gid and username
	to cygheap->user.name ().
	(getgroups32): Simply call internal_getgroup.
	(getgroups): Call internal_getgroup instead of getgroups32.
	(setgroups32): Call internal versions of get{pw,gr}XX.
	* sec_helper.cc: Include pwdgrp.h.
	(is_grp_member): Call internal versions of get{pw,gr}XX.
	* security.cc: Include pwdgrp.h.
	(alloc_sd): Call internal versions of get{pw,gr}XX.
	* syscalls.cc: Include pwdgrp.h.
	(seteuid32): Call internal versions of get{pw,gr}XX.
	(setegid32): Ditto.
	* uinfo.cc: Include pwdgrp.h.
	(internal_getlogin): Call internal versions of get{pw,gr}XX.
	(cygheap_user::ontherange): Ditto.
	* sec_acl.cc: Include pwdgrp.h.
	(setacl): Call internal versions of get{pw,gr}XX.
	(acl_access): Ditto and simplify logic.
	(aclfromtext): Ditto.
2002-12-10 12:43:49 +00:00
Christopher Faylor 4b47fb2c3f correct date 2002-12-09 23:08:59 +00:00
Christopher Faylor b862c42198 * lib/pseudo-reloc.c: New file.
* lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during initialization of
cygwin binary (.exe or .dll).
2002-12-09 22:49:12 +00:00
Danny Smith 97cc22ad06 * include/shellapi.h (ExtractIconEx[AW]): Correct return type
to UINT.
2002-12-09 01:51:27 +00:00
Danny Smith 009bcda6f9 * mingwex/math/s_erf.c: New file.
* mingwex/math/sf_erf.c: New file.
	* mingwex/Makefile.in (MATH_DISTFILES): Add new files.
	(MATH_OBJS): Add new objects.
	* include/math.h (erf[f]): Add prototypes.
	(erfc[f]): Add prototypes.
2002-12-08 01:46:42 +00:00
Danny Smith 4c49b9a2a5 * include/math.h: Add traditional/XOPEN math constants.
Add missing ChangeLog entry for 2002-11-27
2002-12-07 08:58:49 +00:00
Danny Smith e57ba5d3cd * include/winuser.h (AllowSetForegroundWindow,
LockSetForegroundWindow) Add prototypes.
	(ASFW_ANY, LSFW_LOCK, LSFW_UNLOCK) Add defines.
	Thanks to:  Pat Thoyts  <patthoyts@users.sourceforge.net>
	* lib/winuser.def (AllowSetForegroundWindow,
	LockSetForegroundWindow): Add stubs.
2002-12-07 07:23:41 +00:00
Christopher Faylor 2cc2e4e5ea fix date 2002-12-07 04:49:59 +00:00
Christopher Faylor 11b087d571 * cygwin.din: Reflect name change from strtodf to strtof. Export strtof.
* include/cygwin/version.h: Bump API minor number.
2002-12-06 19:48:03 +00:00
Danny Smith e25e377eb3 2002-12-06 Ken Fitlike <kenfitlike@users.sourceforge.net>
* include/commctrl.h (TN_GETDISPINFO[AW]): Add defines and
	UNICODE mappings.
	(tagNMTTDISPINFO[AW]): Replace obsolete struct names
	tagTOOLTIPTEXT[AW] and typedefs. Add defines for backward
	compatability. Add lParam field. Add UNICODE mappings for new
	names.
2002-12-06 04:13:31 +00:00
Christopher Faylor 49dd6fc61e * fhandler.h (fhandler_termios::line_edit): Change return from an int to an
enum to allow the function to return an error.
* fhandler_console.cc (fhandler_console::read): Update the line_edit call to
use the new enum.
* fhandler_termios.cc (fhandler_termios::line_edit): Change return from an int
to an enum to allow the function to return an error.  Put put_readahead call
before doecho for future patch.
* fhandler_tty.cc (fhandler_pty_master::write): Change to call line_edit one
character at a time, and stop if an error occurs.
2002-12-05 16:24:52 +00:00
Christopher Faylor 77c33bf2b9 fix comment 2002-12-04 20:46:16 +00:00
Christopher Faylor 838ad58232 * netdb.cc: New file.
* Makeile.in (DLL_OFILES): Add reference to the new netdb.cc file.
* cygwin.din : Add new aliased exports for service and protocol enumerations in
netdb.cc.
2002-12-04 20:44:17 +00:00
Corinna Vinschen 7453997e0e * cxx.cc: New file. Implement new, new[], delete and delete[]
operators and  __cxa_pure_virtual if compiled by gcc >=3.
	* Makefile.in (DLL_OFILES): Add cxx.o.
	Remove libstdc++.a from cygwin1.dll link step.
2002-12-04 20:36:23 +00:00
Danny Smith d0619aa715 2002-12-02 Andrew Stadt <acstadt@sympatico.ca>
* include/shellapi.h (_SHFILEOPSTRUCTA,_SHFILEOPSTRUCTW):
	Wrap with pshpack2.h/poppack.h to correct alignment.
2002-12-02 09:53:09 +00:00
Danny Smith c7ca0398dc 2002-12-02 Ken Fitlike <kenfitlike@users.sourceforge.net>
* include/commctrl.h (LVBKIF_*): Add defines.
	(LVM_SETIMAGE[AW]): Add defines and UNICODE mappings.
	(LVM_GETIMAGE[AW]): Add defines and UNICODE mappings.
	(LVBKIMAGE[AW]): Add defines and UNICODE mappings.
	(LPLVBKIMAGE[AW]): Add defines and UNICODE mappings.
	(LVM_GETBKIMAGE[AW]): Add defines and UNICODE mappings.
	(LVM_SETBKIMAGE[AW]): Add defines and UNICODE mappings.
	(ListView_GetBkImage): Add define.
	(ListView_SetBkImage): Add define.
	(LVBKIMAGE): Add structures and typedefs.
2002-12-02 09:50:03 +00:00
Christopher Faylor 4f96ae699c * fhandler_tty.cc (fhandler_pty_master::accept_input): Move read_retval
assignment to prevent race condition.  Remove read_retval from return
statement.
2002-11-30 22:23:01 +00:00
Christopher Faylor 883bbc6478 * pinfo.h (winpids::set): Renamed from init.
(winpids::init): New declaration.
(winpids::cs): Ditto.
(winpids::winpids): Use set rather than init.
* external.cc (fillout_pinfo): Ditto.
* dcrt0.cc (dll_crt0_1): Call winpids::init.
* pinfo.cc (winpids::set): Renamed from init.  Wrap calls in critical section.
(winpids::init): New function.
(winpids::cs): Define.
2002-11-29 07:05:26 +00:00
Christopher Faylor c0b813e500 * sigproc.cc (sig_dispatch_pending): Remove assertion. 2002-11-29 00:43:50 +00:00
Christopher Faylor ae799c9931 revert botched checkin 2002-11-28 00:41:02 +00:00
Christopher Faylor 7007fd238f * include/cygwin/version.h: Bump DLL minor number. 2002-11-28 00:40:20 +00:00
Christopher Faylor 50f4a61a36 * fhandler_socket.cc (fhandler_socket::sendto): Fix potential unitialized value
return.
2002-11-27 23:44:14 +00:00
Christopher Faylor cdaf88961d * cygwin.din: Export pthread_getsequence_np.
* include/cygwin/version.h: Bump API minor version.
2002-11-27 16:11:40 +00:00
Danny Smith dc8597f966 * mingwex/math/lgamma.c: New file.
* mingwex/math/lgammaf.c: New file.
	* mingwex/math/lgammal.c: New file.
	* mingwex/math/tgamma.c: New file.
	* mingwex/math/tgammaf.c: New file.
	* mingwex/math/tgammal.c: New file.
	* mingwex/math/cephes_mconf (polevlf): Add float version.
	(p1evlf): Likewise.
	Define _CEPHES_USE_ERRNO.
	* mingwex/Makefile.in (MATH_DISTFILES): Add new files.
	(MATH_OBJS): Add new objects.
	* include/math.h (lgamma[fl]): Add prototypes.
	(tgamma[fl]): Add prototypes.
2002-11-27 03:41:25 +00:00
Christopher Faylor eb6d2e2f9a white space 2002-11-27 02:26:44 +00:00
Christopher Faylor 05c728c45b * cygwin.din: Export nl_langinfo().
* include/cygwin/version.h: Bump API minor version.
2002-11-27 02:12:50 +00:00
Christopher Faylor b263d1d8d3 * fhandler_tty.cc (fhandler_pty_master::accept_input): Just use a normal Sleep
or suffer amazing pauses when other tty apps are running.
(fhandler_pty_master::process_slave_output): Ditto.
2002-11-26 20:32:39 +00:00
Danny Smith 5362be5926 Add strtold and wcstold to libmingwex.a
* mingwex/strtold.c: New file.
	* mingwex/wcstold.c: New file.
	* mingwex/ldtoa.c: New file.
	* mingwex/math/cephes_emath.h: New file.
	* mingwex/math/cephes_emath.c: New file.
	* mingwex/Makefile.in (DISTFILES): Add new files.
	(MATH_DISTFILES): Ditto.
	(STDLIB_OBJS): New. Define as strtold.c wcstold.c.
	(MATH_OBJS): Add cephes_emath.o.
	(LIB_OBJS): Add $(STDLIB_OBJS).
	* include/stdlib.h (strtold, wcstold): Add prototypes.
	* include/wchar.h (wcstold): Add prototype.

Add missing ChangeLog entry for 2002-11-09.
2002-11-26 00:11:06 +00:00
Earnie Boyd 4e85569d11 * include/w32api.h: Increment to version 2.2
* Makefile.in: Ditto.
2002-11-25 21:15:52 +00:00
Earnie Boyd 60d4d42f4f * lib/Makefile.in (dist, install): Correct the install destinations.
* lib/ddk/Makefile.in (dist, install): Ditto.
2002-11-25 18:14:25 +00:00
Corinna Vinschen d1b6d5cd14 * mkpasswd.c (main): Set pw_passwd field to '*' on 9x/Me. 2002-11-25 15:12:50 +00:00
Corinna Vinschen efcaf0426a * passwd.cc (read_etc_passwd): Never add an entry when starting
on Win95/98/ME if a default entry is present.
	* uinfo.cc (internal_getlogin): Look for the default uid if needed.
	Always call user.set_name ().
2002-11-25 15:11:39 +00:00
Corinna Vinschen f1da8a0664 * sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and
nentries is less than the number of entries in the file's ACL.
2002-11-25 11:23:21 +00:00
Corinna Vinschen 19f209011a 2002-11-24 Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc: Fix some formatting.  Only set and check `other' bits in
	a_perm throughout.  Use ILLEGAL_GID id for all entries having no id.
	(setacl): Fix inheritance condition.
	(getacl): Set all permission bits in CLASS_OBJ and DEF_CLASS_OBJ
	entries.  Remove DENY bits before returning to calling function.
	(acltomode): Fix usage of searchace().  If available, use CLASS_OBJ
	to mask GROUP_OBJ permissions.
	(aclfrommode): Fix usage of searchace().  If available, set CLASS_OBJ
	permissions to same value as GROUP_OBJ permissions.

2002-11-24  Pierre Humblet <pierre.humblet@ieee.org>

	* sec_acl.cc (getace): Fix the behavior when allow and
	deny entries are present in arbitrary order.
	(getacl): Report the actual number of entries when
	aclbufp is NULL, even if nentries is zero. Fix the mask
	reporting, handle the case where the owner and group sids
	are equal and streamline the code.
	(acl_worker): Take allow_ntsec into account.
2002-11-24 18:58:47 +00:00
Corinna Vinschen 2d06bd1109 * setfacl.c (getperm): Set only `other' permission bits.
(getaclentry): Set a_id to -1 by default.
2002-11-24 18:07:30 +00:00
Corinna Vinschen ad2bc53e8f * getfacl.c (permstr): Use `other' permission bits for requesting
ace permissions.
2002-11-24 16:15:33 +00:00
Robert Collins f8c8e13b7e 2002-11-05 Thomas Pfaff <tpfaff@gmx.net>
* dcrt0.cc (dll_crt0_1): Add call to pthread::initMainThread to
        initialize mainthread when it is safe to call new.
        * init.cc (dll_entry): Change call to store reents in tls key.
        * thread.cc (_reent_clib) : Change call to get reents from tls
        key.
        (_reent_winsup): Ditto.
        (MTinterface::Init): Key handling changed. Remove initialization
        of member variables.
        (MTinterface::fixup_after_fork): Reinitialize mainthread object
        after fork. Reset threadount to 1.
        (pthread::initMainThread): Create mainthread object dynamically.
        and initialize with valid handles.
        (pthread::self): Remove calls to create thread objects.
        (pthread::setTlsSelfPointer): Change call to store thread self
        handle in tls key.
        (pthread::getTlsSelfPointer): New static method.
        (pthread::exit): Remove setTlsSelfPointer call.
        (pthread::initCurrentThread): New method.
        (pthread::thread_init_wrapper): Change call to store thread self
        handle in tls key.
        (pthread::join): Check for a valid joiner.
        (pthreadNull::pthreadNull): Mark Null object as detached.
        (pthreadNull::exit): Terminate thread via ExitThread.
        * thread.h (pthread::initMainThread): Change parameter in function
        call.
        (pthread::getTlsSelfPointer): New static method.
        (pthread::initCurrentThread): New method.
        (MTinterface::reent_key): Remove.
        (MTinterface::thread_self_dwTlsIndex): Ditto..
        (MTinterface::indexallocated): Ditto.
        (MTinterface::mainthread): Ditto.
        (MTinterface::reent_key): New member.
        (MTinterface::thread_self_key): Ditto.
        (MTinterface::MTinterface): Initialize all members.
2002-11-24 13:54:14 +00:00
Robert Collins 4f0de34d37 2002-11-25 Robert Collins <rbtcollins@hotmail.com>
* readme: Document running portions of the test suite (Thanks Egor!).
        * winsup.api/pthread/mainthreadexits.c: New file, derived from
        Thomas Pfaff's test cases.
        * winsup.api/pthread/threadidafterfork.c: Ditto.
2002-11-24 13:41:36 +00:00
Christopher Faylor 4497f2a88d * wait.cc (wait4): Force pending signal delivery before waiting for process
completion.
2002-11-23 20:24:08 +00:00
Christopher Faylor 1d676025c9 * include/cygwin/version.h: Bump DLL minor number. 2002-11-23 17:43:46 +00:00
Christopher Faylor 15a3d9cc40 fix typo 2002-11-23 01:27:42 +00:00
Christopher Faylor a0d3c309e4 * exceptions.cc (handle_sigsuspend): Force pending signal delivery before
waiting for signals to happen.
* signal.cc (sleep): Force pending signal delivery before sleeping.
(usleep): Ditto.
(signal): Force pending signal delivery before manipulating signal stuff.
(sigprocmask): Ditto.
(kill_worker): Ditto.
(abort): Ditto.
(sigaction): Ditto.
* syscalls.cc (readv): Force pending signal delivery before I/O.
(writev): Ditto.
(open): Ditto.
* net.cc: Ditto, throughout.
* sigproc.cc (sig_dispatch_pending): Deliver any pending signals prior to
returning.
* tty.cc (tty::make_pipes): Increase pipe buffer size.
2002-11-22 20:51:13 +00:00
Christopher Faylor 8efb9fd7af * include/cygwin/version.h: Fix comment. 2002-11-22 16:27:32 +00:00