Commit Graph

941 Commits

Author SHA1 Message Date
Christopher Faylor edc4bfd9da * include/cygwin/version.h: Bump minor version number.
* childinfo.h: Bump child structure magic number.
2001-04-25 14:59:49 +00:00
Corinna Vinschen feae8d0eab * uinfo.cc (internal_getlogin): Return pointer to struct passwd.
(uinfo_init): Accommodate the above change.
        * syscalls.cc (seteuid): Ditto.
2001-04-25 12:54:21 +00:00
Corinna Vinschen d551169a9f * autoload.cc: Add LoadDLLfunc statements for SetTokenInformation@16.
* cygheap.cc: Include security.h.
        * grp.cc (internal_getgrent): New function.
        (getgroups): Rearranged using `internal_getgrent' and the new
        `cygsid' class.
        * passwd.cc (internal_getpwent): New function.
        * sec_acl.cc: Use new `cygsid' class throughout.
        (acl_access): Use `internal_getgrent' instead of `getgrent'.
        * sec_helper.cc: Use new `cygsid' class throughout.
        (get_id_from_sid): Use `internal_getgrent' instead of `getgrent'.
        Use `internal_getpwent' instead of `getpwent'.
        * security.cc: Use new `cygsid' class throughout.
        * security.h: Move `MAX_SID_LEN' from winsup.h to here.
        Add extern declarations for `internal_getgrent' and `internal_getpwent'.
        (class cygsid): New class.
        * shared.cc (sec_user): Use new `cygsid' class.
        * syscalls.cc (seteuid): Try to set owner to user and primary group to
        current group in impersonation token before performing impersonation.
        (setegid): Try to set primary group in process token to the new group
        if ntsec is on.
        * uinfo.cc (internal_getlogin): Use new `cygsid' class.
        Try to set owner to user and primary group to current group in process
        token if the process has been started from a non cygwin process.
        (uinfo_init): Set primary group only if the process has been started
        from a non cygwin process.
        * winsup.h: Move define for `MAX_SID_LEN' to security.h.
2001-04-25 09:43:25 +00:00
Corinna Vinschen 3a6e96682d * fhandler_dsp.cc: Improved handling of 8 bit playback modes.
Put in mock support for SNDCTL_DSP_SETFRAGMENT.
2001-04-25 07:26:54 +00:00
Corinna Vinschen b7cf6a2f5b * passwd.cc (getpwnam_r): Add pw_passwd handling as well.
(getpwuid_r): Ditto.
2001-04-24 21:52:57 +00:00
Corinna Vinschen 3c73ae1c1e * passwd.cc (getpwnam_r): Use correct offsets into buffer.
Copy pw_gecos field as well.
        (getpwuid_r): Ditto.
2001-04-24 21:45:20 +00:00
Egor Duda 8db71e0169 * dlmalloc.c: New file. Port of Doug Lea's malloc
* dlmalloc.h: Ditto.
* Makefile.in: Add support for MALLOC_DEBUG
* config.h.in: Ditto.
* winsup.h: Ditto.
* configure.in: Add --enable-malloc-debugging option.
* configure: Regenerate.
* debug.h: Include declarations for debugging malloc.
* tty.cc (grantpt): Fix definition.
(unlockpt): Ditto.
2001-04-24 15:25:31 +00:00
Christopher Faylor f3ea62a847 Remove trailing underscore from fhandler_base and friends, throughout.
* fhandler.h (fhandler_base::set_open_status): New method.  Stores original
open status.
(fhandler_base::get_open_status): New method.  Retrieves original open status.
(fhandler_base::reset_to_open_binmode): New method.
* fhandler.cc (fhandler_base::open): Save open status.
(fhandler_base::init): Ditto.
* fhandler_clipboard.cc (fhandler_clipboard::open): Ditto.
* fhandler_console.cc (fhandler_console::open): Ditto.
* fhandler_dsp.cc (fhandler_dsp::open): Ditto.
* fhandler_dev_mem.cc (fhandler_dev_mem::open): Ditto.
* fhandler_dev_random.cc (fhandler_dev_random::open): Ditto.
* fhandler_serial.cc (fhandler_serial::open): Ditto.
* fhandler_tty_slave.cc (fhandler_tty_slave::open): Ditto.
* fhandler_tty_master.cc (fhandler_tty_master::open): Ditto.
* fhandler_dev_zero.cc (fhandler_dev_zero::open): Ditto.
* syscalls.cc (setmode): Rework so that 0 mode value causes reversion to open
state.
* fhandler_tty_slave.cc (fhandler_tty_slave::read): Use correct multiplier when
converting from deciseconds to milliseconds.
2001-04-24 02:07:58 +00:00
Christopher Faylor 9cf9c14668 * fhandler.h (fhandler_base::clear_r_binary): New method.
(fhandler_base::clear_w_binary): New method.
* syscalls.cc (setmode): Accept 0 as mode value.  Resets text/binary behavior
for fd to default.
2001-04-23 17:29:33 +00:00
Christopher Faylor f940c5b1aa * net.cc [errmap]: Add '0' condition.
(find_winsock_errno): Don't translate no error to EPERM.
2001-04-23 16:46:30 +00:00
Christopher Faylor 3c76c0760f spacing changes. 2001-04-23 02:56:19 +00:00
Christopher Faylor c02e9189cf * include/cygwin/version.h: Bump Cygwin version and API version. 2001-04-23 00:48:23 +00:00
Robert Collins 9672024b82 Mon Apr 23 9:27:00 2001 Robert Collins <rbtcollins@hotmail.com>
* thread.cc (MTinterface::Init): Always initialise per process variables.
2001-04-22 23:59:15 +00:00
Christopher Faylor 1acf5c29c8 * features.h: Reinstate as wrapper for sys/features.h. 2001-04-22 23:18:28 +00:00
Corinna Vinschen b265245256 * security.cc (alloc_sd): Reformat comment.
* shared.cc: Drop function declarations already in security.h.
2001-04-22 22:12:12 +00:00
Christopher Faylor 96dc5dd7e5 * shortcut.c (check_shortcut): Close input file handle before returning.
* path.cc (check_sysfile): Ditto.
(symlink_info::check): Rely on opened file handle being closed by symlink
checking routines.  Set ext_tacked_on when .lnk is detected.
2001-04-22 16:19:27 +00:00
Christopher Faylor da77d416c5 * thread.cc (MTinterface::Init): Remove accidentally checked in code. 2001-04-21 23:26:14 +00:00
Robert Collins 9450ad0d02 Sun Apr 22 20:22:00 2001 Robert Collins <rbtcollins@hotmail.com>
* passwd.cc (getpwuid): Check for thread cancellation.
	(getpwuid_r): Ditto.
	(getpwname): Ditto.
	(getpwnam_r): Ditto.
	* thread.h (pthread_mutex): New constructors for pshared operation.
	(MTinterface): Associative array for pshared mutex's.
	* thread.cc (MTinterface::Init): Initailize pshared mutex array.
	(pthread_cond::BroadCast): Implementation notes.
	(pthread_cond::TimedWait): Remove use of SignalObjectAndWait on non-NT systems.
	(pthread_mutex::pthread_mutex(unsigned short)): New function.
	(pthread_mutex::pthread_mutex (pthread_mutex_t *, pthread_mutexattr *)):New function.
	(pthread_mutex::pthread_mutex(pthread_mutexattr *)): Fail on pshared mutex's.
	(__pthread_mutex_getpshared): New function.
	(__pthread_join): Check for thread cancellation.
	(__pthread_cond_timedwait): Support pshared mutex's.
	(__pthread_cond_wait): Ditto.
	(__pthread_condattr_setpshared): Error on PROCESS_SHARED requests.
	(__pthread_mutex_init): Support pshared mutex's.
	(__pthread_mutex_getprioceiling): Ditto.
	(__pthread_mutex_lock): Ditto.
	(__pthread_mutex_trylock): Ditto.
	(__pthread_mutex_unlock): Ditto.
	(__pthread_mutex_destroy): Ditto.
	(__pthread_mutex_setprioceiling): Ditto.
	(__pthread_mutexattr_setpshared): Support PTHREAD_PROCESS_PSHARED requests.
2001-04-21 14:23:47 +00:00
Christopher Faylor 603260769e * cygwin.din: Add *scanf and *scan_r functions. 2001-04-20 23:38:43 +00:00
Corinna Vinschen 3c8e92d9fc * security.cc (set_process_privileges): Swap out.
* sec_helper.cc (set_process_privilege): Rename from
        `set_process_privileges'. Takes the privilege to enable or disable
        as parameter now.
        * security.h: Add prototype for `set_process_privileges'.
2001-04-20 20:36:13 +00:00
Christopher Faylor b9815dc3dc * path.cc (path_conv::check): Always initialize member variables. 2001-04-20 16:40:04 +00:00
Christopher Faylor cbd8868713 * include/sys/file.h: More cleanup for X_OK. 2001-04-20 16:36:17 +00:00
Christopher Faylor cdcfe4e8e9 * include/sys/file.h: Move X_OK protection earlier.
* dtable.cc (dtable::vfork_child_fixup): Avoid closing already closed handles.
2001-04-20 15:50:03 +00:00
Corinna Vinschen bfbc1aecdc * grp.cc (getgroups): Change so that SIDs get compared instead
of strings to SIDs.
2001-04-20 14:30:22 +00:00
Corinna Vinschen c0d1968a18 * Makefile.in: Add object files `sec_helper.cc' and `sec_acl.cc'.
* security.cc: Swap out several functions.
        * sec_acl.cc: New file. Move Sun compatibel ACL functions from
        `security.cc' to here.
        * sec_helper.cc: New file. Move security helper functions from
        `security.cc' to here.
        * security.h: Changed to accomodate the above changes.

        * grp.cc: Replace `group_in_memory_p' by `group_state'.
        Eliminate group_sem throughout.
        (enum grp_state): New enumeration type.
        (read_etc_group): Make race safe.
        * security.cc: Eliminate group_sem throughout.
2001-04-20 13:02:32 +00:00
Corinna Vinschen b78d6f6e7b * mmap.cc (mmap): Drop usage of the same memory area if the same
region of the same file is mapped twice.
2001-04-19 07:44:34 +00:00
Christopher Faylor 0381fec68f Throughout, change fdtab references to cygheap->fdtab.
* child_info.h (cygheap_exec_info): Eliminate special fdtab stuff.
* spawn.cc (spawn_guts): Ditto.
* cygheap.cc (cygheap_init): Initialize fdtab, if appropriate.
* cygheap.h (CYGHEAPSIZE): Include size of init_cygheap.
(_cmalloc_entry): Include fdtab here.
* dtable.h (dtable): Declare/define new methods.
* dtable.cc (dtable::vfork_child_fixup): New method.
(dtable::fixup_after_exec): Remove unneeded extra arguments.
* dcrt0.cc (dll_crt0_1): Ditto.
* environ.cc (getwinenv): Use case sensitive comparison.
(winenv): Make a copy of environment cache to avoid realloc problems when
duplicate environment variables exist in the environment.  (From Egor Duda)
* net.cc (cygwin_socket): Revert Apr 14 change.
* include/sys/file.h: Protect against previous X_OK definition.
* passwd.cc: Eliminate passwd_sem throughout.
* security.cc: Ditto.
* cygwin.din: Export New functions.
* passwd.cc (read_etc_passwd): Make race safe.
(getpwuid_r): New function.
(getpwnam_r): New function.
2001-04-18 21:10:15 +00:00
Corinna Vinschen 77c45b121e * grp.cc (getgroups): Avoid crash if passwd field if /etc/group is
empty.
2001-04-18 14:52:07 +00:00
Christopher Faylor 4199e1e6fb * path.h (path_conv::add_ext_from_sym): Declare.
* path.cc (path_conv::add_ext_from_sym): Convert to pure inline method.
2001-04-17 23:12:11 +00:00
Corinna Vinschen e6629a8ad0 * path.cc (windows_device_names): Add missing NULL element. 2001-04-17 16:52:09 +00:00
Christopher Faylor adfd477da3 * path.cc (windows_device_names): Move dsp to proper location. 2001-04-17 16:16:27 +00:00
Corinna Vinschen 8aefe7c08b Forgot the ChangeLog... 2001-04-17 11:49:19 +00:00
Corinna Vinschen 0f56512627 * path.cc (path_conv::check): Set case_clash even if pcheck_case
is set to PCHECK_ADJUST when a case clash is given for the last
        component in path.
        (symlink_info::case_check): Ditto.
        * syscalls.cc (_rename): Avoid overwriting an already existing file
        if a case clash is given even if pcheck_case is set to PCHECK_ADJUST.
