summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init,Thomas Pfaff2003-03-187-3/+761
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pthread_rwlock_rdlock, pthread_rwlock_tryrdlock, pthread_rwlock_wrlock, pthread_rwlock_trywrlock, pthread_rwlock_unlock, pthread_rwlockattr_init, pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared, and pthread_rwlockattr_destroy. * include/cygwin/version.h: Bump API minor number. * include/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Define a reasonable value. Add prototypes for pthread_rwlock_destroy, pthread_rwlock_init, pthread_rwlock_rdlock, pthread_rwlock_tryrdlock, pthread_rwlock_wrlock, pthread_rwlock_trywrlock, pthread_rwlock_unlock, pthread_rwlockattr_init, pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared, and pthread_rwlockattr_destroy. * thread.h (PTHREAD_ONCE_MAGIC): Remove superflous semicolon. (PTHREAD_RWLOCK_MAGIC): New define. (PTHREAD_RWLOCKATTR_MAGIC): Ditto. (pthread_rwlockattr): New class. (pthread_rwlock): Ditto. (MTinterface::rwlocks): New member. (MTinterface::MTinterface): Initialize rwlocks. Add prototypes for __pthread_rwlock_destroy, __pthread_rwlock_wrlock, __pthread_rwlock_trywrlock, __pthread_rwlock_unlock, __pthread_rwlockattr_init, __pthread_rwlockattr_getpshared, __pthread_rwlockattr_setpshared, and __pthread_rwlockattr_destroy. * thread.cc (MTinterface::Init): Initialize rwlock internal mutex. (MTinterface::fixup_after_fork): Fixup rwlocks after fork. (pthread_rwlockattr::isGoodObject): Implement. (pthread_rwlockattr::pthread_rwlockattr): Ditto. (pthread_rwlockattr::~pthread_rwlockattr): Ditto. (pthread_rwlock::initMutex): Ditto. (pthread_rwlock::pthread_rwlock): Ditto. (pthread_rwlock::~pthread_rwlock): Ditto. (pthread_rwlock::RdLock): Ditto. (pthread_rwlock::TryRdLock): Ditto. (pthread_rwlock::WrLock): Ditto. (pthread_rwlock::TryWrLock): Ditto. (pthread_rwlock::UnLock): Ditto. (pthread_rwlock::addReader): Ditto. (pthread_rwlock::removeReader): Ditto. (pthread_rwlock::lookupReader): Ditto. (pthread_rwlock::RdLockCleanup): Ditto. (pthread_rwlock::WrLockCleanup): Ditto. (pthread_rwlock::fixup_after_fork): Ditto. (pthread_rwlock::isGoodObject): Ditto. (pthread_rwlock::isGoodInitializer): Ditto. (pthread_rwlock::isGoodInitializerOrObject): Ditto. (pthread_rwlock::isGoodInitializerOrBadObject): Ditto. (__pthread_rwlock_destroy): Ditto. (pthread_rwlock::init): Ditto. (__pthread_rwlock_rdlock): Ditto. (__pthread_rwlock_tryrdlock): Ditto. (__pthread_rwlock_wrlock): Ditto. (__pthread_rwlock_trywrlock): Ditto.
* * thread.h (pthread_cond::ExitingWait): Remove.Thomas Pfaff2003-03-183-197/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (pthread_cond::mutex): Ditto. (pthread_cond::cond_access): Ditto. (pthread_cond::win32_obj_id): Ditto. (pthread_cond::TimedWait): Ditto. (pthread_cond::BroadCast): Ditto. (pthread_cond::Signal): Ditto. (pthread_cond::waiting): Change type to unsigned long. (pthread_cond::pending): New member. (pthread_cond::semWait): Ditto. (pthread_cond::mtxIn): Ditto. (pthread_cond::mtxOut): Ditto. (pthread_cond::mtxCond): Ditto. (pthread_cond::UnBlock): New method. (pthread_cond::Wait): Ditto. * thread.cc: Update list of cancellation points. (pthread_cond::pthread_cond): Rewrite. (pthread_cond::~pthread_cond): Ditto. (pthread_cond::TimedWait): Remove. (pthread_cond::BroadCast): Ditto. (pthread_cond::Signal): Ditto. (pthread_cond::UnBlock): Implement. (pthread_cond::Wait): Ditto. (pthread_cond::fixup_after_fork): Rewrite. (pthread_mutex::fixup_after_fork): Remove DETECT_BAD_APP conditional. (__pthread_cond_broadcast): Just return 0 if the condition is not initialized. Call pthread_cond::UnBlock to release blocked threads. (__pthread_cond_signal): Ditto. (__pthread_cond__dowait): Rewrite. (pthread_cond_timedwait): Add pthread_testcancel call. Fix waitlength calculation. (pthread_cond_wait): Add pthread_testcancel call.
* * include/pthread.h (PTHREAD_MUTEX_NORMAL): New define.Thomas Pfaff2003-03-184-50/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * thread.cc: Remove errno.h include. (pthread::precreate): Change internal mutex type to normal. (pthread_mutex::canBeUnlocked): Implement. (pthread_mutex::pthread_mutex): Initialize lock_counter with 0. (pthread_mutex::Lock): Rename to _Lock. Add self parameter. Change lock_counter logic. Update SetOwner call. (pthread_mutex::TryLock): Rename to _TryLock. Add self parameter. Change lock_counter logic. Update SetOwner call. (pthread_mutex::UnLock): Rename to _UnLock. Add self parameter. Change lock_counter logic. (pthread_mutex::Destroy): Rename to _Destroy. Update TryLock call. (pthread_mutex::SetOwner): Move to thread.h as inline. (pthread_mutex::LockRecursive): Ditto. (pthread_mutex::fixup_after_fork): Change lock_counter logic. (__pthread_mutexattr_settype): Add PTHREAD_MUTEX_NORMAL to valid types check. * thread.h: Include errno.h and limits.h. (MUTEX_LOCK_COUNTER_INITIAL): Remove. (MUTEX_OWNER_ANONYMOUS): New define. (pthread_mutex::canBeUnlocked): New static method. (pthread_mutex::lock_counter): Change type to unsigned long. (pthread_mutex::GetPthreadSelf): New method. (pthread_mutex::Lock): Call _Lock with pthread_self pointer. (pthread_mutex::TryLock): Call _TryLock with pthread_self pointer. (pthread_mutex::UnLock): Call _UnLock with pthread_self pointer. (pthread_mutex::Destroy): Call _Destroy with pthread_self pointer. (pthread_mutex::SetOwner): Moved from thread.cc as inline. (pthread_mutex::LockRecursive): Ditto. (pthread_mutex::_Lock): New method. (pthread_mutex::_TryLock): New method. (pthread_mutex::_UnLock): New method. (pthread_mutex::_Destroy): New method.
* * fhandler_proc.cc (format_proc_cpuinfo): Use IsProcessorFeaturePresentCorinna Vinschen2003-03-182-53/+83
| | | | | only on Windows NT. Read CPU Mhz value only on NT. Revert previous change so cpuid instruction is called even on non-NT systems.
* * glob.c (g_lstat): Change API minor test to match API minor numberCorinna Vinschen2003-03-172-2/+8
| | | | | change in previous patch. (g_stat): Ditto.
* * include/cygwin/version.h: Reorganize last two api versions so that btowc andChristopher Faylor2003-03-172-3/+10
| | | | | | trunc exports show up before previous bump since there has been no exported version of the DLL with the 64 bit changes yet but 1.3.22 will have the btowc and trunc.
* * cygwin.din: Export btowc, trunc.Christopher Faylor2003-03-176-15/+55
| | | | | | | | | | | | | | | | * include/cygwin/version.h: Reflect new exports. * syscalls.cc (_stat): Rename to stat to avoid newlib wrapper. * syscalls.cc (_fstat): Ditto. * fhandler_console.cc (fhandler_console::close): Correct check for current tty. Add debugging output when console is freed. (set_console_state_for_spawn): Add debugging output. * fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console open flag when vforking. * sigproc.cc (sigproc_terminate): Fix debugging output. * spawn.cc (handle): Eliminate second argument. (spawn_guts): Reflect elimination of argument change to handle. * syscalls.cc (setsid): Add debugging output when console is freed. * syscalls.cc (rename): Revert assumption that DELETE_ON_CLOSE works on Win9x.
* * include/cygwin/version.h: Bump DLL minor number to 23.Christopher Faylor2003-03-134-3/+15
|
* * autoload.cc (IsProcessorFeaturePresent): Add.Corinna Vinschen2003-03-133-1/+15
| | | | * fhandler_proc.cc (format_proc_cpuinfo): Add case for 9x systems.
* * fhandler_proc.cc (format_proc_cpuinfo): Fix vendor id in cpuid case.Corinna Vinschen2003-03-132-1/+5
|
* * net.cc (cygwin_rcmd): Use correct file descriptor in call to fdsock.Corinna Vinschen2003-03-132-2/+7
| | | | (cygwin_rexec): Ditto.
* * syscalls.cc (rename): Assume that DELETE_ON_CLOSE works on Win9x.Christopher Faylor2003-03-133-3/+10
| | | | * fhandler_tty.cc (fhandler_tty_slave::close): Fix typo in debug output.
* * fhandler_socket.cc (fhandler_socket::dup): Don't callCorinna Vinschen2003-03-112-1/+20
| | | | | fhandler_base::dup() but call DuplicateHandle directly instead to have control over socket inheritence.
* 2003-03-11 Corinna Vinschen <corinna@vinschen.de>Corinna Vinschen2003-03-112-4/+24
| | | | | | | | | | | * fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid using WinSock2 socket duplication methods. Add comment. 2003-03-11 Pierre Humblet <pierre.humblet@ieee.org> * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Set io_handle to INVALID_SOCKET in case of failure. (fhandler_socket::dup): Return 0 if the io_handle is valid.
* * sec_acl.cc (setacl): Don't handle DELETE flag specially.Corinna Vinschen2003-03-103-10/+9
| | | | * security.cc (alloc_sd): Ditto.
* Fix typo.Corinna Vinschen2003-03-091-1/+1
|
* * winver.rc: Change Copyright hint to inlcude 2003.Corinna Vinschen2003-03-092-1/+5
|
* Switch to 32/64 datatypes:Corinna Vinschen2003-03-0911-43/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (OBSOLETE_FUNCTIONS): Add open acl aclcheck aclfrommode aclfrompbits aclfromtext aclsort acltomode acltopbits acltotext chown facl fchown fgetpos fopen freopen fseeko fsetpos fstat ftello ftruncate getegid geteuid getgid getgrent getgrgid getgrnam getgroups getpwuid getpwuid_r getuid initgroups lchown lseek lstat mknod mmap seekdir setegid seteuid setgid setgroups setregid setreuid setuid stat telldir truncate. (NEW_FUNCTIONS): Add _open64 acl32 aclcheck32 aclfrommode32 aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32 acltotext32 chown32 facl32 fchown32 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 fstat64 ftello64 ftruncate64 getegid32 geteuid32 getgid32 getgrent32 getgrgid32 getgrnam32 getgroups32 getpwuid32 getpwuid_r32 getuid32 initgroups32 lchown32 lseek64 lstat64 mknod32 mmap64 seekdir64 setegid32 seteuid32 setgid32 setgroups32 setregid32 setreuid32 setuid32 stat64 telldir64 truncate64 to substitute the above. * cygserver_shm.h (class client_request_shm): Change uid_t and gid_t members to __uid32_t and __gid32_t. * cygwin.din: Add symbols acl32 aclcheck32 aclfrommode32 aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32 acltotext32 facl32 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 _fstat64 ftello64 _lseek64 mknod32 _open64. * glob.c: Include perprocess.h. (globtilde): Call getpwuid32 and getuid32 instead of getpwuid and getuid. (g_lstat): Check for applications API version to call the appropriate typed gl_lstat function. (g_stat): Ditto for gl_stat. * shm.cc (client_request_shm::client_request_shm): Call geteuid32 and getegid32 instead of geteuid and getegid throughout. * syscalls.cc (_open64): New alias for open. (_lseek64): New alias for lseek64. (_fstat64): New alias for fseek64. (mknod32): New function. (mknod): Calls mknod32 now. * winsup.h: Make function declarations for getuid32, geteuid32, and getpwuid32 accessible for plain C sources. Add declarations for getegid32 and getpwnam. * include/cygwin/version.h: Bum API minor number to 78. * include/sys/cygwin.h: Guard C++ specific members of struct per_process against inclusion in plain C sources. * include/sys/mman.h (mman): Add guard to avoid type clash when compiling Cygwin.
* fix typoChristopher Faylor2003-03-091-1/+1
|
* * include/cygwin/version.h: Bump DLL minor number to 21.Christopher Faylor2003-03-092-1/+5
|
* whitespace cleanupChristopher Faylor2003-03-0915-56/+55
|
* Do some minor reformatting of 'extern "C"' use throughout.Christopher Faylor2003-03-0913-111/+511
| | | | | | | | | | | | | * autoload.cc (GetSystemTimes): Define new autoload function. * fhandler_proc.cc (proc_listing): Add cpuinfo and partitions entries. (fhandler_proc::fill_filebuf): Add PROC_CPUINFO and PROC_PARTITIONS cases. (format_proc_uptime): Use GetSystemTimes if available. (read_value): New macro. (print): New macro. (cpuid): New function. (can_set_flag): New function. (format_proc_cpuinfo): New function. (format_proc_partitions): New function.
* * syscalls.cc (unlink): Attempt to be more clever about setting attributes ofChristopher Faylor2003-03-092-12/+30
| | | | | file. Only open file in query mode to avoid having to mess with security stuff for reading.
* * rmsym: Fix regular expression.Corinna Vinschen2003-03-092-2/+6
|
* * Makefile.in: Change from using new-* to cygwin0 for temporary targets.Christopher Faylor2003-03-092-10/+16
|
* * include/cygwin/socket.h: Set SOMAXCONN to Winsock2 value.Corinna Vinschen2003-03-092-1/+5
|
* * syscalls.cc (unlink): Always attempt to use FILE_FLAG_CLOSE_ON_DELETE toChristopher Faylor2003-03-092-57/+29
| | | | | | delete files since this allows us to preserve the protection of hard linked files. (link): Generate full path for potentially recalculated .lnk target.
* missed in last checkinChristopher Faylor2003-03-081-1/+1
|
* Revert below changes regarding _pinfo::cmdline.Christopher Faylor2003-03-085-19/+17
|
* * external.cc (cygwin_internal): Change n to __off64_t to match changeCorinna Vinschen2003-03-087-16/+32
| | | | | | | | | | | | | | of _pinfo::cmdline. * fhandler.h (class fhandler_virtual): Change filesize member to __off64_t. * fhandler_proc.cc (format_proc_meminfo): Change to return __off64_t. (format_proc_stat): Ditto. (format_proc_uptime): Ditto. * fhandler_process.cc (format_process_stat): Ditto. (format_process_status): Ditto. (format_process_statm): Ditto. * pinfo.cc (_pinfo::cmdline): Expect __off64_t parameter. * pinfo.h (class _pinfo): Change declaration of cmdline accordingly.
* * path.h (PATH_LNK): New enum val.Christopher Faylor2003-03-085-37/+72
| | | | | | | | | | | | | | | | | (path_conv::is_lnk_symlink): New function. True if path represents .lnk style symlink. * path.cc (check_shortcut): Set PATH_LNK in pflags when appropriate. (symlink_info::check): Ditto. Remove PATH_LNK from pflags initially. * syscalls.cc (unlink): Always remove readonly attribute from a symlink regardless of type. (link): (from Corinna Vinschen) Allow links to symlinks. Reset attributes on a symlink after successful link creation. (chmod): Use is_lnk_symlink where appropriate. (rename): Ditto. * tty.cc (create_tty_master): Call GetComputerName instead of cygwin_gethostname. Set ut_id. * syscalls.cc (login): Call endutent. (setutent): Do not seek after a fresh open.
* * syscalls.cc (seteuid32): Fix formatting.Corinna Vinschen2003-03-072-3/+8
|
* * thread.cc (MTinterface::fixup_after_fork): Initialize mainthreadThomas Pfaff2003-03-042-4/+9
| | | | prior to pthread objects.
* * fhandler_socket.cc (fhandler_socket::dup): Initialize type.Corinna Vinschen2003-03-042-0/+5
|
* revert erroneous entryChristopher Faylor2003-03-041-9/+0
|
* * Makefile.in (strace.exe): Include mingw_getopt.o in link line.Christopher Faylor2003-03-041-0/+9
| | | | | | | | * cygcheck.cc (print_version): Update copyright. * strace.cc (print_version): Ditto. (main): Allow cygwin paths for -o option. (create_child): Allow cygwin path as argv[0]. * path.cc (path.cc): Allow UNC paths.
* * fhandler.h (fhandler_tty_slave::close): Declare new function.Christopher Faylor2003-03-043-2/+55
| | | | | | | | | | | | | (fhandler_tty_slave::dup): Declare new function. (fhandler_tty_slave::fixup_after_function): Declare new function. * fhandler_tty.cc (fhandler_tty_slave_open): Only increment fhandler_console::open_fhs when associated with a pty. (fhandler_tty_slave::close): Define new function. Decrement fhandler_console::open_fhs when associated with a pty. (fhandler_tty_slave::dup): Define new function. Increment fhandler_console::open_fhs when associated with a pty. (fhandler_tty_slave::fixup_after_fork): Define new function. Increment fhandler_console::open_fhs when associated with a pty.
* * fhandler_tty.cc (fhandler_pty_slave::open): Grudgingly incrementChristopher Faylor2003-03-032-0/+8
| | | | | fhandler_console::open_fhs here. (fhandler_pty_slave::close): Ditto for close.
* * lib/getopt.c: Refresh from NetBSD sources.Christopher Faylor2003-03-032-18/+32
|
* * fhandler_console.cc (fhandler_console::close): Don't decrement in use counterChristopher Faylor2003-03-032-1/+7
| | | | if in vfork fixup stage.
* * lib/getopt.c: Nuke use of unneeded BSDisms.Christopher Faylor2003-03-022-8/+7
|
* * dll_init.cc (dll_list::load_after_fork): Don't revert to LoadLibrary ifChristopher Faylor2003-03-028-48/+30
| | | | | | | | | | | | | | | | | LoadLibraryEx fails. * dtable.cc (dtable::dec_console_fds): Eliminate. (dtable::release): Don't treat console specially. (dtable::build_fhandler): Ditto. * dtable.h (console_fds): Eliminate. (dtable::dec_console_fds): Eliminate. (dtable::inc_console_fds): Eliminate. * fhandler.h (fhandler_console::open_fhs): New static element. * fhandler_console.cc (fhandler_console::open): Increment open_fs. (fhandler_console::close): Call FreeConsole if no more open consoles and ctty is not associated with the console. * syscalls.cc (setsid): Simplify check for when to call FreeConsole. (check_pty_fds): Eliminate definition. * winsup.h (check_pty_fds): Eliminate declaration.
* * dll_init.cc (dll_list::load_after_fork): Fix typo where result of LoadLibraryChristopher Faylor2003-03-022-1/+6
| | | | was ignored.
* fix typoChristopher Faylor2003-03-021-1/+1
|
* * fhandler_socket.cc (fhandler_socket::bind): Open and write socketCorinna Vinschen2003-03-012-20/+37
| | | | file using Win32 calls.
* * fhandler_socket.cc (get_inet_addr): Open and read socket file usingCorinna Vinschen2003-03-012-7/+32
| | | | Win32 calls.
* * cygwin.din: Wrap atexit and exit with cygwin, thread-safe functions.Christopher Faylor2003-03-015-12/+53
| | | | | * dcrt0.cc (cygwin_atexit): New function. (cygwin_exit): Ditto.
* 2003-02-28 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2003-02-282-3/+8
| | | | | * syscalls.cc (fstat64): Pass get_name () to pc. (access): Pass fn to stat_worker.
* 2003-03-27 Corinna Vinschen <corinna@vinschen.de>Corinna Vinschen2003-02-272-61/+131
| | | | | | | | | | | | | * fhandler_socket.cc (class sock_event): New class managing Winsock events for interruptible socket calls. (fhandler_socket::connect): Move support for interruptible call to class sock_event. Use class object instead. (fhandler_socket::accept): Ditto. Remove useless casts. 2003-03-27 Thomas Pfaff <tpfaff@gmx.net> * fhandler_socket.cc (fhandler_socket::connect): Add support for an interruptable connect.
* * uinfo.cc (internal_getlogin): Only update user.groups.pgsidCorinna Vinschen2003-02-272-1/+7
| | | | if the call to set the primary group succeeds.