Commit Graph

6440 Commits

Author SHA1 Message Date
Danny Smith 3315e811a4 * include/io.h (__mingw_access): New static inline wrapper to restore
pre-Vista 'access (fname, X_OK)'  behaviour.
	(__USE_MINGW_ACCESS): Use to map access() to __mingw_access().
2007-03-05 08:25:32 +00:00
Danny Smith 5643b1ee86 * mingwex/fesetround.c (fesetround): Use unsigned int as operand
to  stmxcsr.
	Thanks to Alexey Kuznetsov <ring0_mipt at users dot sf dot net>
2007-03-05 07:42:36 +00:00
Corinna Vinschen 788e7da136 * ntdll.h (struct _OBJECT_NAME_INFORMATION): Define.
* syscalls.cc (unlink_nt): Check shared directory for being empty
	before trying to move and mark for deletion.
2007-03-02 20:04:26 +00:00
Corinna Vinschen 3532877889 * security.cc (get_file_attribute): Avoid compiler warning. 2007-03-02 19:54:20 +00:00
Christopher Faylor e943a1a37e * fork.cc (fork): Reset child to true after fork since it may have been reset
by fork memory copies.
2007-03-01 18:43:38 +00:00
Christopher Faylor 6e070c257c * Makefile (DLL_OFILES): Remove ntea.o
* environ.cc (set_ntea): Delete.
(parse_thing): Delete "ntea" setting.
* fhandler.cc (fhandler_base::open): Remove allow_ntea considerations.
(check_posix_perm): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Ditto.
(fhandler_base::open_fs): Ditto.
(fhandler_disk_file::mkdir): Ditto.
* path.cc (symlink_worker): Ditto.
* security.cc (get_file_attribute): Ditto.
(set_file_attribute): Ditto.
* security.h: Remove allow_ntea declaration.
2007-03-01 15:13:47 +00:00
Corinna Vinschen 40303ac9de * path.cc (close_user_proc_parms_cwd_handle): Remove.
(cwdstuff::init): Don't call close_user_proc_parms_cwd_handle.
	Call set to set cwd with all-sharing handle.
	(cwdstuff::set): Fix comment.  Don't close cwd handle.  Set in
	user parameter block instead and close old cwd handle.
	* syscalls.cc (rename): Call unlink_nt instead of RemoveDirectory or
	DeleteFile to allow deleting shared files/directories.
2007-02-27 18:38:22 +00:00
Corinna Vinschen 3323df7e0e * fhandler.cc(fhandler_base::open): Open with READ_CONTROL only in
case of query_open flag set to query_read_control.  Add case for
	new query_read_attributes flag.
	(fhandler_base::fstatvfs): New method.
	* fhandler.h (enum query_state): Add query_read_attributes flag.
	(class fhandler_base): Declare new virtual fstatvfs method.
	(class fhandler_socket): Ditto.
	(class fhandler_pipe): Ditto.
	(class fhandler_fifo): Ditto.
	(class fhandler_disk_file): Ditto.
	(class fhandler_virtual): Ditto.
	* fhandler_disk_file.cc (fhandler_base::fstat_fs): Open with
	query_read_attributes instead of query_read_control.
	(fhandler_disk_file::fstatvfs): New method.
	(fhandler_disk_file::facl): Open with query_read_attributes instead of
	query_read_control.
	* fhandler_fifo.cc (fhandler_fifo::fstatvfs): New method.
	* fhandler_socket.cc (fhandler_socket::fstatvfs): New method.
	(fhandler_socket::fchmod): Return with EBADF in the default case.
	(fhandler_socket::fchown): Ditto.
	(fhandler_socket::facl): Ditto.
	* fhandler_virtual.cc (fhandler_virtual::fstatvfs): Ditto.
	* ntdll.h (struct _FILE_FS_ATTRIBUTE_INFORMATION): Define.
	(struct _FILE_FS_FULL_SIZE_INFORMATION): Define.
	* pipe.cc (fhandler_pipe::fstatvfs): New method.
	* syscalls.cc (fstatvfs): Just call the fhandler's fstatvfs.
	(statvfs): Ditto.
	(fstatfs): Call fstatvfs.
	(statfs): Drop EFAULT handling.
2007-02-27 12:58:56 +00:00
Danny Smith cbf4bfcd5b 2007-02-27 Thorsten Dahlheimer <tdahlheim@gmx.net>
* include/stdio.h (_unlink, unlink): Add prototypes.
2007-02-27 07:40:12 +00:00
Corinna Vinschen 139654836c * fhandler.cc (fhandler_base::fstat): Set all file times to arbitrary
fixed value.
2007-02-26 14:19:00 +00:00
Corinna Vinschen 14e06cca26 * fhandler_registry.cc (registry_listing): Drop name of HKEY_DYN_DATA.
(registry_keys): Drop HKEY_DYN_DATA.
	* net.cc: Fix comment.
	* syslog.cc: Ditto.
2007-02-26 12:39:25 +00:00
Corinna Vinschen 457c7938f0 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop comment.
* mmap.cc (gen_access): Remove.
	(mmap_record::gen_access): Remove.
	(mmap64): Don't mention 9x any longer.
	* syscalls.cc (statvfs): Drop status code consideration for 9x.
	* libc/minires-os-if.c (get_registry_dns_items): Don't mention 9x any
	longer.
	(get_registry_dns): Drop getting registry key on 9x.  Drop is9x
	variable.
2007-02-26 12:22:41 +00:00
Corinna Vinschen a76877e977 Throughout remove all usage of wincap.has_security.
* environ.cc (environ_init): Drop setting allow_ntsec here.
	* grp.cc (initgroups32): Drop usage of label "out".
	* security.cc (allow_ntsec): Set to true by default.
	* syscalls.cc (seteuid32): Remove label success_9x.
	* wincap.cc: Remove has_security throughout.
	* wincap.h: Ditto.