2001-04-17 11:47:37 +00:00
Corinna Vinschen 77eb506d60 Add missing ChangeLog entry. 2001-04-17 08:51:34 +00:00
Christopher Faylor 7b79ebc5e9 Turn NEWVFORK off. 2001-04-17 06:07:07 +00:00
Christopher Faylor 431ba7dd33 * path.h (cwdstuff): Move class.
* cygheap.h (cwdstuff): To here.
(init_cygheap): Add cwd field.
* child_info.h (cygheap_exec_info): Eliminate cwd stuff.
(child_info_spawn): Ditto.
* dcrt0.cc (dll_crt0_1): Remove cygcwd.fixup_after_exec call.  Convert cygcwd
reference to cygheap->cwd.
* path.cc: Ditto, throughout.
(cwdstuff::copy): Eliminate.
(cwdstuff::fixup_after_exec): Ditto.
* spawn.cc (spawn_guts): Eliminate call to cygcwd.copy.
* fhandler.h (FH_OSS_DSP): Move into "fast" device category.
2001-04-17 03:52:08 +00:00
Corinna Vinschen 7ade56ca6a * mmap.cc: Move fh_paging_file from some functions to be
a global static variable.
        (class mmap_record): Add `devtype_' member to remember
        the device type of the file. Add declaration for methods
        `get_device', `alloc_fh' and `free_fh'.
        (mmap_record::mmap_record): Initialize `devtype_' correctly.
        (mmap_record::alloc_fh): New method.
        (mmap_record::free_fh): Ditto.
        (munmap): Use new mmap_record::alloc_fh and mmap_record::free_fh
        methods to create a correct fhandler.
        (msync): Ditto.
        (fixup_mmaps_after_fork): Ditto.
2001-04-16 17:26:04 +00:00
Corinna Vinschen c4548fb4fa * grp.cc (getgroups): If `allow_ntsec' is set, use the process token
information to evaluate the groups list.
2001-04-16 14:02:42 +00:00
Christopher Faylor 3b3b19d258 * features.h: Remove this file as it is now being supplied by newlib. 2001-04-16 04:08:05 +00:00
Christopher Faylor b0a50cf34c * autoload.cc: Add winmm functions needed by fhandler_dsp.cc.
* fhandler_dsp.cc: New file.  Implements OSS like /dev/dsp.
* include/sys/soundcard.h: New file.  User land includes for OSS /dev/dsp.
* fhandler.h: Add new class fhandler_dev_dsp and a FH_OSS_DSP definition.
* dtable.cc (dtable::build_fhandler): Allow creation of the /dev/dsp device.
* path.cc (windows_device_names): Add /dev/dsp into list of device names.
* Makefile.in (DLL_OFILES): Add fhandler_dsp.o.
2001-04-16 03:27:16 +00:00
Christopher Faylor 4535e6a9aa * uname.c (uname): Default n in in86 to 6 if Windows returns > 6. 2001-04-15 20:39:46 +00:00
Corinna Vinschen 1ff87985a1 * path.cc (add_ext_from_sym): Redefine to call `add_ext_from_sym_'.
(add_ext_from_sym_): New inline function.
2001-04-15 14:00:45 +00:00
Christopher Faylor 34bbe838e6 * config.h.in: Turn on VFORK by default. 2001-04-14 23:24:07 +00:00
Christopher Faylor 266be1d8c9 * net.cc (cygwin_socket): Set SO_LINGER to small value so closed UNIX domain
sockets will not stay around.
* select.cc (socket_cleanup): Set SO_LINGER to small value so closed dummy
sockets do not stay around.  Use correct value for second argument to shutdown.
2001-04-14 22:11:03 +00:00
Robert Collins e6b98fc8d6 Sat Apr 14 17:04:00 2001 Robert Collins <rbtcollins@hotmail.com>
* thread.h (MTinterface): Add threadcount.
	* thread.cc (MTinterface::Init): Set threadcount to 1.
	(__pthread_create): Increment threadcount.
	(__pthread_exit): Decrement threadcount and call exit() from the last thread.
