Use hMainProc where appropriate, throughout.
* environ.cc (spenv::retrieve): Add debugging statements.
* pinfo.cc (set_myself): Don't call strace.hello if already stracing.
* strace.cc (strace): Move NO_COPY keyword so that it will actually take
effect.
* testsuite/lib/passfail.exp (newlib_pass_fail_all): New
procedure.
(newlib_pass_fail): Change to compile and run only one file.
* testsuite/newlib.locale/locale.exp: Use new
newlib_pass_fail_all procedure.
* testsuite/newlib.string/string.exp: Likewise.
Dave Brolley [Tue, 18 Jun 2002 21:19:17 +0000 (21:19 +0000)]
2002-06-18 Dave Brolley <brolley@redhat.com>
From Catherine Moore, Michael Meissner, Richard Sandiford:
* configure.in: Support frv*-*-*.
* frv/Makefile.in: New file.
* frv/configure: New file.
* frv/configure.in: New file.
* frv/crt0.S: New file.
* frv/fstat.c: New file.
* frv/getpid.c: New file.
* frv/isatty.c: New file.
* frv/kill.c: New file.
* frv/print.c: New file.
* frv/putnum.c: New file.
* frv/sbrk.c: New file.
* frv/sim-close.S: New file.
* frv/sim-exit.S: New file.
* frv/sim-inbyte.c: New file.
* frv/sim-lseek.S: New file.
* frv/sim-open.S: New file.
* frv/sim-read.S: New file.
* frv/sim-time.c: New file.
* frv/sim-unlink.S: New file.
* frv/sim-write.S: New file.
* frv/stat.c: New file.
Danny Smith [Tue, 18 Jun 2002 20:48:57 +0000 (20:48 +0000)]
* include/tchar.h (_getts): Define as _getws for _UNICODE.
(_putts): Define as _putws for _UNICODE.
Thanks to: Tomasz Pona <cochisek@poczta.onet.pl> for report.
Jeff Johnston [Tue, 18 Jun 2002 16:07:14 +0000 (16:07 +0000)]
2002-06-18 Jeff Johnston <jjohnstn@redhat.com>
* testsuite/newlib.stdlib/atexit.c: New file.
* testsuite/newlib.stdlib/atexit.exp: Ditto.
* testsuite/newlib.string/tstring.c: Change default start size
to something more reasonable for embedded platforms.
* cygheap.h (cygheap_user::issetuid): New method.
* dtable.cc (dtable::vfork_child_dup): Use new method to determine if we are in
"setuid mode."
* fork.cc (fork_parent): Ditto.
* spawn.cc (spawn_guts): Ditto.
* syscalls.cc (seteuid32): Ditto.
(setegid32): Ditto.
* environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do potential
recalculation of cygheap_user stuff when in setuid mode. Return special value
when environment variable exists but should not be added.
(build_env): Don't add retrieved value to dstp if it is 'dont_add'.
Changes suggested by Pierre Humblet.
* environ.cc (NL): New macro.
(conv_envvars): Use NL macro to fill in name and namelen.
(spenv::namelen): New field.
(spenvs): Use NL to fill in name and namelen.
(spenv::retrieve): Eliminate length argument. Instead, use namelen throughout.
(build_env): Don't calculate length of initial FOO= part of environment.
Accommodate spenv::retrive argument change.
* cygheap.h (cygheap_user::winname): New field.
* cygheap.cc (cygheap_user::set_name): Clear winname when name changes.
* uinfo.cc (cygheap_user::env_logsrv): Avoid calculating server when Windows
user == SYSTEM.
(cygheap_user::env_domain): Set winname here too.
(cygheap_user::env_userprofile): Eliminate superfluous tests.
(cygheap_user::env_name): Seed winname by calling env_domain().
* child_info.h (child_proc_info): Declare as base class.
(spawn_info): Declare as alias of child_proc_info to aid debugging.
(fork_info): Ditto.
* cygheap.cc (cygheap_fixup_in_child): Use child_proc_info global rather than
parameter.
* cygheap.h (cygheap_fixup_in_child): Reflect above change in declaration.
* dcrt0.cc (_dll_crt0): Move 'si' definition here. Assign child_proc_info.
(dll_crt0_1): Accommodate cygheap_fixup_in_child and *_info changes.
* environ.cc (spenv::retrieve): Make regparm.
* environ.h (environ_init): Ditto.
(win_env::add_cache): Ditto.
(build_env): Ditto.
(getwinenv): Ditto.
* fork.cc (sync_with_parent): Use fork_info global.
(fork_child): Ditto.
* cygheap.h (cygheap_user::userprofile_env_buf): New static member.
* environ.cc (build_env): Add debugging statement.
(spenvs): Switch functions for USERDOMAIN and USERNAME.
* spawn.cc (spawn_guts): Move environment initialization prior to
cygheap_setup_for_child or environment info will never be copied to child.
* libc/argz: New directory.
* libc/argz/*: New files.
* libc/argz/argz_add.c: New file.
* libc/argz/argz_add_sep.c: New file.
* libc/argz/argz_append.c: New file.
* libc/argz/argz_count.c: New file.
* libc/argz/argz_create.c: New file.
* libc/argz/argz_create_sep.c: New file.
* libc/argz/argz_delete.c: New file.
* libc/argz/argz_extract.c: New file.
* libc/argz/argz_insert.c: New file.
* libc/argz/argz_next.c: New file.
* libc/argz/argz_replace.c: New file.
* libc/argz/argz_stringify.c: New file.
* libc/argz/buf_findstr.c: New file.
* libc/argz/envz_add.c: New file.
* libc/argz/envz_entry.c: New file.
* libc/argz/envz_get.c: New file.
* libc/argz/envz_merge.c: New file.
* libc/argz/envz_remove.c: New file.
* libc/argz/envz_strip.c: New file.
* libc/include/argz.h: New file.
* libc/include/envz.h: New file.
* Makefile.am (LIBC_OBJECTLISTS): Add
libc/argz/objectlist.awk.in.
* libc/Makefile.am (SUBDIRS): Add argz.
(SUBLIBS): Add argz/libargz.la.
* libc/configure.in (AC_OUTPUT): Add argz/Makefile.
* libc/include/errno.h: Add error_t typedef.
* cygheap.h (cygheap_user): Add static members to hold home{drive,path} info.
* uinfo.cc (cygheap_user::ontherange): Use static class members for local HOME*
storage.
* cygheap.cc (cygheap_user::set_logsrv): Remove.
(cygheap_user::set_domain): Ditto.
* cygheap.h (cygheap_user::set_logsrv): Remove declaration.
(cygheap_user::set_domain): Ditto.
(cygheap_user::env_domain): Declare new method.
(cygheap_user::env_name): Ditto.
* environ.cc (spenvs): Add two environment variables.
* spawn.cc (spawn_guts): Call build_env after RevertToSelf. Always set
ciresrv.mount_h.
(cygheap_user::ontherange): Recalculate homedrive/homepath if they are empty.
Use env_logsrv to get logon server.
(cygheap_user::env_logsrv): Calculate server name here rather than relying on
it having been previously calculated.
(cygheap_user::env_domain): Ditto for domain name.
(cygheap-user::env_name): New method.
* syscalls.cc (seteuid32): Do not get or set the environment. Do not call
LookupAccountSid nor internal_getlogin. Set cygheap->user name and sid from
the passwd entry.
* uinfo.cc (uinfo_init): Only call internal_getlogin when starting from a non
Cygwin process and use the values returned in user.
(internal_getlogin): Simplify to case where starting from a non Cygwin process.
Store return values in user and return void. Do not set the Windows default
environment.
* dcrt0.cc (dll_crt0_1): Call uinfo_init only when needed. Do not set
myself->uid nor reset user.sid.
* spawn.cc (spawn_guts): Get the sid from cygheap->user. Always
RevertToSelf(). Don't set uid in impersonated case.
* cygheap.cc (cygheap_user::set_sid): Do not set orig_sig.
(cygheap_user::set_orig_sid): New.
* cygheap.h: Declare cygheap_user::set_sid.
* winsup.h: Add argument to uinfo_init().
Earnie Boyd [Fri, 14 Jun 2002 13:46:12 +0000 (13:46 +0000)]
* include/w32api.h: Change to version 2.0 to reflect the change
in the license.
* README: Renamed.
* README.w32api: Renamed from README. Modified license to remove
the restriction of notifying the author based on the fact that the
author is unreachable at the notified address.
* Makefile.in (VERSION): Change to 2.0.
Corinna Vinschen [Fri, 14 Jun 2002 11:31:33 +0000 (11:31 +0000)]
* passwd.c: Rearrange includes to avoid unnecessary warnings.
(GetPW): Add parameter to (dis)allow printing of Windows username.
Use defines instead of numerical constants where possible.
Try avoiding impersonation problem. Rearrange to print Windows
username only if it's different from Cygwin username.
(ChangePW): Use defines instead of numerical constants where possible.
(main): Call GetPW with additional parameter. Change error text.
* passwd.c (GetPW): Handle case of user-edited /etc/passwd
with cygwin_internal (CW_EXTRACT_DOMAIN_AND_USER, ...).
Jeff Johnston [Thu, 13 Jun 2002 23:03:01 +0000 (23:03 +0000)]
2002-06-13 Stephen L. Moshier <steve@moshier.net>
* libm/math/e_pow.c (__ieee754_pow): Fix case whereby
x is close to -1.0 and y is very large to use ax (absolute value)
instead of x.
* libm/math/ef_pow.c (__ieee754_powf): Ditto.
Corinna Vinschen [Thu, 13 Jun 2002 11:35:11 +0000 (11:35 +0000)]
* cygheap.cc (cygheap_user::set_name): Remove setting homedrive and
homepath to NULL.
(cygheap_user::set_logsrv): Fix free'ing of plogsrv.
* cygheap.h (cygheap_user::cygheap_user): Initialize homedrive and
homepath to NULL.
* cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to NULL on
user name change.
(cygheap_user::set_logsrv): Allocate enough space for leading \\ so that we can
put this in the environment, if needed.
* cygheap.h (homebodies): New enum.
(cygheap_user::homedrive): New field.
(cygheap_user::homepath): Ditto.
(cygheap_user::env_logsrv): New method.
(cygheap_user::env_homepath): New method.
(cygheap_user::env_homedrive): New method.
(cygheap_user::env_userprofile): New method.
(cygheap_user::ontherange): New method.
* environ.cc (envsize): Eliminate debugging argument.
(environ_init): Assume that envc counts number of elments not total size.
(spenv): New class.
(spenvs): New array, renamed from forced_winenv_vars, using spenv.
(spenv::retrieve): New method.
(build_env): Rename from 'winenv' -- one stop shopping for building new
environment blocks for both windows and "unix".
* environ.h (build_env: Declare.
(winenv): Delete declaration.
(envsize): Ditto.
* spawn.cc (spawn_guts): Use build_env to build windows and cygwin environment
blocks.
* uinfo.cc (internal_getlogin): Eliminate environment manipulation. Default to
info from GetUserName if it exists. Move HOMEPATH and HOMEDRIVE stuff
elsewhere. Move HOME setting elsewhere. Only set HOME environment variable in
processes that are not parented by a cygwin process.
(cygheap_user::ontherange): Define new method.
(cygheap_user::env_logsrv): Ditto.
(cygheap_user::env_homepath): Ditto.
(cygheap_user::env_homedrive): Ditto.
(cygheap_user::env_userprofile): Ditto.
* Makefile.in: Ensure that -MD gets added to CFLAGS regardless of CFLAGS
command-line setting.
* cygwin.din: Export sexec* functions as function which returns ENOSYS
(i.e., sexec* is deprecated).
* dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is restored
even on failure.
* exec.cc: Throughout, remove references to sexec* and _spawnve.
* pinfo.h: Remove _spawnve declaration.
* spawn.cc: Rename _spawnve to spawnve and use throughout.
(spawn_guts): Eliminate hToken argument and processing of same. Just perform
special actions if impersonating.
(spawnve): Rename from _spawnve.
* dcrt0.cc (dll_crt0_1): Initialize wincap and check for sanity before running
global ctors.
* wincap.h (wincap): Eliminate constructor. Default is to zero memory, anyway.
* wincap.cc (wincap): Copy this on fork to avoid initialization in forked
processes.
Robert Collins [Mon, 10 Jun 2002 01:10:45 +0000 (01:10 +0000)]
2002-06-10 Robert Collins <rbtcollins@hotmail.com>
* cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop.
* pthread.cc: Change __pthread_self to pthread::self() thruoghout.
(_pthread_cleanup_push): New function.
(_pthread_cleanup_pop): Ditto.
* thread.cc: Thanks to Thomas Pfaff for the pthread cleanup_push,_pop
patch, this work is derived from that.
Change __pthread_self to pthread::self() thruoghout.
(__pthread_self): Rename to pthread::self.
(pthread::self): New method.
(pthread::pthread): Initialize new member.
(pthread::push_cleanup_handler): New method.
(pthread::pop_cleanup_handler): New method.
(pthread::pop_all_cleanup_handlers): New method.
(__pthread_exit): Pop all cleanup handlers.
* thread.h (pthread::push_cleanup_handler): Declare.
(pthread::pop_cleanup_handler): Ditto.
(pthread::pop_all_cleanup_handlers): Ditto.
(pthread::self): New static method.
(__pthread_exit): Give C++ linkage.
(__pthread_join): Ditto.
(__pthread_detach): Ditto.
(__pthread_self): Remove.
2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
* include/pthread.h (__pthread_cleanup_handler): New structure
(pthread_cleanup_push): Rewritten .
(pthread_cleanup_pop): Ditto.
(_pthread_cleanup_push): New prototype.
(_pthread_cleanup_pop) Ditto.
2002-04-24 Thomas Pfaff <tpfaff@gmx.net>
* thread.cc (thread_init_wrapper): Check if thread is already joined.
(__pthread_join): Set joiner first.
(__pthread_detach): Ditto.
Robert Collins [Sun, 9 Jun 2002 23:02:00 +0000 (23:02 +0000)]
2002-06-10 Robert Collins <rbtcollins@hotmail.com>
* cygserver_transport.cc (create_server_transport): Finish the split
out of sockets code from transport_layer_base. Thanks to Nicholas
Wourms and Conrad Scott for catching this.
* mount.cc (main): Use default system/user flag for cygdrive stuff, too.
(change_cygdrive_prefix): Change MOUNT_AUTO to MOUNT_CYGDRIVE.
* umount.cc (remove_cygdrive_prefix): Ditto.
(main): Use default system/user flag for cygdrive stuff, too.