Commit Graph

55 Commits

Author SHA1 Message Date
Christopher Faylor 77f4a25028 * Makefile.in: Autogenerate some header files which provide magic numbers.
Force dependencies for files which depend on autogenerated headers to ensure
that they are always built.
* child_info.h (child_info): Add new fields to accommodate new magic number
header stuff.
* dcrt0.cc: Rely on "child_info_magic.h" to ensure that correct child_info
magic numbers are used.
(dll_crt0_1): Temporarily remove _cygwin_testing_magic test.
(_dll_crt0): Do more testing on magic numbers from fork_info structure.  Call
"multiple_cygwin_problem" where appropriate.
(multiple_cygwin_problem): Rename from multiple_cygwin_die.  Issue a warning or
die, as appropriate based on cygwin version/magic number mismatch.
* pinfo.cc (pinfo::exit): Don't attempt to dereference `this' if it doesn't
exist.  This can happen when a fatal error occurs early in process
initialization.
* shared.cc: Rely on "shared_info_magic.h" to accommodate that new magic number
header stuff.
(shared_info::initialize): Use new magic number stuff, for shared region.
(memory_init): Ditto, for mount table.
* shared_info.h: Accomodate new magic number stuff for shared region and mount
table.
* sigproc.cc: Rely on "child_info_magic.h" to accommodate new magic number
header stuff.
(init_child_info): Initialize new fields in child_info) to accomodate magic
numbers.
* winsup.h: Rename multiple_cygwin_die to multiple_cygwin_problem.
* include/cygwin/version.h: Define macros for manipulating version magic.
* cygmagic: New shell script for generating magic numbers.
2001-12-26 04:53:34 +00:00
Christopher Faylor 4f235c9559 * include/cygwin/version.h: Bump API minor version for below changes. 2001-12-20 18:54:30 +00:00
Christopher Faylor 2a50e3df6f * path.cc (mount_info::conv_to_win32_path): Avoid returning error if cygdrive
== '/'.
(mount_info::cygdrive_win32_path): Return 0 if invalid cygdrive path.
2001-12-03 16:47:18 +00:00
Christopher Faylor a36ee0b6b9 * include/cygwin/version.h: Bump version to 1.3.6. 2001-11-12 00:40:29 +00:00
Christopher Faylor 82105181d8 * include/cygwin/version.h: Bump version to 1.3.5. 2001-11-05 23:13:47 +00:00
Christopher Faylor 9c510edc61 Eliminate excess whitespace. 2001-11-05 06:09:15 +00:00
Corinna Vinschen b20e2ee663 * fhandler_tape.cc (fhandler_dev_tape::tape_status): Report
EOTWarningZoneSize in get->mt_eotwarningzonesize.
        * include/cygwin/mtio.h: Define DEFTAPE.
        (struct mtget): Add member `mt_eotwarningzonesize'. Add a comment.
        * include/cygwin/version.h: Bump API minor version to 47.
2001-10-16 16:28:39 +00:00
Corinna Vinschen ba94682838 * Makefile.in: Build wincap.o.
* wincap.cc: New file.
        * wincap.h: Ditto.
        * autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
        * dcrt0.cc (os_being_run): Eliminated.
        (osname): Ditto.
        (iswinnt): Ditto.
        (set_os_type): Ditto.
        (dll_crt0_1): Call wincap.init() instead of set_os_type().
        (_dll_crt0): Ditto.
        * environ.cc (set_chunksize): New function.
        (parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
        * fork.cc (chunksize): Eliminated. Moved to be member of wincap.
        * host_dependent.h: Removed.
        * syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
        * cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
        environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
        fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
        security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
        times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
        capability check throughout.
        * winsup.h: Include wincap.h. Eliminate extern declarations of
        `os_being_run' and `iswinnt'. Eliminate `os_type" definition.
        * include/cygwin/version.h: Bump version to 1.3.4.
2001-09-12 17:46:37 +00:00
Christopher Faylor dbc82a87a3 * cygwin.din: Remove cygwin_getshared.
* shared.cc: Ditto.
* include/cygwin/version.h: Bump API minor number.
* dtable.cc (dtable::build_fhandler): Fix incorrect test for socket.
2001-09-11 15:25:08 +00:00
Corinna Vinschen d969111291 * include/cygwin/version.h: Bump API minor version to 45 according
to adding the gamm*_r functions.
2001-09-09 12:32:54 +00:00
Christopher Faylor c12a96d12f * cygwin.din: Add gamm*_r function exports. 2001-09-08 01:35:55 +00:00
Christopher Faylor 1ff9f4b937 * cygheap.h (init_cygheap): Move heap pointers here.
* include/sys/cygwin.h (perprocess): Remove heap pointers.
* dcrt0.cc (__cygwin_user_data): Reflect obsolete perprocess stuff.
(_dll_crt0): Don't initialize heap pointers.
(cygwin_dll_init): Ditto.
(release_upto): Use heap pointers from cygheap.
* heap.h: Ditto.
* fork.cc (fork_parent): Ditto.  Don't set heap pointers in ch.
(fork_child): Remove obsolete sigproc_fixup_after_fork.
* shared.cc (memory_init): Reorganize so that cygheap initialization is called
prior to regular heap since regular heap uses cygheap now.
* sigproc.cc (proc_subproc): Eliminate zombies allocation.
(sigproc_init): Move zombies alloation here.  Don't free up array on fork, just
reuse it.
(sigproc_fixup_after_fork): Eliminate.
* sigproc.h: Ditto.
* include/cygwin/version.h: Reflect change to perprocess structure.
2001-09-07 21:32:07 +00:00
Corinna Vinschen a71aee46c4 * cygwin.din: Add `dirfd'.
* dir.cc (dirfd): New function.
        (opendir): Open a directory file descriptor and save it in
        __d_dirent->d_fd.
        (closedir): Close directory file descriptor.
        * include/cygwin/version.h: Bump API minor version to 44.
