Commit Graph

2394 Commits

Author SHA1 Message Date
Christopher Faylor dbf193cea8 * include/paths.h: Add some missing entries. 2003-09-25 03:46:20 +00:00
Christopher Faylor 7759daa979 * shared_info.h (CURR_MOUNT_MAGIC): Fix.
* sigproc.cc (sigpacket): New structure.
(sig_send): Fill out sigpacket structure to send to signal thread rather than
racily sending separate packets.
(wait_sig): Use sigpacket structure to receive info from signal sender.
2003-09-25 03:06:36 +00:00
Pierre Humblet 64f74184bb *** empty log message *** 2003-09-25 02:33:27 +00:00
Pierre Humblet 138847683d 2003-09-24 Pierre Humblet <pierre.humblet@ieee.org>
* shared_info.h (class user_info): New.
	(cygwin_user_h): New.
	(user_shared): New.
	(enum shared_locations): Replace SH_MOUNT_TABLE by SH_USER_SHARED;
	(mount_table): Change from variable to macro.
	* shared.cc: Use sizeof(user_info) in "offsets".
	(user_shared_initialize): Add "reinit" argument to indicate need
	to reinitialize the mapping. Replace "mount_table" by "user_shared"
	throughout. Call user_shared->mountinfo.init and
	user_shared->delqueue.init.
	(shared_info::initialize): Do not call delqueue.init.
	(memory_init): Add argument to user_shared_initialize.
	* child_info.h (child_info::mount_h): Delete.
	(child_info::user_h): New.
	* sigpproc.cc (init_child_info): Use user_h instead of mount_h.
	* dcrt0.cc (_dll_crt0): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::close): Use
	user_shared->delqueue instead of cygwin_shared->delqueue.
	* fhandler_virtual.cc (fhandler_virtual::close): Ditto.
	* syscalls.cc (close_all_files): Ditto.
	(unlink): Ditto.
	(seteuid32): Add argument to user_shared_initialize.