2007-02-23 15:15:50 +00:00
Corinna Vinschen 9fa43ff6c6 * fhandler.h (class fhandler_pipe): Remove members writepipe_exists,
orig_pid and id.  Make hit_eof inline.
	* fhandler_fifo.cc (fhandler_fifo::open): Drop handling of
	writepipe_exists, orig_pid and id.
	* pipe.cc: Ditto throughout.
	(pipecount): Remove.
	(pipeid_fmt): Remove.
	(fhandler_pipe::hit_eof): Simplify.  Move to fhandler.h.
	(fhandler_pipe::dup): Drop leave label.
	(fhandler_pipe::create): Drop has_unreliable_pipes case.
	* wincap.cc: Remove has_unreliable_pipes throughout.
	* wincap.h: Ditto.
2007-02-23 14:47:45 +00:00
Corinna Vinschen 296a8a6369 * devices.in: Change native device name to native NT device name for
/dev/null, /dev/comX and /dev/ttySx.
	* devices.cc: Regenerate.
	* fhandler.cc (fhandler_base::open_9x): Remove.
	(fhandler_base::open): Don't test for DOS device name, don't call
	open_9x.
	(fhandler_dev_null::open): Remove.
	* fhandler.h (class fhandler_base): Drop open_9x declaration.
	(class fhandler_dev_null): Drop open declaration.
2007-02-23 14:20:28 +00:00
Corinna Vinschen b5cb5c9e64 * fhandler_console.cc (fhandler_console::need_invisible): Drop
pty_needs_alloc_console check.
	* spawn.cc (spawn_guts): Ditto.
	(av::fixup): Remove setting iscui.
	* syscalls.cc (rename): Drop has_move_file_ex checks.  Remove 9x
	specific code.
	* wincap.cc: Remove has_move_file_ex and pty_needs_alloc_console
	throughout.
	* wincap.h: Ditto.
2007-02-23 12:01:52 +00:00
Corinna Vinschen 7131554a69 Throughout remove using wincap.
* Makefile.in (OBJS): Remove wincap.o.
	* README: Don't mention 9x.
	* bsd_mutex.cc (_mtx_unlock): Drop checking for 9x error codes.
	* cygserver.cc (server_submission_loop::request_loop): Add FIXME
	comment.
	* wincap.cc: Remove.
	* wincap.h: Remove.
	* woutsup.h: Don't include wincap.h.
2007-02-23 11:43:48 +00:00
Corinna Vinschen aaee2ffaed * exceptions.cc (dummy_ctrl_c_handler): Remove.
(init_console_handler): Drop has_null_console_handler_routine checks.
	* fhandler_raw.cc (fhandler_dev_raw::open): Drop has_raw_devices check.
	* fhandler_serial.cc (fhandler_serial::open): Drop
	.supports_reading_modem_output_lines check.
	* miscfuncs.cc (low_priority_sleep): Drop has_switch_to_thread check.
	* shared.cc (open_shared): Drop needs_memory_protection checks.
	* spawn.cc (spawn_guts): Drop start_proc_suspended check.
	* uname.cc (uname): Drop has_valid_processorlevel check.
	* wincap.cc: Remove has_raw_devices, has_valid_processorlevel,
	supports_reading_modem_output_lines, needs_memory_protection,
	has_switch_to_thread, start_proc_suspended and
	has_null_console_handler_routine throughout.
	* wincap.h: Ditto.
2007-02-23 10:51:59 +00:00
Corinna Vinschen 0ed760d75e * fhandler.cc (fhandler_base::lseek): Drop 9x considerations.
* fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto.
	* wincap.cc: Remove lock_file_highword and has_64bit_file_access
	throughout.
	* wincap.h: Ditto.
2007-02-23 09:49:49 +00:00
Corinna Vinschen 8e17bd8685 * cygheap.h (struct cwdstuff): Remove sync member and keep_in_sync
accessors.
	* external.cc (cygwin_internal): Drop call to cygheap->cwd.keep_in_sync.
	* fhandler_disk_file.cc (fhandler_disk_file::link): Always presume
	ability to create hard links.
	* path.cc (cwdstuff::init): Drop 9x considerations.
	(cwdstuff::keep_in_sync): Remove.
	(cwdstuff::set): Take NT for granted.
	* pinfo.h (cygwin_pid): Just return pid.
	* wincap.cc: Remove has_hard_links, can_open_directories,
	has_negative_pids, has_named_pipes, has_try_enter_critical_section,
	cant_debug_dll_entry and detect_win16_exe throughout.
	* wincap.h: Ditto.
2007-02-22 18:01:13 +00:00
Corinna Vinschen 3af640487f * fhandler_console.cc (fhandler_console::read): Drop 9x specific
handling of AltGr key.
	* mmap.cc: Take NT for granted throughout.
	* wincap.cc: Remove map_view_of_file_ex_sucks, altgr_is_ctrl_alt,
	has_working_copy_on_write, share_mmaps_only_by_name,
	virtual_protect_works_on_shared_pages, has_mmap_alignment_bug and
	has_working_virtual_lock throughout.
	* wincap.h: Ditto.
2007-02-22 17:35:14 +00:00
Corinna Vinschen eef57fe1e3 * fhandler.cc (fhandler_base::set_no_inheritance): Always use
SetHandleInformation.
	* fhandler_disk_file.cc (fhandler_disk_file::lock): Always use
	UnlockFileEx/LockFileEx functions.
	* net.cc (fdsock): Don't bother to duplicate socket for inheritance.
	* sysconf.cc (get_nproc_values): Take NT for granted.
	(get_avphys): Ditto.
	* syslog.cc (WIN95_EVENT_LOG_PATH): Remove define.
	(get_win95_event_log_path): Remove.
	(vsyslog): Fix formatting.  Take NT for granted.
	* wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait,
	has_eventlog, has_set_handle_information,
	has_set_handle_information_on_console_handles and supports_smp
	throughout.
	* wincap.h: Ditto.
