NULL before closing.
* spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely
in case of failing CloseProcess.
* fhandler.cc (fhandler_base::open_): Return EISDIR when trying to
create a directory.
* path.cc (path_conv::check): If input path had a trailing dir
separator, tack it on to the native path if directory doesn't exist.
(cwcsdup1): New function.
* cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR.
(cwcsdup): Declare.
(cwcsdup1): Declare.
* registry.cc (get_registry_hive_path): Use WCHAR instead of char
throughout.
(load_registry_hive): Ditto.
* registry.h (get_registry_hive_path): Change declaration accordingly.
(load_registry_hive): Ditto.
* sec_helper.cc (cygpsid::string): New method returning PWCHAR.
* security.h (cygpsid::string): Declare.
* syscalls.cc (seteuid32): Convert local name var to WCHAR.
* uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers
to WCHAR. Call sys_wcstombs_alloc to generate puserprof buffer.
* winsup.h: Fix comment.
(NT_MAX_PATH): New definition for maximum internal path length.
Use throughout where appropriate.
* include/limits.h (PATH_MAX): Set to 4096 as on Linux.
(cwdstuff::get_handle): New method.
* path.cc (cwdstuff::set): When doit is true, always try to get
directory handle. Fail if duplicating handle fails. Store handle
in dir. Fix potential SEGV when setting drive_length.
* path.cc (struct smb_extended_info): Define.
(fs_info::update): Request object id info to get Samba information.
Set flags according to new implementation.
* path.h (struct fs_info): Add samba_version to status_flags.
Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG.
GetModuleFileNameExA.
* fhandler_process.cc (format_process_maps): Change modname type to
WCHAR. Set buffer sizes to PATH_MAX. Call GetModuleFileNameExW
instead of GetModuleFileNameExA. Call mount_info::conv_to_posix_path
instead of cygwin_conv_to_full_posix_path. Set posix_modname to
modname if that call fails.
(format_process_stat): Set cmd buffer size to NAME_MAX + 1. Simplify
setting cmd to process name.
(format_process_status): Ditto.
* path.cc (mount_info::conv_to_posix_path): Call sys_wcstombs
correctly.
(get_cygdrive_prefixes): Remove.
(cygwin_internal): Call get_cygdrive_info with NULL flag parameters
instead of get_cygdrive_prefixes.
* path.cc (mount_info::get_cygdrive_info): Allow NULL flag parameters.
get_initial, and fixup_after_exec declarations.
Convert win32 to UNICODE_STRING.
(cwdstuff::get_drive): Convert win32 path in current codepage.
(cwdstuff::set): Take native NT path.
* ntdll.h (struct _TEB): Typedef.
* path.cc (mount_info::conv_to_posix_path): Add variant taking
wide char DOS paths.
(symlink_info::posixify): Simplify concatenating cwd and relative path.
(hash_path_name): Drop special relative path handling.
(chdir): Drop special "drive only" handling. Call cwdstuff::set with
native path.
(cwdstuff::get_hash): Remove.
(windows_system_directory): Remove.
(_upp): Remove.
(get_user_proc_parms): Make inline. Get PEB pointer by calling
NtCurrentTeb.
(cwdstuff::init): Simplify.
(cwdstuff::set): Rework to handle incoming native NT path. Workaround
a Vista problem with CWD handle in the user process parameter block.
(cwdstuff::get): Simplify locking. Accommodate type change of win32.
* shared_info.h (mount_info): Add declaration for new conv_to_posix_path
method.
* strfuncs.cc (sys_wcstombs): Return correct length of created
multi-byte string.
* path.cc (symlink_info::check_shortcut): Use NT function to get file
size. Reintroduce checking file size before reading it. Eliminiate
close_it label.
(symlink_info::check_sysfile): Check for EOF condition.
be able to keep SYMLINK_MAX sized strings.
(symlink_worker): Rework for long path names. When writing windows
shortcuts, store pathname additionally "hidden" after the actual
shortcut data to workaround size limitations of the description field.
(symlink_info::check_shortcut): Drop file name parameter. Drop max
file size check. Use NT functions. Use appended full path if
available, description otherwise. Check symlink string length for
not exceeding SYMLINK_MAX. Don't close file here.
(symlink_info::check_sysfile): Drop file name parameter. Use NT
functions. Check symlink string length for not exceeding SYMLINK_MAX.
Don't close file here.
(symlink_info::check_reparse_point): Drop file name parameter. Drop
useless length checks. Allow SYMLINK_MAX length symlink strings.
Don't close file here.
(symlink_info::posixify): Allow SYMLINK_MAX length symlink strings.
(symlink_info::check): Turn around checking for symlink file attributes.
Use NT functions. Close symlink file here.
* include/limits.h (PATH_MAX): Define as 32760. Change comment.
(SYMLINK_MAX): Define as PATH_MAX - 1.
(NtQueryAttributesFile): Move to maintain alphabetical order of
declarations. Add comment to note that timestamp information returned
by NtQueryAttributesFile is unreliable.
* path.h (etc::changed_h): Move here.
(etc::fn): Change type to OBJECT_ATTRIBUTES.
(etc::last_modified): Change type to LARGE_INTEGER.
(etc::init): Take PUNICODE_STRING as second argument.
* path.cc: Accomodate above changes.
(etc::test_file_change): Use NT native functions.
(etc::dir_changed): Ditto.
* uinfo.cc (pwdgrp::load): Call etc::init with NT native path.
(RtlUpcaseUnicodeChar): Declare.
* path.cc (hash_path_name): Split into three functions, taking
the path as char *, PWCSTR, or PUNICODE_STRING. Move implementation
into PUNICODE_STRING-based function. Drop old drive-relative path
consideration.
* winsup.h (iswdirsep): Like isdirsep but for WCHARs.
(isabspath_u): Like isabspath, for PUNICODE_STRINGs.
(iswabspath): Like isabspath, for PWCHARs.
(hash_path_name): Add new declarations.
have no native NT path representation for simplified debug output.
* syscalls.cc: Convert debug output to print native NT path.
(unlink): Drop redundant debug output.
* fhandler_disk_file.cc (fhandler_disk_file::link): Drop extern
declaration of stat_suffixes. Use NT native path in debug output.
(fhandler_base::utimes_fs): Simplify closeit case. Use close_fs
to close newly opened file handle.
(fhandler_base::open_fs): Use NT native path in debug output.
* path.cc: Throughout drop extern declaration of stat_suffixes.
* path.h (stat_suffixes): Declare.
* sec_acl.cc (acl_worker): Drop extern declaration of stat_suffixes.
* times.cc (utimes_worker): Take path_conv as parameter instead of
single-byte pathnam, drop nofollow argument, accommodate throughout.
Compare UNICODE paths when enumerating file descriptors. Fix
formatting. Use NT native path in debug output.
for binary in case of .exe files.
* ntdll.h (RtlPrefixUnicodeString): Declare.
* path.cc (path_conv::is_binary): New method.
* path.h (path_conv::is_binary): Declare.
* syscalls.cc (rename_append_suffix): New static helper function for
rename.
(rename): Rewrite. New suffix tests. Use native NT functions.
readdir_get_ino.
* fhandler.h (fhandler_disk_file::readdir_helper): Switch file name
parameter to PUNICODE_STRING.
* fhandler_disk_file.cc: Drop including ntdef.h.
(class __DIR_mounts): Store mount points in UNICODE. Additionally
store cygdrive prefix in unicode here. Change methods accordingly.
(__DIR_mounts::eval_ino): Call new stat_worker instead of lstat64.
(__DIR_mounts::~__DIR_mounts): New destructor to free UNICODE buffers.
(path_conv::ndisk_links): Rewrite using native NT functions.
(fhandler_base::fstat_by_handle): Use NAME_MAX instead of CYG_MAX_PATH.
Always set pfvi->VolumeSerialNumber to non-0. Remove last resort
code.
(fhandler_base::fstat_by_name): Rewrite using native NT functions.
(fhandler_base::fstat_fs): Always call fstat_by_name if fstat_by_handle
fails.
(fhandler_base::fstat_helper): Rely on dwVolumeSerialNumber.
(fhandler_disk_file::facl): Call fstat_by_name if fstat_by_handle fails.
(DIR_BUF_SIZE): Define using NAME_MAX instead of CYG_MAX_PATH.
(__DIR_cache): Remove __name.
(d_dirname): Remove.
(fhandler_disk_file::opendir): Drop pathname length check.
Remove outdated comment. Use get_name method instead of accessing
pc.normalized_path directly.
(readdir_get_ino): Drop unused dir parameter. Accomodate throughout.
Allocate fname dynamically. Call new stat_worker instead of lstat64.
Call NtOpenFile instead of CreateFile. Call NtClose instead of
CloseHandle.
(fhandler_disk_file::readdir_helper): Use native NT functions.
Check for volume mount points and use correct inode number.
(fhandler_disk_file::readdir): Simplify slightly.
Use get_name instead of pc.normalized_path.
(fhandler_disk_file::rewinddir): Use RtlInitUnicodeString.
(fhandler_cygdrive::fstat): Ignore floppy drives. Set st_nlink
correctly.
(fhandler_cygdrive::readdir): Ignore floppy drives.
* fhandler_netdrive.cc (fhandler_netdrive::readdir): Accommodate
change to readdir_get_ino.
* fhandler_proc.cc (PROC_DIR_COUNT): Define.
(fhandler_proc::fstat): Evaluate correct link count for /proc.
* ntdll.h (struct _FILE_DIRECTORY_INFORMATION): Define.
(NtFsControlFile): Declare.
(RtlAppendUnicodeToString): Declare.
(RtlAppendUnicodeStringToString): Declare.
(RtlCompareUnicodeString): Declare.
(RtlCopyUnicodeString): Declare.
(RtlCreateUnicodeStringFromAsciiz): Declare.
(RtlEqualUnicodeString): Declare.
(RtlFreeUnicodeString): Declare.
(RtlInitEmptyUnicodeString): Declare.
(RtlSecondsSince1970ToTime): Declare.
(RtlInitEmptyUnicodeString): Define as inline function.
(RtlInitCountedUnicodeString): Define as inline function.
* path.cc (path_conv::check): New method with PUNICODE_STRING as path,
preliminary implementation.
(mount_info::get_mounts_here): Change to create UNICODE_STRINGs.
Also copy cygpath prefix into UNICODE_STRING.
(is_floppy): Drop 9x consideration.
* path.h: Drop including ntdef.h.
(path_conv::check): Add declaration.
(path_conv::path_conv): Add constructor for UNICODE_STRING paths.
* shared_info.h (mount_info::get_mounts_here): Change declaration.
* syscalls.cc: Drop forward declaration of stat_worker.
(stat_worke): Take path_conv as parameter. Drop nofollow flag.
(stat64): Create matching path_conv and call stat_worker with it.
(lstat64): Ditto.
* winsup.h: Include ntdef.h.
(stat_worker): Declare.
(readdir_get_ino): Change declaration.
variables. Call pc.get_object_attr to create object attributes.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.
* syscalls.cc (unlink_nt): Ditto.
* path.cc (path_conv::set_normalized_path): Set wide_path to NULL.
(path_conv::get_nt_native_path): Drop parameter. Create path in
wide_path/uni_path members.
(path_conv::get_object_attr): New method to create object attributes.
(path_conv::get_wide_win32_path): New method to create Win32 wide path.
(path_conv::check): Initialize wide_path to NULL.
(path_conv::~path_conv): cfree wide_path.
* path.h (class path_conv): New members wide_path and uni_path.
Add declarations of get_object_attr and get_wide_win32_path.
(path_conv::path_conv): Initialize wide_path to NULL.
(path_conv::get_nt_native_path): Drop parameter.
(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.
(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.
* ntdll.h (struct _FILE_RENAME_INFORMATION): Define.
* path.cc (fs_info::update): Note length of rootdir prefix in
root_len.
(get_nt_native_path): New function, taking over functionality of
path_conv::get_nt_native_path.
(path_conv::get_nt_native_path): Just call get_nt_native_path.
* path.h (get_nt_native_path): Declare.
(struct fs_info): New member root_len.
(fs_info::length): New inline method returning root_len.
(path_conv::rootdir): New inline method returning rootdir prefix.
* syscalls.cc (try_to_bin): Rewrite using only system calls.
(unlink_nt): Call try_to_bin with additional handle to open file
parameter.
(statvfs): Use path_conv::rootdir method.
* wincap.h: Define has_recycle_dot_bin throughout.
* wincap.cc: Ditto.
"keep_in_sync" methods.
* external.cc (cygwin_internal): Call above keep_in_sync method when
CW_SYNC_WINENV is requested.
* path.cc (cwdstuff::init): Don't change to windows_system_directory
if keep_in_sync is requested.
(cwdstuff::keep_in_sync): New method.
(cwdstuff::set): Take sync flag into account.
(rmdir): Don't check last path component for "..".
* fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop kludge
which tries to allow deleting the current working directory.
* path.cc (has_dot_last_component): Add parameter to indicate testing
for "..". Take trailing slash into account.
(symlink_info::posixify): Rely on cygheap->cwd.win32 having a
useful value.
(cwdstuff::init): Initialize cygheap->cwd with current working
directory. Change to windows_system_directory afterwards.
(cwdstuff::set): Never call SetCurrentDirectory here. Just check
if changing into target directory would be allowed. Add comment to
explain why.
* path.h (has_dot_last_component): Declare with second parameter.
* pinfo.cc (pinfo::zap_cwd): Remove.
(pinfo::exit): Drop call to zap_cwd.
* pinfo.h (class pinfo): Remove declaration of zap_cwd.
* spawn.cc (spawn_guts): Set current working directory for non-Cygwin
child applications. Drop call to zap_cwd.
Change FS_IS_SAMBA and FS_IS_SAMBA_WITH_QUOTA and their usage
accordingly. Define FS_IS_NETAPP_DATAONTAP. Recognize NetApp device
and store in is_netapp flag. Mark NetApp device as having no good
inodes.
* path.h (struct fs_info): Add is_netapp flag. Add matching accessors.
paths in symlinks to POSIX.
(symlink_info::check_shortcut): Allocate buf allowing for a trailing 0.
Call posixify on the result.
(symlink_info::check_sysfile): Read from file into local buffer.
Eliminate old b16 considerations. Call posixify on the result.
(symlink_info::check_reparse_point): Don't use PrintName but
SubstituteName which is relevant for Windows' path handling.
Call posixify on the result.
(mount_info::conv_to_win32_path): Update comment.
* fhandler_disk_file.cc (path_conv::ndisk_links): Use backslashes
to make NT kernel functions work for \\?\GLOBALROOT paths.
(conv_envvars): Use env_win32_to_posix_path_list rather than
cygwin_win32_to_posix_path_list.
(posify): Translate back to win32 path if errno is EIDRM.
* environ.h: Update copyright. Define ENV_CVT.
* path.cc (conv_path_list): If converting for the environment and removed an
element set errno to ENV_CVT.
(env_win32_to_posix_path_list): New function.
at this point anyway.
(get_symlink_ea): Remove.
(set_symlink_ea): Remove.
(symlink_worker): Drop writing symlink into NTFS extended attributes.
(symlink_info::check): Drop reading symlinks from NTFS extended
attributes.
(NtSetEaFile): Define.
* fhandler.cc (fhandler_base::open): Use appropriate open flags
in query case when allow_ntea is set.
* ntdll.h (struct _FILE_GET_EA_INFORMATION): Define.
(struct _FILE_FULL_EA_INFORMATION): Define.
(NtQueryEaFile): Declare.
(NtSetEaFile): Declare.
* ntea.cc (read_ea): Rename from NTReadEA and rewrite using
NtQueryEaFile.
(write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile.
* path.cc (get_symlink_ea): Make static. Add handle parameter to
accomodate new read_ea call.
(set_symlink_ea): Make static. Add handle parameter to accomodate new
write_ea call.
(symlink_worker): Call set_symlink_ea while file is still open.
(symlink_info::check): Call get_symlink_ea after file has been opened.
* security.cc (get_file_attribute): Accomodate new read_ea call.
(set_file_attribute): Accomodate new write_ea call.
* security.h (read_ea): Change declaration accordingly.
(write_ea): Ditto.
to take file size and inode number as 64 bit values.
* fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc
(FS_IS_SAMBA_WITH_QUOTA): Ditto.
(path_conv::hasgood_inode): Delete.
(path_conv::is_samba): Delete.
(path_conv::isgood_inode): Centralized function to recognize
a good inode number.
(fhandler_base::fstat_by_handle): Constify fvi_size and fai_size.
Accomodate argument change in fstat_helper.
(fhandler_base::fstat_by_name): Ditto.
(fhandler_base::fstat_helper): Accomodate argument change. Call
path_conv::isgood_inode to recognize good inodes.
(fhandler_disk_file::opendir): Explain Samba weirdness here.
Call path_conv::fs_is_samba instead of path_conv::is_samba.
(fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS
as valid return code from NtQueryDirectoryFile to indicate that
FileIdBothDirectoryInformation is not supported.
Call path_conv::isgood_inode to recognize good inodes.
* ntdll.h (STATUS_INVALID_INFO_CLASS): Define.
* path.cc (fs_info::update): Rework file system recognition
and set appropriate flags.
* path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags.
Constify pure read accessors.
__d_internal.
* fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef".
(d_dirname): Remove useless "struct".
(d_cachepos): Ditto.
(d_cache): Ditto.
(class __DIR_mounts): New class, implementing mount point tracking
for readdir.
(d_mounts): New macro for easy access to __DIR_mounts structure.
(fhandler_disk_file::opendir): Allocate __DIR_mounts structure and
let __d_internal element of dir point to it.
(fhandler_disk_file::readdir_helper): Add mount points in the current
directory, which don't have a real directory backing them.
Don't generate an inode number for /dev. Add comment, why.
(fhandler_disk_file::readdir): Move filling fname to an earlier point.
Check if current entry is a mount point and evaluate correct inode
number for it.
(fhandler_disk_file::readdir_9x): Ditto.
(fhandler_disk_file::rewinddir): Set all mount points in this directory
to "not found" so that they are listed again after calling rewinddir().
(fhandler_disk_file::closedir): Deallocate __DIR_mounts structure.
* path.cc (mount_info::get_mounts_here): New method to evaluate a list
of mount points in a given parent directory.
* shared_info.h (class mount_info): Declare get_mounts_here.
SCAN_APPENDLNK.
(suffix_scan::next): Rearrange code to make .lnk append order slightly
more deterministic.
* spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align
evaluation with stat_suffixes.
(dll_suffixes): Ditto.
if ntsec is on. Don't check execute permission of Windows batch files.
(av::fixup): Handle empty files gracefully. Drop execute permission
test here.
* path.cc (suffix_scan::next): Don't skip any suffix on first run.
(_major): Ditto.
(device::is_fs_special): New function.
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Set the size to 0 for
devices rather than reporting the size of the symlink.
(fhandler_disk_file::readdir): Use is_fs_special to determine if .lnk should be
stripped.
* path.cc: Rename symlink_info::is_symlink to symlink_info::issymlink
throughout.
(symlink_info::isdevice): New field.
(path_conv::check): Use 'isdevice' to determine if just-parsed entity is a
device rather than relying on non-zero major/minor.
(symlink_info::parse_device): Set isdevice to true if we've discovered a
device.
(symlink_info::check): Clear isdevice field prior to processing. Use isdevice
to control debugging output.
(symlink_info::set): Set isdevice to false.
* path.h (path_conv::is_fs_special): New function.
* devices.cc: Regenerate.
eof_detected status flag. Delete is_eom and is_eof methods.
Move drive_size, bytes_per_sector, eom_detected status flag, as well
as the methods read_file, write_file, raw_read and raw_write to ...
(class fhandler_dev_floppy): ... here. Remove is_eom and is_eof
methods. Add dup method.
* fhandler_floppy.cc (IS_EOM): New macro.
(fhandler_dev_floppy::is_eom): Remove.
(fhandler_dev_floppy::is_eof): Remove.
(fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags.
(fhandler_dev_floppy::get_drive_info): Only call EX functions on
systems supporting them and stop suffering strange delays.
(fhandler_dev_floppy::read_file): Move here, drop setting
current_position.
(fhandler_dev_floppy::write_file): Move here, drop setting
current_position.
(fhandler_dev_floppy::open): Rearrange comment.
(fhandler_dev_floppy::dup): New method.
(fhandler_dev_floppy::get_current_position): New inline method. Use
instead of former current_position were appropriate.
(fhandler_dev_floppy::raw_read): Move here. Drop EOF handling.
(fhandler_dev_floppy::raw_write): Move here. Drop EOF handling.
(fhandler_dev_floppy::lseek): Remove useless conditions. Convert
sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call.
(fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case
to here.
* fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove.
(fhandler_dev_raw::is_eof): Remove.
(fhandler_dev_raw::write_file): Remove.
(fhandler_dev_raw::read_file): Remove.
(fhandler_dev_raw::raw_read): Remove.
(fhandler_dev_raw::raw_write): Remove.
(fhandler_dev_raw::dup): Drop copying removed members.
(fhandler_dev_raw::ioctl): Drop blocksize testing.
* wincap.h: Implement has_disk_ex_ioctls throughout.
* wincap.cc: Ditto.
(wincap_vista): Preliminary wincaps for Windows Vista/Longhorn.
(wincapc::init): Add Vista/Longhorn handling.
intact throughout.
(normalize_win32_path): Revert to only checking for slash.
(realpath): Convert drive letters to cygdrive paths before
doing anything else.
* shared_info.h (mount_info::cygdrive_posix_path): Make public.
in favor of calling path_conv with PC_POSIX flag. Align error
handling closer to POSIX. As on Linux, return user space allocated
memory if second parameter is NULL.
directory if /dev doesn't actually exist.
(win32_device_name): Don't consider FH_DEV to be a device since it's really a
directory which should go through mount processing.
* fhandler_proc.cc: Use cygheap rather than user heap for allocation of filebuf
throughout.
* fhandler_registry.cc: Ditto.
* fhandler_virtual.cc: Ditto.
* fhandler_process.cc: Ditto.
(get_mem_values): Use malloc/realloc/free rather than new.
* pinfo.cc (_pinfo::commune_send): Allocate on cygwin heap rather than user
heap. Avoid calling ReadFile when correct number of characters have been read
or suffer buffer corruption.
(_pinfo::fd): Allocate on cygwin heap rather than user heap.
(_pinfo::fds): Ditto.
(_pinfo::root): Ditto.
(_pinfo::cwd): Ditto.
(_pinfo::cmdline): Ditto.
* devices.h (FH_DEV): New define.
* devices.in: Detect lone /dev.
* devices.cc: Regenerate.
* path.cc (path_conv::check): Treat FH_DEV as a special case.
* winsup.h (close_all_files): Reflect argument change.
* dtable.cc (close_all_files): Ditto.
* dtable.h: Ditto.
* fhandler.h: Ditto.
* spawn.cc (spawn_guts): Move close_all_files back to its original location in
first P_OVERLAY test but use argument denoting that handles are only supposed
to be closed, not released (more work to be done here).
* syscalls.cc (close_all_files): Take an argument denoting whether to release
closed files or not.
* path.cc (symlink): Change argument names to reflect linux man page.
(symlink_worker): Ditto. Also appropriately set ENOENT for empty strings.
everywhere. Leave some thread.cc stuff alone for now.
* cygtls.h: Kludge some definitions to avoid including a problematic windows
header.
(_cygtls::_myfault): New entry.
(_cygtls::_myfault_errno): Ditto.
(_cygtls::fault_guarded): New function.
(_cygtls::setup_fault): Ditto.
(_cygtls::return_from_fault): Ditto.
(_cygtls::clear_fault): Ditto.
(myfault): New class.
* exceptions.cc (handle_exceptions): Handle case of guarded fault in system
routine.
* gendef: Add another entry point for setjmp that the compiler doesn't know
about and won't complain about.
* gentls_offsets: Just include windows.h rather than kludging a HANDLE def.
* miscfuncs.cc (check_null_str): Delete.
(check_null_empty_str): Ditto.
(check_null_empty_str_errno): Ditto.
(check_null_str_errno): Ditto.
(__check_null_invalid_struct): Ditto.
(__check_null_invalid_struct_errno): Ditto.
(__check_invalid_read_ptr): Ditto.
(__check_invalid_read_ptr_errno): Ditto.
(dummytest): New function.
(check_iovec_for_read): Delete.
(chec_iovec): Rename from check_iovec_for_write. Take a read/write parameter.
* tlsoffsets.h: Regenerate.
* winsup.h: Remove check_* declarations.
(check_iovec_for_read): Delete declaration. Turn into a define instead.
(check_iovec_for_write): Ditto.
(check_iovec): New declaration.
* thread.h: Use ifdef guard name consistent with other header files.