2003-09-25 02:29:05 +00:00
Christopher Faylor a4e167fa27 correct incorrect checkin 2003-09-25 00:38:45 +00:00
Christopher Faylor 7ac6173643 * devices.cc: New file.
* devices.gperf: New file.
* devices.shilka: New file.
* cygwin-gperf: New file.
* cygwin-shilka: New file.
* fhandler_fifo.cc: New file.
* fhandler_nodevice.cc : New file.  Reorganize headers so that path.h precedes
fhandler.h throughout.  Remove device argument and unit arguments from fhandler
constructors throughout.  Remove pc arguments to fhandler functions and use
internal pc element instead, throughout.  Use dev element in pc throughout.
Use major/minor elements rather than units and device numbers previously in
fhandler class.  Use correct methods for fhandler file names rather than
directly accessing file name variables, throughout.
* Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o
* dcrt0.cc (dll_crt0_1): Call device::init.
* devices.h: Renumber devices based on more Linux-like major/minor numbers.
Add more devices.  Declare standard device storage.
(device): Declare struct.
* dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_* type.
* dtable.cc (dtable::get_debugger_info): Ditto.
(cygwin_attach_handle_to_fd): Ditto.
(dtable::release): Remove special FH_SOCKET case in favor of generic
"need_fixup_before" test.
(dtable::init_std_file_from_handle): Use either build_fh_dev or build_fh_name
to build standard fhandler.
(dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name.  Move
out of dtable class.  Don't accept a path_conv argument.  Just build it here
and pass it to:
(build_fh_pc): Renamed from dtable::build_fhandler.  Move out of dtable class.
Use intrinsic device type in path_conv to create new fhandler.
(build_fh_dev): Renamed from dtable::build_fhandler.  Move out of dtable class.
Simplify arguments to just take new 'device' type and a name.  Just return
pointer to fhandler rather than trying to insert into dtable.
(dtable::dup_worker): Accommodate above build_fh name changes.
(dtable::find_fifo): New (currently broken) function.
(handle_to_fn): Use strechr for efficiency.
* dtable.h: Reflect above build_fh name changes and argument differences.
(fhandler_base *&operator []): Return self rather than copy of self.
* fhandler.cc (fhandler_base::operator =): Use pc element to set normalized
path.
(fhandler_base::set_name): Ditto.
(fhandler_base::raw_read): Use method to access name.
(fhandler_base::write): Correctly use get_output_handle rather than get_handle.
(handler_base::device_access_denied): New function.
(fhandler_base::open): Eliminate pc argument and use pc element of
fhandler_base throughout.
(fhandler_base::fstat): Detect if device is based in filesystem and use
fstat_fs to calculate stat, if so.
(fhandler_base::fhandler_base): Eliminate handling of file names and, instead,
just free appropriate component from pc.
(fhandler_base::opendir): Remove path_conv parameter.
* fhandler.h: Remove all device flags.
(fhandler_base::pc): New element.
(fhandler_base::set_name): Change argument to path_conv.
(fhandler_base::error): New function.
(fhandler_base::exists): New function.
(fhandler_base::pc_binmode): New function.
(fhandler_base::dev): New function.
(fhandler_base::open_fs): New function.
(fhandler_base::fstat_fs): New function.
(fhandler_base::fstat_by_name): New function.
(fhandler_base::fstat_by_handle): New function.
(fhandler_base::isfifo): New function.
(fhandler_base::is_slow): New function.
(fhandler_base::is_auto_device): New function.
(fhandler_base::is_fs_special): New function.
(fhandler_base::device_access_denied): New function.
(fhandler_base::operator DWORD&): New operator.
(fhandler_base::get_name): Return normalized path from pc.
(fhandler_base::get_win32_name): Return windows path from pc.
(fhandler_base::isdevice): Renamed from is_device.
(fhandler_base::get_native_name): Return device format.
(fhandler_fifo): New class.
(fhandler_nodevice): New class.
(select_stuff::device_specific): Remove array.
(select_stuff::device_specific_pipe): New class element.
(select_stuff::device_specific_socket): New class element.
(select_stuff::device_specific_serial): New class element.
(select_stuff::select_stuff): Initialize new elements.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base class
from fhandler_disk_file.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_disk_file::open): Move most functionality into
fhandler_base::open_fs.
(fhandler_base::open_fs): New function.
(fhandler_disk_file::close): Move most functionality into
fhandler_base::close_fs.
(fhandler_base::close_fs): New function.
* fhandler_mem.cc (fhandler_dev_mem::open): Use device name in debugging
output.
* fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy standard
urandom device into appropriate place.
(fhandler_socket::accept): Reflect change in fdsock return value.
* fhandler_tty.cc: See "throughouts" above.
* net.cc: Accommodate fdsock change throughout.
(fdsock): Return success or failure, accept fd argument and device argument.
* path.cc (symlink_info::major): New element.
(symlink_info::minor): New element.
(symlink_info::parse_device): Declare new function.
(fs_info::update): Accommodate changes in path_conv class.
(path_conv::fillin): Ditto.
(path_conv::return_and_clear_normalized_path): Eliminate.
(path_conv::set_normalized_path): New function.
(path_conv::path_conv): Set info in dev element.  Use path_conv methods Check
for FH_FS rather than FH_BAD to indicate when to fill in filesystem stuff.
where appropriate rather than direct access.  Use set_normalized_path to set
normalized path.
(windows_device_names): Eliminate.
(get_dev): Ditto.
(get_raw_device_number): Ditto.
(get_device_number): Ditto.
(win32_device_name): Call new device name parser to do most of the heavy
lifting.
(mount_info::conv_to_win32_path): Fill in dev field as appropriate.
(symlink_worker): Handle new device files.
(symlink_info::check): Ditto.
(symlink_info::parse_device): Define new function.
* path.h (executable_states): Move here from fhandler.h.
(fs_info): Rename variables to *_storage and create methods for accessing same.
(path_conv): Add dev element, remove devn and unit and adjust inline methods to
accommodate.
(set_normalized_path): Declare new function.
* pinfo.cc (_pinfo::commune_recv): Add broken support for handling fifos.
(_pinfo::commune_send): Ditto.
* pipe.cc (fhandler_pipe::close): check for existence of handle before closing
it.
(handler_pipe::create): Rename from make_pipe.  Change arguments to accept
fhandler_pipe array.  Accommodate fifos.
(pipe): Rework to deal with fhandler_pipe::create changes.
(_pipe): Ditto.
* select.cc: Use individual device_specific types throughout rather than
indexing with obsolete device number.
(set_bits): Use is_socket call rather than checking device number.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
(conv_to_win32_path): Reflect addition of device argument.
* syscalls.cc (mknod_worker): New function.
(open): Use build_fh_name to build fhandler.
(chown_worker): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(chmod_device): New function.
(chmod): Detect if this is an 'auto' device rather than an on-filesystem device
and handle appropriately.  Use chmod_device to set mode of in-filesystem
devices.
(stat_worker): Eliminate path_conv argument.  Call build_fh_name to construct
fhandler.  Use fh->error() rather than pc->error to detect errors in fhandler
construction.
(access_worker): New function pulled from access.  Accommodate in-filesystem
devices.
(access): Use access_worker.
(fpathconf): Detect if this is an 'auto' device rather than an on-filesystem
device and handle appropriately.
(mknod_worker): New function.
(mknod32): New function.
(chroot): Free normalized path -- assuming it was actually cmalloced.
* tty.cc (create_tty_master): Tweak for new device class.
(tty::common_init): Ditto.
* winsup.h (stat_worker): Remove.
(symlink_worker): Declare.
* exceptions.cc (set_process_mask): Just call sig_dispatch_pending and don't
worry about pending_signals since sig_dispatch_pending should always do the
right thing now.
(sig_handle): Reorganize SIGCONT handling to more closely conform to SUSv3.
* pinfo.h: Move __SIG enum to sigproc.h.
(PICOM_FIFO): New enum element.
(_pinfo): Remove 'thread2signal' stuff throughout class.
(_pinfo::commune_send): Make varargs.
(_pinfo::sigtodo): Eliminate.
(_pinfo::thread2signal): Ditto.
* signal.cc (kill_worker): Eliminate call to setthread2signal.
* sigproc.cc (local_sigtodo): Eliminate.
(getlocal_sigtodo): Ditto.
(sigelem): New class.
(pending_signals): New class.
(sigqueue): New variable, start of sigqueue linked list.
(sigcatch_nonmain): Eliminate.
(sigcatch_main): Eliminate.
(sigcatch_nosync): Eliminate.
(sigcomplete_nonmain): Eliminate.
(pending_signals): Eliminate.
(sig_clear): Call signal thread to clear pending signals, unless already in
signal thread.
(sigpending): Call signal thread to get pending signals.
(sig_dispatch_pending): Eliminate use of pending_signals and just check
sigqueue.
(sigproc_terminate): Eliminate all of the obsolete semaphore stuff.  Close
signal pipe handle.
(sig_send): Eliminate all of the obsolete semaphore stuff and use pipe to send
signals.
(getevent): Eliminate.
(pending_signals::add): New function.
(pending_signals::del): New function.
(pending_signals::next): New function.
(wait_sig): Eliminate all of the obsolete semaphore stuff.  Use pipe to
communicate and maintain a linked list of signals.
* sigproc.h: Move __SIG defines here.  Add __SIGPENDING.
(sig_dispatch_pending): Remove "C" specifier.
(sig_handle): Accept a mask argument.
* thread.cc: Remove signal handling considerations throughout.
2003-09-25 00:37:18 +00:00
Christopher Faylor 3400b4fc44 * dcrt0.cc (do_exit): Eliminate "C" linkage. Call events_terminate early.
(exit_states): Move out of source file into header file.
* winsup.h: Move exit_states here.  Remove "C" linkage from do_exit
declaration.
* debug.cc (lock_debug): Remove explicit (and incorrect) external for
exit_state.
* sigproc.cc (sig_dispatch_pending): Don't flush signals if exiting.
2003-09-23 04:02:07 +00:00
Christopher Faylor 0199487e6a * spawn.cc (pthread_cleanup): New struct.
(do_cleanup): New function.
(spawn_guts): Initialize struct for pthread_cleanup handling to ensure proper
restoration of signals if/when thread is cancelled.  Restore settings using
pthread_cancel_pop.
2003-09-20 19:51:48 +00:00
Christopher Faylor 5ab307ccfd * include/cygwin/version.h: Bump DLL minor number to 6. 2003-09-20 03:15:57 +00:00
Christopher Faylor 370b1173b0 * thread.h (__reent_t::init_clib): Declare new function.
* thread.cc (__reent_t::init_clib): Define new function.
(pthread::thread_init_wrapper): Use __reent_t::init_clib to init local clib
storage and set std{in,out,err} appropriately.
2003-09-20 02:43:18 +00:00
Christopher Faylor bc54734d15 fix accidental checkin 2003-09-20 00:43:33 +00:00
Christopher Faylor d1fb625d2b * syscalls.cc (system): Strip signal considerations from here so that they are
not inherited by a child process.
* spawn.cc (spawn_guts): Handle system() signal stuff here.
* winsup.h (_P_SYSTEM): Define.
2003-09-20 00:31:13 +00:00
Corinna Vinschen 41946df611 * fhandler_tty.cc (fhandler_pty_master::process_slave_output):
Handle buf == NULL as flushing the buffer.
	(fhandler_tty_slave::read): Handle ptr == NULL as flushing the buffer.
	(fhandler_tty_slave::tcflush): Implement input queue flushing by
	calling read with NULL buffer.
	(fhandler_pty_master::tcflush): Ditto, calling process_slave_output.
	* termios.cc (tcflush): Check for legal `queue' value.  Return
	EINVAL otherwise.
2003-09-18 18:54:48 +00:00
Christopher Faylor f7f542063b * syscalls.cc (gethostid): Add lpFreeBytesAvailable argument to
GetDiskFreeSpaceEx call since NT4 requires it.
2003-09-17 21:47:12 +00:00
Christopher Faylor 11dcd1546f * fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with
PID_MAP_RW.
* sigproc.cc (talktome): Ditto for winpids.
2003-09-17 02:10:13 +00:00
Christopher Faylor 9ee691211b fix stupid typo 2003-09-17 01:43:27 +00:00
Christopher Faylor deb648cc8b * pinfo.h (winpids::pid_access): New element.
(winpids::winpids): Rejigger to set pinfo_access.
* pinfo.cc (winpids::add): Try to open shared memory region with supplied
pinfo_access first, then default to readonly.
* fhandler_termios.cc (tty_min::kill_pgrp): When getting list of pids to work
with, suggest opening with PID_MAP_RW.
* signal.cc (kill_pgrp): Ditto.
* sigproc.cc (sig_send): Perform a write check on todo prior to attempting to
increment it.  Return EACCES if we can't write to it.
2003-09-17 01:15:56 +00:00
Corinna Vinschen 1498189ca8 * cygheap.cc (cygheap_user::set_saved_sid): Rename from set_orig_sid.
* cygheap.h (class cygheap_user): Rename orig_psid, orig_uid and
	orig_gid to saved_psid, saved_uid and saved_gid respectively.
	Rename methods orig_sid and set_orig_sid to saved_sid and set_saved_sid
	respectively.
	* sec_helper.cc (sec_acl): Accomodate above changes.
	* spawn.cc (spawn_guts): Ditto.
	* uinfo.cc (uinfo_init): Ditto.
2003-09-16 09:24:52 +00:00
Christopher Faylor c429c346d8 fix typo 2003-09-16 03:59:35 +00:00
Christopher Faylor 2bfdb22e23 * getopt.cc (opterr): Reinstate initialization.
(optind): Ditto.
(optopt): Ditto.
* pinfo.cc: Include cygheap.h or suffer compile error.
* shared.h: Reset magic number.
2003-09-16 03:39:55 +00:00
Christopher Faylor 8ec37f2168 * exceptions.cc (sig_handle_tty_stop): Fix boneheaded mistake by using correct
check for parent state rather than inverted check.
2003-09-16 03:07:27 +00:00
Pierre Humblet c61ada9bd3 2003-09-15 Pierre Humblet <pierre.humblet@ieee.org>
* security.h (__sec_user): Add "access2" argument.
	(sec_acl): Add "original" and "access2" arguments.
	(sec_user): Add "sid2" and "access2" argument. Remove dependence on
	allow_ntsec.
	(sec_user_nih): Ditto.
	* sec_helper.cc (__sec_user): Add "has_security" test.
	Call sec_acl with new arguments, letting it handle original_sid.
	(sec_acl): Add "original" and "access2" arguments. Handle original_sid
	depending on flag but avoiding duplicates. Use "access2" for sid2.
	* pinfo.cc (pinfo::init): Use security attributes created by sec_user
	when creating the mapping.
	* security.cc (create_token): Adjust arguments in call to sec_acl.
	Call sec_user instead of __sec_user.
	* syscall.cc (seteuid32):  Adjust arguments in call to sec_acl. Remove
	now unnecessary test. Remove useless conversions to psid.
	* dcrt0.cc (dll_crt0_1): Call cygsid::init before pinfo_init.
2003-09-16 00:45:50 +00:00
Christopher Faylor de9e39f701 * Makefile.in: Make malloc_wrapper -fomit-frame-pointer.
* cygwin.din: Remove extraneous mallinfo definition.
* dcrt0.cc (quoted): Use strechr for efficiency.
* fhandler.cc (fhandler_base::write): Correctly use get_output_handle rather
than get_handle.
(fhandler_base::lseek): Use method for accessing name in debug output.
2003-09-14 01:58:03 +00:00
Christopher Faylor e306c058c7 * fhandler_disk_file.cc (path_conv::ndisk_links): Fix potential off-by-one
problem when first file in a directory is a directory.
2003-09-14 00:07:50 +00:00
Christopher Faylor 276448cf67 * include/sys/cygwin.h: Rename PID_UNUSED to PID_MAP_RW.
* pinfo.cc (pinfo_init): Initialize myself->gid.
(pinfo::init): Create the "access" variable, set it appropriately and use it to
specify the requested access.
* exceptions.cc (sig_handle_tty_stop): Add PID_MAP_RW in pinfo parent.
* signal.cc (kill_worker): Ditto for pinfo dest.
* syscalls.cc (setpgid): Ditto for pinfo p.
2003-09-13 17:14:15 +00:00
Christopher Faylor 4442ed9171 * include/cygwin/version.h: Bump DLL minor number to 5. 2003-09-13 17:12:01 +00:00
Christopher Faylor b0309a1658 * thread.cc (MTinterface::fixup_after_fork): Remove code which potentially
overwrote _impure pointer with contents of thread which invoked fork since this
eliminates important information like the pointer to the atexit queue.
2003-09-13 01:21:32 +00:00
Christopher Faylor 21d7ec1928 * fhandler_disk_file.cc (path_conv::ndisk_links): Fix problem where search
characters overwrote the path instead of being tacked on the end.
2003-09-12 20:17:28 +00:00
Christopher Faylor fb3dd71676 * dcrt0.cc (_dll_crt0): Accommodate breaking apart of early_stuff_init.
* exceptions.cc (early_stuff_init): Delete.
(init_console_handler): New function - top half of early_stuff_init.
(init_global_security): New function - bottom half of early_stuff_init.
(sig_handle): Avoid special hExeced test for SIGINT.  Just terminate the
captive process.
(signal_exit): Add debugging output.
* fhandler_tty.cc (fhandler_tty_slave::open): Don't allocate a console if one
already seems to exist.  Properly initialize ctrl-c handling if we do allocate
a console.
* winsup.h (early_stuff_init): Delete declaration.
(init_console_handler): New declaration.
(init_global_security): New declaration.
2003-09-12 06:41:53 +00:00
Christopher Faylor 9e24b8ace9 * fhandler_disk_file.cc (path_conv::ndisk_links): Rename from num_entries.
Accept an argument and calculate any extra links needed based on missing .  and
..  entries.
(fhandler_disk_file::fstat_helper): Always call pc->ndisks_links() to calculate
the number of links.
* path.h (path_conv::ndisk_links): Declare.
2003-09-11 23:30:26 +00:00
Christopher Faylor b9041ba3d9 * path.cc (normalize_posix_path): Put check for '//' prefix back to denote a
UNC path.
(slash_unc_prefix_p): Remove vestige of old //c method for accessing drives.
2003-09-11 17:46:31 +00:00
Christopher Faylor 88092a3ea1 * dir.cc (rmdir): Add more samba workarounds. 2003-09-11 14:43:09 +00:00
Corinna Vinschen d99e72dc52 * shared.cc (user_shared_initialize): Revert length attribute for name
variable to be just UNLEN + 1.
2003-09-11 07:57:39 +00:00
Christopher Faylor 0efafbfb8c * shared_info.h (shared_info::initialize): Remove argument.
* cygheap.h (cygheap_user::init): New declaration.
* uinfo.cc (cygheap_user::init): New.
(internal_getlogin): Move functionality to cygheap_user::init.  Open the
process token to update the group sid.
* shared.cc (user_shared_initialize): Get the user information from
cygheap->user.
(shared_info::initialize): Remove argument.  Call cygheap->user.init instead of
cygheap->user.set_name.
(memory_init): Do not get the user name and do not pass it to
shared_info::initialize.
* registry.cc (get_registry_hive_path): Make csid a cygpsid.
(load_registry_hive): Ditto.
2003-09-10 21:01:40 +00:00
Christopher Faylor 1aa76ad568 * fhandler_disk_file.cc (num_entries): Take . and .. into account if they do
not exist since cygwin simulates them.
(fhandler_cygdrive::fstat): Ditto.
(fhandler_cygdrive::readdir): Don't do any specific tests on __d_position when
seeing if a drive exists.
2003-09-10 20:16:00 +00:00
Corinna Vinschen 932a40e86b * Makefile.in (DLL_OFILES): Add getopt.o and iruserok.o.
* cygwin.din: Export __check_rhosts_file, __rcmd_errstr, optarg,
	opterr, optind, optopt, optreset, getopt, getopt_long, iruserok
	and ruserok.
	* getopt.c: Moved from lib to here.  Define opt* variables as
	dllexport.
	* iruserok.c: Moved from lib to here.  Rearrange function order.
	Prefer using 64/32 bit functions.
	* syscalls.cc (shell_fp): Define as struct __sFILE64.
	(getusershell): Use fopen64 instead of fopen.
	* winsup.h: Add declarations for seteuid32, fopen64,
	cygwin_gethostbyname and cygwin_inet_addr.
	* include/getopt.h: Declare opt* variables dllimport.
	* include/cygwin/version.h: Bump API minor number.
2003-09-10 19:13:05 +00:00
Christopher Faylor 6d2d2bce72 * exceptions.cc (sig_handle_tty_stop): Check parent PID_NOCLDSTOP rather than
erroneously checking *my own* sigtodo.
2003-09-10 17:26:12 +00:00
Christopher Faylor 4018776f6e * Makefile.in: Add some more -fomit-frame-pointer files.
* path.cc (conv_path_list_buf_size): Free normalized_path or suffer memory
leak.
* syscalls.cc (chroot): Ditto.
2003-09-10 16:22:49 +00:00
Corinna Vinschen 34a1d63d80 * Makefile.in (DLL_OFILES): Add bsdlib.o.
* autoload.cc (RegisterServiceProcess): Add.
	* bsdlib.cc: New file.
	(daemon): New function.
	(login_tty): Ditto.
	(openpty): Ditto.
	(forkpty): Ditto.
	* cygwin.din: Export daemon, forkpty, login_tty, logwtmp, updwtmp,
	openpty and revoke.
	* syscalls.cc (updwtmp): New function, writing to wtmp exclusively.
	(logwtmp): Ditto.
	(login): Call updwtmp instead of writing to wtmp by itself.
	(logout): Ditto.
	* tty.cc (revoke): New funtion.
	* include/paths.h: Define _PATH_DEVNULL.
	* include/pty.h: New header.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/utmp.h: Declare logwtmp with const arguments.
	Declare updwtmp.
	* lib/iruserok.c: New file.
	(ruserok): New function.
	(iruserok): Ditto.
	(__ivaliduser): Ditto.
	(__icheckhost): Ditto.
2003-09-10 15:51:59 +00:00
Corinna Vinschen 136265194d * fhandler_socket.cc (fhandler_socket::fstat): Don't use PC_POSIX. 2003-09-10 10:01:32 +00:00
Pierre Humblet 7119fc0d0b 2003-09-09 Pierre Humblet <pierre.humblet@ieee.org>
* shared_info.h: Include security.h.
	(open_shared): Add psa argument.
	(user_shared_initialize): New declaration.
	* security.h: Add _SECURITY_H guard.
	(sec_user): Use sec_none in the no ntsec case.
	* spawn.cc (spawn_guts): Remove call to load_registry_hive.
	* syscalls (seteuid32): If warranted, call load_registry_hive,
	user_shared_initialize and RegCloseKey(HKEY_CURRENT_USER).
	* shared.cc (user_shared_initialize): New.
	(open_shared): Add and use psa argument.
	(memory_init): Move mount table initialization to
	user_shared_initialize. Call it.
2003-09-10 02:12:26 +00:00
Corinna Vinschen 807dfb3d4a * mmap.cc (mmap64): Change address types from caddr_t to void *
according to SUSv3.
	(mmap): Ditto.
	(munmap): Ditto.
	(msync): Ditto.
	(mprotect): Ditto.  Move to before the fhandler methods.
	* include/sys/mman.h: Change prototypes accordingly.
2003-09-09 09:41:18 +00:00
Christopher Faylor 3ef50005c7 * dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely know to be
set.
* exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since it is
reset automatically.
* fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP.
* include/sys/cygwin.h: Ditto.
* sigproc.cc (sig_send): Use sigframe init method to set frame since it checks
for previous ownership of the frame.
* sigproc.h (sigframe::init): Accept an "is_exception" argument.
2003-09-09 03:11:31 +00:00
Christopher Faylor 51d340e1c8 * dir.cc (readdir): Reinstate setting of old ino field for legacy applications.
* dirent.h (dirent): Rename unused field to __ino32.
* passwd.cc (getpwnam_r): Initialize pw_comment field.
2003-09-09 00:21:16 +00:00
Christopher Faylor 7d0e78a71b * passwe.cc (getpwnam_r): Initialize pw_comment field. 2003-09-08 22:03:20 +00:00
Christopher Faylor 7a198a0675 * passwd.cc (getpwuid_r32): Initialize pw_comment field. 2003-09-08 21:44:53 +00:00
Christopher Faylor 9547a8b3c3 * sigproc.cc (wait_sig_inited): Remove assertion since it is racy. 2003-09-08 21:10:23 +00:00
Corinna Vinschen 24efca1401 * cygwin.din: Export endusershell, getusershell and setusershell.
* syscalls.cc (getusershell): New function.
	(setusershell): Ditto.
	(endusershell): Ditto.
	* include/cygwin/version.h: Bump API minor number.
2003-09-08 20:08:53 +00:00
Corinna Vinschen dcb6ce0cb2 * cygwin.din: Export argz_add argz_add_sep argz_append argz_count
argz_create argz_create_sep argz_delete argz_extract argz_insert
	argz_next argz_replace argz_stringify envz_add envz_entry envz_get
	envz_merge envz_remove envz_strip
	* include/cygwin/version.h: Bump api minor number.
2003-09-08 08:53:01 +00:00
Christopher Faylor 0c7b55727a Throughout, remove __d_u.__d_data fields from DIR structure.
* include/sys/dirent.h (dirent): Remvoe old_d_ino.
(DIR): Make __d_dirhash a 64 bit value.  Remove __d_data and __d_u.  Add
__flags.
* dir.cc (opendir_states): New enum.
(opendir): Clear new DIR __flags field.
(readdir): Fill in '.' and '..' entries if we hit EOF and we haven't seen them
already.  Nuke setting of old_d_ino.
(rewinddir): Reset DIR __flags field.
(seekdir64): Ditto.
* fhandler_disk_file.cc (fhandler_cygdrive::fhandler_cygdrive): Remove special
handling of "." and ".." since they are now handled automatically.
2003-09-08 04:04:19 +00:00
Christopher Faylor 2e5228f964 * include/cygwin/in.h: Don't define ipv6 stuff unless we call for it
specifically since it isn't really implemented yet.
2003-09-08 00:26:26 +00:00
Christopher Faylor bd8938985e * cygheap.cc (_csbrk): More left coercion cleanup.
* fhandler_tty.cc (fhandler_tty_slave::read): Ditto.
(fhandler_tty_slave::write): Ditto.
* fhandler_windows.cc (fhandler_windows::read): Ditto.
* heap.cc (sbrk): Ditto.
2003-09-07 18:27:54 +00:00
Christopher Faylor ed2287adcd * signal.cc (nanosleep): Improve test for valid values. Round delay up to
resolution.  Fix test for negative remainder.  Use timeGetTime through gtod.
(sleep): Round up return value.  Christopher Faylor <cgf@redhat.com>
* hires.h (HIRES_DELAY_MAX): Define.
(hires_ms::minperiod): Declare static.
(hires_ms::resolution): New.
(hires_ms::dmsecs): New.
(hires_ms::prime): Return UINT.
(gtod): Declare.
* times.cc (hires_ms::prime): Always calculate minperiod and set it to 1 in
case of failure.  Return minperiod.
(hires_ms::resolution): Define.
(hires_ms::~hires_ms): Delete.
(hires_ms::usecs): Check minperiod to prime.
(gtod) Define as global.
2003-09-07 05:18:01 +00:00
Christopher Faylor 6cce721b15 Remove left coercion throughout. 2003-09-07 02:22:58 +00:00
Christopher Faylor 46645f9c6e * hires.h (hires_ms::~hires_ms): Delete declaration.
* times.cc (hires_ms::~hires_ms): Delete definition..
2003-09-06 02:14:06 +00:00
Christopher Faylor c6f53ff6be * dcrt0.cc (__argc_safe): New variable.
(dll_crt0_1): Store argc in __argc_safe, which will theoretically remain
untouched by the user.
* fhandler_console.cc (fhandler_console::read): Silence some compiler warnings.
* fhandler_raw.cc (fhandler_dev_raw::raw_read): Ditto.
* pinfo.cc (_pinfo::commune_recv): Carefully bound argv scan and check for
potentially bad pointers since user could have set argv cell to anythinw.
* cygheap.h (CYGHEAPSIZE): Bump up size.
2003-09-05 01:55:01 +00:00
Corinna Vinschen 39473bba44 * sysconf.cc (sysconf): Return more accurate value for _SC_AVPHYS_PAGES. 2003-09-04 10:57:58 +00:00
Corinna Vinschen 4544f7f6a2 * mmap.cc: Restructure. Add, remove and rewrite comments throughout
for better readability.  Change function names for better
	understanding.
	(MAP_SET): Accomodate name change from map_map_ to page_map_.
	(MAP_CLR): Ditto.
	(MAP_ISSET): Ditto.
	(mmap_record::page_map_): Rename from page_map_.
	(mmap_record::get_map): Remove.
	(mmap_record::alloc_page_map): Rename from alloc_map. Return bool
	indicating success of cygheap memory allocation.
	(mmap_record::free_page_map): Rename from free_map.
	(mmap_record::fixup_page_map): Rename from fixup_map.
	(mmap_record::find_unused_pages): Rename from find_empty.
	(mmap_record::map_pages): Rename from map_map.
	(mmap_record::unmap_pages): Rename from unmap_map.
	(class list): Make all class members private.
	(list::list): Remove.
	(list::~list): Remove.
	(list::get_fd): New attribute reader.
	(list::get_hash): Ditto.
	(list::get_record): Ditto.
	(list::add_record): Manage all allocation for mmap_records.  Check
	for failed memory allocation and return NULL if so.
	(list::set): New function.
	(list::del_record): Rename from erase. Return true if last mmap_record
	has been deleted, false otherwise. Check for legal incoming index
	value.
	(list::erase): Remove erase/0.
	(list::search_record): Rename from match.
	(map::map): Remove.
	(map::~map): Remove.
	(map::add_list): Manage all allocation for lists.  Check for failed
	memory allocation and return NULL if so.
	(map::get_list): New method.
	(map::del_list): Rename from erase. Check for legal incoming index
	value.
	(mmap64): Check for failed mmap_record memory allocation.  Return
	with MAP_FAILED and errno set to ENOMEM if so.
	(munmap): Rearrange loop using new list and mmap_record accessor
	functions.  Rename loop index variables for better understanding.
	Check if list can be deleted after last mmap_record in it has been
	deleted.
	(msync): Rearrange loop using new list and mmap_record accessor
	functions.  Rename loop index variables for better understanding.
	(fixup_mmaps_after_fork): Ditto.
2003-09-04 10:27:51 +00:00
Christopher Faylor 026dcb34c6 * cxx.cc (new): Fix formatting. Just return result of ccalloc rather than
calling memset explicitly.
2003-09-04 03:01:35 +00:00
Christopher Faylor 75119e9980 * exceptions.cc (set_process_mask): Set pending signals only when signals
become unmasked.
* sigproc.cc (pending_signals): Flip back to a global.
(wait_sig): Don't set pending signals when there is an armed semaphore or
signal is blocked.
* shared.cc (shared_info::initialize): Add a username parameter for user-mode
mounts.  Reorganize to try to avoid startup race.
(memory_init): Move some stuff into shared_info::initialize.
* shared_info.h (shared_info::initialize): Change declaration.
(CURR_SHARED_MAGIC): Update.
2003-09-03 14:15:55 +00:00
Christopher Faylor b960d7bf2d * include/cygwin/version.h: Bump DLL minor number to 4. 2003-09-01 17:12:29 +00:00
Christopher Faylor da43df2df0 * net.cc (dup_ent): Restore check for NULL input. 2003-09-01 16:47:03 +00:00
Christopher Faylor 840fcfef8d * include/sys/cygwin.h: Don't define cygwin-specific things if !__CYGWIN__. 2003-09-01 02:26:27 +00:00
Christopher Faylor c0a9bffd03 * cygheap.cc (cygheap_init): Allocate space for sigaction array in cygheap.
* cygheap.h (cygheap_types): Add HEAP_SIGS.
* exceptions.cc (signal_fixup_after_exec): Remove from this file.
* pinfo.h (pinfo::getsig): Just return global_sigs array.
(pinfo::sigs): Delete.
* sigproc.cc (signal_fixup_after_exec): Move it here.
(global_sigs): New global array, moved from pinfo structure.
(sigalloc): New function.  Allocate global sigaction array here.
(proc_subproc): Remove copysigs call.  It's automatic now.
* include/sys/cygwin.h (PID_NOCLDSTOP): New value.
* signal.cc (sigaction): Set myself->PID_NODCLDSTOP when appropriate.
* sigproc.h (sigalloc): Declare.
* fnmatch.c (fnmatch): Use C90 parameters.
(rangematch): Ditto.
* fhandler.cc (fhandler_base::raw_read): Use right coercion to avoid a compiler
warning.
2003-09-01 02:05:32 +00:00
Christopher Faylor 12ffca1d84 * net.cc (dup_ent): Make debugging output consistent. 2003-08-31 23:23:40 +00:00
Christopher Faylor a3de4e19b4 Use dup_ent rather than specific dup_*_ptr functions throughout.
* (gen_ent): Delete.
(dup_ent): Subsume gen_ent functionality.
(dup_host_ptr): Delete.
(dup_proto_ptr): Ditto.
(dup_servent_ptr): Ditto.
* net.cc (gen_ent): Invert sense of null check so that debug output makes
sense.
2003-08-31 23:16:34 +00:00
Christopher Faylor edf16a29fc * net.cc (free_char_list): Delete.
(dup_addr_list): Delete.
(dup_char_list): Delete.
(free_hostent_ptr): Delete.
(free_protoent_ptr): Delete.
(free_servent_ptr): Delete.
(DWORD_round): New function.
(strlen_round): New function.  Returns strlen rounded up to word size.
(dup_ent): New, generic function to duplicate a {host,proto,serv}ent structure.
(gen_ent): New macro.  Generates a generic dup_{host,proto,serv}ent_ptr
function.
(cygwin_getservbyname): Remove call to free_servent_ptr, pass servent_buf to
dup_servent_ptr.
(cygwin_getservbyport): Ditto.
(cygwin_gethostbyname): Ditto for hostent.
(cygwin_gethostbyaddr): Ditto.
(cygwin_getprotobyname): Ditto for protoent.
(cygwin_getprotobynumber): Ditto.
2003-08-31 22:02:15 +00:00
Christopher Faylor f8e2f358c4 * Makefile.in (MALLOC_OFILES): Always fill in with correct malloc object.
* configure.in: Fill in MALLOC_OFILES with either debugging or regular malloc.
* configure: Regenerate.
* dlmalloc.c: Make various fruitless changes to attempt to get to work.
* dlmalloc.h: Ditto.
* malloc.cc (free): Check malloc pool when debugging.
* path.cc (win32_device_name): Eliminate compiler warning.
* sigproc.cc (sig_dispatch_pending): Remove use of was_pending.  Let
thisframe.call_signal_handler decide if handler should be called rather than
using bogus was_pending check.
* exceptions.cc (interrupt_setup): Remove accidentally checked in debugging
code.
* heap.cc (sbrk): Save rounded addess in user_heap_max.
2003-08-31 18:26:58 +00:00
Christopher Faylor 110a4b87df change copyright 2003-08-31 00:40:16 +00:00
Christopher Faylor b939e87080 * sigproc.cc (sig_dispatch_pending): Remove explicit call to
thisframe.call_signal_handler.
2003-08-30 20:43:06 +00:00
Christopher Faylor 40f3536c52 missed one 2003-08-30 16:35:46 +00:00
Christopher Faylor 6c125ba745 Remove some cygserver files. 2003-08-30 16:31:10 +00:00
Christopher Faylor 5a96b1cbff * sigproc.h: Make some functions regparm.
* sigproc.cc (checkstate): Make regparm.
(getevent): Change parameters in declaration, rename from getsem, make regparm.
(sig_send): Recognize that nosync is now an event.  Remove some old cruft from
previous interrupt anywhere signal handler.
(getevent): Change parameters in definition, rename from getsem.  Allocate
event rather than semaphore.
(wait_sig): Treat sigcatch_nosync as an event.
2003-08-29 03:29:16 +00:00
Christopher Faylor 99a8fab5a6 * sigproc.h: Make some functions regparm.
* sigproc.cc (checkstate): Make regparm.
(getevent): Change parameters in declaration, rename from getsem, make regparm.
(sig_send): Recognize that nosync is now an event.  Remove some old cruft from
previous interrupt anywhere signal handler.
(getevent): Change parameters in definition, rename from getsem.  Allocate
event rather than semaphore.
(wait_sig): Treat sigcatch_nosync as an event.
2003-08-29 02:59:06 +00:00
Christopher Faylor 5e8355c765 * exceptions.cc (sigreturn): Fix problem where old return address was not
properly restored for a nested signal.
2003-08-29 02:05:00 +00:00
Christopher Faylor d533b9214f * autoload.cc (SwitchToThread): Declare as autoload function.
* cygthread.h (cygthread::main_thread_id): Make public.
* exceptions.cc (setup_handler): Remove unneeded priority stuff.  Rename label
to reflect what it does.  Add debugging for idiotic Windows NT problem.  Change
debugging output to include signal number.
* miscfuncs.cc (low_priority_sleep): If available, use SwitchToThread function
to give time slice to other threads.
* wincap.cc: Properly define have_switch_to_thread throughout.
* wincap.h (wincap::switch_to_thread): New element.
2003-08-28 02:09:42 +00:00
Christopher Faylor e2bc5017fa * syscalls.cc (mount): Don't check win32_path when doing cygdrive mount. 2003-08-28 02:04:16 +00:00
Christopher Faylor 7028311c04 * specdir: Correctly remove temporary directory prior to use. 2003-08-27 21:01:14 +00:00
Christopher Faylor 90f4768b78 * sigproc.cc (wait_sig): Count number of iterations through 'more_signals' loop
and issue a warning if DEBUGGING and excessive.
(WFSO): When debugging and infinite timeout, loop.
2003-08-27 20:42:52 +00:00
Corinna Vinschen 1ce25e2add * include/cygwin/stat.h: Allow definition of internal stat structures
also when compiling newlib.
2003-08-26 07:45:38 +00:00
Christopher Faylor ff57520702 add missing files 2003-08-25 19:44:44 +00:00
Christopher Faylor 4392d36cbb Throughout, change USE_CYGSERVER to USE_SERVER.
* Makefile.in (LIBSERVER): Define and use.
* configure.in: Set LIBSERVER as appropriate.
* environ.cc: Rename allow_daemon to allow_server.  Only recognize when
USE_SERVER is defined.
2003-08-25 18:21:07 +00:00
Christopher Faylor be1ea8cde7 * syscalls.cc (_remove_r): Define. 2003-08-23 18:03:16 +00:00
Christopher Faylor 5c6497b43f * cygheap.h (enum cygheap_types): Add HEAP_MMAP.
(CYGHEAPSIZE): Add another 64K.
* mmap.cc: Use cmalloc, ccalloc and crealloc with HEAP_MMAP type throughout.
2003-08-23 00:03:54 +00:00
Christopher Faylor 7f32ba3a8d * cygheap.cc (user_heap_info::max): New field.
* heap.cc (heap_init): Save pointer to end of heap reserved memory.
(sbrk): Don't attempt to commit memory beyond end of heap reserved memory.
Attempt to honor comment and reserve commitbytes if heapchunk fails.
2003-08-22 19:33:09 +00:00
Christopher Faylor 897c6b5231 * exceptions.cc (sigreturn): Don't clobber ebp in recursive signal calls. 2003-08-22 19:25:56 +00:00
Christopher Faylor 29cd21d03a * exceptions.cc (sig_handle): Change so that default signals indicate success. 2003-08-22 17:01:53 +00:00
Christopher Faylor 095abc79ba * sigproc.cc (wait_sig): Remove redundant test in do/while. 2003-08-22 03:40:49 +00:00
Christopher Faylor a9f7754462 * sigproc.cc (wait_sig): Avoid infinite loop. 2003-08-22 01:07:01 +00:00
Christopher Faylor b5c5b9996a * speclib: Reenable removal of temp files. 2003-08-21 03:36:02 +00:00
Christopher Faylor d688945c44 * miscfuncs.cc (low_priority_sleep): Sleep at same priority as main thread.
* sigproc.cc (wait_sig): Keep looping if there are more signals to consider and
we are flushing signals.
(sig_send): Put nonsync signals in the correct bucket.
2003-08-21 03:18:46 +00:00
Christopher Faylor 0b10f795f1 * speclib: Fix created lib to avoid "File truncated" problems. 2003-08-21 02:19:25 +00:00
Christopher Faylor 2bf794af9a * exceptions.cc (interrupt_setup): Set sigsave.sig last to avoid a race. 2003-08-20 18:09:24 +00:00
Christopher Faylor 6f6d673cc5 * sigproc.cc (wait_sig): Ensure that myself->getsigtodo array is flushed on a
__SIGFLUSH.  Christopher Faylor <cgf@redhat.com>
* exceptions.cc (_sigreturn): Handle nested signals without growing the stack.
2003-08-20 05:15:33 +00:00
Christopher Faylor 5f31e0f305 * exceptions.cc (pending_signals): Remove unneeded declaration.
* sigproc.cc (pending_signals): Make static.
(wait_sig): Use defined values rather than integers for rc.  Never scan both
todo arrays as this could cause hangs if signals arrive from two different
sources.  Rename saw_pending_signals to saw_failed_interrupt.  Exit loop when
signal found.  Enter low-priority sleep, if necessary, after finished
signalling completion.  Set pending_signals when blocked
(from Pierre Humblet).
2003-08-20 02:31:26 +00:00
Christopher Faylor 6ac844b5e3 clarify 2003-08-20 01:19:04 +00:00
Christopher Faylor 06bb489932 * signal.cc (sigpending): Move.
* sigproc.cc (sigpending): To here.
(getlocal_sigtodo): Return process-local signal array.
(sigpending): Accommodate new process-local signal array.
(sig_send): Ditto.
(sig_set_pending): Ditto.
(wait_sig): Ditto.
2003-08-19 05:47:44 +00:00
Christopher Faylor 05cb7b17cb Throughout, eliminate argument to sig_dispatch_pending.
* exceptions.cc (setup_handler): Move non-interruptible condition handling
(back) to wait_sig (as suggested by Pierre Humblet).
(set_process_mask): Don't worry about calling sig_dispatch_pending from
sigthread since it is detected in the function anyway.
(sig_handle): Eliminate thisproc arg.  Don't call sig_dispatch_pending on
SIGCONT since that should happen automatically.
* sigproc.cc (sig_dispatch_pending): Eliminate justwake argument.  Just return
when called from sigthread.
(wait_sig): Change some variables to bool.  Change inner while to an if.  Move
uninterruptible signal handling here.
(sigproc_terminate): Don't call sig_dispatch_pending.  Just increment semaphore
on exit.
* speclib: Use slightly different (but still flawed) method for determining
symbols to extract from libraries.
2003-08-19 04:10:42 +00:00
Christopher Faylor 755f575f15 correct attribution, since this is not Pierre's patch. 2003-08-19 01:17:53 +00:00
Christopher Faylor 372cd2cbe6 * exceptions.cc (sigdelayed): Fix race where signal handler could get the wrong
mask.
2003-08-19 00:31:56 +00:00
Christopher Faylor 9d7f26eaf4 * path.cc (mount): Add null/empty check for input parameters.
(umount): Add null/empty check for input parameters.
2003-08-19 00:18:48 +00:00
Corinna Vinschen 981f9625f3 * grp.cc (read_group): Revert previous change.
* uinfo.cc (pwdgrp::load): Always reset curr_lines.
2003-08-17 17:50:40 +00:00
Corinna Vinschen 22d82f9f46 * errno.cc (errmap): Map ERROR_INVALID_BLOCK_LENGTH to EIO.
* fhandler_raw.cc (fhandler_dev_raw::raw_read): Set more accurate
	errnos instead of EACCES.
	(fhandler_dev_raw::raw_write): Ditto.
2003-08-17 17:12:18 +00:00
Christopher Faylor 293ce8104d * path.cc (special_name): Accommodate all special names with extensions. 2003-08-17 16:33:15 +00:00
Corinna Vinschen 92d897cde2 * mmap.cc (mmap64): Avoid crash if file size is less than requested
map length.
2003-08-15 12:05:08 +00:00
Corinna Vinschen 6763d47b1e * path.cc (special_name): Add checks for some specials followed by
a "." and a FIXME comment.
2003-08-13 17:28:00 +00:00
Corinna Vinschen ae89a49602 * cygwin.din: Accomodate change from cygwin_lstat to lstat.
* syscalls.cc: Add defines to avoid declaration issues when
	renaming cygwin_lstat back to lstat.
	(lstat): Reverted name change from cygwin_lstat.
2003-08-13 11:28:42 +00:00
Corinna Vinschen c86c10b803 * include/sys/param.h (NBBY): Define if not defined.
* include/sys/param.h (setbit): Add new bitmap related macro.
	(clrbit): Likewise.
	(isset): Likewise.
	(isclr): Likewise.
	(howmany): Add new counting/rounding macro.
	(rounddown): Likewise.
	(roundup): Likewise.
	(roundup2): Likewise.
	(powerof2): Likewise
	(MIN): Add macro for calculating min.
	(MAX): Add macro for calculating max.
2003-08-12 10:23:40 +00:00
Christopher Faylor 9d77d53601 * include/cygwin/version.h: Bump DLL minor number to 3. 2003-08-09 16:32:03 +00:00
Christopher Faylor 5c65fa0200 * include/stdint.h: Correctly define INT32_MIN. 2003-08-08 19:30:41 +00:00
Christopher Faylor b344f1876c * grp.cc (read_group): Set __group32.gr_mem pointer back to &null_ptr after
free() is called.
2003-08-08 19:28:34 +00:00
Christopher Faylor 4b154cc1b3 * Makefile.in: Rework to accommodate new speclib arguments.
* speclib: Rework to extract everything from libcygwin.a rather than building
things from existing object files.
2003-08-06 01:40:12 +00:00
Christopher Faylor 4423d92489 * path.cc (cygdrive_getmntent): Do not skip over drives of type
DRIVE_REMOVABLE.
* fhandler.cc (fhandler_base::lseek): Be more paranoid when constructing
offsets from 64 bit value.
* syscalls.cc (logout): Avoid temp buffer memcpy since new scheme does not
require it.
(utmp_data): Rework as a macro which returns a pointer into a buffer.
(getutent): Use new buffer allocation mechanism to grab a utmp buffer.
(getutid): Ditto.
(pututline): Ditto.
2003-08-05 04:49:44 +00:00
Christopher Faylor 3fea2e4087 * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Do not change 'errno' if
end of directory condition is encountered as per SUSv2.
* fhandler_proc.cc (fhandler_proc::readdir): Ditto.
* fhandler_process (fhandler_process::readdir): Ditto.
* fhandler_registry (fhandler_registry::readdir): Ditto.
2003-08-05 03:04:28 +00:00
Christopher Faylor b9621e8d94 * dcrt0.cc (_dll_crt0): Move strace.microseconds initialization to after
pthread initialization.
(dll_crt0_1): i.e., here.
2003-07-30 04:46:07 +00:00
Christopher Faylor 8e2315f07d * include/cygwin/version.h: Bump DLL minor number to 2. 2003-07-28 21:14:25 +00:00
Christopher Faylor d2466c7aa0 * fhandler_base.cc (fhandler_base::readv): Rework to properly return number of
bytes from read.
2003-07-28 21:13:17 +00:00
Christopher Faylor df04ae29b2 * exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if there
is a tty associated with the process.  Send SIGHUP on CTRL_LOGOFF_EVENT.
* fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open handle
counter regardless of whether this is a pty or tty.
(fhandler_tty_slave::open): Ditto.
(fhandler_tty_slave::dup): Ditto.
(fhandler_tty_common::set_close_on_exec): Ditto.
(fhandler_tty_master::init_console): Decrement console open handle counter
after init since it will now be handled by all tty open.
* syscalls.cc (setsid): Rework debugging output slightly.
2003-07-26 04:53:59 +00:00
Christopher Faylor ddb6762155 * configure.in: Use 'install-sh -c'.
* configure: Regenerate.
2003-07-26 01:53:18 +00:00
Christopher Faylor 5ed664d4a6 preliminary checkin 2003-07-26 00:28:59 +00:00
Christopher Faylor 9ddd929f68 preliminary checkin 2003-07-26 00:10:48 +00:00
Christopher Faylor 7f4773b3ef * configure.in: Always use install-sh.
* configure: Regenerate.
2003-07-25 23:52:30 +00:00
Christopher Faylor 5d66faab67 * include/cygwin/socket.h: Conditionalize [AP]F_INET6 define. 2003-07-25 17:57:51 +00:00
Christopher Faylor 6f8c86aec5 * Makefile.in (OBSOLETE_FUNCTION): Add fdopen. 2003-07-25 17:42:08 +00:00
Christopher Faylor 86ed5c8821 * cygwin.din: Export _fdopen64
* Makefile.in (NEW_FUNCTIONS): Add _fdopen64 -> fdopen translation.
* include/cygwin/version.h: Bump api minor number.
* ntdll.h: Remove (now) duplicate FILE_SYNCHRONOUS_IO_NONALERT definition.
2003-07-25 16:13:12 +00:00
Christopher Faylor 1fbeb8274f * environ.cc (check_case_init): Use strncasematch.
* cygwin.din: Export __mempcpy.
* cygwin/version.h: Bump api minor number.
2003-07-24 19:33:14 +00:00
Corinna Vinschen d432ac751b * mmap.cc: Use proper format specifiers for _off64_t and size_t in
format strings passed to syscall_printf () and debug_printf ()
	throughout.
2003-07-21 13:06:49 +00:00
Pierre Humblet b4ece40c0f 2003-07-18 Pierre Humblet <pierre.humblet@ieee.org>
* security.cc (verify_token): Fix white space and style.
        Use type bool instead of BOOL and char. Use alloca
        instead of malloc and free for my_grps.
2003-07-18 02:14:42 +00:00
Corinna Vinschen fc2843ca96 * sysconf.cc (sysconf): Fix OPEN_MAX patch. Return page size on
_SC_PAGESIZE again.
2003-07-17 07:35:16 +00:00
Christopher Faylor 5b429f2674 update copyright 2003-07-17 05:27:03 +00:00
Corinna Vinschen ea3ba11499 * cygheap.h (class cygheap_user): Use INVALID_HANDLE_VALUE as invalid
value for tokens.
	* syscalls.cc (seteuid32): Ditto.  Set new_token to process token if
	process token is suitable.
	* uinfo.cc (uinfo_init): Initialize tokens in cygheap user info
	to INVALID_HANDLE_VALUE.

	* cygheap.h (enum impersonation): Delete.
	(cygheap_user::impersonation_state): Delete.
	(cygheap_user::current_token): New.
	(cygheap_user::issetuid): Modify to use current_token.
	(cygheap_user::token): Ditto.
	(cygheap_user::deimpersonate): Ditto.
	(cygheap_user::reimpersonate): Ditto.
	(cygheap_user::has_impersonation_tokens): Ditto.
	(cygheap_user::close_impersonation_tokens): Ditto.
	* security.cc (cygwin_set_impersonation_token): Always set the token.
	(verify_token): Change type of gsid to cygpsid.
	(get_file_attribute): Use the effective ids.
	* syscalls.cc (seteuid32): Modify to use cygheap_user::current_token.
	* uinfo.cc (uinfo_init) Do not set cygheap->user.impersonation_state.
2003-07-14 17:04:21 +00:00
Christopher Faylor 9e8ac0ae35 * pinfo.cc (_pinfo::commune_send): Fix bounds test so that poll of
communicating pid actually stops eventually.
2003-07-12 21:37:07 +00:00
Christopher Faylor e47d564835 * path.cc (get_device_number): Remove special com? consideration.
(special_chars): Make static.
(special_introducers): New.
(special_char): Allow specified valid_chars args.
(fnunmunge): Handle aux-like filenames correctly.
(special_name): Add con, conin$, conout$.
(mount_item::fnmunge): Use __small_sprintf return value to calculate
increments.
2003-07-11 00:54:46 +00:00
Christopher Faylor 30811232c7 * include/cygwin/version.h: Bump DLL minor number to 1. 2003-07-10 02:33:27 +00:00
Christopher Faylor 2f5cab7bb2 * fhandler_proc.cc (format_proc_stat): Use correctly sized constants for
filling in zeros on 98.
2003-07-10 02:09:24 +00:00
Christopher Faylor f1a4b6b59a * include/cygwin/version.h: Bump DLL minor number to 1. 2003-07-10 01:58:39 +00:00
Christopher Faylor cf38615c3b * fhandler_proc.cc (fhandler_proc::fill_filebuf): Allocate more space for stat
buffer.
(format_proc_stat): Reorganize to accumulate and report on all cpus.
2003-07-10 01:09:24 +00:00
Christopher Faylor ab3dc80d9e * sysconf.cc (sysconf): Return processors online rather than bitmask for
_SC_NPROCESSORS_ONLN.
2003-07-09 23:59:47 +00:00
Christopher Faylor 4d782b426a * cygheap.cc (creturn): Set appropriate errno when out of memory.
(ccalloc): Only issue system_printf when debugging.
* dtable.cc (dtable::extend): Only allocate 100 * the incremental growth size
max.  Set errno appropriately.
(dtable::build_fhandler): Check for error from set_name.
* fhandler.cc (fhandler_base::set_name): Set errno and return error on OOM.
* fhandler.h (fhandler_base::set_name): Change to bool.
* fhandler_process.cc (format_process_stat): Fix formatting.
* resource.cc (getrlimit): Return greater of OPEN_MAX or fd table size.
* sysconf.cc (sysconf): Ditto.
2003-07-09 01:33:06 +00:00
Christopher Faylor a711a5af45 * rmsym: Don't use ranlib. 2003-07-07 05:32:24 +00:00
Christopher Faylor c0a6fcd75b * newsym: Reenable removal of tmp directory. Just use ar to generate archive
index.
* Makefile.in: Don't send ranlib to newsym.
2003-07-07 05:30:33 +00:00
Christopher Faylor 0e5db0bfe8 * newsym: Create objects that are closer to those created by dlltool so as not
to confuse --export-all-symbols.
* rmsym: Be a little more accepting of object filenames now that dlltool can
create different format files.
2003-07-07 05:23:35 +00:00
Christopher Faylor c522b9078c * newsym: Oops. Revert below change. 2003-07-07 00:14:58 +00:00
Christopher Faylor 88a628163e * newsym: Use correct prefix for generating imports.
* pinfo.cc (_pinfo::commune_send): Don't wait forever for a response from
another process.
2003-07-06 23:24:13 +00:00
Christopher Faylor 0d043e9aac white space 2003-07-06 20:13:48 +00:00
Christopher Faylor b671715358 * syscalls.cc (gethostid): Set thread affinity so that results are predictable. 2003-07-06 20:08:42 +00:00
Corinna Vinschen f2d3c47b14 * mmap.cc (list::match): Add parameters to return valid address and
length back to munmap().  Evaluate intersection between given
	area and mapped area and return it, if any.
	(mmap64): On regular files, don't allow mappings beginning beyond
	EOF.  Return with errno set to ENXIO instead.
	(munmap): Rewrite SUSv3 conformant.  Check if given memory area is
	valid.  Unmap all maps inside given memory area.  Don't return error
	if no mapping has been unmapped.
2003-07-05 18:59:35 +00:00
Corinna Vinschen 4b2cbaeefd * fhandler.h (fhandler_socket::get_connect_state): New method to
return socket connection state.
	* fhandler_socket.cc (dup): Copy socket connect state to new file
	handle.
	* net.cc (cygwin_rcmd): Mark file handles of sockets returned by
	rcmd() as CONNECTED state.
	(cygwin_rexec): Similarly for rexec().
	(socketpair): Mark both ends of a new socket pair as CONNECTED.
2003-07-05 18:20:13 +00:00
Christopher Faylor 49806b9b06 fix typo 2003-07-04 17:37:59 +00:00
Corinna Vinschen 6694f3054e * mmap.cc (fhandler_disk_file::mmap): Fix address test. 2003-07-04 09:06:54 +00:00