2007-02-22 17:09:46 +00:00
Corinna Vinschen 64f211c87c Fix typo. 2007-02-22 16:33:44 +00:00
Corinna Vinschen 03d5ce6d08 * dir.cc (rmdir): Move existance check in front of
has_dot_last_component check.  Simply setting errno in latter case.
2007-02-22 16:32:39 +00:00
Corinna Vinschen e9095199cc * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case.
Simplify seek beyond EOF case.
	* times.cc (times): Remove wincap.has_get_process_times case.
	* wincap.cc: Remove has_delete_on_close, has_page_guard,
	has_get_process_times and has_lseek_bug throughout.
	* wincap.h: Ditto.
2007-02-22 16:22:38 +00:00
Corinna Vinschen 501f1020f9 Throughout remove all usage of wincap.access_denied_on_delete.
* dir.cc (rmdir): Add existance check to be errno-compatible with Linux.
	* fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop test for
	non-existent dir on 9x share.
	* syscalls.cc (unlink): Add comment.
	* wincap.cc: Remove access_denied_on_delete flag throughout.
	* wincap.h: Ditto.
2007-02-22 16:04:19 +00:00
Corinna Vinschen e387a378b4 * fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug
introduced by switching to NtClose.
2007-02-22 15:07:21 +00:00
Christopher Faylor 39fc0d36ae * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of guard test.
Increase size of stack reserved and increase size before the current stack
pointer.  Use pointers when doing arithmetic.
(dll_crt0_1): Initialize exception handler when we notice we're the child of a
fork from non-main thread.
* fork.cc (frok::parent): Make argument volatile.
(frok::child): Ditto.
(lock_signals): New class.
(lock_pthread): Ditto.
(hold_everhthing): Ditto.
(frok::parent): Move atforkprepare and atforkparent to lock_pthread class.
(fork): Make ischild boolean.  Use hold_everything variable within limited
scope to set various mutexes in such a way as to avoid deadlocks.
* thread.h (pthread_mutex::tid): New variable, active when debugging for
tracking thread id of owner.
(pthread_mutex::set_owner): Set tid when debugging.
* thread.cc (pthread_mutex::pthread_mutex): Clear tid.
(pthread_mutex::_unlock): Ditto when unlocking.
(pthread_mutex::fixup_after_fork): Set tid to special value after forking since
owner is unknown.
2007-02-22 12:34:55 +00:00
Corinna Vinschen bd8f891e8a Throughout replace all usage of wincap.shared with the constant
FILE_SHARE_VALID_FLAGS.
	* fhandler.cc (fhandler_base::open_9x): Drop local variable shared.
	* wincap.cc: Remove shared member throughout.
	* wincap.h: Ditto.
2007-02-22 11:17:01 +00:00
Corinna Vinschen 570858c30f * Makefile.in (DLL_IMPORTS): Add libntdll.a.
* autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and
	ntdll.dll available on all platforms since NT4.

	Throughout remove all usage of wincap.is_winnt.
	* dcrt0.cc (dll_crt0_0): Remove call to mmap_init.
	* fhandler.h (class fhandler_base): Remove has_changed flag.
	(fhandler_disk_file::touch_ctime): Remove declaration.
	(fhandler_disk_file::readdir_9x): Ditto.
	(fhandler_disk_file::touch_ctime): Remove.
	(fhandler_disk_file::readdir_9x): Remove.
	(fhandler_disk_file::closedir): Call NtClose instead of CloseHandle.
	* mmap.cc: Throughout call CreateMapping and MapView directly.
	(VirtualProt9x): Remove.
	(VirtualProtNT): Remove.
	(VirtualProtEx9x): Remove.
	(VirtualProtExNT): Remove.
	(VirtualProtect): Remove define.
	(VirtualProtectEx): Remove define.
	(CreateMapping9x): Remove.
	(CreateMappingNT): Rename to CreateMapping.
	(MapView9x): Remove.
	(MapViewNT): Rename to MapView.
	(struct mmap_func_t): Remove definition.
	(mmap_funcs_9x): Remove.
	(mmap_funcs_nt): Remove.
	(mmap_func): Remove.
	(mmap_init): Remove.
	* net.cc (getdomainname): Drop comment. Use NT4 registry key only.
	(get_95_ifconf): Remove.
	* pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes.
	(winpids::enum9x): Remove.
	(winpids::set): Just call enum_processes directly.
	(winpids::enum_init): Ditto.
	* pinfo.h (class winpids): Drop enum_processes pointer.  Rename
	enumNT to enum_processes.  Drop enum9x declaration.  Drop initialization
	of enum_processes throughout.
	* registry.cc (get_registry_hive_path): Just create NT key.
	(load_registry_hive): Only load NT specific file.
	* syscalls.cc (unlink_9x): Remove.
	(unlink): Just call unlink_nt.
	* wincap.cc: Remove is_winnt flag throughout.
	* wincap.h: Ditto.
	* winsup.h: Remove mmap_init declaration.
2007-02-22 10:54:47 +00:00
Corinna Vinschen 8782b2a2af * ipcs.c (_POSIX2_LINE_MAX): Drop definition. 2007-02-22 10:53:37 +00:00
Corinna Vinschen 3fbf471f35 * Makefile.in (OBJS): Drop transport_sockets.o.
* sysv_shm.cc (shmget_allocate_segment): Remove spurious cast.
	* transport.cc: Don't include transport_sockets.h.
	(create_server_transport): Always create transport_layer_pipes.
	* transport_sockets.cc: Remove.
	* transport_sockets.h: Remove.
2007-02-22 10:50:51 +00:00
Corinna Vinschen bc455088cf * wincap.cc (wincap_unknown): Change settings for unknown to reflect
the capabilities of NT4.
	(wincap_95): Remove.
	(wincap_95osr2): Remove.
	(wincap_98): Remove.
	(wincap_98se): Remove.
	(wincap_me): Remove.
	(wincap_nt3): Remove.
	(wincapc::init): Temporarily bail out on any 9x system.