2001-09-03 16:36:54 +00:00
Christopher Faylor 3ca6bcc4d0 * include/cygwin/version.h: Bump API version. 2001-08-14 15:05:43 +00:00
Christopher Faylor 96a3f4ae68 * cygheap.cc (cygheap_root::set): Avoid treating '/' specially.
* fhandler.cc (fhandler_base::fcntl): Only set specific O_NDELAY style flag
passed in from application.
* fhandler_socket.cc (fhandler_socket::fcntl): Ditto.
* fhandler.h: Set constant for future use.
* winsup.h: Define OLD_O_NDELAY only for old programs.
* include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK.
2001-08-07 00:01:42 +00:00
Christopher Faylor 8e4e3874c4 * cygwin.din: Export sys_errlist, sys_nerr.
* include/cygwin/version.h: Bump minor version number.
2001-07-27 16:33:20 +00:00
Christopher Faylor 351a85482c Christopher Faylor <cgf@cygnus.com>
* cygwin.din: Export __signgam.
* include/cygwin/version.h: Bump minor version number.
2001-07-26 20:42:52 +00:00
Corinna Vinschen 463513f0e2 * cygwin.din: Add fchdir symbols.
* path.cc (chdir): Guard against invalid parameter.
         (fchdir): New function.
         * include/cygwin/version.h: Bump API minor version to 40.
         * uinfo.cc (internal_getlogin): Remove unused variable.
