Commit Graph

7463 Commits

Author SHA1 Message Date
Corinna Vinschen 26fb7ef5e4 * wide_path.h (class wide_path): New class to convert Windows path
to WCHAR win32 path, including long path conversion if necessary.
	* cygcheck.cc: Use class wide_path throughout to call Win32 functions
	taking potentially long filenames.
	(display_error): Use snprintf rather than sprintf.
	(display_error_fmt): Ditto.
	(dump_sysinfo): Use FindFirstFileW/FindNextFileW.
	* cygpath.cc: Use class wide_path throughout to call Win32 functions
	taking potentially long filenames.
	(get_device_name): Raise buffer size to take long pathnames.
	(get_short_paths): Convert to using GetShortPathNameW.
	(get_short_name): Ditto.
	(get_long_path_name_w32impl): Convert to equivalent of GetLongPathNameW.
	(get_long_name): Convert to using GetLongPathNameW.
	(do_sysfolders): Raise buffer size for POSIX pathname to PATH_MAX.
	(do_pathconv): In case of POSIX->Win32 conversion, convert to wchar_t
	Win32 path name and drop long pathname prefix if possible.
	(main): Call setlocale to accommodate wide char/multibyte conversions.
2009-03-14 14:56:20 +00:00
Corinna Vinschen 01cdb57d40 * gendef: Remove STABS directives. 2009-03-14 09:14:47 +00:00
Christopher Faylor 962acfe58a * ldd.cc: Rework to detect missing DLLs.
(start_process): Change to expect windows filename as input.
(tocyg): New function - convert cygwin fn to windows fn.
(print_dlls_and_kill_inferior): Accept extra argument denoting whether to open
input and look for nonexistent DLLs.  Use tocyg to convert filename and pass it
to start_process.
(report): Flag when an DLL-not-found exception occurs and pass this information
to print_dlls_and_kill_inferior.
(filelist): New structure.
(saw_file): New function.
(dump_import_directory): Ditto.
(map_file): Ditto.
(skip_dos_stub): Ditto.
(get_directory_index): Ditto.
(process_file): Ditto.
2009-03-14 06:46:00 +00:00
Corinna Vinschen ad2c5ad9d2 * mktemp.cc: Remove STABS specific link-time warning. Align copyright
text to upstream.
2009-03-13 20:49:42 +00:00
Corinna Vinschen 8c0b8bc352 * flock.cc: Fix lockf copyright to latest version. 2009-03-13 09:33:55 +00:00
Corinna Vinschen 752c477b42 * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined
earlier.
	(get_ino_by_handle): Take additional path_conv argument, accommodate
	throughout.  Only use FileId if isgood_inode check is true.
	(fhandler_base::open_fs): Simplify setting ino due to above change.
	(readdir_get_ino): Make sure to return always a non-zero inode number.
	(fhandler_disk_file::readdir): Always open file in dir with
	FILE_OPEN_REPARSE_POINT so as not to open wrong file.
	Drop call to isgood_inode here.
	* path.cc (symlink_info::check): Call fs.update in case we're fetching
	file information from call to NtQueryDirectoryFile.
2009-03-12 22:03:28 +00:00
Corinna Vinschen fc69f1aed5 * flock.cc (fhandler_disk_file::lock): Don't test file open mode in
case of flock-type locks.  Explain why.
2009-03-12 18:30:29 +00:00
Corinna Vinschen 2e0b52c9d8 * gethostby_helper: Fix typos in DEBUGGING case. 2009-03-12 15:54:49 +00:00
Corinna Vinschen cab0758eb2 * cygwin.din: Export wcscasecmp, wcsncasecmp.
* posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-11 13:00:28 +00:00
Corinna Vinschen 32382e935a * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf,
vswscanf.
	* posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf
	to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-11 12:03:44 +00:00