2007-02-21 15:18:07 +00:00
Corinna Vinschen 7db9fabc83 * cygcheck.cc (dump_sysinfo): Add "not supported" to osname on 9x
machines.  Drop "not supported" for Vista.  Drop "Longhorn" text
	for now.
2007-02-20 16:41:54 +00:00
Corinna Vinschen 8fbd574ef0 * cygwin.din (sem_unlink): Export.
* posix_ipc.cc: Include thread.h and semaphore.h.  Remove TODO
	comment.
	(ipc_names): Add max_len member.  Set to maximum length of the path
	before tacking on the prefix path.  Set prefix path for named semaphors
	to /dev/shm, as on Linux.
	(enum ipc_type_t): Change sem to semaphore to avoid name conflicts.
	(check_path): Detect empty paths.  Use ipc_names's max_len member.
	Use __small_sprintf to create full object path name.  Special case
	semaphores.
	(ipc_cond_init): Drop superfluous strcpy.
	(class ipc_flock): New class to simplify file locking in subsequent
	code.
	(struct mq_hdr): Raise size of mqh_uname to allow adding a unique
	LUID to the name.
	(mq_open): Fix formatting.  Create unique synchronization object names
	using AllocateLocallyUniqueId.
	(struct sem_finfo): New structure defining named semaphore file content.
	(sem_open): Move here.  Rework implementation to allow kernel
	persistent implementation of POSIX named semaphores.
	(_sem_close): Implement sem_close.
	(sem_close): Move here.  Just call _sem_close with do_close parameter
	set to true.
	(sem_unlink): New function.
	* pthread.cc (mangle_sem_name): Remove.
	(sem_open): Move to posix_ipc.cc.
	(sem_close): Ditto.
	* syscalls.cc (close_all_files): Call semaphore::terminate here.
	* thread.cc: Fix formatting.  Rearrange semaphore functions so that
	they are close together.
	(semaphore::semaphore): Rework to play nicely with new named semaphore
	implementation.
	(semaphore::_terminate): Call _sem_close if semaphore is a named
	semaphore.
	(semaphore::destroy): Don't destroy named semaphores.  Return EINVAL
	instead.
	(semaphore::close): Only destroy named semaphores.  Return EINVAL
	otherwise.
	(semaphore::open): Rework to play nicely with new named semaphore
	implementation.  Loop through existing semaphores to be able to
	return same sem_t pointer as a former call on the same named semaphore.
	(semaphore::getinternal): New function called from _sem_close.
	* thread.h (class List): Make mx and head public.
	(class semaphore): Fix formatting.  Align method declarations with
	implementation in thread.cc.  Add members used for named semaphores.
	(semaphore::terminate): New static method.
	* include/semaphore.h: Redefine SEM_FAILED.  Fix formatting.
	(sem_unlink): Add declaration.
	* include/cygwin/version.h: Bump API minor number.
2007-02-20 15:48:04 +00:00
Christopher Faylor d0cf179299 * exceptions.cc (_cygtls::signal_exit): Only call myself.exit when when
exit_state indicates that we've visited do_exit.
* sync.h (lock_process::lock_process): Use renamed exit_state -
ES_PROCESS_LOCKED.
* winsup.h: Rename ES_MUTO_SET to ES_PROCESS_LOCKED.
2007-02-20 14:31:26 +00:00
Corinna Vinschen 4997a508c8 * fhandler_socket.cc (fhandler_socket::bind): Remove printing wrong
errno in debug output.
2007-02-20 09:48:31 +00:00
Christopher Faylor 510a85cbf9 Remove extraneous whitespace.
* pinfo.cc (commune_process): Use default argument to lock_process.
* sigproc.cc: Update copyright.
* select.cc: Ditto.
2007-02-20 00:16:18 +00:00
Danny Smith c30b7cc622 Correct spelling of submitter's name in ChangeLog. 2007-02-18 09:57:51 +00:00
Danny Smith 8cf2dca12b 2007-02-18 Aurimas Cernius <aurisc4@gmail.com>
* include/excpt.h:  Replace "_try1" in comments  with "__try1".
2007-02-18 09:46:48 +00:00
Danny Smith 6542214e59 2007-02-18 Jiri Malak <jiri.malak@iol.cz>
* include/windef.h [WATCOM]: Fix !NONAMELESSUNION defines.
	* include/winnt.h [WATCOM] (GetCurrentFiber, GetFiberData):
	Add prototypes.
	[WATCOM] (NtCurrentTeb): Add protype and inline asm definition.

2007-02-18  Vesa Jskelinen  <chaac@users.sourveforge.net>

	* lib/user32.def (InternalGetWindowText): Add stub.
2007-02-18 08:08:12 +00:00
Corinna Vinschen eb8a6636bf * posix_ipc.cc (mq_open): Avoid compiler warning. Initialize mqhdr
before using it in file exists case.
	* include/mqueue.h (mqd_t): Make non-pointer type.
2007-02-15 17:49:25 +00:00
Corinna Vinschen 93162be554 * posix_ipc.cc (ipc_mutex_init): Create global object name.
(ipc_cond_init): Ditto.
	(struct mq_hdr): Add mqh_uname member to store synchronization object
	name.
	(mq_open): Create unique synchronization object name and store in
	mq_hdr->mqh_uname.  Use this name in calls to ipc_mutex_init and
	ipc_cond_init.
2007-02-15 11:28:46 +00:00
Danny Smith 18c27356c4 * Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES.
(ALL_CXXFLAGS): Likewise.
	* mingwex/Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES.
	(ALL_CXXFLAGS): Likewise.
	* profile/Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES.
	(ALL_CXXFLAGS): Likewise.
