summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on EINTR orChristopher Faylor2009-01-273-4/+15
| | | | | | | | 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.
* * shared.cc (shared_name): New function for WCHAR names.Corinna Vinschen2009-01-264-16/+34
| | | | | | | | (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.
* * grp.cc (getgrgid_r): Simplify code by using stpcpy.Corinna Vinschen2009-01-263-52/+35
| | | | | | (getgrnam_r): Ditto. * passwd.cc (getpwuid_r32): Simplify code by using stpcpy. (getpwnam_r): Ditto.
* * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENTCorinna Vinschen2009-01-262-1/+8
| | | | flag.
* * mount.cc (mount_info::from_fstab): Open fstab file withCorinna Vinschen2009-01-242-1/+8
| | | | FILE_OPEN_FOR_BACKUP_INTENT flag.
* * smallprint.cc (__small_vsprintf): Use already available buffer tmpCorinna Vinschen2009-01-232-8/+10
| | | | in wfillin case.
* * select.cc (peek_serial): Add hack to allow proper operation with com0comChristopher Faylor2009-01-222-0/+9
| | | | driver.
* ChangeLog:Corinna Vinschen2009-01-2112-1430/+1504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
* * fhandler_procnet.cc: Reorganize global procnet content data into aCorinna Vinschen2009-01-205-39/+43
| | | | | | | | new struct virt_tab_t. Accommodate throughout. * fhandler.h: Fix copyright dates. * fhandler_process.cc: Ditto. * fhandler_registry.cc: Ditto.
* * devices.h (FH_PROCESSFD): New device type.Corinna Vinschen2009-01-2010-324/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n.Corinna Vinschen2009-01-203-4/+26
| | | | | | | | * 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.
* * autoload.cc (WSAIoctl): Reintroduce.Corinna Vinschen2009-01-207-65/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyondCorinna Vinschen2009-01-172-1/+8
| | | | EOF is required.
* * fhandler_proc.cc: Reorganize global proc content data into a newCorinna Vinschen2009-01-173-139/+104
| | | | | | | | | | 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.
* * Fix copyright dates.Corinna Vinschen2009-01-167-6/+11
|
* * libc/getopt.c (parse_long_options): Use fix from NetBSD's getoptCorinna Vinschen2009-01-132-9/+24
| | | | to avoid false ambiguities.
* * syscalls.cc (enum bin_status): New type.Corinna Vinschen2009-01-122-41/+123
| | | | | | | | | | | (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.
* * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.Corinna Vinschen2009-01-113-7/+15
| | | | | | | * 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.
* * mount.cc (mount_info::from_fstab_line): Always convert driveCorinna Vinschen2009-01-093-24/+34
| | | | | | | | | 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.
* * include/sys/cygwin.h (CW_SETERRNO): Define.Christopher Faylor2009-01-097-7/+39
| | | | | | | | | * 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.
* * libc/fts.c (fts_build): Use DT_DIR case on Cygwin.Corinna Vinschen2009-01-082-3/+10
| | | | | (fts_ufslinks): Fix using wrong structure member in Cygwin-specific code.
* * ntdll.h: Reorder NT status flags. Fix a case difference. AddCorinna Vinschen2009-01-073-15/+57
| | | | | | | | | | 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.
* * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe ifCorinna Vinschen2009-01-073-1/+11
| | | | | | original file has .exe as well. * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit apps as binaries.
* correctChristopher Faylor2009-01-031-2/+2
|
* Remove unneeded header files from source files throughout. Update copyrightsChristopher Faylor2009-01-0359-308/+410
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Year-end rollover.Christopher Faylor2009-01-032-3342/+3341
|
* * speclib: Rewrite completely in perl. Avoid multiple nm calls.Christopher Faylor2009-01-022-51/+94
|
* * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 191.Christopher Faylor2008-12-312-1/+6
|
* * glob_pattern_p.cc: New file.Christopher Faylor2008-12-316-16/+53
| | | | | | * Makefile.in (DLL_OFILES): Add glob_pattern_p.o. * glob.h: Add declaration for glob_pattern_p. * pinfo.cc (pinfo::thisproc): Remove __stdcall attribute.
* * include/bits/wordsize.h: New linux-compatibility header.Christopher Faylor2008-12-312-0/+10
|
* * exceptions.cc (try_to_debug): Avoid creating a huge buffer on the stack.Christopher Faylor2008-12-302-3/+7
|
* * mount.cc: Change comment.Christopher Faylor2008-12-256-334/+365
| | | | | | | | | | | | (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.
* * path.cc (symlink_info::check_shortcut): Ensure that symlink handle is closedChristopher Faylor2008-12-242-2/+6
| | | | on successful return.
* * fhandler.h (fhandler_base_setup_overlapped): Add new argument.Christopher Faylor2008-12-234-143/+55
| | | | | | | | | | | | | | | | | | | | | | | (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.
* * pipe.cc (getov_result): Minor cleanup.Christopher Faylor2008-12-222-3/+6
|
* * pipe.cc (getov_result): Add parameters to facilitate better EOF checking.Christopher Faylor2008-12-212-5/+15
| | | | (pipe_handler): Pass extra arguments to getov_result.
* * fhandler.cc (fhandler_base::wait_overlapped): Reorganize to eliminate gotosChristopher Faylor2008-12-202-37/+43
| | | | | and to hopefully eliminate one race when a signal is detected or there is a WFMO error.
* * pinfo.h (pinfo::thisproc): Declare. Rename from set_myself.Christopher Faylor2008-12-204-16/+25
| | | | | | | | * 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.
* * pwdgrp.h (pwdgrp::refresh): Fix indentation.Corinna Vinschen2008-12-203-6/+11
| | | | | * uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated read. Drop local variable off.
* * pinfo.cc (pinfo_basic): New class.Christopher Faylor2008-12-194-13/+41
| | | | | | | | | | | (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.
* * fhandler_registry.cc (perf_data_files): New table.Corinna Vinschen2008-12-192-13/+77
| | | | | | | | | | | | | | | | (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.
* * path.cc (path_conv::check): Handle incoming DOS paths non-POSIXy,Corinna Vinschen2008-12-192-1/+14
| | | | always case-insensitive, always ignoring ACLs.
* * fhandler_disk_file.cc: Set 4th parameter of NtQueryDirectoryFile toCorinna Vinschen2008-12-182-9/+22
| | | | | | | | 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.
* * path.cc (symlin_info::check): Set 4th parameter ofCorinna Vinschen2008-12-182-23/+35
| | | | | | | | 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.
* * fhandler_registry.cc (DEFAULT_VALUE_NAME): Remove constant.Corinna Vinschen2008-12-162-69/+83
| | | | | | | | | | | | (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.
* * syscalls.cc (gen_full_path_at): Use isabspath instead of isdirsepCorinna Vinschen2008-12-152-1/+6
| | | | to recognize absolute path.
* * sec_auth.cc (open_local_policy): Set lsa handle toCorinna Vinschen2008-12-152-1/+11
| | | | INVALID_HANDLE_VALUE when LsaOpenPolicy fails. Explain why.
* * setlsapwd.cc (setlsapwd): Simplify code. Only try to call cygserverCorinna Vinschen2008-12-152-7/+15
| | | | | if opening local policy fails. Don't treat removing non-existant private data as error.
* * setlsapwd.cc (setlsapwd): Explicitely erase password buffer contentCorinna Vinschen2008-12-152-1/+9
| | | | after usage.
* * fhandler_registry.cc (fhandler_registry::exists): Handle EACCES.Corinna Vinschen2008-12-152-2/+8
| | | | (fhandler_registry::open): Ditto.