Corinna Vinschen 71d13bca55 * fhandler.h (fhandler_socket::wait_for_events): Take additional
parameter "dontwait".
	* fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the
	socket is non-blocking if dontwait is true.
	(fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to
	set the wait_for_events dontwait parameter.
	(fhandler_socket::send_internal): Ditto.  Optimize code slightly.
	* include/cygwin/socket.h (MSG_DONTWAIT): Define.
	* include/cygwin/version.h: Bump API minor number.
2009-03-09 14:40:45 +00:00
Corinna Vinschen c47426aedb * cygwin.din: Export wcsftime.
* posix.sgml: Move wcsftime to SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-09 13:22:37 +00:00
Corinna Vinschen f9f478ad80 * pathnames.sgml: Try to be more clear explain raw devices. 2009-03-09 10:23:44 +00:00
Corinna Vinschen 313fb10ba2 * utils.sgml: Fix typo. 2009-03-09 09:20:38 +00:00
Christopher Faylor 9caeaa61c0 * cygcheck.cc (usage): Fix typo. 2009-03-08 21:13:26 +00:00
Corinna Vinschen 6f57cb4a52 * cygwin.din: Export gethostbyname2.
* net.cc: define _CYGWIN_IN_H and include resolv.h.
	(realloc_ent): New function.
	(dup_ent): Call realloc_ent.
	(memcpy4to6): New function.
	(dn_length1): New function.
	(gethostby_helper): New function.
	(gethostbyname2): New function.
	* posix.sgml: Add gethostbyname2.
	* include/cygwin/version.h: Bump API minor number.
	* libc/minires.c (get_options): Look for "inet6" and apply bounds
	to "retry" and "retrans".
	(res_ninit): Set the default options at the beginning.
	(dn_expand): Fix "off by one".
2009-03-06 16:31:26 +00:00
Corinna Vinschen 45e20e47ba * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf,
vswprintf.  Sort.
	* posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf
	to SUSv4 list.  Sort SUSv4 list.
	* include/cygwin/version.h: Bump API minor number.
2009-03-06 10:09:55 +00:00
Chris Sutcliffe 6e0e5a4fc2 2009-03-05 Kai Tietz <kai.tietz@onevision.com>
* pseudo-reloc.c: Rewrite to enable pseudo_reloc version 2.
2009-03-05 14:48:38 +00:00
Corinna Vinschen 06281845fb * dcrt0.cc (disable_dep): Disable. Explain why.
(dll_crt0_0): Disable calling disable_dep.  Explain why.
2009-03-04 11:45:58 +00:00
Corinna Vinschen 2895b8b502 * net.cc: Include asm/byteorder.h.
(htonl): Move to end of file.  Add comment to explain why.  Align
	definition to POSIX.  Use related macro from asm/byteorder.h.
	(ntohl): Ditto.
	(htons): Ditto.
	(ntohs): Ditto.
	* include/asm/byteorder.h: Revert previous patch.
2009-03-03 11:44:18 +00:00
Corinna Vinschen ed296a4727 * include/asm/byteorder.h: Disable optimization when building
Cygwin network code.
2009-03-03 11:11:26 +00:00
Corinna Vinschen 92fa4552fd * faq-using.xml: Rework UTF FAQ to accommodate latest setlocale
change in newlib.
2009-03-03 10:36:59 +00:00
Corinna Vinschen e81ae92910 * pathnames.sgml: Remove reference to managed mountpoints in mount
entry example.
2009-03-03 09:11:45 +00:00
Corinna Vinschen 17a12c5065 * utils.sgml: Set example prompt to "$" throughout. Don't use "/"
as example cygdrive prefix.  Remove reference to -u and -s options.
	Add an example using the -o flag.
2009-03-02 10:56:19 +00:00
Corinna Vinschen 8262e64256 * mount.cc (mount_entries): Handle a "/" cygdrive prefix correctly.
Add comments.
2009-03-02 10:47:04 +00:00
Christopher Faylor c7ef20e7fa * dtable.cc (dtable::select_read): Add ability to override fh.
* fhandler.h (fhandler_fifo::select_read): Declare new function.
(fhandler_fifo::select_write): Ditto.
(fhandler_fifo::select_except): Ditto.
* select.cc (peek_pipe): Treat certain classes of pipe errors as "no data".
(fhandler_fifo::select_read): Define new function.
(fhandler_fifo::select_write): Ditto.
(fhandler_fifo::select_except): Ditto.
* shared_info.h (CURR_SHARED_MAGIC): Update.
2009-02-27 00:34:40 +00:00
Christopher Faylor 99fe2b7866 Add DESTDIR functionality to Makefile.in's. 2009-02-24 02:11:14 +00:00
Corinna Vinschen 8ec5da1ff6 * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code. 2009-02-23 18:27:48 +00:00
Corinna Vinschen b419b631b6 * faq-using.xml: Rework XEmacs FAQ. 2009-02-23 16:33:17 +00:00
Corinna Vinschen 348267bdf6 * autoload.cc (NetLocalGroupEnum): Remove.
(NetLocalGroupGetMembers): Remove.
	(NetUserGetLocalGroups): Add.
	* sec_auth.cc (is_group_member): Remove function.
	(get_user_local_groups): Get user as string instead of as SID.
	Call NetUserGetLocalGroups instead of NetLocalGroupEnum.  Drop call
	to is_group_member.
	(get_server_groups): Call get_user_local_groups with user name instead
	of user SID.
2009-02-20 16:10:45 +00:00
Corinna Vinschen 964abbd08e * winver.rc: Fix Copyright date. 2009-02-19 16:12:02 +00:00
Corinna Vinschen 89b5579d3b * cygwin.din: Export mbsnrtowcs and wcsnrtombs.
* posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section.
	* include/cygwin/version.h: Bump API minor number.
2009-02-19 09:22:51 +00:00
Corinna Vinschen 15fc34ac5a * cygwin.din: Export open_wmemstream.
* posix.sgml: Move open_wmemstream to SUSv4 section.
	* include/cygwin/version.h: Bump API minor number.
2009-02-18 17:38:16 +00:00
Corinna Vinschen c6b9747e04 * cygwin.din: Export reallocf.
* malloc_wrapper.cc( reallocf): New function.
	* posix.sgml: Add reallocf to BSD section.
	* include/cygwin/version.h: Bump API minor number.
	* libc/fts.c: Remove erroneous reallocf definition.
2009-02-16 20:22:38 +00:00
Corinna Vinschen de5c20c2de * cygwin.din: Export wcstoimax, wcstoumax.
* posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section.
	* include/inttypes.h: Declare wcstoimax and wcstoumax.
	* include/cygwin/version.h: Bump API minor number.
2009-02-16 15:36:01 +00:00
Corinna Vinschen 4806c1f4f6 * faq-using.xml: Fix usage of ampersand in NT emacs script. 2009-02-14 20:56:48 +00:00
Corinna Vinschen 6ff3731ad4 * faq-using.xml: Expand Emacs entries. 2009-02-14 20:52:50 +00:00
Corinna Vinschen b36d8c6040 * overview.sgml: Fix 1.7 release date. 2009-02-13 18:41:32 +00:00
Corinna Vinschen c6d3735106 * cygwin.din: Export wcsnlen.
* posix.sgml: Move wcsnlen to SUSv4 section.
	* include/cygwin/version.h: Bump API minor number.
2009-02-13 18:39:37 +00:00
Corinna Vinschen 4b1b39e758 * environ.cc (_getenv_r): New function. 2009-02-13 17:49:37 +00:00
Corinna Vinschen 22e138ad6b * posix.sgml: Move dirfd to SUSv4 section. 2009-02-13 12:45:02 +00:00
Corinna Vinschen 52d132e48e * cygwin-api.in.sgml: Fix API section layout. 2009-02-13 12:23:21 +00:00
Corinna Vinschen b0e662b8d6 * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated
interfaces section.  Move interfaces added in SUSv4 to SUSv4
	section or, if unimplemented, add them to the unimplemented interfaces
	section.
2009-02-13 12:19:25 +00:00
Corinna Vinschen f2ba21b1a4 * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section.
Move Solaris calls now in SUSv4 to SUSv4 section.  Rename unimplemented
	section to refer to SUSv4.  Add note about missing interfaces.
	Move wcstod and wcstof from unimplemented to SUSv4 section.
2009-02-13 11:33:32 +00:00
Corinna Vinschen 06d60a915d * pathnames.sgml: Add a cygdrive section. 2009-02-13 10:13:28 +00:00
Corinna Vinschen 0211e37a62 * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by
default as documented.
2009-02-13 09:05:42 +00:00
Corinna Vinschen 8cf4b71e1f * pathnames.sgml: Replace "binmode" with new "binary" output of mount. 2009-02-13 09:04:51 +00:00
Corinna Vinschen cc9054ccce * cygwin.din: Export wcstod and wcstof.
* include/cygwin/version.h: Bump API minor number.
2009-02-13 08:33:11 +00:00
Corinna Vinschen 545b4d2b57 * faq-using.xml: First cut on Emacs. 2009-02-12 15:30:03 +00:00
Corinna Vinschen 45105145e1 * faq-setup.xml: Revamp for Cygwin 1.7.
* faq-using.xml: Ditto.
2009-02-12 14:45:50 +00:00
Corinna Vinschen c2da1d6ebf * faq-programming.xml: Revamp (mostely) for Cygwin 1.7.
* faq-what.xml: Ditto.
2009-02-11 18:22:50 +00:00
Corinna Vinschen bb549dfed8 * Makefile.in (FAQ_SOURCES): Define FAQ sources.
(faq/faq.html): Depend on FAQ sources.
	(faq/faq-nochunks.html): Ditto.
	* faq-api.xml: Revamp for Cygwin 1.7.
	* faq-problems.xml: Remove.
	* faq-sections.xml: Accommodate removal of faq-problems.xml.
	* faq.xml: Ditto.
2009-02-11 16:44:13 +00:00
Corinna Vinschen 64d6e1d43e * syscalls.cc (open): Handle O_DIRECTORY flag.
* include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH.
	* include/cygwin/version.h: Bump API minor number.
2009-02-11 16:06:39 +00:00
Corinna Vinschen 29915d8ef2 * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format. Add
code to allow to read disk and CD/DVD devices in full length.  Explain
	why.
	(fhandler_dev_floppy::raw_read): Add current position to debug output.

	* include/sys/sched.h: New stub file to override newlib file with
	clashing definitions.
2009-02-09 18:28:53 +00:00
Corinna Vinschen 9a1d57ec13 * include/winioctl.h (FSCTL_ALLOW_EXTENDED_DASD_IO): Copy definition
from ddk/ntifs.h.
2009-02-09 18:22:08 +00:00
Keith Marshall ce6ef36015 MinGW-Feature-Request [2222263]: Make getopt() GNU / BSD compatibile. 2009-02-08 18:02:17 +00:00
Chris Sutcliffe f8471cd023 2009-02-06 Linton Miller <Linton.Miller@trivininc.com>
* include/wtsapi32.h (WTS_CURRENT_SESSION): Fix definition.
2009-02-07 04:34:27 +00:00
Corinna Vinschen 11acb173d9 * cygwin.din: Export wcstok.
* posix.sgml: Move wcstok from unimplemented to susv3.
	* include/cygwin/version.h: Bump API minor number.
2009-02-05 17:30:17 +00:00
Corinna Vinschen 8c71dc5878 * fhandler_proc.cc (proc_tab): Add entry for mounts symlink.
(format_proc_mounts): New function to implement mounts symlink.
	* fhandler_process.cc (process_tab): Add entry for mounts file.
	(format_process_mounts): New function to implement mounts file.
2009-02-04 16:40:04 +00:00
Corinna Vinschen 29e22d07d6 * security.cc (alloc_sd): Disable generating default permission entries
for directories.
2009-02-04 15:26:22 +00:00
Corinna Vinschen f01ffdd1e5 * pathnames.sgml: Rephrase the "Case sensitive filenames" chapter
slightly.
2009-02-03 09:03:18 +00:00
Corinna Vinschen 43616e5526 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number
evaluation for faked "." entry.

	* mount.cc (fs_info::update): Move setting of is_cdrom after checking
	for caseinsensitivity.  Recognize UDF in is_cdrom case and set
	caseinsensitive flag according to UDF brokenness determined by OS.
	Add comment to explain why.
	* mount.h (class fs_info): Add is_udf status flag.
	* path.cc (symlink_info::check): Add workaround for UDF bug in
	terms of casesensitivity on certain OSes.
	* wincap.h (wincaps::has_broken_udf): New element.
	(wincaps::has_broken_udf): New element
2009-01-29 20:32:08 +00:00
Corinna Vinschen bacd5877ba * cygcheck.cc (dump_sysinfo): Evaluate and print state of
obcaseinsensitive kernel flag.
2009-01-29 19:31:04 +00:00
Christopher Faylor 1ae0cd1335 * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on EINTR or
real error.
(fhandler_base::write_overlapped): Assume that bytes_written will contain
proper error value.
* pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since signals
are handled by pipe functions now.
2009-01-27 05:21:08 +00:00
Corinna Vinschen 555a908c17 * shared.cc (shared_name): New function for WCHAR names.
(open_shared): Take name parameter as WCHAR.  Accommodate throughout.
	* shared_info.h ((CURR_SHARED_MAGIC): Redefine.
	(shared_name): Add declaration for function taking a WCHAR name.
	(open_shared): Change declaration according to above change.
	* pinfo.cc (pinfo::init) : Accommodate above change.
2009-01-26 13:42:37 +00:00
Corinna Vinschen b89fb103f2 * grp.cc (getgrgid_r): Simplify code by using stpcpy.
(getgrnam_r): Ditto.
	* passwd.cc (getpwuid_r32): Simplify code by using stpcpy.
	(getpwnam_r): Ditto.
2009-01-26 13:20:46 +00:00
Corinna Vinschen 93e884989a * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT
flag.
2009-01-26 13:03:49 +00:00
Corinna Vinschen 01d2675aea * mount.cc (mount_info::from_fstab): Open fstab file with
FILE_OPEN_FOR_BACKUP_INTENT flag.
2009-01-24 16:30:09 +00:00
Corinna Vinschen 7d01164900 * pathnames.sgml: Add requirement for world-readability of special
/etc files.
2009-01-24 15:31:18 +00:00
Corinna Vinschen 998f82685e * pathnames.sgml: Add section about accessing /etc files. 2009-01-24 12:26:10 +00:00
Corinna Vinschen dcf6bd1e04 * smallprint.cc (__small_vsprintf): Use already available buffer tmp
in wfillin case.
2009-01-23 13:59:13 +00:00
Christopher Faylor 9895091d0d * select.cc (peek_serial): Add hack to allow proper operation with com0com
driver.
2009-01-22 16:00:58 +00:00
Corinna Vinschen 7ffaa17c80 ChangeLog:
* configure.in: Remove --enable-server option.  Allways add the
	cygserver directory to $SUBDIRS.
	* configure: Regenerate.

cygwin/ChangeLog:

	Remove USE_SERVER define.  Accommodate throughout.
	* configure.in: Remove --enable-server option.
	* configure: Regenerate.
	* environ.cc: Remove CYGWIN=server setting.

cygserver/ChangeLog:

	* client.cc (allow_server): Remove variable.
	(client_request_get_version::client_request_get_version): Drop checking
	allow_server.

utils/ChangeLog:

	* passwd.c: Remove CYGWIN=server requirement from usage text.

doc/ChangeLog:

	* cygserver.sgml: Remove the "How to use the Cygserver services"
	section.
	* cygwinenv.sgml: Move "(no)server" to the removed options section.
	* faq-programming.xml: Remove CYGWIN=server requirement for running
	the Cygwin testsuite.
	* ntsec.sgml: Ditto for using `passwd -R'.
2009-01-21 17:14:39 +00:00
Corinna Vinschen d9ad7a9c4e * fhandler_procnet.cc: Reorganize global procnet content data into a
new struct virt_tab_t.  Accommodate throughout.

	* fhandler.h: Fix copyright dates.
	* fhandler_process.cc: Ditto.
	* fhandler_registry.cc: Ditto.
2009-01-20 18:04:32 +00:00
Corinna Vinschen 38f50ae4d5 * devices.h (FH_PROCESSFD): New device type.
* dtable.cc (build_fh_pc): Add case for FH_PROCESSFD.
	* fhandler.h (class fhandler_virtual): Drop bufalloc member.
	* fhandler_virtual.h: New header.
	* fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor
	of types virt_type_t and virt_tab_t from fhandler_virtual.h.
	Change prototypes of format_XXX functions accordingly.
	(proc_tab): Drop size member info.
	(fhandler_proc::fill_filebuf): Don't allocate filebuf here.  Allocate
	it in the format_XXX functions.
	* fhandler_process.cc: Reorganize global process content data into a
	new struct virt_tab_t.  Accommodate throughout.
	(format_process_winexename): New function.
	(format_process_winpid): New function.
	(format_process_exename): New function.
	(format_process_root): New function.
	(format_process_cwd): New function.
	(format_process_cmdline): New function.
	(format_process_ppid): New function.
	(format_process_uid): New function.
	(format_process_pgid): New function.
	(format_process_sid): New function.
	(format_process_gid): New function.
	(format_process_ctty): New function.
	(format_process_fd): New function.
	* fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use
	bufalloc.
	* fhandler_registry.cc (fhandler_registry::fill_filebuf): Define
	bufalloc locally.
	* fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop
	initialization of bufalloc.
	(fhandler_virtual::dup): Drop copying bufalloc.
2009-01-20 17:22:11 +00:00
Corinna Vinschen f8190b5705 * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.
* thread.cc (pthread_rwlock::rdlock): If a thread already owns a
	read lock, just count the number of locks for it, per SUSv4.
	(pthread_rwlock::tryrdlock): Ditto.
	(pthread_rwlock::unlock): If a thread has more than one concurrent
	read locks, just count down.
2009-01-20 12:40:31 +00:00
Corinna Vinschen 3787b37ef2 * autoload.cc (WSAIoctl): Reintroduce.
(WSASendMsg): Define.
	* fhandler.h (class fhandler_socket): Change definition of recv_internal
	and send_internal to take WSAMSG pointer as parameter.
	* fhandler_socket.cc (WSAID_WSARECVMSG): Define.
	(LPFN_WSARECVMSG): Define.
	(WSASendMsg): Declare.
	(get_ext_funcptr): New function to fetch address of WSARecvMsg.
	(fhandler_socket::recv_internal): Take just a LPWSAMSG parameter.
	Change code accordingly.  If control information is requested,
	fetch address of WSARecvMsg and use that instead of WSARecvFrom.
	(fhandler_socket::recvfrom): Change return type to ssize_t as
	declared in fhandler.h.  Accommodate changes to recv_internal.
	(fhandler_socket::recvmsg): Ditto.  Make sure that control information
	is only requested if system, address family, and socket type support it.
	(fhandler_socket::send_internal): Take just a LPWSAMSG parameter
	and the flags.  Change code accordingly.  If control information is
	provided, use WSASendMsg instead of WSASendTo.
	(fhandler_socket::sendto): Drop useless comment.  Accommodate changes
	to send_internal.
	(fhandler_socket::sendmsg): Ditto.  Make sure that control information
	is only provided if system, address family, and socket type support it.
	* wincap.h (wincaps::has_recvmsg): New element.
	(wincaps::has_sendmsg): New element
	* wincap.cc: Implement above elements throughout.
	* include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment
	of type struct cmsghdr.
2009-01-20 11:16:59 +00:00
Corinna Vinschen ddc0c0d3f5 * include/winbase.h (enum _DEP_SYSTEM_POLICY_TYPE): Fix version guard. 2009-01-19 15:36:14 +00:00
Andreas Schwab b50494eedc Remove conflict marker. 2009-01-19 09:42:13 +00:00
Corinna Vinschen 895d15b81e * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond
EOF is required.
2009-01-17 17:20:37 +00:00
Chris Sutcliffe 96ed5e2441 2009-01-11 Henry Nestler <henry@bigfoot.de>
* lib/ddk/ntoskrnl.def: Enable ZwQueryEaFile, ZwSetEaFile, NtQueryEaFile,
        NtSetEaFile.
2009-01-17 17:00:07 +00:00
Corinna Vinschen 2ac273a946 * Makefile.in: Fix copyright date.
* cygcheck.cc (scan_registry): Take additional parameter and add code
	to avoid recursion in Wow6432Node subkey.  Rename variable cygnus to
	cygwin.  Scan for "Cygwin" instead of for "cygnus" substring.
	(dump_sysinfo): Drop unused calls to scan_registry.  Drop scanning
	HKEY_CURRENT_CONFIG.
2009-01-17 11:59:16 +00:00
Corinna Vinschen 40255b64d4 * fhandler_proc.cc: Reorganize global proc content data into a new
struct proc_tab_t.  Accommodate throughout.
	(format_proc_version): New function.
	(format_proc_loadavg): New function.
	(format_proc_self): New function.

	* resource.cc (getrlimit): Return correct rlim_max value for
	RLIMIT_NOFILE.
2009-01-17 10:16:42 +00:00
Corinna Vinschen 165cb24581 * Fix copyright dates. 2009-01-16 12:17:28 +00:00
Corinna Vinschen ab30b9e352 * cygcheck.cc (dump_sysinfo): Raise size of osname. Add Windows 7
and Windows 2008 R2 as recognized OSes.  Update products array to
	the latest documented list.
2009-01-16 12:10:02 +00:00
Corinna Vinschen 8c3efc4901 * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt
to avoid false ambiguities.
2009-01-13 09:58:43 +00:00
Corinna Vinschen 8a0f3bbf2d * syscalls.cc (enum bin_status): New type.
(try_to_bin): Return bin_status.  Rename win32_path to pc.  Rename h
	to fh.  Rename fh to tmp_fh.  Add code to set delete dispostion and
	more code to replace file moved to bin by another, temporary file.
	Add comments to explain why.
	(unlink_nt): Replace move_to_bin with bin_stat.  Only set bin_stat
	to move_to_bin for non-remote files.  As a last resort, call try_to_bin
	if setting delete-on-close failed.  Only re-set R/O DOS attribute
	and only close handle if it's still valid.
2009-01-12 15:51:23 +00:00
Corinna Vinschen b98c66ee2c * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.
* path.cc (path_conv::check): Set to and check for ENOENT instead of
	ENOSHARE.

	* path.cc (symlink_info::check): Fix Samba 3.2.x comment.
2009-01-11 16:13:11 +00:00
Chris Sutcliffe 45cda16a7f 2009-01-10 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/_mingw.h: Increment version to 3.15.2.
2009-01-10 18:42:32 +00:00
Corinna Vinschen 54a83cc65a * mount.cc (mount_info::from_fstab_line): Always convert drive
letter in native path to uppercase.
	* path.cc (normalize_win32_path): Ditto.
	(path_prefix_p): Revert previous patch.

	* path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
	return code to circumvent weird behaviour of Samba 3.2.x shares.
2009-01-09 16:20:26 +00:00
Christopher Faylor d95d8c5393 * include/sys/cygwin.h (CW_SETERRNO): Define.
* external.cc (CW_SETERRNO): Implement.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to reflect the
above change.
* path.cc (path_prefix_p): Treat X: as equivalent to x:.
* mkglobals_h: Remove unneeded #define.
* spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
2009-01-09 05:18:02 +00:00
Christopher Faylor 086dc27fec * ldd.cc: New file. First stab at implementing ldd-like functionality for
Cygwin.
* Makefile.in (CYGWIN_BINS): Add ldd.
(ldd.exe): Use -lpsapi.
2009-01-09 05:11:57 +00:00
Corinna Vinschen aa9f366548 * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.
(fts_ufslinks): Fix using wrong structure member in Cygwin-specific
	code.
2009-01-08 21:12:46 +00:00
Corinna Vinschen f4ad04049f * ntdll.h: Reorder NT status flags. Fix a case difference. Add
STATUS_CANNOT_DELETE flag.
	* syscalls.cc (unlink_nt): Change initial NtOpenFile to request
	FILE_SHARE_DELETE sharing mode.  Change comment accordingly.
	If setting delete disposition failed with STATUS_CANNOT_DELETE, try
	to delete using delete-on-close.  Explain why.
	Rearrange setting R/O DOS attribute after trying to delete.  Simplify
	comment.
2009-01-07 18:18:23 +00:00
Corinna Vinschen 3bee7767a8 * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if
original file has .exe as well.
	* path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit
	apps as binaries.
2009-01-07 14:12:40 +00:00
Corinna Vinschen 49a0cd95c0 * include/winbase.h (SCS_64BIT_BINARY): Define. 2009-01-07 14:11:57 +00:00
Pierre Humblet 952801c27e * cygcheck.cc (dump_sysinfo_services): Quote the path for popen. 2009-01-06 04:11:23 +00:00
Keith Marshall f1170e02f2 Fix MinGW-Bug [2445962]; (reported by Keishi Suenaga). 2009-01-04 17:35:36 +00:00
Christopher Faylor 952783ba77 * Makefile.in (CFLAGS): Look in cygwin's build directory for header files. 2009-01-03 05:37:34 +00:00
Christopher Faylor 8bb2521761 correct 2009-01-03 05:13:35 +00:00
Christopher Faylor 66a83f3eac Remove unneeded header files from source files throughout. Update copyrights
where appropriate.
* globals.cc: New file for generic global variables.
* mkglobals_h: New file to generate globals.h.
* mkstatic: New Script used to build a (currently non-working) static
libcygwin_s.a.
* Makefile.in: Add unused rule to build a non-working libcygwin_s.a.
(DLL_OFILES): Add globals.o.  Make all objects rely on globals.h.
(globals.h): New target.  Generate globals.h.
* cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE operator
is allowed in _cygtls.
* dcrt0.cc: Move most globals to globals.cc.
* init.cc: Ditto.
* environ.cc (strip_title_path): Remove now-unneeded extern.
* fhandler_serial.cc (fhandler_serial::open): Ditto.
* pinfo.cc: Ditto.
(commune_process): Ditto.
* shared.cc: Ditto.
* glob.cc: Ditto.
* strace.cc: Ditto.
* exceptions.cc: Define CYGTLS_HANDLE before including winsup.h.
* path.cc (stat_suffixes): Move here.
* security.h: Add forward class path_conv declaration.
* smallprint.cc (__small_vsprintf): Make a true c++ function.
(__small_sprintf): Ditto.
(small_printf): Ditto.
(console_printf): Ditto.
(__small_vswprintf): Ditto.
(__small_swprintf): Ditto.
* spawn.cc (spawn_guts): Remove _stdcall decoration in favor of regparm.
(hExeced): Move to globals.cc
* strfuncs.cc (current_codepage): Ditto.
(active_codepage): Ditto.
* sync.cc (lock_process::locker): Move here from dcrt0.cc.
* syscalls.cc (stat_suffixes): Move to path.cc.
* tty.cc (tty::create_master): Uncapitalize fatal warning for consistency.
* winsup.h: Include globals.h to declare most of the grab bag list of globals
which were previously defined here.
* mount.h: Move USER_* defines back to shared_info.h.
* speclib: Force temporary directory cleanup.
2009-01-03 05:12:22 +00:00
Christopher Faylor 258776ce91 Year-end rollover. 2009-01-03 02:27:46 +00:00
Christopher Faylor 944c817a60 * speclib: Rewrite completely in perl. Avoid multiple nm calls. 2009-01-02 06:57:14 +00:00
Christopher Faylor feb2075569 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 191. 2008-12-31 21:47:45 +00:00
Christopher Faylor ecd5bc4ea8 * glob_pattern_p.cc: New file.
* Makefile.in (DLL_OFILES): Add glob_pattern_p.o.
* glob.h: Add declaration for glob_pattern_p.
* pinfo.cc (pinfo::thisproc): Remove __stdcall attribute.
2008-12-31 21:33:34 +00:00
Keith Marshall 762cf3ee22 Correct mishandling of invalid characters in printf() format specs. 2008-12-31 15:34:09 +00:00
Christopher Faylor 0c94c057a4 * include/bits/wordsize.h: New linux-compatibility header. 2008-12-31 04:12:44 +00:00
Pierre Humblet 0b451bb524 * cygcheck.cc (pretty_id): Quote the path for popen.
(dump_sysinfo_services): Ditto.
2008-12-31 01:44:36 +00:00
Christopher Faylor b837af5478 * exceptions.cc (try_to_debug): Avoid creating a huge buffer on the stack. 2008-12-30 18:18:09 +00:00
Christopher Faylor 5829832825 * mount.cc: Change comment.
(smb_extended_info): Move here from path.cc.
(fs_info::update): Ditto.
(mount_info::create_root_entry): Delay conversion to slashes and use passed in
buffer to figure out fs type.
* path.cc (smb_extended_info): Move.
(fs_info::update): Ditto.
* mount.h: New file.  Move mount information here.
* path.h: (fs_info::update): Move.
* shared_info.h (mount_item): Ditto.
2008-12-25 15:55:31 +00:00
Christopher Faylor 58402a3f63 * path.cc (symlink_info::check_shortcut): Ensure that symlink handle is closed
on successful return.
2008-12-24 16:34:38 +00:00
Christopher Faylor 9a8597c13a * fhandler.h (fhandler_base_setup_overlapped): Add new argument.
(fhandler_base::get_overlapped_buffer): Declare new function.
(fhandler_base::set_overlapped): Ditto.
(fhandler_pipe::overlapped): New variable.
(fhandler_pipe::get_overlapped): Rework to return contents of overlapped
variable.
(fhandler_pipe::set_overlapped): Set overlapped variable based on argument.
(fhandler_fifo::get_overlapped_buffer): Return pointer to io_status.
* fhandler.cc (handler_base::setup_overlapped): Set to overlapped pointer to
NULL if new doit parameter is false.  Otherwise set up overlapped event as
usual.
(fhandler_base::wait_overlapped): Return inres if this isn't an overlapped
operation.
(fhandler_base::read_overlapped): Remove inappropriate asserts.
* pipe.cc (fhandler_pipe::fhandler_pipe): Zero overlapped element.
(struct pipesync): Delete.
(getov_result): Ditto.
(pipe_handler): Ditto.
(pipesync::pipesync): Ditto.
(fhandler_pipe::init): Don't set up pipesync thread.  Just pass opened_properly
flag along to overlapped setup.
2008-12-23 18:22:33 +00:00
Christopher Faylor 6ef31d2336 * pipe.cc (getov_result): Minor cleanup. 2008-12-22 19:18:00 +00:00
Christopher Faylor 91ad1942a2 * pipe.cc (getov_result): Add parameters to facilitate better EOF checking.
(pipe_handler): Pass extra arguments to getov_result.
2008-12-21 01:54:32 +00:00
Christopher Faylor 0cf888799b * fhandler.cc (fhandler_base::wait_overlapped): Reorganize to eliminate gotos
and to hopefully eliminate one race when a signal is detected or there is a
WFMO error.
2008-12-20 19:20:00 +00:00
Christopher Faylor 9ac421686a * pinfo.h (pinfo::thisproc): Declare. Rename from set_myself.
* pinfo.cc (pinfo::thisproc): Define.  Rename from set_myself.  Set procinfo to
NULL to avoid confusing subsequent init.
(pinfo_init): Accommodate set_myself -> pinfo::thisproc rename.
* dcrt0.cc (child_info_fork::handle_fork): Ditto.
(child_info_spawn::handle_spawn): Ditto.
2008-12-20 17:32:31 +00:00
Corinna Vinschen e9982f2a2b * pwdgrp.h (pwdgrp::refresh): Fix indentation.
* uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated
	read.  Drop local variable off.
2008-12-20 09:35:18 +00:00
Chris Sutcliffe 99c7be03b2 2008-12-16 Danny Smith <dannysmith@users.sourceforge.net>
* msvcrt.def.in (___lc_codepage_func, ___lc_collate_cp_func,
        ___lc_handle_func, ___mb_cur_max_func, ___setlc_active_func,
        ___unguarded_readlc_active_add_func, __crtCompareStringW,
        __crtGetStringTypeW, __crtLCMapStringW, __pctype_func,
        __pwctype_func, __iob_func, __uncaught_exception, __wcserror,
        __CxxDetectRethrow, __CxxExceptionFilter, __CxxQueryExceptionSize,
        __CxxRegisterExceptionObject, __CxxUnregisterExceptionObject,
        __CxxCallUnwindDtor, __DestructExceptionObject, _aligned_free,
        _aligned_malloc, _aligned_offset_malloc, _aligned_offset_realloc,
        _aligned_realloc, _cgetws, _cputws, _cwprintf, _cwscanf, _getwch,
        _getwche, _putwch, _resetstkoflw, _scprintf, _scwprintf,
        _set_SSE2_enable, _snscanf, _snwscanf, _strtoi64, _strtoui64,
        _ungetwch, _vscprintf, _vscwprintf, _wcserror, _wcstoi64,
        _wcstoui64, _wctype, _wtof, _get_heap_handle): Always export.
2008-12-20 03:55:37 +00:00
Christopher Faylor 1af6bb97a4 * pinfo.cc (pinfo_basic): New class.
(pinfo_basic::pinfo_basic): Define constructor for new class.
(myself): Initialize from myself_initial.
(set_myself): Set pid and progname from already myself_initial.
* strace.cc (strace::strace): Split apart strace::hello.  Send notification to
strace as early as possible.
(strace::hello): Just send clause which describes the current process.  This
can now be preceded by early initialization strace output.
* include/sys/strace.h (strace::strace): Declare new constructor.
2008-12-19 19:09:51 +00:00
Corinna Vinschen 887eb76fca * fhandler_registry.cc (perf_data_files): New table.
(PERF_DATA_FILE_COUNT): New constant.
	(fhandler_registry::exists): Add check for HKEY_PERFORMANCE_DATA
	value names.
	(fhandler_registry::fstat): For HKEY_PERFORMANCE_DATA, return
	default values only.
	(fhandler_registry::readdir): For HKEY_PERFORMANCE_DATA, list
	names from perf_data_files only.
	(fhandler_registry::fill_filebuf): Use larger buffer to speed up
	access to HKEY_PERFORMANCE_DATA values.  Remove check for possible
	subkey.  Add RegCloseKey ().
	(open_key): Replace goto by break, remove label.  Do not try to
	open subkey of HKEY_PERFORMANCE_DATA.  Add missing RegCloseKey ()
	after open subkey error.
2008-12-19 14:31:40 +00:00
Corinna Vinschen 292c99741d * path.cc (path_conv::check): Handle incoming DOS paths non-POSIXy,
always case-insensitive, always ignoring ACLs.
2008-12-19 12:15:33 +00:00
Corinna Vinschen a4fc1198a4 * fhandler_disk_file.cc: Set 4th parameter of NtQueryDirectoryFile to
NULL throughout.
	(fhandler_disk_file::facl): Fix a condition so that fstat_by_handle
	is actually used.
	(fhandler_disk_file::readdir): Don't print debug message on a simple
	STATUS_NO_MORE_FILES status code.
2008-12-18 18:54:25 +00:00
Corinna Vinschen dc7dfa3a82 * path.cc (symlin_info::check): Set 4th parameter of
NtQueryDirectoryFile to NULL instead of 0 since it's a pointer.
	Simplify label and break from loop handling in symlink evaluation
	conditional expression.  Drop a now useless break statement.  Fix
	behaviour when searching for `foo' and then finding a `foo.lnk'
	which is no shortcut.
2008-12-18 15:37:19 +00:00
Corinna Vinschen 5c86c94db7 * utils.sgml: Fix typo in passwd screen text. 2008-12-16 10:56:33 +00:00
Corinna Vinschen 2cc8b9e014 * fhandler_registry.cc (DEFAULT_VALUE_NAME): Remove constant.
(encode_regname): Encode empty (default) name to "@".
	Encode "@" to "%40".  Change error return to -1.
	(decode_regname): Decode "@" to empty name.  Decode "%40" to "@".
	(fhandler_registry::exists): Skip check for keys if name is empty.
	Remove check for DEFAULT_VALUE_NAME, now handled by decode_regname ().
	(fhandler_registry::readdir): Remove check for empty name, now
	handled by encode_regname ().
	(fhandler_registry::open): Remove check for DEFAULT_VALUE_NAME.
	(fhandler_registry::open_key): Fail with ENOENT if key name is empty.
2008-12-16 09:20:05 +00:00
Corinna Vinschen 1348f65bb9 * syscalls.cc (gen_full_path_at): Use isabspath instead of isdirsep
to recognize absolute path.
2008-12-15 20:53:18 +00:00
Corinna Vinschen 658fe9ec36 * sec_auth.cc (open_local_policy): Set lsa handle to
INVALID_HANDLE_VALUE when LsaOpenPolicy fails.  Explain why.
2008-12-15 20:25:44 +00:00
Corinna Vinschen 63a89e8464 * setlsapwd.cc (setlsapwd): Simplify code. Only try to call cygserver
if opening local policy fails.  Don't treat removing non-existant
	private data as error.
2008-12-15 18:07:35 +00:00
Corinna Vinschen faded04e6c * setpwd.cc (client_request_setpwd::serve): Don't treat removing
non-existant private data as error.
2008-12-15 18:05:50 +00:00
Corinna Vinschen 85fd77a145 * setlsapwd.cc (setlsapwd): Explicitely erase password buffer content
after usage.
2008-12-15 17:39:39 +00:00
Corinna Vinschen d08afb78d1 * setpwd.cc (client_request_setpwd::serve): Explicitely erase password
buffer content after usage.
2008-12-15 17:39:21 +00:00
Corinna Vinschen 8d12bd32cd * passwd.c (main): Put how to delete the registry password on its own
line in passwd -R output.
2008-12-15 17:33:08 +00:00
Corinna Vinschen 6452986601 * fhandler_registry.cc (fhandler_registry::exists): Handle EACCES.
(fhandler_registry::open): Ditto.
2008-12-15 12:51:46 +00:00
Corinna Vinschen f8a41da921 * cygwin.din: Export fgetwc, fgetws, fputwc, fputws, fwide, getwc,
getwchar, putwc, putwchar, ungetwc.
	* posix.sgml: Move above functions (add missing) into "implemented
	SUSv3" section.
	* include/cygwin/version.h: Bump api minor number.
2008-12-15 12:40:29 +00:00
Corinna Vinschen 305b19d738 * fhandler.h (class fhandler_registry): Declare dup method.
* fhandler_registry.cc (fhandler_registry::exists): Fix missing
	parenthesis.
	(fhandler_registry::dup): New method.
2008-12-15 12:33:27 +00:00
Corinna Vinschen 12406f25fb * gcc.sgml: Use 'bash$' as Cygwin prompt throughout.
* gdb.sgml: Ditto.
	* pathnames.sgml: Ditto.  Fix the @ expansion example.
2008-12-15 09:37:50 +00:00
Christopher Faylor ec4eb70c33 * fhandler_disk_file.cc (readdir_get_ino): Don't complain about MS-DOS paths
since the function could be fed one by an internal call.
2008-12-14 06:01:46 +00:00
Christopher Faylor 2b0c1c0d44 * utils.sgml: Convert some backslashes to slashes. 2008-12-13 22:43:54 +00:00
Christopher Faylor 693862058a * pathnames.sgml: Convert some backslashes to slashes. 2008-12-13 21:14:44 +00:00
Christopher Faylor 9fe25af7a6 * cygheap.cc (cygheap_user::~cygheap_user): Remove unneeded if 0'ed code.
* fhandler_registry.cc (fhandler_registry::exists): Recode goto as if/else to
avoid a gcc4 compiler warning.
(fhandler_registry::open): Ditto.  Use one goto rather than two.
* gentls_offsets: Fix compiler warning in generated output.
* tlsoffsets.h: Regenerate.
* mount.cc (fillout_mntent): slashify native paths returned via getmntent.
2008-12-13 21:05:31 +00:00
Corinna Vinschen baaa8b9140 * pathnames.sgml: New section for /proc/registry. Document registry
name encoding.
2008-12-12 15:14:06 +00:00
Corinna Vinschen 373e8a118b * resolv.h: #include <netinet/in.h> for sockaddr_in typedef. 2008-12-09 16:09:46 +00:00
Danny Smith cf2f4a6aef Committed as obvious.
2008-12-08  Dmitry G. Gorbachev  <d.g.gorbachev@gmail.com>

	* cpu_features.c (__cpu_features_init): Remove erroneous ';'.
2008-12-09 02:42:21 +00:00
Corinna Vinschen d27ebea923 * fhandler_registry.cc (encode_regname): Add Parameter add_val.
Append "%val" if add_val is set.
	(decode_regname): Remove trailing "%val". Change returncode accordingly.
	(__DIR_hash): New class.
	(d_hash): New macro.
	(key_exists): New function.
	(fhandler_registry::exists): Remove encode of registry name before path
	compare, decode file part of path instead.  Skip checks for keys if
	trailing "%val" detected.
	(fhandler_registry::fstat): Change check of return value of
	decode_regname ().
	(fhandler_registry::readdir): Allocate __DIR_hash.  Record key names in
	hash table. Append "%val" if key with same name exists. Fix error
	handling of encode_regname ().  Set dirent.d_type.
	(fhandler_registry::closedir): Delete __DIR_hash.
	(fhandler_registry::open): Don't open key if trailing "%val" detected
	by decode_regname ().
	(open_key): Ditto.
2008-12-08 11:45:18 +00:00
Chris Sutcliffe 4864a38c34 2008-12-05 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/w32api.h: Increment version to 3.13.
        * Makefile.in: Ditto.
2008-12-06 02:25:28 +00:00
Chris Sutcliffe 8310aa78b2 2008-12-05 Chris Sutcliffe <ir0nh34d@users.sf.net>
* lib/glut.def: remove.
        * lib/glut32.def: ditto.
2008-12-06 02:19:57 +00:00
Corinna Vinschen edff4e3d94 * ntsec.sgml: Fix typo. 2008-12-04 10:07:54 +00:00
Corinna Vinschen e1984134be * libc/minires.c (open_sock): Set non blocking and close on exec.
(res_ninit): Set id pseudo-randomly.
	(res_nsend): Do not set close on exec. Initialize server from id.
	Flush socket. Tighten rules for answer acceptance.
	(res_nmkquery): Update id using current data.
2008-12-03 16:37:53 +00:00
Corinna Vinschen 5875a5e7d5 * ntsec.sgml: Revamp parts of the doc for clearness. 2008-12-03 11:47:27 +00:00
Corinna Vinschen f5e7a77023 * ntsec.sgml: Fix a few typos. 2008-12-02 19:29:37 +00:00