2007-02-14 23:42:07 +00:00
Corinna Vinschen 7b487ba942 * Makefile.in (DLL_OFILES): Add posix_ipc.o.
* cygwin.din (mq_close): Export.
	(mq_getattr): Export.
	(mq_notify): Export.
	(mq_open): Export.
	(mq_receive): Export.
	(mq_send): Export.
	(mq_setattr): Export.
	(mq_timedreceive): Export.
	(mq_timedsend): Export.
	(mq_unlink): Export.
	* posix_ipc.cc: New file implementing the above functions.  Move
	shm_open and shm_unlink from syscalls.cc here.
	* sysconf.cc (sca): Set value of _SC_MQ_OPEN_MAX to MQ_OPEN_MAX,
	_SC_MQ_PRIO_MAX to MQ_PRIO_MAX, _SC_MESSAGE_PASSING to
	_POSIX_MESSAGE_PASSING.
	* include/limits.h (MQ_OPEN_MAX): Define.
	(MQ_PRIO_MAX): Define.
	* include/mqueue.h: New file.
	* include/cygwin/version.h: Bump API minor number.
2007-02-14 10:06:46 +00:00
Corinna Vinschen af52f2802f * include/cygwin/stdlib.h (valloc): Declare.
(memalign): Declare.
2007-02-13 18:55:49 +00:00
Chris Sutcliffe b46bc8f5f5 2007-02-11 Daniel Atallah <datallah@users.sourceforge.net>
* include/winnt.h (LANG_SERBIAN_NEUTRAL, LANG_BOSNIAN,
LANG_BOSNIAN_NEUTRAL): Define.

2007-02-11  Daniel Schlyder  <thrug@users.sourceforge.net>

* include/winuser.h: Add guards around TITLEBARINFO and
GetTitleBarInfo().
2007-02-11 14:32:24 +00:00
Corinna Vinschen 09928447ed * libc/minires-os-if.c (write_record): Handle DNS_TYPE_SRV and
some obsolete types.
2007-02-09 10:09:21 +00:00
Corinna Vinschen aafecff6a8 * syscalls.cc (check_shm): New static function to do path checking
common to shm_open and shm_unlink.  Check for /dev/shm existance.
	(shm_open): Call check_shm.
	(shm_unlink): Ditto.
2007-02-08 14:40:13 +00:00
Corinna Vinschen ce8bab5a92 * cygwin.din (shm_open): Export.
(shm_unlink): Export.
	* syscalls.cc (shm_open): New function.
	(shm_unlink): New function.
	* sysconf.cc (sca): Set value of _SC_SHARED_MEMORY_OBJECTS to
	_POSIX_SHARED_MEMORY_OBJECTS.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/mman.h (shm_open): Add prototype.
	(shm_unlink): Ditto.
2007-02-08 13:36:53 +00:00
Corinna Vinschen 0bce6570f0 * cygmalloc.h (__set_ENOMEM): Declare.
(MALLOC_FAILURE_ACTION): Call __set_ENOMEM.
	* malloc_wrapper.cc (malloc) Remove setting errno here.
	(realloc): Ditto.
	(calloc): Ditto.
	(memalign): Ditto.
	(valloc): Ditto.
	(posix_memalign): Save and restore errno.
2007-02-08 11:35:52 +00:00
Danny Smith d4c6243390 * include/io.h (X_OK): Revert 2007-01-24 change, but leave comment. 2007-02-08 08:15:32 +00:00
Corinna Vinschen 5155321fbc * cygmalloc.h (MALLOC_FAILURE_ACTION): Move to correct #if branch. 2007-02-07 20:44:04 +00:00
Corinna Vinschen 59e3b6ca7d * cygmalloc.h (MALLOC_FAILURE_ACTION): Define empty.
* cygwin.din (posix_madvise): Export.
	(posix_memalign): Export.
	* fhandler.cc (fhandler_base::fpathconf): Return useful values in
	_PC_VDISABLE, _PC_SYNC_IO and _PC_SYMLINK_MAX cases.
	* malloc_wrapper.cc (malloc): Set errno here since it's not set in
	dlmalloc.c anymore.
	(realloc): Ditto.
	(calloc): Ditto.
	(memalign): Ditto.
	(valloc): Ditto.
	(posix_memalign): New function.
	* mmap.cc (posix_madvise): New function.
	* sysconf.cc (get_open_max): New function.
	(get_page_size): Ditto.
	(get_nproc_values): Ditto.
	(get_avphys): Ditto.
	(sc_type): New type.
	(sca): New array to map _SC_xxx options to sysconf return values.
	(sysconf): Reimplement using sca array.
	* include/limits.h: Add all missing values as defined by SUSv3.
	* include/pthread.h (PTHREAD_DESTRUCTOR_ITERATIONS): Move definition
	to sys/limits.h.
	(PTHREAD_KEYS_MAX): Ditto.
	* include/semaphore.h (SEM_VALUE_MAX): Ditto.
	* include/cygwin/stdlib.h (posix_memalign): Declare.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/mman.h: Add posix_madvise flags.
	(posix_madvise): Declare.
	* include/sys/termios.h (_POSIX_VDISABLE): Move definition to
	sys/limits.h.
2007-02-07 17:22:40 +00:00
Corinna Vinschen f82f801cd2 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support for
baud rates up to 3000000 baud.  Add missing 128K and 256K cases.
	(fhandler_serial::tcgetattr): Ditto.
	* include/sys/termios.h: Add baud rate definitions from B460800 up to
	B3000000.
2007-02-05 12:32:23 +00:00
Corinna Vinschen 9e9bc4e144 * syscalls.cc (unlink_nt): Add missing assignment in case NtClose fails. 2007-02-02 15:16:54 +00:00
Corinna Vinschen ee945cb382 Fix typo. 2007-02-01 17:13:31 +00:00
Corinna Vinschen 4815dd49bb * net.cc (ga_dup): New function, taken from ga_clone with v4-in-v6
mapping addition.
	(ga_clone): Just call ga_dup from here.
	(ga_duplist): New function to duplicate list of struct addrinfo.
	(ga_echeck): Don't check a_flags, it already happened in
	cygwin_getaddrinfo.
	(cygwin_freeaddrinfo): Always call ipv4_freeaddrinfo.
	(cygwin_getaddrinfo): Use new wincap.supports_all_posix_ai_flags
	flag rather than wincap.has_gaa_on_link_prefix.  Always duplicate
	WinSock's addrinfo list to a self-allocated list.  Handle AI_V4MAPPED
	for pre-Vista platforms supporting getaddrinfo.
	* wincap.h (wincapc::supports_all_posix_ai_flags): New element.
	* wincap.cc: Implement above element throughout.
	* include/netdb.h: Note how AI_ADDRCONFIG is not supported pre-Vista.
	Remove superfluous comment.
