diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2013-04-23 13:44:36 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2013-04-23 13:44:36 +0400 |
commit | 61522196c71593da09572fce9af9e0d7dad61bc3 (patch) | |
tree | 9bf74facd67974fa2f780d6ce68b14eb7a94e371 /winsup/cygserver | |
parent | 1875ee55d31d3673059373c8f9837bf98f93c713 (diff) |
* Merge in cygwin-64bit-branch.
Diffstat (limited to 'winsup/cygserver')
-rw-r--r-- | winsup/cygserver/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygserver/ChangeLog.64bit | 87 | ||||
-rw-r--r-- | winsup/cygserver/Makefile.in | 2 | ||||
-rw-r--r-- | winsup/cygserver/bsd_helper.cc | 2 | ||||
-rw-r--r-- | winsup/cygserver/bsd_helper.h | 4 | ||||
-rw-r--r-- | winsup/cygserver/bsd_log.cc | 4 | ||||
-rw-r--r-- | winsup/cygserver/bsd_log.h | 4 | ||||
-rw-r--r-- | winsup/cygserver/bsd_mutex.cc | 6 | ||||
-rw-r--r-- | winsup/cygserver/client.cc | 8 | ||||
-rw-r--r-- | winsup/cygserver/cygserver.cc | 51 | ||||
-rw-r--r-- | winsup/cygserver/msg.cc | 2 | ||||
-rw-r--r-- | winsup/cygserver/process.h | 4 | ||||
-rw-r--r-- | winsup/cygserver/sem.cc | 2 | ||||
-rw-r--r-- | winsup/cygserver/shm.cc | 2 | ||||
-rw-r--r-- | winsup/cygserver/sysv_shm.cc | 6 | ||||
-rw-r--r-- | winsup/cygserver/threaded_queue.h | 4 |
16 files changed, 139 insertions, 53 deletions
diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog index 76b6c27db..a29903af4 100644 --- a/winsup/cygserver/ChangeLog +++ b/winsup/cygserver/ChangeLog @@ -1,3 +1,7 @@ +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details. + 2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx> * Makefile.in: Remove old from CFLAGS and move C*FLAGS so that they can diff --git a/winsup/cygserver/ChangeLog.64bit b/winsup/cygserver/ChangeLog.64bit new file mode 100644 index 000000000..7ab21bf54 --- /dev/null +++ b/winsup/cygserver/ChangeLog.64bit @@ -0,0 +1,87 @@ +2013-03-07 Corinna Vinschen <corinna@vinschen.de> + + * msg.cc (client_request_msg::serve): Revert change to refuse 64 bit + processes on 32 bit systems. + * sem.cc (client_request_sem::serve): Ditto. + * shm.cc (client_request_shm::serve): Ditto. + +2013-03-01 Corinna Vinschen <corinna@vinschen.de> + + * client.cc: Revert changes to handle 32 bit processes on 64 bit + systems. + * sysv_msg.cc: Ditto. + * sysv_sem.cc: Ditto. + * sysv_shm.cc: Ditto. + +2013-02-13 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygserver.exe): Make cygwin_build a tooldir (-B instead + of -L) to support bootstrapping. + +2013-02-09 Corinna Vinschen <corinna@vinschen.de> + + * configure: Regenerate to fix wrong ac_unique_file dependency. + +2012-12-06 Corinna Vinschen <corinna@vinschen.de> + + * sysv_msg.cc (conv_timespec32_to_timespec): Move implementation to + cygserver_ipc.h. + (conv_timespec_to_timespec32): Ditto. + (conv_msqid_ds32_to_msqid_ds): Drop and move code into copyin_msqid_ds. + (conv_msqid_ds_to_msqid_ds32): Drop and move code into copyout_msqid_ds. + * sysv_sem.cc (copyin_semid_ds): New inline function on Cygwin. + (copyout_semid_ds): Ditto. + (__semctl): Use a conditional arg_size value rather than a fixed + sizeof(real_arg) throughout, to accommodate 64/32 bit conversion. + Use copyout_semid_ds and copyin_semid_ds to copy semid_ds + structures from cygserver to client and vice versa on Cygwin. + * sysv_shm.cc (copyin_shmid_ds): New inline function on Cygwin. + (copyout_shmid_ds): Ditto. + (shmctl): Use copyout_shmid_ds and copyin_shmid_ds to copy shmid_ds + structures from cygserver to client and vice versa on Cygwin. + +2012-12-05 Corinna Vinschen <corinna@vinschen.de> + + * client.cc (client_request::header_t::header_t): Accommodate changes + to msglen member. + (client_request::handle_request): Ditto. + (client_request::client_request): Zero out entire parameter block. + Explain why. + * sysv_msg.cc (conv_timespec32_to_timespec): New inline function on + 64 bit Cygwin. + (conv_timespec_to_timespec32): Ditto. + (conv_msqid_ds32_to_msqid_ds): Ditto. + (conv_msqid_ds_to_msqid_ds32): Ditto. + (copyin_msqid_ds): New inline function on Cygwin. + (copyout_msqid_ds): Ditto. + (msgctl): Use copyout_msqid_ds and copyin_msqid_ds to copy msqid_ds + structures from cygserver to client and vice versa on Cygwin. + (msgsnd): Special case copyin of msg_type on 64 bit Cygwin. + (msgrcv): Special case copyout of msg_type on 64 bit Cygwin. + +2012-12-04 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (tunable_int_fetch): Convert 2nd parameter to + int32_t. + * bsd_helper.h (tunable_int_fetch): Fix declaration accordingly. + * bsd_log.cc (log_level): Change type to int32_t. + * bsd_log.h (log_level): Fix declaration accordingly. + * bsd_mutex.cc (msgmni): Change type to int32_t. + (semmni): Ditto. + * cygserver.cc: Fix debug output to be target agnostic. Use same + style throughout. + * msg.cc (client_request_msg::serve): Refuse to serve 64 bit processes + from 32 bit cygserver. + * sem.cc (client_request_sem::serve): Ditto. + * shm.cc (client_request_shm::serve): Ditto. + * sysv_shm.cc (shm_delete_mapping): Mark size as unused to make gcc + happy. + (kern_shmat): Ditto with flags. + * process.h (class process): Change type of _cleaning_up member to LONG. + * threaded_queue.h (class threaded_queue): Ditto for _workers_count. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add AC_NO_EXECUTABLES to allow bootstrap. + * configure: Regenerate. + diff --git a/winsup/cygserver/Makefile.in b/winsup/cygserver/Makefile.in index e98dea2e6..e2fe30992 100644 --- a/winsup/cygserver/Makefile.in +++ b/winsup/cygserver/Makefile.in @@ -71,7 +71,7 @@ libclean: fullclean: clean libclean cygserver.exe: $(CYGWIN_LIB) $(OBJS) $(CYGWIN_OBJS) - $(CXX) -o $@ ${wordlist 2,999,$^} -static -static-libgcc -L$(cygwin_build) -lntdll + $(CXX) -o $@ ${wordlist 2,999,$^} -static -static-libgcc -B$(cygwin_build) -lntdll $(cygwin_build)/%.o: $(cygwin_source)/%.cc @$(MAKE) -C $(@D) $(@F) diff --git a/winsup/cygserver/bsd_helper.cc b/winsup/cygserver/bsd_helper.cc index 7c6d23a60..718c587c3 100644 --- a/winsup/cygserver/bsd_helper.cc +++ b/winsup/cygserver/bsd_helper.cc @@ -655,7 +655,7 @@ tunable_param_init (const char *config_file, bool force) } void -tunable_int_fetch (const char *name, long *tunable_target) +tunable_int_fetch (const char *name, int32_t *tunable_target) { tun_struct *s; for (s = &tunable_params[0]; s->name; ++s) diff --git a/winsup/cygserver/bsd_helper.h b/winsup/cygserver/bsd_helper.h index 045898573..bc8d22810 100644 --- a/winsup/cygserver/bsd_helper.h +++ b/winsup/cygserver/bsd_helper.h @@ -1,6 +1,6 @@ /* bsd_helper.h: Helps integrating BSD kernel code - Copyright 2003 Red Hat, Inc. + Copyright 2003, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -60,7 +60,7 @@ vm_object_t vm_object_duplicate (struct thread *td, vm_object_t object); void vm_object_deallocate (vm_object_t object); void tunable_param_init (const char *, bool); -void tunable_int_fetch (const char *, long *); +void tunable_int_fetch (const char *, int32_t *); void tunable_bool_fetch (const char *, tun_bool_t *); #endif /* _BSD_HELPER_H */ diff --git a/winsup/cygserver/bsd_log.cc b/winsup/cygserver/bsd_log.cc index 78dcdb00c..18dc1a53b 100644 --- a/winsup/cygserver/bsd_log.cc +++ b/winsup/cygserver/bsd_log.cc @@ -1,6 +1,6 @@ /* bsd_log.cc - Copyright 2003, 2004 Red Hat Inc. + Copyright 2003, 2004, 2012 Red Hat Inc. This file is part of Cygwin. @@ -14,7 +14,7 @@ details. */ #include <stdio.h> #include <stdlib.h> -long log_level = 8; /* Illegal value. Don't change! */ +int32_t log_level = 8; /* Illegal value. Don't change! */ tun_bool_t log_debug = TUN_UNDEF; tun_bool_t log_syslog = TUN_UNDEF; tun_bool_t log_stderr = TUN_UNDEF; diff --git a/winsup/cygserver/bsd_log.h b/winsup/cygserver/bsd_log.h index 48573182a..0027d4ff5 100644 --- a/winsup/cygserver/bsd_log.h +++ b/winsup/cygserver/bsd_log.h @@ -1,6 +1,6 @@ /* bsd_log.h: Helps integrating BSD kernel code - Copyright 2003 Red Hat, Inc. + Copyright 2003, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -13,7 +13,7 @@ details. */ #include <sys/types.h> #include <sys/syslog.h> -extern long log_level; +extern int32_t log_level; extern tun_bool_t log_debug; extern tun_bool_t log_syslog; extern tun_bool_t log_stderr; diff --git a/winsup/cygserver/bsd_mutex.cc b/winsup/cygserver/bsd_mutex.cc index d4cad5678..a13cfe07d 100644 --- a/winsup/cygserver/bsd_mutex.cc +++ b/winsup/cygserver/bsd_mutex.cc @@ -1,6 +1,6 @@ /* bsd_mutex.cc - Copyright 2003, 2004, 2005, 2007 Red Hat Inc. + Copyright 2003, 2004, 2005, 2007, 2012 Red Hat Inc. This file is part of Cygwin. @@ -285,8 +285,8 @@ msleep_init (void) msleep_glob_evt = CreateEvent (NULL, TRUE, FALSE, NULL); if (!msleep_glob_evt) panic ("CreateEvent in msleep_init failed: %lu", GetLastError ()); - long msgmni = support_msgqueues ? msginfo.msgmni : 0; - long semmni = support_semaphores ? seminfo.semmni : 0; + int32_t msgmni = support_msgqueues ? msginfo.msgmni : 0; + int32_t semmni = support_semaphores ? seminfo.semmni : 0; TUNABLE_INT_FETCH ("kern.ipc.msgmni", &msgmni); TUNABLE_INT_FETCH ("kern.ipc.semmni", &semmni); debug ("Try allocating msgmni (%d) + semmni (%d) msleep records", diff --git a/winsup/cygserver/client.cc b/winsup/cygserver/client.cc index dfa88d09b..63ce421c9 100644 --- a/winsup/cygserver/client.cc +++ b/winsup/cygserver/client.cc @@ -1,6 +1,6 @@ /* client.cc - Copyright 2001, 2002, 2003, 2004, 2008, 2009 Red Hat Inc. + Copyright 2001, 2002, 2003, 2004, 2008, 2009, 2012, 2013 Red Hat Inc. Written by Egor Duda <deo@logos-m.ru> @@ -115,11 +115,11 @@ client_request_attach_tty::send (transport_layer_base * const conn) } client_request::header_t::header_t (const request_code_t request_code, - const size_t msglen) - : msglen (msglen), - request_code (request_code) + const size_t len) + : request_code (request_code) { assert (request_code >= 0 && request_code < CYGSERVER_REQUEST_LAST); + msglen = len; } // FIXME: also check write and read result for -1. diff --git a/winsup/cygserver/cygserver.cc b/winsup/cygserver/cygserver.cc index 8b3fd4c45..bf78e9daf 100644 --- a/winsup/cygserver/cygserver.cc +++ b/winsup/cygserver/cygserver.cc @@ -1,6 +1,6 @@ /* cygserver.cc - Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011 Red Hat Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011, 2012 Red Hat Inc. Written by Egor Duda <deo@logos-m.ru> @@ -51,13 +51,13 @@ setup_privileges () rc = OpenProcessToken (GetCurrentProcess () , TOKEN_ALL_ACCESS , &hToken) ; if (!rc) { - debug ("error opening process token (%lu)", GetLastError ()); + debug ("error opening process token (err %u)", GetLastError ()); return false; } rc = LookupPrivilegeValue (NULL, SE_DEBUG_NAME, &sPrivileges.Privileges[0].Luid); if (!rc) { - debug ("error getting privilege luid (%lu)", GetLastError ()); + debug ("error getting privilege luid (err %u)", GetLastError ()); ret_val = false; goto out; } @@ -66,7 +66,7 @@ setup_privileges () rc = AdjustTokenPrivileges (hToken, FALSE, &sPrivileges, 0, NULL, NULL) ; if (!rc) { - debug ("error adjusting privilege level. (%lu)", GetLastError ()); + debug ("error adjusting privilege level. (err %u)", GetLastError ()); ret_val = false; goto out; } @@ -106,8 +106,8 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process, 0, bInheritHandle, DUPLICATE_SAME_ACCESS)) { - log (LOG_ERR, "error getting handle(%u) to server (%lu)", - (unsigned int)from_handle, GetLastError ()); + log (LOG_ERR, "error getting handle(%p) to server (err %u)", + from_handle, GetLastError ()); goto out; } } else @@ -119,7 +119,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process, | DACL_SECURITY_INFORMATION), sd, sizeof (sd_buf), &bytes_needed)) { - log (LOG_ERR, "error getting handle SD (%lu)", GetLastError ()); + log (LOG_ERR, "error getting handle SD (err %u)", GetLastError ()); goto out; } @@ -128,8 +128,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process, if (!AccessCheck (sd, from_process_token, access, &access_mapping, &ps, &ps_len, &access, &status)) { - log (LOG_ERR, "error checking access rights (%lu)", - GetLastError ()); + log (LOG_ERR, "error checking access rights (err %u)", GetLastError ()); goto out; } @@ -143,7 +142,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process, to_process, to_handle_ptr, access, bInheritHandle, 0)) { - log (LOG_ERR, "error getting handle to client (%lu)", GetLastError ()); + log (LOG_ERR, "error getting handle to client (err %u)", GetLastError ()); goto out; } @@ -191,8 +190,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn, if (!from_process_handle) { - log (LOG_ERR, "error opening `from' process, error = %lu", - GetLastError ()); + log (LOG_ERR, "error opening `from' process (err %u)", GetLastError ()); error_code (EACCES); return; } @@ -204,8 +202,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn, if (!to_process_handle) { - log (LOG_ERR, "error opening `to' process, error = %lu", - GetLastError ()); + log (LOG_ERR, "error opening `to' process (err %u)", GetLastError ()); CloseHandle (from_process_handle); error_code (EACCES); return; @@ -228,7 +225,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn, TRUE, &token_handle); - debug ("opened thread token, rc=%lu", rc); + debug ("opened thread token, rc=%u", rc); if (!conn->revert_to_self ()) { CloseHandle (from_process_handle); @@ -239,8 +236,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn, if (!rc) { - log (LOG_ERR, "error opening thread token, error = %lu", - GetLastError ()); + log (LOG_ERR, "error opening thread token (err %u)", GetLastError ()); CloseHandle (from_process_handle); CloseHandle (to_process_handle); error_code (EACCES); @@ -264,7 +260,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn, from_master, &req.from_master, TRUE) != 0) { - log (LOG_ERR, "error duplicating from_master handle, error = %lu", + log (LOG_ERR, "error duplicating from_master handle (err %u)", GetLastError ()); error_code (EACCES); } @@ -276,7 +272,7 @@ client_request_attach_tty::serve (transport_layer_base *const conn, to_master, &req.to_master, TRUE) != 0) { - log (LOG_ERR, "error duplicating to_master handle, error = %lu", + log (LOG_ERR, "error duplicating to_master handle (err %u)", GetLastError ()); error_code (EACCES); } @@ -285,9 +281,8 @@ client_request_attach_tty::serve (transport_layer_base *const conn, CloseHandle (to_process_handle); CloseHandle (token_handle); - debug ("%lu(%lu, %lu) -> %lu(%lu,%lu)", - req.master_pid, from_master, to_master, - req.pid, req.from_master, req.to_master); + debug ("%u(%p, %p) -> %u(%p,%p)", req.master_pid, from_master, to_master, + req.pid, req.from_master, req.to_master); return; } @@ -374,7 +369,7 @@ server_submission_loop::request_loop () */ if (!SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST + 1)) if (!SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST)) - debug ("failed to raise accept thread priority, error = %lu", + debug ("failed to raise accept thread priority (err %u)", GetLastError ()); while (_running) @@ -393,7 +388,7 @@ server_submission_loop::request_loop () if (!conn && errno == EINTR) { if (!SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_NORMAL)) - debug ("failed to reset thread priority, error = %lu", + debug ("failed to reset thread priority (err %u)", GetLastError ()); Sleep (0); @@ -401,7 +396,7 @@ server_submission_loop::request_loop () THREAD_PRIORITY_HIGHEST + 1)) if (!SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST)) - debug ("failed to raise thread priority, error = %lu", + debug ("failed to raise thread priority (err %u)", GetLastError ()); } if (conn) @@ -534,9 +529,9 @@ main (const int argc, char *argv[]) const char opts[] = "c:deEf:hl:mp:qr:sSVyY"; - long cleanup_threads = 0; - long request_threads = 0; - long process_cache_size = 0; + int32_t cleanup_threads = 0; + int32_t request_threads = 0; + int32_t process_cache_size = 0; bool shutdown = false; const char *config_file = DEF_CONFIG_FILE; bool force_config_file = false; diff --git a/winsup/cygserver/msg.cc b/winsup/cygserver/msg.cc index 87df87310..c92e698b0 100644 --- a/winsup/cygserver/msg.cc +++ b/winsup/cygserver/msg.cc @@ -1,6 +1,6 @@ /* msg.cc: Single unix specification IPC interface for Cygwin. - Copyright 2003, 2004 Red Hat, Inc. + Copyright 2003, 2004, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygserver/process.h b/winsup/cygserver/process.h index 4702d2818..3de11b6f8 100644 --- a/winsup/cygserver/process.h +++ b/winsup/cygserver/process.h @@ -1,6 +1,6 @@ /* process.h - Copyright 2001, 2002, 2003, 2004, 2005 Red Hat Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2012 Red Hat Inc. Written by Robert Collins <rbtcollins@hotmail.com> @@ -103,7 +103,7 @@ private: const DWORD _winpid; HANDLE _hProcess; HANDLE _signal_arrived; - long _cleaning_up; + LONG _cleaning_up; DWORD _exit_status; // Set in the constructor and in exit_code (). cleanup_routine *_routines_head; /* used to prevent races-on-delete */ diff --git a/winsup/cygserver/sem.cc b/winsup/cygserver/sem.cc index 37d894ef9..55cd6e51e 100644 --- a/winsup/cygserver/sem.cc +++ b/winsup/cygserver/sem.cc @@ -1,6 +1,6 @@ /* sem.cc: Single unix specification IPC interface for Cygwin. - Copyright 2003, 2004 Red Hat, Inc. + Copyright 2003, 2004, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygserver/shm.cc b/winsup/cygserver/shm.cc index 38f2d2ee5..3be0d15f4 100644 --- a/winsup/cygserver/shm.cc +++ b/winsup/cygserver/shm.cc @@ -1,6 +1,6 @@ /* shm.cc: Single unix specification IPC interface for Cygwin. - Copyright 2003, 2004 Red Hat, Inc. + Copyright 2003, 2004, 2012 Red Hat, Inc. This file is part of Cygwin. diff --git a/winsup/cygserver/sysv_shm.cc b/winsup/cygserver/sysv_shm.cc index 1a7271f87..4578c53a2 100644 --- a/winsup/cygserver/sysv_shm.cc +++ b/winsup/cygserver/sysv_shm.cc @@ -258,7 +258,7 @@ shm_delete_mapping(struct vmspace *vm, struct shmmap_state *shmmap_s) { struct shmid_ds *shmseg; int segnum, result; - size_t size; + size_t size __attribute__ ((unused)); GIANT_REQUIRED; @@ -335,7 +335,7 @@ int kern_shmat(struct thread *td, int shmid, const void *shmaddr, int shmflg) { struct proc *p = td->td_proc; - int i, flags; + int i, flags __attribute__ ((unused)); struct shmid_ds *shmseg; struct shmmap_state *shmmap_s = NULL; #ifndef __CYGWIN__ @@ -512,7 +512,7 @@ done2: return (EINVAL); #endif } -#endif /* __CYGWIN__ */ +#endif /* !__CYGWIN__ */ #ifndef _SYS_SYSPROTO_H_ struct shmctl_args { diff --git a/winsup/cygserver/threaded_queue.h b/winsup/cygserver/threaded_queue.h index 0c3f9913a..e17f90434 100644 --- a/winsup/cygserver/threaded_queue.h +++ b/winsup/cygserver/threaded_queue.h @@ -1,6 +1,6 @@ /* threaded_queue.h - Copyright 2001, 2002, 2003 Red Hat Inc. + Copyright 2001, 2002, 2003, 2012 Red Hat Inc. Written by Robert Collins <rbtcollins@hotmail.com> @@ -50,7 +50,7 @@ public: void add (queue_request *); private: - long _workers_count; + LONG _workers_count; bool _running; queue_submission_loop *_submitters_head; |