2001-04-14 07:06:02 +00:00
Christopher Faylor 1114d47268 Fix ChangeLog format. 2001-04-13 15:34:33 +00:00
Christopher Faylor 39b6859a28 * fork.cc (fork_child): Call the __pthread_atforkchild function.
(fork_parent): Call the __pthread_atforkparent function.
* cygwin.din: Export pthread_atfork.
* thread.h (callback): New class.
(MTinterface): Use it.
* thread.cc (__pthread_atforkprepare): New function.
(__pthread_atforkparent): New function.
(__pthread_atforkchild): New function.
(__pthread_atfork): New function.
* pthread.cc (pthread_atfork): New function.
2001-04-13 15:28:20 +00:00
Corinna Vinschen e61cead397 * path.cc (add_ext_from_sym): New define evaluating `known'suffix'.
(path_conv::check): Use add_ext_from_sym throughout.
2001-04-13 07:54:20 +00:00
Corinna Vinschen 70c370d674 * dir.cc (mkdir): Check for case clash.
* environ.cc: Add extern declaration for `pcheck_case'.
        (check_case_init): New function.
        (struct parse_thing): Add "check_case" option.
        * errno.cc (_sys_nerrlist): Add text for ECASECLASH.
        (strerror): Add case branch for ECASECLASH.
        * fhandler.cc (fhandler_disk_file::open): Check for case clash.
        * path.cc: Add global variable `pcheck_case'.
        (struct symlink_info): Add member `case_clash' and method `case_check'.
        (path_prefix_p_): Call `pathnmatch' instead of `strncasematch'.
        (pathnmatch): New funtion.
        (pathmatch): Ditto.
        (path_conv::check): Add handling for case checking.
        (symlink): Check for case clash.
        (symlink_info::check): Add parameter for case checking.
        Handle case checking.
        (symlink_info::case_check): New method.
        (chdir): Don't use unconverted path if pcheck_case==PCHECK_STRICT.
        * path.h: Add extern declarations for `pathmatch' and
        `pathnmatch'.
        (enum case_checking): New enumeration type describing
        the case checking behaviour of path conversion routines.
        (class path_conv): Add member `case_clash'.
        * syscalls.cc (_link): Check for case clash.
2001-04-12 21:21:37 +00:00
Christopher Faylor 82d4a5d4bb * syscalls.cc (mkfifo): New function stub. 2001-04-12 16:50:13 +00:00
Christopher Faylor aa67fd12e9 * configure.in: Remove PTH_ALLOW.
* cygwin.din: Remove @PTH_ALLOW@ prefixes to pthread functions.  Add new
pthread exports.
* pthread.cc: New wrapper functions for the above new exports.
* sched.cc (valid_sched_parameters): New function.
(sched_setparam): Use it.
(sched_set_thread_priority): New function.  Used by pthread_sched*.
* thread.cc (pthread_key_destructor::InsertAfter): New function.
(pthread_key_destructor::UnlinkNext): New function.
(pthread_key_destructor::Next): New function.
(pthread_key_destructor_list::Insert): New function.
(pthread_key_destructor_list::Remove): New function.
(pthread_key_destructor_list::Pop): New function.
(pthread_key_destructor::pthread_key_destructor): New function.
(pthread_key_destructor_list::IterateNull): New function.
(MTinterface::Init): Initialise new member.
(pthread::pthread): Initialise new members.
(pthread::create): Copy new attributes.  Set the new thread priority.
(pthread_attr::pthread_attr): Initialise new members.
(pthread_key::pthread_key): Setup destructor function.
(pthread_key::~pthread_key): Remove destructor function.
(pthread_mutexattr::pthread_mutexattr): New function.
(pthread_mutexattr::~pthread_mutexattr): New function.
(__pthread_once): New function.
(__pthread_cleanup): New function.
(__pthread_cancel): New function.
(__pthread_setcancelstate): New function.
(__pthread_setcanceltype): New function.
(__pthread_testcancel): New function.
(__pthread_attr_getinheritsched): New function.
(__pthread_attr_getschedparam): New function.
(__pthread_attr_getschedpolicy): New function.
(__pthread_attr_getscope): New function.
(__pthread_attr_setinheritsched): New function.
(__pthread_attr_setschedparam): New function.
(__pthread_attr_setschedpolicy): New function.
(__pthread_attr_setscope): New function.
(__pthread_exit): Call any key destructors on thread exit.
(__pthread_join): Use the embedded attr values.
(__pthread_detach): Use the embedded attr values.
(__pthread_getconcurrency): New function.
(__pthread_getschedparam): New function.
(__pthread_key_create): Pass the destructor on object creation.
(__pthread_key_delete): Correct incorrect prototype.
(__pthread_setconcurrency): New function.
(__pthread_setschedparam): New function.
(__pthread_cond_timedwait): Support static mutex initialisers.
(__pthread_cond_wait): Ditto.
(__pthread_mutex_getprioceiling): New function.
(__pthread_mutex_lock): Support static mutex initialisers.
(__pthread_mutex_trylock): Ditto.
(__pthread_mutex_unlock): Ditto.
(__pthread_mutex_destroy): Ditto.
(__pthread_mutex_setprioceiling): New function.
(__pthread_mutexattr_getprotocol): New function.
(__pthread_mutexattr_getpshared): New function.
(__pthread_mutexattr_gettype): New function.
(__pthread_mutexattr_init): New function.
(__pthread_mutexattr_destroy): New function.
(__pthread_mutexattr_setprotocol): New function.
(__pthread_mutexattr_setprioceiling): New function.
(__pthread_mutexattr_getprioceiling): New function.
(__pthread_mutexattr_setpshared): New function.
(__pthread_mutexattr_settype): New function.  Remove stubs for non MT_SAFE
compilation.
* thread.h: Remove duplicate #defines.  Add prototypes for new functions in
thread.cc.
(pthread_key_destructor): New class.
(pthread_key_destructor_list): New class.
(pthread_attr): Add new members.
(pthread): Remove members that are duplicated in the pthread_attr class.
(pthread_mutex_attr): Add new members.
(pthread_once): New class.
* include/pthread.h: Add prototypes for new functions exported from
cygwin1.dll.  Remove typedefs.
* include/sched.h: Add prototypes for new functions in sched.cc.
* include/cygwin/types.h: Add typedefs from pthread.h
2001-04-12 15:40:18 +00:00
Robert Collins 5c83f260b8 * configure.in: Remove PTH_ALLOW.
* cygwin.din: Remove @PTH_ALLOW@ prefixes to pthread functions.
	Add new pthread exports.
	* pthread.cc: New wrapper functions for the above new exports.
	* sched.cc (valid_sched_parameters): New function.
	(sched_setparam): Use it.
	(sched_set_thread_priority): New function. Used by pthread_sched*.
	* thread.cc (pthread_key_destructor::InsertAfter): New function.
	(pthread_key_destructor::UnlinkNext): New function.
	(pthread_key_destructor::Next): New function.
	(pthread_key_destructor_list::Insert): New function.
	(pthread_key_destructor_list::Remove): New function.
	(pthread_key_destructor_list::Pop): New function.
	(pthread_key_destructor::pthread_key_destructor): New function.
	(pthread_key_destructor_list::IterateNull): New function.
	(MTinterface::Init): Initialise new member.
	(pthread::pthread): Initialise new members.
	(pthread::create): Copy new attributes. Set the new thread priority.
	(pthread_attr::pthread_attr): Initialise new members.
	(pthread_key::pthread_key): Setup destructor function.
	(pthread_key::~pthread_key): Remove destructor function.
	(pthread_mutexattr::pthread_mutexattr): New function.
	(pthread_mutexattr::~pthread_mutexattr): New function.
	(__pthread_once): New function.
	(__pthread_cleanup): New function.
	(__pthread_cancel): New function.
	(__pthread_setcancelstate): New function.
	(__pthread_setcanceltype): New function.
	(__pthread_testcancel): New function.
	(__pthread_attr_getinheritsched): New function.
	(__pthread_attr_getschedparam): New function.
	(__pthread_attr_getschedpolicy): New function.
	(__pthread_attr_getscope): New function.
	(__pthread_attr_setinheritsched): New function.
	(__pthread_attr_setschedparam): New function.
	(__pthread_attr_setschedpolicy): New function.
	(__pthread_attr_setscope): New function.
	(__pthread_exit): Call any key destructors on thread exit.
	(__pthread_join): Use the embedded attr values.
	(__pthread_detach): Use the embedded attr values.
	(__pthread_getconcurrency): New function.
	(__pthread_getschedparam): New function.
	(__pthread_key_create): Pass the destructor on object creation.
	(__pthread_key_delete): Correct incorrect prototype.
	(__pthread_setconcurrency): New function.
	(__pthread_setschedparam): New function.
	(__pthread_cond_timedwait): Support static mutex initialisers.
	(__pthread_cond_wait): Ditto.
	(__pthread_mutex_getprioceiling): New function.
	(__pthread_mutex_lock): Support static mutex initialisers.
	(__pthread_mutex_trylock): Ditto.
	(__pthread_mutex_unlock): Ditto.
	(__pthread_mutex_destroy): Ditto.
	(__pthread_mutex_setprioceiling): New function.
	(__pthread_mutexattr_getprotocol): New function.
	(__pthread_mutexattr_getpshared): New function.
	(__pthread_mutexattr_gettype): New function.
	(__pthread_mutexattr_init): New function.
	(__pthread_mutexattr_destroy): New function.
	(__pthread_mutexattr_setprotocol): New function.
	(__pthread_mutexattr_setprioceiling): New function.
	(__pthread_mutexattr_getprioceiling): New function.
	(__pthread_mutexattr_setpshared): New function.
	(__pthread_mutexattr_settype): New function.
	Remove stubs for non MT_SAFE compilation.
	* thread.h: Remove duplicate #defines.
	Add prototypes for new functions in thread.cc.
	(pthread_key_destructor): New class.
	(pthread_key_destructor_list): New class.
	(pthread_attr): Add new members.
	(pthread): Remove members that are duplicated in the pthread_attr class.
	(pthread_mutex_attr): Add new members.
	(pthread_once): New class.
	* include/pthread.h: Add prototypes for new functions exported from cygwin1.dll.
	Remove typedefs.
	* include/sched.h: Add prototypes for new functions in sched.cc.
	* include/cygwin/types.h: Add typedefs from pthread.h
2001-04-12 04:04:53 +00:00
Christopher Faylor fc672fb26c * path.cc (struct symlink_info): Add extn and ext_tacked_on fields.
(path_conv::check): Only tack on extension if a known one didn't already exist.
(suffix_scan::has): Return pointer to known extension.
(symlink_info::check): Record location of extension, if any.
2001-04-11 19:09:53 +00:00
Egor Duda 619f7fa032 * fhandler.h (class fhandler_socket): Add members and methods to
support secure connections on AF_UNIX sockets.
* fhandler_socket.cc (fhandler_socket::set_connect_secret): New method.
(fhandler_socket::get_connect_secret): Ditto.
(fhandler_socket::create_secret_event): Ditto.
(fhandler_socket::close_secret_event): Ditto.
(fhandler_socket::check_peer_secret_event): Ditto.
(fhandler_socket::fixup_after_fork): Duplicate secret event to child.
(fhandler_socket::dup): Copy address family.
(fhandler_socket::close): Close secret event.
* net.cc (get_inet_addr): Read secret cookie.
(cygwin_connect): Check if peer knows secret cookie value.
(cygwin_accept): Ditto. Copy address family to newly created socket.
(cygwin_bind): Generate and write secret cookie.
(wsock_init): Initialize random number generator.
2001-04-09 07:21:32 +00:00
Christopher Faylor c08e6c4430 Work around new g++ problem. 2001-04-09 01:23:27 +00:00
Christopher Faylor e3eef4d042 remove extra whitespace. 2001-04-09 00:52:33 +00:00
Christopher Faylor aa970c616c * Makefile.in: Put -lgcc last in list of libraries, since stdc++ library needs
it.
* cygwin.din: Remove obsolete "__empty" export.
* exceptions.cc (call_signal_handler_now): Force inclusion of function even
when -finline-functions is specified.
* sigproc.h: Remove obsolete call_signal_handler declaration.
* fhandler_console.cc (cp_get_internal): New function.
(cp_convert): New function.
(con_to_str): New function.
(str_to_con): New function.
(fhandler_console::read): Replace OemToCharBuff with con_to_str.
(fhandler_console::write_normal): Replace CharToOemBuff with str_to_con.
2001-04-09 00:44:25 +00:00
Corinna Vinschen 9ddfe5a04a * syscalls.cc (stat_worker): Fix conditional which still allowed
successful stat'ing of non-existant files.
2001-04-05 20:43:23 +00:00
Christopher Faylor 0403bb7415 * child_info.h: Bump magic number for fork/exec/spawn. 2001-04-04 14:37:45 +00:00
Corinna Vinschen c196a1a26a * errno.cc (errmap): Map ERROR_FILE_INVALID to ENXIO. 2001-04-03 18:20:38 +00:00
Christopher Faylor c90e420d91 * cygrun.c (main): Fix compiler warning.
* gmon.c (_mcleanup): Ditto.
* profil.c (profile_off): Ditto.
* net.cc (find_winsock_errno): New function.
(__set_winsock_errno): Use find_winsock_errno.
(cygwin_setsockopt): Detect SO_ERROR for debugging.
(cygwin_getsockopt): Ditto.  Translate error when getsockopt returns SO_ERROR.
* winsup.h: regparmize __set_winsock_errno.
* include/sys/strace.h: Document that strace functions can't use regparm.
2001-04-03 02:53:25 +00:00
Corinna Vinschen 0f0a7dc99d * fhandler.cc (fhandler_disk_file::open): Avoid checking a magic
number of a directory.
2001-04-02 14:35:17 +00:00
Christopher Faylor f97adf983d * shared_info.h (mount_info): Remove mnt_ elements.
* thread.h (struct _winsup_t): Add mnt_ elements.
* path.cc (fillout_mntent): Use mnt_ elements from reent_winsup ().
2001-04-02 04:27:12 +00:00
Christopher Faylor 1ba3935dfb * exceptions.cc (sigframe::call_signal_handler): Return value of
call_signal_handler_now.
* sigproc.h (sigframe): Use constructor.
* syscalls.cc (_read): Correct errno test prior to calling signal handler.
2001-04-02 00:18:29 +00:00
Christopher Faylor 0ef785e4ee Fix typo. 2001-04-01 23:05:30 +00:00
Christopher Faylor 2a1743c76d * exceptions.cc (sigframe::call_signal_handler): Move out side of "C" block or
some compilers will complain.
2001-04-01 05:38:08 +00:00
Christopher Faylor 11f3a79b64 * exceptions.cc (call_signal_handler_now): Rename from call_signal_handler to
avoid C++ confusion.
2001-04-01 05:24:20 +00:00
Christopher Faylor 5817ee2d09 * path.cc (fillout_mntent): Always remove drive root directories from future
consideration by "/cygdrive" reporting.
(cygdrive_getmnt): Avoid reporting removable drives or drives with no media
mounted.
2001-04-01 05:09:57 +00:00
Christopher Faylor f2aeff27f0 * thread.h (struct _winsup_t): Remove obsolete elements. Add available_drives
element.
* path.cc (mount_info::getmntent): Report "/cygdrive" drives when mounted
drives are exhausted.
(fillout_mntent): New function.
(mount_item::getmntent): Use fillout_mntent.
(cygdrives_mntent): New function.  Returns next available "/cygdrive".
(setmntent): Initialize available "/cygdrives".
* syscalls.cc: Remove some if 0'ed code.
* times.cc (timezone): Use more descriptive variable name.
2001-04-01 03:06:02 +00:00
Christopher Faylor f611148366 * sigproc.h (class sigframe): Implement 'unregister()' method.
(sigframe::~sigframe): Use unregister method.
(sigframe::call_signal_handler): Declare new method.
* exceptions.cc (sigframe::call_signal_handler): New method.  Unregisters
current sigframe before calling signal handler.
(setup_handler): Clear waiting threads prior to arming signal_arrived.
* syscalls.cc (_read): Change goto to loop.  Recalculate sigframe inside of
loop so that constructor is called when appropriate.
* wait.cc (wait4): Ditto.
* signal.cc: Change "sig" to "signal" in debugging messages throughout.
* sigproc.cc: Ditto.
2001-04-01 00:06:17 +00:00
Christopher Faylor ab57d14639 * fhandler_serial.cc (fhandler_serial::raw_write): Close protected handles with
ForceCloseHandle or suffer spurious warnings.
2001-03-31 22:13:02 +00:00
Christopher Faylor 0cec322603 * fhandler.cc (fhandler_base::read): Remove special handling of CTRL-Z. 2001-03-31 21:24:48 +00:00
Corinna Vinschen c796f4f1e6 Fix formatting. 2001-03-31 11:00:52 +00:00
Corinna Vinschen 70afbaae17 * fhandler.h (class fhandler_console): Add members `insert_mode'.
* fhandler_console.cc (fhandler_console::dup): Duplicate `insert_mode'.
        (fhandler_console::fhandler_console): Initialize `insert_mode'.
        fhandler_console::char_command): Add terminal capabilities
        "enter insert mode" = \E[4h and "exit insert mode" = \E[4l.
        Care for insert mode on terminal capability "repeat char" = \E[x;yb.
        (fhandler_console::write_normal): Care for insert mode before writing
        to the console.
        (array keytable): Add keymapping for modified cursor and control
        block keys (xterm like).
2001-03-31 09:19:32 +00:00
Christopher Faylor 12453b4590 Fix strange formatting. 2001-03-31 04:18:01 +00:00
Christopher Faylor 0ed560cb08 Fix strange formatting. 2001-03-31 03:56:58 +00:00
Corinna Vinschen f42da31ad6 * fhandler.h (class fhandler_console): Add members `savebufsiz' and
`savebuf' to allow save/restore of screen.
        * fhandler_console.cc (fhandler_console::dup): Duplicate savebuf.
        (fhandler_console::fhandler_console): Initialize `savebufsiz' and
        `savebuf'.
        (fhandler_console::char_command): Add terminal capabilities
        "save screen content" = \E[?47h and "restore screen content" = \E[?47l.
2001-03-30 11:10:13 +00:00
Christopher Faylor b5eb3d0f15 * path.cc (chdir): Eat trailing whitespace on input path. 2001-03-29 00:30:39 +00:00
Christopher Faylor 1ac6d1a144 * lib/_cygwin_S_IEXEC.c: Remove "const" from globals or they never seem to be
defined.  Wrap definitions in extern "C".  Include winsup.h to assure proper
definitions.
* dcrt0.cc (dll_crt0_1): Call stdio_init after premain run so that binmode.o,
etc., will control default stdio settings.
* dtable.cc (dtable::init_std_file_from_handle): Allow __fmode to force
binmode/textmode settings.  Default pipes to binmode.
2001-03-28 03:42:58 +00:00
Corinna Vinschen 37a2d97a31 * mmap.cc (mmap): Fix conditional for previous patch. 2001-03-27 09:35:39 +00:00
Christopher Faylor 90725b3297 add missing stuff. 2001-03-26 22:17:06 +00:00
Corinna Vinschen 1636a5a1e8 * mmap.cc (mmap): Outflank copy-on-write problem on 9x by
setting access mode to FILE_MAP_READ when read access is requested.
2001-03-26 18:17:15 +00:00
Christopher Faylor aa73152ef7 * dlfcn.cc (check_access): Eliminate.
(check_path_access): Use passed in path_conv buf.
(get_full_path_of_dll): Use passed in name buf to avoid a static.  Rip out most
of the path checking since LoadLibrary will do all of this automatically.
(dlopen): Set errno when appropriate (may not be compliant?).
* environ.cc (posify): Don't pass in "native" path if it seems to actually be
posix.
2001-03-26 01:16:11 +00:00
Christopher Faylor db0421f6ec * fhandler.h (fhandler_dev_clipboard): Extend to support writing.
* fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard):
Initialize new fields.  Open clipboard here.
(fhandler_dev_clipboard::dup): New method.
(fhandler_dev_clipboard::open): Accomodate new fields.  Register clipboard
here, if appropriate.
(set_clipboard): New function.  Moves buffer to clipboard.
(fhandler_dev_clipboard::write): Truly implement clipboard writing.
(fhandler_dev_clipboard::read): Reimplement to allow successive reads.
(fhandler_dev_clipboard::lseek): Truly implement seeks in clipboard.
(fhandler_dev_clipboard::close): Clear out new fields.  Support sequential
reads and sequential writes.  Support for binary data via a native clipboard
format.
2001-03-22 22:11:34 +00:00
Christopher Faylor 0b30bad456 * fhandler_console.cc (fhandler_console::set_default_attr): Update console
color attributes on tty reset.
2001-03-22 18:19:00 +00:00
Christopher Faylor c445814840 * autoload.cc (kernel32_init): New function for kernel32 autoload
initialization.
(SignalObjectAndWait): Add conditional load of this function when it is
available.
2001-03-22 03:42:08 +00:00
Christopher Faylor 99a40adcd9 add new file. 2001-03-21 16:06:22 +00:00
Christopher Faylor 6b2a2aa4af Add missing files. 2001-03-21 14:00:29 +00:00
Christopher Faylor 9a08b2c02e * sched.cc: New file. Implement sched*.
* include/sched.h: New file.  User land includes for sched*.
* Makefile.in: Add sched.o
* cygwin.din: Add exports for sched*.
2001-03-21 02:17:58 +00:00
Christopher Faylor a1299ba54b * dtable.cc: Guard against new winsock.h/winsock2.h warnings when mixing
winsock*.h and sys/types.h.
* fhandler_socket.cc: Ditto.
* net.cc: Ditto.
* select.cc: Ditto.
* exceptions.cc: Remove unneeded define.
2001-03-20 19:50:28 +00:00
Christopher Faylor b8c8fa1786 * exceptions.cc (interruptible): Update debugging output.
(setup_handler): Ensure that wait_sig loop wakes up when we punt on sending a
signal.
* poll.cc (poll): Add signal guard here.
2001-03-19 22:48:26 +00:00
Egor Duda 78ace8a7e5 * tty.h (tty::create_inuse): Add new parameter to allow non-
inheritable 'inuse' events.
* tty.cc (tty::create_inuse): Use new parameter.
* fhandler_tty.cc (fhandler_tty_master::init): Ditto.
* fhandler_tty.cc (fhandler_pty_master::open): Ditto.
* fhandler_tty.cc (fhandler_tty_master::init): Create master_alive
event.
* tty.cc (tty_list::terminate): Close master_alive event.
* fhandler_tty.cc (fhandler_tty_common::close): Send EOF to slaves
when master side is closed.
2001-03-19 18:27:37 +00:00
Corinna Vinschen 98750a8404 * mmap.cc (map::get_list_by_fd): Avoid calling `get_namehash' when
file descriptor is -1.
2001-03-19 13:33:51 +00:00
Corinna Vinschen 30f326bf5e * syscalls.cc (check_posix_perm): New static function.
(fpathconf): Add _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY
        support.
        (pathconf): Ditto.
        * include/cygwin/version.h: Bump API minor number to 37.
2001-03-19 11:02:41 +00:00
Christopher Faylor 94b03f2380 Fix spacing, copyrights. 2001-03-18 21:11:25 +00:00
Christopher Faylor 51cb7ca7ac fix spacing. 2001-03-18 20:58:18 +00:00
Egor Duda 5e8e21d938 * fhandler.h (fhandler_tty_slave): Declare new methods.
* select.cc (fhandler_tty_slave::select_read): New method.
* select.cc (fhandler_tty_slave::ready_for_read): Ditto.
* select.cc (verify_tty_slave): New function.
* fhandler_termios.cc (fhandler_termios::line_edit): Empty input
buffer on signal.
* fhandler_tty.cc (fhandler_tty_slave::read): Check for input data
after reading from pipe. Reset event if input pipe is empty.
* tty.h (class tty): Allow creating events with manual reset.
* tty.cc (tty::get_event): Use manual_reset flag.
* tty.cc (tty::common_init): Create input_available_event with
manual reset.
2001-03-18 18:05:01 +00:00
Christopher Faylor ca1cea7ed3 Update copyrights. 2001-03-18 03:34:05 +00:00
Christopher Faylor 9d1373cf8a Update copyright. 2001-03-18 03:25:30 +00:00
Christopher Faylor 00a7496150 * external.cc (fillout_pinfo): Match windows pid, as well as cygwin pid when
passed in pid.  Don't prematurely break when searching for a pid.
* thread.h (_winsup_t): Eliminate unneeded field.
2001-03-18 02:49:29 +00:00
Corinna Vinschen 8eb72e632c * net.cc (get_95_ifconf): Use strcasematch instead of strcasecmp.
* syscalls.cc (_unlink): Ditto.
        (_rename): Ditto.
2001-03-17 19:53:52 +00:00
Christopher Faylor 57499703f2 * path.cc (suffix_scan::next): Avoid searching for foo.lnk twice when input is
"foo".
2001-03-17 17:44:53 +00:00
Corinna Vinschen 298fad4623 * net.cc (cygwin_socket): Set protocol to 0 when address family is
AF_UNIX to avoid WSAEPROTONOSUPPORT error.
2001-03-17 17:13:52 +00:00
Corinna Vinschen f52488f76b * net.cc (cygwin_socket): Pass protocol parameter to socket call. 2001-03-17 17:04:45 +00:00
Christopher Faylor b63a3f55a7 * dir.cc (readdir): Use strcasematch for consistency.
* path.cc (symlink_info): Eliminate known_suffix.
(path_conv::check): Always copy ext_here to end of buffer, if found.
(suffix_scan): Eliminate ext_here, add suffixes_start.
(suffix_scan::has): Eliminate an argument.  Reorganize.  Always return pointer
to end of input path.
(suffix_scan::next): Take a second pass through the suffix list looking for
.lnk.
(symlink_info::check): Eliminate known_suffix usage.
2001-03-17 07:09:41 +00:00
Christopher Faylor 92f4bf9725 Fix typo. 2001-03-17 05:14:16 +00:00
Christopher Faylor db15b3e359 Accomodate all devices. 2001-03-17 05:11:20 +00:00
Christopher Faylor 5bb22c6b1d * syscalls.cc (stat_dev): Give devices full read/write. 2001-03-17 05:06:14 +00:00
Christopher Faylor c0c9de3c66 * thread.cc (MTinterface::CreateCond): Check for null attr pointer. 2001-03-17 04:49:13 +00:00
Christopher Faylor ddca580f9a * fhandler_termios.cc (fhandler_termios::line_edit): Don't accept input when a
signal is sent or we'll end up in an EOF/signal race.
2001-03-17 02:15:33 +00:00
Christopher Faylor ed4c976cf2 fix spelling error. 2001-03-17 01:45:40 +00:00
Christopher Faylor b65c6896c8 * path.cc: Translate scan states from defines to enums.
(suffix_scan): Rename state to nextstate for clarity.
(lnk_match): Change to allow multiple states to indicate that a .lnk has been
matched.
(suffix_scan::has): Eliminate a goto.  Handle .lnk as a special case, since a
.lnk may also need to be tacked on the end of a .lnk.
(suffix_scan::next): Don't increment next state.  Set it specifically.
Recognize new .lnk states.
2001-03-17 01:29:14 +00:00
Christopher Faylor 5ccbf4b699 * cygwin.din: Export the new functions.
* pthread.cc (pthread_cond_*): Add wrapper functions that call __pthread_cond*
functions.
* thread.cc (__pthread_cond_*): Implement the pthread_cond* functions.
* thread.h: Add new class entries and prototypes for __pthread_cond* functions.
* include/pthread.h: user land header prototypes for pthread_cond* functions
and related defines.
2001-03-17 01:14:58 +00:00
Corinna Vinschen e212576dba * environ.cc (parse_options): Use strtok_r instead of strtok.
* security.cc (convert_string_sid_to_sid): Ditto.
        (aclfromtext): Ditto. Fix buffer usage.
2001-03-14 15:32:49 +00:00
Corinna Vinschen 78d2c08cd9 * path.cc (lnk_suffixes): Remove.
(class suffix_scan): Add `lnk_state' flag.
        (suffix_scan::lnk_match): Return state of `lnk_state' now.
        (suffix_scan::has): Changed behaviour if file has `.lnk' suffix.
        (suffix_scan::next): Set `lnk_state' where appropriate.
        (symlink_info::check): Fix a wrong `break'.
        * syscalls.cc (chown_worker): Change debug statement to reflect
        lchown fix.
        (lchown): Call chown_worker with `PC_SYM_NOFOLLOW' instead of
        `PC_SYM_IGNORE'.
2001-03-14 11:13:46 +00:00
Corinna Vinschen 1d39c83a32 * fhandler.cc (fhandler_disk_file::fstat): Add correct modes to
symlinks when stat'ing on FAT or FAT32 file systems.
2001-03-13 13:07:15 +00:00
Egor Duda 344ce60cfb Fix typo 2001-03-13 07:58:29 +00:00
Egor Duda e935fcf08a * fhandler.h (fhandler_termios::fixup_after_exec): New function.
* fhandler.cc (fhandler_termios::fixup_after_fork): New function.
Fixup output handle.
* fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Output
handle is now fixed up in fhandler_termios::fixup_after_fork().
2001-03-12 21:27:42 +00:00
Egor Duda 79409dc0a2 * fhandler.h (fhandler_termios::fhandler_termios): Enable fixup
after fork.
* fhandler_console.cc (fhandler_console::fhandler_console): Fixup
after fork is now enabled in the base class constructor.
2001-03-12 20:39:40 +00:00
Christopher Faylor 2b777e2e94 * mkvers.sh: Include config.h so that DEBUGGING is correctly defined. 2001-03-12 16:20:30 +00:00
Christopher Faylor 941fa5ad96 * spawn.cc (spawn_guts): Don't set EXIT_REPARENTING if parent process is not a
cygwin process (suggested by Jason Gouger <cygwin@jason-gouger.com>).
2001-03-12 14:49:29 +00:00
Christopher Faylor d0909d913a * child_info.h: Bump magic number for fork/exec/spawn. 2001-03-11 21:05:49 +00:00
Christopher Faylor abb88b6f53 Remove obvious brain freeze problem. 2001-03-11 16:46:28 +00:00
Christopher Faylor 2116a17508 * autoload.cc (noload): Use proper method for multiline strings or newer gcc's
complain.
* exceptions.cc (unused_sig_wrapper): Ditto.
* fhandler.h (fhandler_base): Make get_io_handle and friends return self.
* fhandler_tty.cc (fhandler_pty_common::close_on_exec): Accomodate DEBUGGING
flag to avoid spurious warnings when inheritance is set.
2001-03-11 01:58:23 +00:00
Christopher Faylor 7cf3b655ec * shortcut.c (PATH_ALL_EXEC): Add parentheses to avoid a compiler warning.
* exceptions.cc (setup_handler): Clarify debugging message.
* sigproc.cc (proc_subproc): Remove PROC_CHILDSTOPPED test.  It is handled by
normal PROC_CLEARWAIT case.
(wait_sig): Eliminate "dispatched" tracking.  Remove __SIGCHILDSTOPPED test.
Decrement counter again before jumping out of InterlockedDecrement loop so that
subsequent InterlockedIncrement will keep the counter at the correctly
decremented value and also detect when there are pending signals.
* sigproc.h: Remove __SIGCHILDSTOPPED element.
(procstuff): Remove PROC_CHILDSTOPPED element.
2001-03-10 23:37:50 +00:00
Christopher Faylor e2f2a27ee8 * syscalls.cc (_rename): Set errno to ENOENT when an old path doesn't exist
(from Kazuhiro Fujieda <fujieda@jaist.ac.jp>).  Also set EACCES when directory
is not writable.
2001-03-10 20:25:19 +00:00
Christopher Faylor 6ebccdc110 * syscalls.cc (_read): Change definition to return ssize_t to be consistent
with read.
(_write): Change definition to return ssize_t to be consistent with write.
2001-03-07 20:52:33 +00:00
Christopher Faylor 8f98585d51 Update copyright. 2001-03-07 17:45:03 +00:00
Christopher Faylor efd76e4140 * sigproc.h (sigthread): Declare new methods. Create new winapi_lock field.
(sigframe:;set): Call get_winapi_lock after frame is set so that signal handler
thread knows not to call SuspendThread.
(sigframe::~sigframe): Release winapi_lock.
* exceptions.cc (sigthread::get_winapi_lock): New method.
(sigthread::release_winapi_lock): New method.
(setup_handler): Use get_winapi_lock to ensure that signalled thread is not
blocked in a Windows API.
* path.h (path_types): Avoid broken GCC warning.
2001-03-07 06:19:34 +00:00
Corinna Vinschen bf11a54f54 * path.cc (suffix_scan::has): Change order of conditionals
to allow checking for .lnk suffixes even if in_suffixes is empty.
2001-03-06 13:05:56 +00:00
Corinna Vinschen 7cdc9feea1 * autoload.c (cygwin_premain0): Add missing parameter.
* binmode.c (cygwin_premain0): Ditto.
        * textmode.c (cygwin_premain0): Ditto.

Patch contributed by Jason Tiller <jtiller@sjm.com> :
        * auto_load.cc: Add "GetKeyboardLayout" entry in the list of
        Win32 User32.DLL exports to provide.
        * fhandler.h (class fhandler_console): Add meta_mask private
        member to remember which keystroke modifiers should generate
        META.
        * fhandler_console.cc (fhandler_console::read): Modify code that
        tests a keystroke for a META-escaped key to use the 'meta_mask'
        variable.
        (fhandler_console::fhandler_console): Add definition for
        variable "meta_mask" used to determine if a keystroke should be
        preceded by META in the client console stream.  Set meta_mask
        based on whether or not user's keyboard language is English -
        non-English keyboards pass AltGr (right <ALT>) unmolested,
        whereas English keyboards now interpret left- and right-<ALT>
        as META.
2001-03-06 12:05:45 +00:00
Corinna Vinschen a887211b00 * include/a.out.h: Add copyright hint.
* include/fcntl.h: Ditto.
        * include/lastlog.h: Ditto.
        * include/memory.h: Ditto.
        * include/mntent.h: Ditto.
        * include/paths.h: Ditto.
        * include/poll.h: Ditto.
        * include/syslog.h: Ditto.
        * include/termio.h: Ditto.
        * include/tzfile.h: Ditto.
        * include/arpa/inet.h: Ditto.
        * include/asm/byteorder.h: Ditto.
        * include/asm/socket.h: Ditto.
        * include/asm/types.h: Ditto.
        * include/cygwin/if.h: Ditto.
        * include/cygwin/mtio.h: Ditto.
        * include/cygwin/rdevio.h: Ditto.
        * include/cygwin/socket.h: Ditto.
        * include/net/if.h: Ditto.
        * include/netinet/in.h: Ditto.
        * include/netinet/in_systm.h: Ditto.
        * include/netinet/ip.h: Ditto.
        * include/netinet/ip_icmp.h: Ditto.
        * include/netinet/tcp.h: Ditto.
        * include/sys/cdefs.h: Ditto.
        * include/sys/cygwin.h: Ditto.
        * include/sys/ioctl.h: Ditto.
        * include/sys/mman.h: Ditto.
        * include/sys/mount.h: Ditto.
        * include/sys/mtio.h: Ditto.
        * include/sys/procfs.h: Ditto.
        * include/sys/resource.h: Ditto.
        * include/sys/smallprint.h: Ditto.
        * include/sys/socket.h: Ditto.
        * include/sys/strace.h: Ditto.
        * include/sys/syslog.h: Ditto.
        * include/sys/sysmacros.h: Ditto.
        * include/sys/termio.h: Ditto.
        * include/sys/termios.h: Ditto.
        * include/sys/uio.h: Ditto.
        * include/sys/un.h: Ditto.
        * include/sys/utsname.h: Ditto.
        * include/sys/vfs.h: Ditto.
        * include/sys/wait.h: Ditto.
        * regexp/regerror.c: Ditto.
        * regexp/regexp.h: Ditto.
        * regexp/regmagic.h: Ditto.
2001-03-05 21:29:24 +00:00
Christopher Faylor 95a8465ba0 * dlopen.c (dlopen): Return NULL when name is NULL (suggested by
chrisiasci@aol.com).
* cygwin.din: Add a new, internally used export - _check_for_executable.
* dcrt0.cc (dll_crt0_1): Set _check_for_executable for older binaries.  Pass
user_data to premain functions.
* fhandler.cc (fhandler_disk_file::open): Only check for executable if the
linked program is intereested in the executable bit.
(fhandler_disk_file::check_execable_p): Delete.
* fhandler.h (executable_states): New enumeration of various states of
executable bit caring.
(fhandler_base::set_execable_p): New method.
* fhandler_termios.cc (fhandler_termios::line_edit): Flag when a signal has
been sent to the tty.  Return -1 when this is so.
* fhandler_console.cc (fhandler_console::read): Return -1 when signal sending
character encountered.
* path.cc (path_conv::check): Record when path refers to a disk device.  Move
executable extension check here.
(check_sysfile): Accomodate new EXEC path states.
(has_suffix): Remove.
(next_suffix): Remove.
(class suffix_scan): New clas.
(suffix_scan::has): New method.
(suffix_scan:next): New method.
(symlink_info::check): Use suffix_scan method to control for scanning for
suffixes.
* path.h (path_conv::exec_state): New method.
* perprocess.h: Make "C" friendly.
* include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_S_IEXEC.  Bump
CYGWIN_VERSION_API_MINOR.
* include/sys/cygwin.h: Change premain declarations.
* winsup.h: Move __cplusplus test to after builtin defines.
2001-03-05 06:28:25 +00:00
Egor Duda 306c4b6737 * fhandler.h (class fhandler_tty_common): New mutex and event to
syncronize input on master tty with slave tty.
* fhandler_tty.cc (fhandler_pty_master::accept_input): Use them to
syncronize with slave.
* fhandler_tty.cc (fhandler_tty_slave::read): Use input mutex and
event to syncronize with master. Do not limit amount of data read
from master to vmin value. Interrupt on signal and return already
read data, if any.
* fhandler_tty.cc (fhandler_tty_slave::open): Handle input mutex and
event.
* fhandler_tty.cc (fhandler_tty_common::close): Ditto.
* fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Ditto.
* fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Ditto.
* fhandler_tty.cc (fhandler_tty_common::dup): Ditto.
* tty.h (tty::open_input_mutex): New function.
* tty.cc (tty::common_init): Create input mutex and event.
2001-03-04 15:34:25 +00:00
Christopher Faylor 0312ede431 *** empty log message *** 2001-03-03 03:56:34 +00:00
Corinna Vinschen ed94def22d * dir.cc (readdir): Fix creating path in symlink check. 2001-03-02 12:33:50 +00:00
Corinna Vinschen e03f5f7338 * dir.cc (readdir): Fix shortcut==symlink condition.
* environ.cc: Add extern decl for `allow_winsymlinks'.
        (struct parse_thing): Add entry for `[no]winsymlinks'.
        * path.cc (symlink): Change to be able to create both,
        symlink==shortcut and symlink==systemfile, dependent of
        the setting of `allow_winsymlinks'.
        * security.cc (cygwin_logon_user): Add debug output.
        * shortcut.c: Add defines from path.h.
        (has_exec_chars): Copy from path.h.
        (check_shortcut): Check for executable file condition if not a
        shortcut.
2001-03-02 11:41:09 +00:00
Christopher Faylor 903c330dbe * exceptions.cc (sig_handle_tty_stop): Ignore attempts to suspend a process if
started by non-cygwin parent.
2001-03-02 02:09:40 +00:00
Christopher Faylor d80999a1c4 * select.cc (peek_console): Don't report read_ready on mouse events unless we
are looking for mouse events.
* fhandler.h (fhandler_console::mouse_aware): New method.
2001-03-02 01:55:21 +00:00
Corinna Vinschen 2de7601434 * uinfo.cc: Eliminate `#include <wchar.h>'. 2001-02-28 14:14:03 +00:00
Egor Duda 739db26a31 * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Determine
drive geometry or partition size to allow seeking from the end of
raw floppy device. Don't allow positioning past the end of media or
to offsets bigger then max off_t.
2001-02-28 09:59:54 +00:00
Egor Duda a53136cc46 * fhandler.h (class fhandler_console): Make all variables that
describe "state" of console to be members of fhandler_console.
default_color is now the color which is set when console recieves
reset command.
* fhandler_console.cc (fhandler_console::fhandler_console): Turn
mouse handling and raw keyboard mode off by default. Initialize
state information.
* fhandler.cc (fhandler_console::set_raw_win32_keyboard_mode): New
function.
* fhandler_console.cc (fhandler_console::set_default_attr): New
function. Reset console attributes to default values.
* fhandler_console.cc (fhandler_console::open): Reset attributes.
* fhandler_console.cc (fhandler_console::get_win32_attr): New function.
Calculate win32-style console attribute based on terminal attributes.
* fhandler_console.cc (fhandler_console::set_cursor_maybe): Use
member variable.
* fhandler_console.cc (fhandler_console::read): If in raw-win32
keyboard mode, encode win32 keyboard events in \033{x;y;z;t;u;wK
sequences.
* fhandler_console.cc (fhandler_console::dup): Copy all state
information to the dup()ed handle.
* fhandler_console.cc (fhandler_console::scroll_screen): Use current
fill-in	attribute.
* fhandler_console.cc (fhandler_console::clear_screen): Ditto.
* fhandler_console.cc (fhandler_console::char_command): Check if we
saw '?' symbol by member variable. Set terminal	attributes on \033[Xm
commands. \033[24m - turn off underline mode, \033[27m - turn off
reverse mode, \033[39m - restore default foreground color.
\033[49m - restore default background color. \033[2000h - turn on raw
keyboard mode, \033[2000l - turn off raw keyboard mode.
* fhandler_console.cc (fhandler_console::write): Set attribues to
default values on reset command.
2001-02-27 09:14:35 +00:00
Christopher Faylor 5b331f1ef1 * times.cc (settimeofday): Replace function stub with working code. 2001-02-26 22:36:09 +00:00
Corinna Vinschen 88429768bb * strace.cc (strace::vprntf): Move prntf functionality to this function
adding an va_list interface to strace.
        (strace::printf): Calls strace::vprntf now.
        (strace_printf): New function providing an extern "C" interface to
        trace output.
        * include/sys/strace.h: Make plain C clean.
        (class strace): Add `vprntf' method.
2001-02-26 09:50:24 +00:00
Corinna Vinschen 6626ebfef7 * shortcut.c: Remove #include <sys/strace.h>. 2001-02-25 23:14:52 +00:00
Corinna Vinschen 649033a811 * path.cc (symlink): Add a ".lnk" suffix regardless. Add a comment. 2001-02-25 09:34:00 +00:00
Corinna Vinschen 80ed95f2eb * shortcut.c: Change symlink condition. 2001-02-25 09:19:35 +00:00
Corinna Vinschen 675412e9d6 * mmap.cc (fhandler_disk_file::mmap): Use `addr' correctly.
* fhandler_mem.cc (fhandler_dev_mem::mmap): Ditto.
2001-02-23 09:49:19 +00:00
Corinna Vinschen 659b480b8a * path.cc (symlink): Keep relative paths relative in the DOS
path inside of a shortcut. If that's impossible or the target
        path is already absolute save an absolute path.
2001-02-22 16:26:13 +00:00
Corinna Vinschen ff413a9894 * path.cc (symlink): Keep relative paths relative in the DOS
path inside of a shortcut. If that's impossible for some
        reason, save an absolute path.
2001-02-22 16:14:59 +00:00
Corinna Vinschen c5a4eacc69 * cygerrno.h: Revert previous patch.
* errno.cc: Ditto.
        * dir.cc: Eliminate `dir_suffixes'.
        (opendir): Remove usage of `dir_suffixes'.
        (rmdir): Ditto.
        * fhandler.cc (fhandler_disk_file::open): Remove usage of
        `inner_suffixes'.
        * path.cc: Rename `inner_suffixes' to `lnk_suffixes'.
        (path_conv::check): Remove usage of `inner_suffixes'.
        (symlink): Ditto.
        (symlink_info::check): Handle checking for `.lnk' in path_conv
        exclusively here.
        (chdir): Remove usage of `dir_suffixes'.
        * shortcut.c: Eliminate debug_printf lines.
        (check_shortcut): Don't set error except on failing ReadFile.
        * spawn.cc: Remove ".lnk" from `std_suffixes'.
        * syscalls.cc (_unlink): Remove usage of `inner_suffixes'.
        Remove ".lnk" from `stat_suffixes'.
        (_rename): Add check for renaming a symlink to keep the ".lnk"
        suffix after renaming.
2001-02-22 14:51:16 +00:00
Corinna Vinschen 79e56091c9 * shortcut.c: New file. Provides a C interface to reading of
Windows shortcuts to avoid compiler flag `-fvtable-thunks'.
        * shortcut.h: Ditto.
        * Makefile.in: Add shortcut.o to DLL_OFILES.
        * cygerrno.h: Provide a C interface to `geterrno_from_win_error' for
        using in shortcut.c.
        * errno.cc (geterrno_from_win_error): Define as extern "C".
        * path.cc (struct symlink_info): Remove methods `check_shortcut' and
        `check_sysfile'.
        (shortcut_header): Move to shortcut.c.
        (shortcut_initalized): Ditto.
        (create_shortcut_header): Ditto.
        (cmp_shortcut_header): Ditto.
        (symlink_info::check_shortcut): Ditto. Reorganize as a plain C function.
        (symlink_info::check_sysfile): Redefine as a global function using the
        same parameter list as `check_shortcut' for clearness.
        (symlink_info::check): Change parameter list for calls to
        `check_shortcut' and `check_sysfile'.
2001-02-22 12:56:36 +00:00
Corinna Vinschen 87e6b0981f * fhandler.cc (fhandler_disk_file::open): Use `inner_suffixes' when
resolving real_path.
        * path.cc (symlink): Ditto for win32_topath.
2001-02-22 11:06:25 +00:00
Corinna Vinschen fc168ded9e Add copyright year 2001 2001-02-21 22:59:11 +00:00
Corinna Vinschen 10b06c5ee0 * Makefile.in: Add `-lshell32 -luuid' to link pass for new-cygwin1.dll.
* autoload.cc: Add LoadDLLinitfunc for ole32.dll.
        Add LoadDLLfuncEx statements for CoInitialize@4, CoUninitialize@0
        and CoCreateInstance@20.
        * dir.cc (dir_suffixes): New datastructure.
        (readdir): Check for R/O *.lnk files to hide the suffix.
        (opendir): Use `dir_suffixes' in path conversion.
        (rmdir): Ditto.
        * fhandler.cc (fhandler_disk_file::fstat): Add S_IFLNK flag
        before calling `get_file_attribute'. Take FILE_ATTRIBUTE_READONLY
        into account only if the file is no symlink.
        * path.cc (inner_suffixes): New datastructure.
        (SYMLINKATTR): Eliminated.
        (path_conv::check): Use `inner_suffixes' on inner path components.
        (shortcut_header): New global static variable.
        (shortcut_initalized): Ditto.
        (create_shortcut_header): New function.
        (cmp_shortcut_header): Ditto.
        (symlink): Create symlinks by creating windows shortcuts. Preserve
        the old code.
        (symlink_info::check_shortcut): New method.
        (symlink_info::check_sysfile): Ditto.
        (symlink_info::check): Check for shortcuts. Move code reading
        old system attribute symlinks into symlink_info::check_sysfile().
        (chdir): Use `dir_suffixes' in path conversion.
        * security.cc (get_file_attribute): Check for S_IFLNK flag.
        Force 0777 permissions then.
        * spawn.cc (std_suffixes): Add ".lnk" suffix.
        * syscalls.cc (_unlink): Use `inner_suffixes' in path conversion.
        Check for shortcut symlinks to eliminate R/O attribute before
        calling DeleteFile().
        (stat_suffixes): Add ".lnk" suffix.
        (stat_worker): Force 0777 permissions if file is a symlink.
2001-02-21 21:49:37 +00:00
Egor Duda 0917ed5950 * sigproc.cc (getsem): Make semaphore always non-inheritable. 2001-02-21 11:40:22 +00:00
Christopher Faylor 441d7aeef1 * dcrt0.cc (locale_init): Remove. 2001-02-20 03:28:01 +00:00
Christopher Faylor f97e7d754c * cygwin.din: Export rand48 functions.
* thread.cc (MTinterface::Init): Remove the initialization of `reent_data'.
* dcrt0.cc: Add the initalizer to the declaration of `reent_data'.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 35.
2001-02-20 02:53:55 +00:00
Egor Duda fc68bf34bb * signal.cc (signal): Prohibit setting handlers for SIGKILL and SIGSTOP
* signal.cc (sigaction): Ditto
* syscalls.cc (_lseek): Return EINVAL on invalid input
2001-02-16 18:49:20 +00:00
Christopher Faylor ee2c7251d0 * dlfcn.cc (dlopen): Do not call LoadLibrary with a NULL pointer, when the
library is not found
2001-02-14 23:45:56 +00:00
Christopher Faylor 8f8e7442bb * fhandler_console.cc (fhandler_console::char_command): Ignore unknown
rendition codes in \033[xx;yym control sequences
2001-02-14 22:00:09 +00:00
Christopher Faylor cde0c2fbca * fork.cc (fork_parent): Return EAGAIN when can't record pid.
* pinfo.h (pinfo::remember): Return value of call to proc_subproc.
* sigproc.cc (proc_subproc): Return error if can't record pid.
2001-02-10 04:20:52 +00:00
Christopher Faylor c41482c7ee * syscalls.cc (mknod): Add valid parameters. 2001-02-09 17:17:34 +00:00
Corinna Vinschen 889109ab1f * mmap.cc (mmap): Check for reusing a mapping only on MAP_SHARED
and on MAP_PRIVATE|MAP_ANON in the special case of offset 0.
2001-02-08 21:10:45 +00:00
Corinna Vinschen db49d0b530 * mmap.cc (class list): Add member `hash'.
(list::list): Initialize `hash'.
        (list::get_list_by_fd): Use filepath hash value to get the correct
        mapping list if it's not an anonymous mapping.
        (map::add_list): Initialize `hash' with filepath hash value.
        (mmap): Check for reusing a mapping only on MAP_SHARED.
2001-02-08 21:02:36 +00:00
Christopher Faylor 91d385fed3 * signal.cc (killpg): Correct first argument. 2001-02-07 23:48:09 +00:00
Corinna Vinschen 9182099c10 * autoload.cc: Add LoadDLLinitfunc for iphlpapi.dll.
Add LoadDLLfuncEx statements for GetIfTable@12 and GetIpAddrTable@12.
        * fhandler_socket.cc (fhandler_socket::ioctl): Move variable
        definitions to the beginning of the function to allow better debugging.
        Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU.
        * net.cc: Include iphlpapi.h.
        (get_2k_ifconf): Rewritten. Uses IP Helper API now.
        (get_nt_ifconf): Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC
        and SIOCGIFMTU.
        (get_95_ifconf): Ditto. Renamed from `get_9x_ifconf'.
        (get_ifconf): Name loopback `lo' instead of `lo0' as in Linux.
        Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU.
        Call `get_95_ifconf' only on Windows 95, `get_nt_ifconf' only
        on Windows NT < Service Pack 3, `get_2k_ifconf otherwise.
        * include/asm/socket.h: Add defines for SIOCGIFHWADDR, SIOCGIFMETRIC
        and SIOCGIFMTU.
        * include/cygwin/if.h: Add `ifr_hwaddr', `ifr_metric' and `ifr_mtu'.
        (struct ifreq): Add `ifru_hwaddr'.
2001-02-07 22:50:50 +00:00
Corinna Vinschen d7ed877ba3 * syscalls.cc (stat_worker): Add a check for the special case when
a process creates a file using mode 000 using ntsec.
2001-02-06 14:07:02 +00:00
Corinna Vinschen ae9b22c69b * fhandler.cc (fhandler_base::open): Always add GENERIC_READ access
when opening raw disk devices.
        * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Implement bytewise
        access.
        * fhandler_raw.cc (fhandler_dev_raw::open): Always open raw disk device
        binary.
        (fhandler_dev_raw::raw_write): Don't drop read buffer content when
        writing after read.
2001-02-05 16:10:06 +00:00
Corinna Vinschen cada03f92f * mmap.cc (mmap_record::fixup_map): New method to duplicate
the memory protection in a just forked child.
        (mmap): Realign gran_len to page boundary only on anonymous
        mapping before saving in the mmap_record.
        (munmap): Cleanup code.
        (msync): Ditto.
        (fixup_mmaps_after_fork): Ditto. Call mmap_record::fixup_map now.
2001-02-05 12:36:41 +00:00
Christopher Faylor 47f810920a * cygheap.cc (creturn): Correctly calculate cygheap_max. 2001-02-02 04:32:02 +00:00
Christopher Faylor f8da150758 * shared.cc (shared_info::initialize): Reduce size of heap. 2001-01-31 15:06:06 +00:00
Corinna Vinschen 8344351113 * include/sys/resource.h: Fix typo. 2001-01-31 12:24:24 +00:00
Corinna Vinschen 44e6d951c7 * include/sys/resources.h: Add RLIMIT_NLIMITS and RLIM_NLIMITS. 2001-01-31 12:21:23 +00:00
Christopher Faylor 4f42df7bc4 * include/cygwin/version.h: Bump version to 1.3.0. 2001-01-30 23:19:19 +00:00
Corinna Vinschen 9928a7e108 * pinfo.cc (pinfo::init): Use INVALID_HANDLE_VALUE instead of
explicit cast (HANDLE) 0xffffffff.
        * shared.cc (open_shared): Ditto.
2001-01-30 08:10:04 +00:00
Christopher Faylor 747e88d3f6 * fhandler_serial.cc (raw_write): Use local copy of OVERLAPPED structure
instead of shared structure to fix a race condition between read/write.
2001-01-30 01:52:29 +00:00
Corinna Vinschen 68ea0dc2fc * mmap.cc (mmap): Remove obsolete check for MAP_SHARED|MAP_ANON as
being invalid.
2001-01-29 13:39:17 +00:00
Corinna Vinschen f977222f70 * mmap.cc (mmap_record::find_empty): Fix loop condition. 2001-01-29 09:25:10 +00:00
Christopher Faylor 6a4878cf16 * syscalls.cc (_link): Make sure that newpath does not exist. Set errno if it
does.
* cygheap.cc (init_cheap): Don't specify a load address for the heap.  It
doesn't work on #!*& Windows 9x.
(cygheap_init): Move GetUserName to memory_init.
* dcrt0.cc (dll_crt0_1): Call new memory_init functin, eliminate call to
heap_init.
* heap.cc (heap_init): Improve error output.
* heap.h: Correct some declarations.
* shared.cc (mount_table_init): Remove.
(memory_init): Renamed from shared_init.  Reorganize to accomodate strange
Windows 9x problems with cygheap/heap interaction.
* shared_info.h: Rename shared_init to memory_init.
2001-01-29 00:46:25 +00:00
Christopher Faylor ae6c8e4fc2 * include/cygwin/version.h: Bump API version. 2001-01-28 06:26:50 +00:00
Christopher Faylor 9a089f21ea * cygheap.cc (init_cheap): Move username initialization.
(cygheap_init): Here.
* shared_info.h (mount_info): Add a sys_mount_table_counter field.
(shared_info): Ditto.
* path.cc (mount_info::conv_to_win32_path): Check that our mount table is in
sync with the system mount table and reinitialize it if not.
(mount_info::add_reg_mount): Bump sys_mount_table counters if the system mount
table changes.
(mount_info::del_reg_mount): Ditto.
(mount_info::write_cygdrive_info_to_registry): Ditto.
(mount_info::remove_cygdrive_info_from_registry): Ditto.
2001-01-28 06:23:42 +00:00
Christopher Faylor 2a6fc028ba Throughout, change 'cygwin_shared.mount' to 'mount_table'.
* child_info.h (child_info): Move shared_h, console_h to cygheap.  Add mount_h.
* cygheap.h (init_cygheap): Add shared_h, console_h.
* cygheap.cc (init_cheap): Initialize heap at a fixed location after the shared
memory regions.  Initialize cygheap->user name here.
* dcrt0.cc (dll_crt0_1): Call getpagesize () to initialize constants.  Remove
cygheap_init since it is done in shared_init now.
(_dll_crt0): Initialize mount_h, remove shared_h and console_h initialization.
* fhandler_console.cc (console_shared_h): Eliminate.
(get_tty_stuff): Use cygheap->console_h rather than console_shared_h.
* heap.cc (heap_init): Use page size constant calculated earlier in
initialization.
* shared.cc: Eliminate cygwin_shared_h.  Add cygwin_mount_h.
(mount_table_init): New function for initializing a user mount table.
(open_shared_file_map): Use constant for shared memory region.  Initialize
cygheap and mount table here.
(open_shared): Improve debugging output.
(shared_info::initialize): Eliminate call to mount.init.
(shared_terminate): Use cygheap->shared_h.  Close cygwin_mount_h.
(open_shared_file_map): Eliminate.
* shared_info.h (mount_info): Add a version field.
(shared_align_past): New macro for calculating location for shared memory
regions.
* sigproc.cc (init_child_info): Eliminate shared_h, console_h.
* spawn.cc (spawn_guts): Pass on cygwin_mount_h iff not a different user.
* syscalls.cc (system_info): New global holding system memory defaults.
(getpagesize): Use system_info.
* uinfo.cc (internal_getlogin): Only fill in user name if nonexistent.
* winsup.h: Declare system_info.
* passwd.cc (read_etc_passwd): Use cygheap->user.name () rather than retrieving
the name again.
2001-01-28 05:51:15 +00:00
Christopher Faylor bdfeca609b * path.cc (path_conv::check): Detect when path has symlinks.
(symlink_info::check): Remove debugging stuff.
(chdir): Use posix'ized win32 path if cd'ed to a path using symlinks.
2001-01-27 15:34:38 +00:00
Christopher Faylor 0826bed5c1 Fix typos. Add some comments. 2001-01-27 03:02:15 +00:00
Christopher Faylor 206a8d884b * exceptions.cc (sigreturn): Call any pending signals prior to resetting the
signal mask so that stacked signals behave correctly.
(sigdelayed): Avoid a race where a signal could end up calling an incorrect
signal handler if two signals come in close together.
2001-01-27 02:23:46 +00:00
Corinna Vinschen 174f1a392e * mmap.cc (fhandler_disk_file::mmap): Call CreateFileMapping with
len != 0 only when performing an anonymous mapping.
2001-01-24 04:00:41 +00:00
Christopher Faylor 4c7b82500d * path.h: Add a new constant.
* syscalls.cc (_read): Oscillate errno check.
2001-01-22 20:36:38 +00:00
Christopher Faylor c65a318355 * include/cygwin/version.h: Bump API to reflect setlogmask. 2001-01-22 20:29:24 +00:00
Christopher Faylor 29c39fe3dd * cygwin.din: Add export for setlogmask().
* syslog.cc (setlogmask): New function.
2001-01-22 15:55:34 +00:00
Corinna Vinschen c807d3552a * resource.cc (setrlimit): Support RLIMIT_NOFILE. 2001-01-18 09:30:37 +00:00
Christopher Faylor 4e2a97b2ac * syscalls.cc (setdtablesize): Call with amount to increment not total amount.
Return success or failure error code.
2001-01-18 04:26:04 +00:00
Christopher Faylor a7cde2b98a * autoload.cc (LoadDLLinitfunc): Remove debugging statement.
* exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier
in interrupt.
((interrupt_setup): i.e., here.
(sig_handle): Don't queue multiple SIGSTOPS.
* fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity.
* signal.cc (kill_pgrp): Minor cleanup.
* fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type for
function return.  Don't raise signal if a signal is already queued.
* fhandler_console.cc (fhandler_console::read): Use enumerated return type for
bg_check.
* select.cc: Ditto, throughout.
* read.cc: Ditto, throughout.
* termios.cc: Ditto, throughout.
(_read): YA interrupt detect simplification.
* wait.cc (wait4): Ditto.
2001-01-17 14:57:09 +00:00
Corinna Vinschen cb503978ab * cygheap.cc (cygheap_user::~cygheap_user): Temporarily
disable free'ing memory.
2001-01-17 12:47:47 +00:00
Corinna Vinschen 9fedfd57d4 * mmap.cc (mmap): Initialize fh to avoid compiler warnings. 2001-01-16 17:02:46 +00:00
Christopher Faylor 9470a80c8b * wait.cc (wait4): Rename variable for consistency. Allow restartable signal
behavior.
2001-01-16 02:29:47 +00:00
Corinna Vinschen 9334c89c1d * mmap.cc (mmap): Add more parameter checking. Change error output
in case of EINVAL. Treat mmapping /dev/zero like MAP_ANONYMOUS.
2001-01-15 22:18:14 +00:00
Corinna Vinschen c6dd43f263 * mmap.cc: include <unistd.h>. Define some bit operations for
the new page map.
        (mmap_record): Change type of base_address_ to caddr_t.
        Add map_map_ member. Add several methods to manipulate map_map_.
        (mmap_record::alloc_map): New method.
        (mmap_record::free_map): Ditto.
        (mmap_record::find_empty): Ditto.
        (mmap_record::map_map): Ditto.
        (mmap_record::unmap_map): Ditto.
        (list::add_record): Change return type to `mmap_record *'.
        Allocate page map.
        (list::match): New method.
        (mmap): Partly rewritten to take care for the new page map. Add some
        parameter checking.
        (munmap): Ditto.
2001-01-15 19:42:33 +00:00
Corinna Vinschen 66097f06dd * heap.cc (heap_init): Fix extern declaration of getpagesize.
* syscalls.cc (getpagesize): Fix another typo.
2001-01-15 12:53:30 +00:00
Corinna Vinschen dc3651b6cd * syscalls.cc (getpagesize): Save pagesize in global variable to
avoid calling GetSystemInfo too often.
        * heap.cc (getpagesize): Eliminate.
        (heap_init): Use getpagesize function from syscalls.cc.
2001-01-15 12:25:00 +00:00
Corinna Vinschen 4cf2c0e0cb * sysconf.cc (sysconf): return `getpagesize ()' on _SC_PAGESIZE
request to avoid implementing the same twice.
2001-01-15 10:58:19 +00:00
Christopher Faylor a3ec080b35 * syscalls.cc (_read): Use more lightweight method for determining if read has
been interrupted by a signal.
2001-01-14 19:08:30 +00:00
Christopher Faylor c3d62298ba * debug.h: Add regparm attributes to some functions.
* signal.cc (sigaction): Don't treat SIGCONT specially.
* exceptions.cc (interrupt_setup): Save sa_flags of interrupted signal for
later use.
(sig_handler): Default any stopping signal to SIGSTOP.
(call_signal_handler): New function.
(sigdelayed0): New function.
* sigproc.cc (sigproc_init): Initialize SIGSTOP sigaction for special behavior.
* sigproc.h: Define call_signal_handler.
* syscalls.cc (_read): Allow restartable signal behavior.
2001-01-12 05:38:25 +00:00
Corinna Vinschen c4efddf601 * fhandler.h (fhandler_base): New method `fixup_mmap_after_fork'.
(fhandler_disk_file: Ditto.
        (fhandler_dev_mem): Ditto.
        * fhandler_mem.cc (fhandler_dev_mem::open): Set OBJ_INHERIT attribute
        for device\physicalmemory handle.
        (fhandler_dev_mem::mmap): Ditto.
        * fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork): New method.
        * mmap.cc (mmap_record): Add private `fdesc_' member. Change constructor
        accordingly.
        (get_fd): New method.
        (mmap): Use new mmap_record constructor.
        (fhandler_base::fixup_mmap_after_fork): New method.
        (fhandler_disk_file::fixup_mmap_after_fork): Ditto.
        (fixup_mmaps_after_fork): Call `fixup_mmap_after_fork' of appropriate
        fhandler class.
2001-01-11 12:33:12 +00:00
Christopher Faylor 7416e1d2f6 * sigproc.cc (wait_sig): Allow SIGCONT when stopped. 2001-01-10 13:53:38 +00:00
Corinna Vinschen 55ae1dff87 Patch suggested by Ren� M�ller Fonseca <fonseca@mip.sdu.dk>
* include/sys/socket.h: Change prototype to have 2nd parameter `const'.
        * net.cc (cygwin_bind): Change 2nd parameter to `const'.
2001-01-09 16:00:58 +00:00
Christopher Faylor 077ec4cb37 * pinfo.cc (codepage_init): Move function.
* environ.cc (codepage_init): To here.
* exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration since it
is supposed to be maskable.
* signal.cc (sigaction): Ditto.
* sigproc.cc (wait_sig): Ditto.
* winsup.h: Eliminate global declaration of codepage_init.
2001-01-08 04:02:02 +00:00
Corinna Vinschen f3236259b4 * resource.cc (getrlimit): Set errno on EFAULT instead of returning it.
(setrlimit): Ditto.

        Patch by David Sainty <David.Sainty@optimation.co.nz>:
        * resource.cc (setrlimit): Prevent failing with an error when the
        operation would not have changed anything.
2001-01-05 09:01:18 +00:00
Christopher Faylor a5e570bcc3 * thread.cc: Need LONG_MAX definition. 2001-01-04 18:33:39 +00:00
Christopher Faylor 4104f35e67 * thread.cc (MTinterface::CreateSemaphore): Correctly set semaphore max. 2001-01-03 18:50:25 +00:00
Christopher Faylor c79ec95060 * fhandler_console.cc (fhandler_console::read): Restore missing test for code
page before doing OemToCharBuff.
2001-01-03 14:45:47 +00:00
Christopher Faylor 1bdc5f1fab Wed Jan 3 09:20:20 2001 Jason Tishler <jt@dothill.com>
* include/cygwin/version.h: Fix typo in CYGWIN_VERSION_DLL_COMBINED
	macro.
2001-01-03 14:44:13 +00:00
Corinna Vinschen 8a93913d26 * cygwin.din: Add symbols for `getrlimit' and `setrlimit'.
* exceptions.cc (stackdump): Avoid creating stackdump when
        `rlim_core' is 0.
        * resource.cc: New global variable `rlim_core'.
        (getrlimit): New function.
        (setrlimit): Ditto.
        include/cygwin/version.h: Bump minor API version to 32 due to
        adding `getrlimit' and `setrlimit'.
        include/sys/resource.h: Add defines, types and prototypes for
        `getrlimit' and `setrlimit'.
2000-12-27 00:13:57 +00:00
Christopher Faylor 2803e941b3 * autoload.h: Make DLL initializers global to avoid inlining.
* exceptions.cc (interrupt_setup): Reorganize arguments to allow use of
regparm.
(interrupt_now): Ditto.
(interrupt_on_return): Ditto.
(call_handler): Ditto.
2000-12-26 03:21:05 +00:00
Christopher Faylor 48c4679d55 * include/cygwin/version.h: Bump DLL minor version number to 8. 2000-12-25 18:37:44 +00:00
Corinna Vinschen d6a289bac1 Fix syntax. 2000-12-20 12:43:22 +00:00
Corinna Vinschen aa2b85cc90 * autoload.cc: Add load statemant for SetSecurityDescriptorControl.
* security.cc (alloc_sd): Always set SE_DACL_PROTECTED flag on
        Win2K and higher.
2000-12-20 12:42:43 +00:00
Christopher Faylor 7d72d04c77 * exceptions.cc (reset_signal_arrived): Make global to avoid inlining. 2000-12-20 06:03:16 +00:00
Christopher Faylor 2bfdcd8a5f * fhandler_serial.cc (fhandler_serial::raw_read): Always find number of bytes
ready to be read whether overlapped_armed or not.
2000-12-20 05:57:59 +00:00
Corinna Vinschen 3112d7a41c * syscalls.cc (remove): New function, overriding the newlib
implementation.
2000-12-19 20:43:41 +00:00
Corinna Vinschen 5827f4d98a * environ.cc (struct parse_thing): Add entry for new CYGWIN option
`smbntsec'.
        * path.cc (path_conv::check): Check path for being a remote path.
        If so and `allow_smbntsec' is set to FALSE, set has_acls to FALSE.
        * security.cc: Add global definition for `allow_smbntsec'.
        * security.h: Add extern declaration for `allow_smbntsec'.
        * fhandler.cc (fhandler_disk_file::open): Eliminate extern declaration
        of `allow_ntsec'.
        * syscalls.cc: Ditto.
2000-12-19 19:52:57 +00:00
Christopher Faylor 085ec17c5d * fhandler_console.cc (read): Add support for xterm-style mouse event
reporting.
(fhandler_console::char_command): Honor mouse events.
(fhandler_console::open): Enable mouse input events.
(fhandler_console::input_tcsetattr): Ditto.
* select.cc (peek_console): Add check for mouse events.
2000-12-16 03:11:02 +00:00
Christopher Faylor 7fbcbc9592 * path.cc (normalize_posix_path): Calculate path name length overruns more
dynamically.
(normalize_win32_path): Ditto.
* Makefile.in: Avoid scanning the directory twice for *.d files.
2000-12-15 22:25:51 +00:00
Christopher Faylor 80d0051c37 * fhandler.h (fhandler_console): Add additional argument to char_command
method.
* fhandler_console.cc (fhandler_console::read): Revert previously misapplied
patch.
(fhandler_console::char_command): Add a second argument.
(fhandler_console::write): Recognize when a '?' is found after a <esc>[.
2000-12-15 04:42:20 +00:00
Corinna Vinschen 947411367d * net.cc (cygwin_rexec): Eliminate superfluous call to
`set_socket_inheritance'.
        * include/sys/socket.h: Add SUS defines for option values to `shutdown'.
2000-12-11 19:45:54 +00:00
Christopher Faylor 67bd6fb222 * include/sysexits: New file. 2000-12-10 22:19:50 +00:00
Christopher Faylor ee1d77e4b7 * autoload.cc: Autoload CharToOemA.
* dcrt0.cc (dll_crt0_1): Translate command line to OEM if current codepage is
OEM.
* environ.cc: Add new option 'codepage' to CYGWIN environment variable.
* fhandler_clipboard.cc (fhandler_clipboard::read): Read clipboard in OEM mode
if current codepage is OEM.
* fhandler_console.cc (fhandler_console::read): Only translate console input if
current codepage is ANSI.
* fhandler_console.cc (fhandler_console::write_normal): Translate output data
if current codepage is ANSI.
* pinfo.cc (codepage_init): New function.  Setup current codepage from CYGWIN
environment variable and set codepage for file APIs.
* security.cc (read_sd): Translate file name to it if current codepage is OEM.
* winsup.h: (sys_wcstombs,sys_mbstowcs): Use current codepage for translations
between multibyte and widechar string and vice versa.
2000-12-10 00:45:12 +00:00
Christopher Faylor 307cb8ba82 * path.cc (normalize_win32_path): Check for explicit use of two slashes at the
beginning of a path.  These should be treated specially regardless of whether
they are UNC paths or old-style //a paths.  Avoid adding cwd to a path if the
path already begins with '/'.
2000-12-09 21:31:49 +00:00
Christopher Faylor 82c8d7ef8c * path.cc (normalize_win32_path): Reorganize logic to accomodate chroot.
Always check for MAX_PATH overrun.  Avoid adding one too many backslashes when
src path begins with a slash.  From Corinna Vinschen.
* winsup.h: Force demangling for dll_crt0 for newer compilers.
2000-12-09 03:29:33 +00:00
Corinna Vinschen 2a688c15ad * cygwin.din: Declare strtok_r for the import lib. Already in the DLL. 2000-12-07 19:43:37 +00:00
Corinna Vinschen 81e615de98 * winsup/cygwin/include/sys/uio.h: readv: Correct prototype
writev: ditto.
2000-12-06 22:42:26 +00:00
Corinna Vinschen fdb352765e * include/sys/uio.h: Include <sys/cdefs.h>. Use __BEGIN_DECL and
__END_DECL.
        Add declarations for `readv' and `writev'.
2000-12-05 16:08:48 +00:00
Corinna Vinschen 785e8cc89e * Makefile.in: Change `-nostartfiles' to `-nostdlib' to avoid
automatic linking with default libraries when linking new-cygwin1.dll.
	Link with libgcc.a and libstdc++.a explicitly.
2000-12-04 20:05:41 +00:00
Christopher Faylor 191bacb0be * path.cc (normalize_win32_path): Handle UNC paths better.
(slash_unc_prefix_p): Allow backslash UNC paths.
2000-12-03 06:21:40 +00:00
Christopher Faylor b0a187e204 * Makefile.in: Remove some extra cruft. 2000-12-03 05:20:56 +00:00
Christopher Faylor 6c057e82df * Makefile.in: Use CXX to build the DLL.
* configure.in: Find correct c++ compiler.
* configure: Regenerate.
* path.cc (normalize_posix_path): Put correct drive at beginning of \foo style
paths.
(chdir): Don't send non-posix path to cygcwd.set.
2000-12-03 05:16:33 +00:00
Corinna Vinschen 6b6a8cefad * net.cc (get_inet_addr ): Close AF_UNIX socket file after reading. 2000-12-02 21:29:00 +00:00
Corinna Vinschen 09872ef885 * cygheap.cc (chgheap_root::operator =): Check root dir properly. 2000-11-29 22:27:15 +00:00
Corinna Vinschen 38c5dd446e * net.cc (cygwin_inet_aton): Return nonzero if the address
is valid, zero if not according to Linux man page.
2000-11-29 17:15:00 +00:00
Christopher Faylor 95ec0f241f * mmap.cc (munmap): Check that mmap and munmap length match. 2000-11-28 21:25:45 +00:00
Corinna Vinschen e1a993d549 * fhandler.cc (fhandler_disk_file::open): Check for buggy CreateFile
condition.
        * path.cc (path_conv::check): Get file system type in call to
        GetVolumeInformation to check for file systems with buggy CreateFile.
        * path.h (enum path_types): Add PATH_HASBUGGYOPEN.
        (class path_conv): Add methods `has_buggy_open' and
        `set_has_buggy_open'.
2000-11-28 18:45:42 +00:00
Christopher Faylor fe1c7fe7a6 * fhandler.cc (is_at_eof): New function.
(fhandler_base::raw_read): Detect special case where last error ==
ERROR_NOACCESS but the file is at EOF.  Most UNIXes do not consider this to be
an error.
2000-11-26 21:45:16 +00:00
Christopher Faylor e0cdea91fe * include/cygwin/version.h: Bump DLL minor version number to 7. 2000-11-26 19:46:17 +00:00
Corinna Vinschen 2e68f6b47e * include/cygwin/version.h: Bump minor API version due to adding
inet_aton.
2000-11-25 10:29:49 +00:00
Corinna Vinschen 0bec01198b * net.cc (cygwin_inet_aton): New function.
* cygwin.din: Export cygwin_inet_aton as inet_aton.
2000-11-25 10:23:55 +00:00
Christopher Faylor 93c1e56b2d * path.cc (mount_info::read_cygdrive_info_from_registry): Read system cygdrive
prefix with KEY_READ.
(mount_info::get_cygdrive_info): Ditto.
2000-11-24 18:04:44 +00:00
Christopher Faylor 0217c5bb3b * Makefile.in: new-temp.a -> new-templib.a 2000-11-22 16:19:53 +00:00
Christopher Faylor 9784d54da8 * spawn.cc (spawn_guts): Quoting was still wrong. Keep trying to fix it. 2000-11-20 22:10:13 +00:00
Christopher Faylor 099efae038 * spawn.cc (spawn_guts): YA tweak for dealing with arcane rules of quoting in
"normal" Microsoft programs.
* child_info.h: Bump fork magic number.
* include/sys/mount.h: Add an entry for mixed mode.
2000-11-20 19:35:45 +00:00
Christopher Faylor 86d2c003fe *** empty log message *** 2000-11-19 04:58:18 +00:00