2007-02-01 15:54:40 +00:00
Corinna Vinschen 3281664245 * include/cygwin/socket.h: Add IPv6 socket options. 2007-02-01 10:04:45 +00:00
Corinna Vinschen 9cde55ad2d * net.cc (cygwin_getaddrinfo): Fix thinko in AI_ADDRCONFIG handling. 2007-01-31 15:30:42 +00:00
Corinna Vinschen c2decfdc8a * net.cc (cygwin_getaddrinfo): Check ai_flags for valid values.
Handle AI_NUMERICSERV.  Handle AI_ADDRCONFIG behaviour on Vista.
	* include/netdb.h (AI_NUMERICSERV): Add missing flag.
2007-01-31 15:10:22 +00:00
Corinna Vinschen c3772e717f * fhandler_disk_file.cc (fhandler_disk_file::closedir): Add dir name
to debug output.
	* syscalls.cc (try_to_bin): Enable code to move file to user specific
	recycler dir to eliminate Vista problem.
	(unlink_nt): Add comment that rename after opening for delete on close
	only fails on XP.
2007-01-31 10:55:59 +00:00
Corinna Vinschen 62d172bb49 * sigproc.cc (child_info::child_info): Set msv_count to non-zero
value only on systems requiring it.
2007-01-30 21:53:05 +00:00
Corinna Vinschen 291b2d8291 * include/ftw.h: Include sys/cdefs.h. 2007-01-28 11:27:05 +00:00
Danny Smith 9571d219fe Expose some msvcr80.dll functions.
* include/stdio.h (_fseek_nolock. _ftell_nolock, _fseeki64,
	_ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add prototypes
	* msvcrt.def.in (_fseek_nolock. _ftell_nolock, _fseeki64,
	_ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add stubs.
2007-01-27 09:50:11 +00:00
Corinna Vinschen b8d1550207 Fix typo. 2007-01-26 12:32:11 +00:00
Corinna Vinschen 3be6ababd8 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Implement rmdir
on NT by calling unlink_nt.  Check for directory here.
	* syscalls.cc (try_to_bin): Fix buggy debug_printf statement.
	(unlink_nt): Make non-static.  Don't use delete-on-close semantics on
	directoires.  Explain why.
2007-01-26 12:25:23 +00:00
Danny Smith 2731a97413 Expose some msvcr80.dll functions.
* include/stdlib.h (_set_abort_behavior): Add prototype.
	(_WRITE_ABORT_MSG, _CALL_REPORTFAULT): Add defines for
	_set_abort_behavior mask argument.
	(_invalid_parameter_handler): Add typedef.
	(_set_invalid_parameter_handler): Add prototype.
	* include/stdio.h (_get_printf_count_output): Add prototype.
	(_set_printf_count_output): Add prototype.
	* msvcrt.def.in (_get_printf_count_output, _set_printf_count_output,
	_set_abort_behavior, _set_invalid_parameter_handler): Add stubs.
2007-01-26 08:20:54 +00:00
Danny Smith ed897cdfa6 * include/_mingw.h (CRT_INLINE): Correct typo. 2007-01-26 00:20:14 +00:00
Corinna Vinschen e7fc99384e * net.cc (if_nametoindex): This time, really free IP_ADAPTER_ADDRESSES
memory.
	(if_indextoname): Ditto.
2007-01-24 15:55:51 +00:00
Corinna Vinschen fd1bf882f5 * security.h (pop_thread_privilege): Revert to previous state, not
to token used for impersonation.
2007-01-24 12:14:54 +00:00
Corinna Vinschen a0e1630add * cygheap.h (cygheap_user::deimpersonate): Always RevertToSelf. 2007-01-24 10:50:47 +00:00
Danny Smith c0c32634da * include/io.h (X_OK): Define to F_OK. 2007-01-24 08:27:12 +00:00
Corinna Vinschen f28f68cc4f * net.cc (gai_errmap): Add EAI_OVERFLOW entry. Fix formatting.
(cygwin_gai_strerror): Drop using EAI_MAX.
	(w32_to_gai_err): Ditto.
	* include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX.
2007-01-23 17:05:29 +00:00
Corinna Vinschen f7fee067b6 * include/netdb.h: Add AI_xxx flags available since Vista. 2007-01-23 15:56:13 +00:00
Corinna Vinschen 4b13fd15d4 * net.cc (if_nametoindex): Free IP_ADAPTER_ADDRESSES memory.
(if_indextoname): Ditto.
	(if_nameindex): Ditto.  Remove duplicate indexed entries in result.
2007-01-23 09:23:54 +00:00
Corinna Vinschen bff4389137 * autoload.cc (WSAIoctl): Define.
(SendARP): Define.
	* cygwin.din: Export if_freenameindex, if_indextoname, if_nameindex and
	if_nametoindex.
	* fhandler_procnet.cc: Drop including wchar.h.  Drop definitions of
	GAA_FLAG_INCLUDE_ALL_INTERFACES, IP_ADAPTER_UNICAST_ADDRESS_VISTA.
	(fhandler_procnet::exists): Check for has_gaa_prefixes.  Call
	get_adapters_addresses here.
	(fhandler_procnet::readdir): Ditto.
	(prefix): Move to net.cc.
	(fhandler_procnet::fill_filebuf): Call get_adapters_addresses here.
	Simplify allocation.  Use AdapterName rather than FriendlyName as
	interface name.  Use IfIndex if available, Ipv6IfIndex otherwise.
	(in6_are_prefix_equal): Move to net.cc.
	* fhandler_socket.cc: Define old SIOCGxxx values.
	(CONV_OLD_TO_NEW_SIO): Convert old SIOCGxxx value to new one.
	(struct __old_ifreq): Define old struct ifreq.
	(fhandler_socket::ioctl): Handle old SIOCGxxx values.  Handle new
	SIOCGIFFRNDLYNAM command.  Simplify copying ifreq data to user space.
	Call get_ifconf with additional SOCKET parameter.
	* net.cc (IP_ADAPTER_UNICAST_ADDRESS_LH): Define.
	(IP_ADAPTER_ADDRESSES_LH): Define.
	(SIO_GET_INTERFACE_LIST): Define.
	(sockaddr_in6_old): Define.
	(sockaddr_gen): Define.
	(INTERFACE_INFO): Define.
	(IN_LOOPBACK): Define.
	(in_are_prefix_equal): New static function.
	(ip_addr_prefix): New function, replaces prefix function, add AF_INET
	handling.
	(GAA_FLAG_INCLUDE_ALL_INTERFACES): Define.
	(get_adapters_addresses): New function.
	(WS_IFF_xxx): Define Winsock interface flag values.
	(convert_ifr_flags): New function to convert Winsock interface flag
	values to Cygwin interface flag values.
	(get_xp_ifconf): New get_ifconf implementation for XP SP1 and above.
	(get_2k_ifconf): Fix interface index.  Fix formatting.
	(get_nt_ifconf): Fix formatting.
	(get_95_ifconf): Ditto.
	(get_ifconf): Take additional SOCKET parameter.  Call get_xp_ifconf
	on XP SP1 and above.
	(if_nametoindex): New function.
	(if_indextoname): New function.
	(if_nameindex): New function.
	(if_freenameindex): New function.
	(in6_are_prefix_equal): Moved here from fhandler_procnet.cc.
	* wincap.cc (wincap_xp): Define has_gaa_prefixes as true by default.
	(wincapc::init): Assume has_osversioninfoex by default.  Call
	GetVersionEx with OSVERSIONINFOEX first.  Call with OSVERSIONINFO only
	if that fails.  Simplify NT4 case and try to avoid strcmp.  Check XP
	Service Pack using version.wServicePackMajor to avoid strcmp.
	* include/asm/socket.h (SIOCGIFFRNDLYNAM): Define.
	* include/cygwin/if.h: Fix formatting.
	(IFF_POINTTOPOINT): Define.
	(IFF_NOARP): Define.
	(IFF_LOWER_UP): Define.
	(IFF_DORMANT): Define.
	(struct if_nameindex): Define.
	(IFRF_FRIENDLYNAMESIZ): Define.
	(struct ifreq_frndlyname): Define.
	(IFNAMSIZ): Redefine as 44.
	(IF_NAMESIZE): Define.
	(struct ifreq): Redefine ifru_flags as int.  Define ifru_data.  Pad size
	to sizeof sockaddr_in6 for further extensions.
	(ifr_data): Define.
	(ifr_frndlyname): Define.
	(if_nametoindex): Declare.
	(if_indextoname): Declare.
	(if_nameindex): Declare.
	(if_freenameindex): Declare.
	* include/cygwin/version.h: Bump API minor number.
	(CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ): Define check for old vs. new
	ifreq structure.
2007-01-21 22:54:05 +00:00
Danny Smith 8212f7686e Oops. The actual change for this entry wasn't committed.
2007-01-11  Gisle Vanem  <giva@users.sourceforge.net>

	* include/winbase.h (struct _OVERLAPPED): Change type of
	Internal, InternalHigh members to ULONG_PTR.
	(PAPCFUNC): Change DWORD parameter to ULONG_PTR.
	(CreateIoCompletionPort): Likewise.
	(PostQueuedCompletionStatus): Likewise.
	(QueueUserAPC): Likewise.
	(GetQueuedCompletionStatus): Change PDWORD parm to PULONG_PTR.
2007-01-19 08:53:00 +00:00
Danny Smith 8dabc54e41 * include/stdio.h (SEEK_SET, SEEK_CUR, SEEK_END): Define
unconditionally.  Change comment.
	* include/unistd.h (SEEK_SET, SEEK_CUR, SEEK_END): Define
	here too.
	* include/io.h (rename): Declare.
	(remove): Declare.
2007-01-19 03:21:09 +00:00
Corinna Vinschen 45fa1f99c6 * spawn.cc (spawn_guts): Don't set cwd for non-Cygwin child processes
on NT to allow starting them in virtual directories.
2007-01-18 21:28:36 +00:00
Corinna Vinschen 2397d888b1 * mmap.cc (list::hash): Fix type to __ino64_t.
(list::get_hash): Ditto.
	(list::set): Add struct stat parameter.  Use that instead of calling
	fstat.
	(map::get_list_by_fd): Ditto.
	(map::add_list): Ditto.
	(mmap_is_attached_or_noreserve): Call get_list_by_fd appropriately.
	(mmap_worker): Add pameters for map list and file stat information.
	Propagate to called functions.
	(mmap64): Use fstat on files early.  Replace call to GetFileSize.
	Call get_list_by_fd and mmap_worker appropriately.
2007-01-18 17:15:59 +00:00
Corinna Vinschen 5ea0aee2ce * fhandler_procnet.cc: Drop declaration of htonl and ntohs. Include
asm/byteorder.h instead.
2007-01-18 10:30:43 +00:00
Corinna Vinschen 4eeaecbc18 * include/cygwin/in6.h: Drop inclusion of asm/byteorder.h.
* fhandler_procnet.cc: Declare htonl and ntohs here.
2007-01-18 10:25:40 +00:00
Corinna Vinschen 96d7dee2f0 * Makefile.in (DLL_OFILES): Add fhandler_procnet.o.
* autoload.cc (GetAdaptersAddresses): Define.
	* devices.h (FH_PROCNET): Define new device.
	* devices.in (dev_procnet_storage): Add "/proc/net" entry.
	* devices.cc: Regenerate.
	* dir.cc (readdir_worker): Use isproc_dev macro.
	* dtable.cc (build_fh_pc): Add FH_PROCNET.
	* fhandler.h (class fhandler_procnet): New class.
	* fhandler_proc.cc: Add "net" subdirectory handling.
	* fhandler_procnet.cc: New file handling "/proc/net" directory.
	* path.cc (isvirtual_dev): Move to path.h.
	* path.h (isproc_dev): New macro to identify /proc files by device.
	(isvirtual_dev): Moved here.  Define using isproc_dev.
	* syscalls.cc (unlink): Use isproc_dev macro.
	* wincap.h (wincapc::has_gaa_prefixes): New element.
	(wincapc::has_gaa_on_link_prefix): New element.
	* wincap.cc: Implement above elements throughout.
	(wincapc::init): Check XP for service pack and set has_gaa_prefixes
	appropriately.
	* include/cygwin/in6.h: Include asm/byteorder.h.
2007-01-17 19:26:58 +00:00
Corinna Vinschen 12ffdde350 * include/asm/socket.h (SIOGIFINDEX): Define. 2007-01-17 13:43:47 +00:00
Corinna Vinschen 9f3e3df961 * mmap.cc (MapView9x): Note possible uselessness of retrying.
(MapViewNT): Ditto.
	(mmap64): Fix pre-reservation to work for non NULL, non MAP_FIXED.
2007-01-17 10:49:24 +00:00
Corinna Vinschen cbe2437b28 * autoload.cc (RtlAnsiStringToUnicodeString): Define.
(RtlOemStringToUnicodeString): Define.
	* ntdll.h (struct _RTL_USER_PROCESS_PARAMETERS): Define.
	(struct _PEB): Redefine with a bit of content.
	(RtlAnsiStringToUnicodeString): Declare.
	(RtlOemStringToUnicodeString): Declare.
	* path.cc: Include ntdll.h.
	(_upp): New global variable pointing to user process parameter block.
	(get_user_proc_parms): New static function to retrieve user process
	parameter block.
	(close_user_proc_parms_cwd_handle): New function to close handle to
	current working directory in user process parameter block.
	(cwdstuff::init): Drop redundant declaration of dynamically_loaded.
	Set current dir only on 9x.  Call close_user_proc_parms_cwd_handle
	on NT instead.
	(cwdstuff::keep_in_sync): Only on 9x.
	(cwdstuff::set): Keep behaviour on 9x.  On NT write cwd path into user
	process parameter block and set cwd handle to NULL.  Fix comments to
	reflect new behaviour.
2007-01-16 18:01:06 +00:00
Corinna Vinschen 835fc32a3a * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX.
* net.cc (get_2k_ifconf): Ditto.
	(get_nt_ifconf): Fake SIOCGIFINDEX.
	(get_95_ifconf): Ditto.
	(get_ifconf): Handle SIOCGIFINDEX.  Fake it for loopback on systems
	not supporting IP Helper Lib.
	* include/asm/socket.h (SIOCGIFINDEX): Define.
	* include/cygwin/if.h (struct ifreq): Add member for interface index.
	(ifr_ifindex): Define.
2007-01-16 12:01:36 +00:00
Corinna Vinschen 2fd167e6de * include/cygwin/in6.h (struct ipv6_mreq): Change type of interface
member to uint32_t.
	(struct in6_pktinfo): Ditto.
2007-01-16 11:41:55 +00:00
Corinna Vinschen 6281771f37 * include/cygwin/in.h (struct ip_mreq_source): Define.
(struct ip_msfilter): Define.
	(IP_MSFILTER_SIZE): Define.
	(struct in_pktinfo): Define.
	(struct group_req): Define.
	(struct group_source_req): Define.
	(struct group_filter): Define.
	(GROUP_FILTER_SIZE): Define.
	(INADDR_ALLRTRS_GROUP): Define.
	* include/cygwin/socket.h: Define protocol agnostic multicast options.
2007-01-16 11:37:05 +00:00
Corinna Vinschen 153995f846 * CYGWIN_LICENSE: Fix web pages and contact information. 2007-01-15 12:19:01 +00:00
Corinna Vinschen 362359bd10 * ntdll.h: Adjust status definitions. 2007-01-15 11:11:37 +00:00
Corinna Vinschen 5d93eb069e * cygheap.cc (cygheap_init): Add TODO comment. 2007-01-15 11:01:23 +00:00
Corinna Vinschen 5d1dd9308d * ntdll.h (STATUS_SHARING_VIOLATION): Define. 2007-01-15 10:52:15 +00:00
Corinna Vinschen a0638e5e67 * syscalls.cc (unlink_nt): Don't move files to recycle bin which are
not in use.
2007-01-13 20:56:01 +00:00
Christopher Faylor b3f40a5fd0 * glob.cc: Update copyright notice with latest from FreeBSD.
(glob0): Use correct type for c variable to propagate previously detected
protection.
2007-01-13 07:10:14 +00:00
Corinna Vinschen f51b396579 * cygheap.cc (_csbrk): Fix off-by-one error.
* cygwin.sc: Give .cygheap a minimum size of 512K.
2007-01-12 19:40:20 +00:00
Christopher Faylor 5f77729c30 * external.cc (sync_winenv): Use cur_environ () rather than __cygwin_environ. 2007-01-12 15:40:13 +00:00
Corinna Vinschen 0b7c56a5f5 * fork.cc (child_copy): Add missing Windows PID in debug output. 2007-01-12 15:26:02 +00:00
Corinna Vinschen ee4370fd29 * syscalls.cc: Update copyright. 2007-01-12 14:16:42 +00:00