2001-06-10 10:00:21 +00:00
Christopher Faylor f01fb5e796 * include/cygwin/version.h: Bump minor version number. 2001-05-21 15:50:36 +00:00
Egor Duda 86699e1555 * cygwin.din: Export asctime_r, ctime_r, gmtime_r, localtime_r
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 39
2001-04-25 16:18:43 +00:00
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
Christopher Faylor c02e9189cf * include/cygwin/version.h: Bump Cygwin version and API version. 2001-04-23 00:48:23 +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 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
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
Christopher Faylor 4f42df7bc4 * include/cygwin/version.h: Bump version to 1.3.0. 2001-01-30 23:19:19 +00:00
Christopher Faylor ae6c8e4fc2 * include/cygwin/version.h: Bump API version. 2001-01-28 06:26:50 +00:00
Christopher Faylor c65a318355 * include/cygwin/version.h: Bump API to reflect setlogmask. 2001-01-22 20:29:24 +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 48c4679d55 * include/cygwin/version.h: Bump DLL minor version number to 8. 2000-12-25 18:37:44 +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
Christopher Faylor 9bc846bd3d * environ.cc (_addenv): malloc space for setenv if cygwin1.dll is used in
conjunction with older binaries.
(environ_init): Ditto.
* external.cc (get_cygdrive_info): New function.
* external.cc (get_cygdrive_prefixes): Change to use get_cygdrive_info but toss
the user and system flags.
* external.cc (cygwin_internal): Add new CW_GET_CYGDRIVE_INFO case.
* path.cc (mount_info::get_cygdrive_prefixes): Remove method.
* path.cc (mount_info::get_cygdrive_info): New method.  Actually,
get_cygdrive_info is really an enhanced version of get_cygdrive_prefixes
renamed to get_cygdrive_info that also gets the user and system flags.
* shared_info.h (get_cygdrive_prefixes): Remove method.
* shared_info.h (get_cygdrive_info): New method.
* include/cygwin/version.h: Bump minor API version due to adding
CW_GET_CYGDRIVE_INFO to cygwin_internal.
* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_CYGDRIVE_INFO.
2000-11-08 20:36:37 +00:00
Christopher Faylor 442a3c7821 Update copyright. 2000-11-07 02:21:33 +00:00
Christopher Faylor a98b1584c2 * path.cc (mount_info::read_cygdrive_info_from_registry): Use
CYGWIN_INFO_CYGDRIVE_PREFIX, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX, and
CYGWIN_INFO_CYGDRIVE_FLAGS.
* path.cc (mount_info::write_cygdrive_info_to_registry): Use
CYGWIN_INFO_CYGDRIVE_PREFIX and CYGWIN_INFO_CYGDRIVE_FLAGS.
* path.cc (mount_info::remove_cygdrive_info_from_registry): Ditto.
* path.cc (mount_info::get_cygdrive_prefixes): Use CYGWIN_INFO_CYGDRIVE_PREFIX.
* include/cygwin/version.h: Add CYGWIN_INFO_CYGDRIVE_FLAGS,
CYGWIN_INFO_CYGDRIVE_PREFIX, and CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX.
2000-11-06 16:40:29 +00:00
Christopher Faylor f745abc7a0 * include/cygwin/version.h: Bump DLL minor version number to 6. 2000-10-30 01:53:02 +00:00
Corinna Vinschen 7d9688b793 * cygwin.din: Add symbol hstrerror.
* net.cc: Change meaning of member `s' of struct host_errmap.
        (set_host_errno): Fix error in loop condition.
        (hstrerror): Ditto.
        (herror): Add appropriate functionality.
        * include/netdb.h: Add declaration of hstrerror.
        * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 29.
2000-10-14 08:55:44 +00:00
Christopher Faylor cbe4c8e234 Add comment. 2000-10-14 01:03:01 +00:00
Christopher Faylor 84c7d40932 * include/cygwin/version.h: Bump DLL minor version number to 5 due to all of
the changes below.  Redefine process structure to avoid a fixed size table.
Redefine pinfo/_pinfo classes.  Use these throughout.
* dcrt0.cc (dll_crt0_1): Accomodate set_myself argument change.
(__api_fatal): Accomodate _pinfo::record_death argument change.
* exceptions.cc (really_exit): Ditto.
(sig_handle_tty_stop): Use pinfo constructor to access process info.
(events_init): Don't create pinfo_mutex since it is no longer required.
* external.cc (fillout_pinfo): Use winpids class to iterate over all system
pids.
(cygwin_internal): lock_pinfo_for_update and unlock_pinfo are now noops.
* fhandler_termios.cc (fhandler_termios::set_ctty): Use pinfo constructor to
access process info.
* fork.cc (fork): Reorganize to initialize child info after the child has
started since that is when we know the child's winpid, which is necessary to
allocate the pinfo shared memory.
* mmap.cc (recreate_mmaps_after_fork): Change arg type to _pinfo.
* pinfo.cc: Rename pinfo methods to _pinfo throughout.  Eliminate pinfo_list
stuff.
(set_myself): Accept a pid argument now.  Call pinfo initializer to initialize
myself.  Detect when this is an "execed" process and create an "indirect" pid
block.
(pinfo_init): Accomodate set_myself arg change.
(procinfo): Remove.
(pinfo::lock_pinfo): Remove.
(pinfo::unlock_pinfo): Remove.
(pinfo::init): New method.  Allocates shared memory space for process pinfo
structure.
(pinfo::record_death): Don't call locking functions.
(cygwin_winpid_to_pid): Simplify by using new pinfo constructor.
(EnumProcessesW95): New function for iterating over processes on Windows 95.
(winpids::winpids): New constructor for winpids class.  Sets up a list of
process ids.
(enum_init): Initialize w95/wnt pid enumerators.
* shared.cc (shared-info::initialize): Remove pid initialization.
* shared.h: Move pinfo stuff into pinfo.h.
(class shared_info): Remove pinfo_list element.
* signal.cc (kill_worker): Use pinfo constructor to access process info.
(kill_pgrp): Ditto.  Use winpids methods to access list of processes.
* sigproc.cc: Throughout, modify to use _pinfo where appropriate.
(proc_exists (pid_t)): New function.  Determines if a process exists based on
the pid.
(proc_exists (_pinfo *p): Use new proc_exists function above.
(proc_subproc): Copy pinfo stuff around rather than _pinfo pointers.  Try to be
careful about releasing shared memory when we don't need it anymore.  Remove
pinfo locks.
(remove_zombies): Remove pinfo memory when zombie is going away.
* sigproc.h: Reflect _pinfo/pinfo changes in sigproc.cc.
* spawn.cc (spawn_guts): Eliminate pinfo *child argument.  Reorganize to only
initialize child pinfo after process has been started and we know the windows
pid.
(_spawnve): Reflect spawn_guts changes.
* syscalls.cc (setpgid): Use pinfo constructor to access process info.
(getpgid): Ditto.
(internal_getlogin): Use _pinfo.
* winsup.h: Eliminate pinfo_mutex.  Eliminate spawn_guts declaration since it
is static now.  Reflect set_myself argument change.
* include/sys/cygwin.h: Add some PID_* enums to accomodate new pinfo stuff.
* include/cygwin/version.h: Update minor version for cygdrive changes below.
2000-07-29 16:24:59 +00:00
Christopher Faylor 403a661709 * include/cygwin/version.h: Bump DLL minor version number to 4. 2000-07-28 03:35:52 +00:00
Christopher Faylor bd4ec49671 * cygwin.din: Export _getmode and getmode to allow querying of binary state of
an fd.
* external.cc (cygwin_internal): Add handling of perfile_table setting.
* fhandler.cc (perfile_table): New global.
(fhandler_base::get_default_fmode): New method to return a file's default mode
based on its name.
(fhandler_base::open): Use get_default_mode method to determine a file's mode.
Record file mode in file flags.
* fhandler.h (fhandler_base): Declare get_default_fmode
* syscalls.cc (getmode): New function.
* sys/cygwin.h (__cygwin_perfile): New structure.
(cygwin_getinfo_types): Move outside of WINVER conditional.
(per_process): Move inside of WINVER conditional.
2000-07-09 05:29:51 +00:00
Corinna Vinschen 914e40dfe6 * include/cygwin/version.h: Bump API minor version to 24. 2000-07-04 17:25:11 +00:00
Christopher Faylor 14a3bc2fa1 * Makefile.in: Use variables rather than configure constructs where
appropriate.
(LIBCOS): Find additional stub library stuff in their own subdirectory.
* dcrt0.cc: Convert user_data pointer to static __cygwin_user_data area.
(do_global_ctors): Check magic_bisquit for initialization.
(dll_crt0_1): First group of premain functions prior to fd initialization.  Run
second group before calling main.
(dll_crt0 ()): New function, called from new initialization code.
(dll_crt0 (per_process *uptr)): Call new dll_crt0 () function on
initialization.
* debug.cc (thread_stub): Initialize bottom of stack with per-thread info.
* environ.cc (parse_thing): Use binmode global to control CYGWIN=binmode
behavior.
* fhandler.cc (fhandler_base::open): Allow explicit setting of __fmode to
O_BINARY or O_TEXT to override disk mount settings.
* libcmain.cc: Move to lib subdirectory.
* libccrt0.cc: Ditto.
* dll_main.cc: Ditto.
* dll_entry.cc: Ditto.
* getopt.c: Ditto.
* thread.cc (thread_init_wrapper): Call ExitThread explicitly rather than
returning, as a preliminary step towards placing per thread info at the bottom
of the stack.
* winsup.h: Move per_process class to include/sys/cygwin.h.  Declare new
dll_crt0().
* include/cygwin/version.h: Bump API minor version.
* binmode.c: New file.
* textmode.c: Ditto.
* lib/_cygwin_crt0_common.cc: Ditto.
* lib/crt0.h: Ditto.
* lib/cygwin_attach_dll.c: Ditto.
* lib/cygwin_crt0.c: Ditto.
* lib/dll_entry.cc: Ditto.
* lib/dll_main.cc: Ditto.
* lib/getopt.c: Ditto.
* lib/libcmain.c: Ditto.
* lib/premain0.c: Ditto.
* lib/premain1.c: Ditto.
* lib/premain2.c: Ditto.
* lib/premain3.c: Ditto.
2000-07-01 03:51:55 +00:00
Corinna Vinschen 64b3062937 * cygwin.din: Define symbols for `cygwin_logon_user' and
`cygwin_set_impersonation_token'.
        * dcrt0.cc (dll_crt0_1): Eliminate superfluous conditional
        statements.
        Add load statements for `ImpersonateLoggedOnUser', `LogonUserA'
        and `RevertToSelf'.
        * fork.cc (fork): Care for correct impersonation of parent
        and child process.
        * security.cc (cygwin_set_impersonation_token): New function.
        (cygwin_logon_user): Ditto.
        shared.h (class pinfo): New members `orig_uid', `orig_gid',
        `real_uid' nad `real_gid'.
        spawn.cc (spawn_guts): Care for impersonation when starting
        child process in a different user context.
        * syscalls.cc (setgid): Call `setegid' now. Set real_gid.
        (setuid): Call `seteuid' now. Set real_uid.
        (seteuid): Functionality moved from setuid to here. Care for
        correct impersonation.
        (setegid): Functionality moved from setgid to here.
        * uinfo.cc (uinfo_init): Initialization of additional pinfo
        members.
        (getuid): Return real uid.
        (getgid): Return real gid.
        (geteuid): Return effective uid.
        (getegid): Return effective gid.
        include/sys/cygwin.h: Add prototypes for `cygwin_logon_user' and
        `cygwin_set_impersonation_token'.
        include/cygwin/version.h: Bumb API minor version to 22.
2000-06-16 19:36:07 +00:00
Christopher Faylor fe73870ce5 * include/cygwin/version.h: Bump DLL minor version number to 3. 2000-06-08 03:58:51 +00:00
DJ Delorie fcc4976d26 * include/cygwin/version.h: use decimal, NOT octal 2000-05-31 18:04:00 +00:00
DJ Delorie 56cd25ee02 * syscalls.cc (_cygwin_istext_for_stdio): New, for newlib
* include/cygwin/version.h: Bump API number for detect old
programs using old getc/putc macros
2000-05-23 23:52:50 +00:00
Christopher Faylor 4004738117 * include/cygwin/version.h: Bump DLL minor version number to 2. 2000-05-15 04:37:03 +00:00
Christopher Faylor 66aea0c52e * shared.h: Bump PROC_MAGIC.
* include/cygwin/version.h: Bump API minor to accomodate two recent exports.
2000-05-15 03:42:27 +00:00