1 2008-04-30 Corinna Vinschen <corinna@vinschen.de>
3 * sysv_msg.cc: Add fix from upstream version 1.65.
4 (msgsnd): Call msleep with timeout value. Handle EWOULDBLOCK. Make
5 sure it's clear from where msleep has been called in debug output.
6 (msgrcv): Make sure it's clear from where msleep has been called in
9 2008-02-06 Corinna Vinschen <corinna@vinschen.de>
11 * bsd_helper.cc: Replace %E __small_printf format specifier with %lu
12 and call to GetLastError throughout.
13 * bsd_mutex.cc: Ditto.
14 * sysv_sem.cc (semget): Replace %X __small_printf format specifier
17 2008-02-06 Corinna Vinschen <corinna@vinschen.de>
19 Remove dependency from Cygwin internal code.
20 * Makefile.in (CYGWIN_OBJS): Remove smallprint.o.
21 (cygserver.exe): Remove strfuncs.o
22 (strfuncs.o): Drop rule.
23 * bsd_log.cc (_vlog): Use snprintf/vsnprintf instead of
24 __small_sprintf/__small_vsprintf.
25 * sysv_sem.cc (seminit): Use sys_malloc instead of malloc. Use
26 snprintf instead of __small_sprintf.
27 (semunload): Free the above allocated sema_mtx names here.
29 2008-02-03 Brian Dessent <brian@dessent.net>
31 * Makefile.in: Don't link strfuncs.o from the Cygwin build dir.
32 Build it again with __OUTSIDE_CYGWIN__ defined.
34 2007-11-05 Corinna Vinschen <corinna@vinschen.de>
36 * bsd_helper.cc (tunable_params): Add kern.ipc.shm_allow_removed as
38 * cygserver.conf: Add a description for the kern.ipc.shm_allow_removed
40 * sysv_shm.cc (shminit): Set shm_allow_removed variable according to
41 kern.ipc.shm_allow_removed setting.
43 2007-08-02 Corinna Vinschen <corinna@vinschen.de>
45 * smallprint.c: Remove.
47 2007-08-02 Christopher Faylor <me+cygwin@cgf.cx>
49 * Makefile.in: Add -lntdll to link line.
50 (CYGWIN_OBJS): Include strfuncs.o.
52 2007-08-02 Corinna Vinschen <corinna@vinschen.de>
54 * smallprint.c: New file.
55 * Makefile.in (OBJS): Add smallprint.o.
56 (CYGWIN_OBJS): Remove smallprint.o from Cygwin dir.
58 2007-07-21 Corinna Vinschen <corinna@vinschen.de>
60 * bsd_helper.cc: Drop unnecessary security.h include.
62 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
64 Throughout remove using wincap.
65 * Makefile.in (OBJS): Remove wincap.o.
66 * README: Don't mention 9x.
67 * bsd_mutex.cc (_mtx_unlock): Drop checking for 9x error codes.
68 * cygserver.cc (server_submission_loop::request_loop): Add FIXME
72 * woutsup.h: Don't include wincap.h.
74 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
76 * Makefile.in (OBJS): Drop transport_sockets.o.
77 * sysv_shm.cc (shmget_allocate_segment): Remove spurious cast.
78 * transport.cc: Don't include transport_sockets.h.
79 (create_server_transport): Always create transport_layer_pipes.
80 * transport_sockets.cc: Remove.
81 * transport_sockets.h: Remove.
83 2006-05-24 Christopher Faylor <cgf@timesys.com>
85 * configure.in: Update to newer autoconf.
86 (thanks to Steve Ellcey)
87 * configure: Regenerate.
88 * aclocal.m4: New file.
90 2006-01-12 Corinna Vinschen <corinna@vinschen.de>
92 * wincap.cc: New file.
94 * Makefile.in: Accomodate having our own wincap implementation now.
96 2006-01-09 Corinna Vinschen <corinna@vinschen.de>
98 Check FreeBSD upstream changes and apply important patches.
99 * sysv_sem.cc (__semctl): Check copyin return value (from 1.76).
100 * sysv_shm.cc (shminit): Actually use the iterating variable in the
101 for loop when trying to avoid overflow (from 1.102).
103 2005-11-10 Corinna Vinschen <corinna@vinschen.de>
105 * bsd_helper.cc (securityinit): New function. Move initialization
106 of security related variables from ipcinit here.
107 * bsd_helper.h (securityinit): Add prototype.
108 * cygserver.cc (main): Call securityinit right after wincap.init.
110 2005-11-10 Corinna Vinschen <corinna@vinschen.de>
112 * bsd_log.cc (_vpanic): LOG_EMERG is overkill, use LOG_CRIT.
114 2005-11-09 Corinna Vinschen <corinna@vinschen.de>
116 * process.cc (process_cache::process): Fix maximum process condition.
118 2005-10-24 Corinna Vinschen <corinna@vinschen.de>
120 * README: Add description for new -p/--process-cache option.
121 * bsd_helper.cc (default_tun_check): Add kern.srv.process_cache_size
122 entry to tunable_params. Set max value of kern.srv.request_threads
124 * cygserver.cc (SERVER_VERSION): Set to 1.20.
125 (print_usage): Print usage of new parameter -p.
126 (main): Add process cache parameter handling. Accomodate new max
127 value of request threads.
128 * cygserver.conf: Add kern.srv.process_cache_size tunable parameter.
129 Accomodate new max value of kern.srv.request_threads.
130 * process.cc: Fix a comment.
131 (process_cache::process_cache): Add max process cache size parameter.
132 Change _cache_add_trigger to manual reset event.
133 (struct pcache_wait_t): New struct used as parameter to
135 (pcache_wait_thread): New thread function used for threaded process
137 (process_cache::wait_for_processes): Use threaded waiting if number
138 of processes to wait for is bigger than 62. Always check all processes
139 to avoid race under heavy load.
140 (process_cache::sync_wait_array): Remove useless assert. Reset
141 _cache_add_trigger right at the start since it's manual reset now.
142 Accomodate threaded waiting.
143 * process.h (process_cache::process_cache): Add max_procs parameter.
144 (process_cache::_max_process_count): New member.
145 (process_cache::_wait_array: Raise to allow up to 5 wait threads.
146 (process_cache::_process_array): Ditto.
148 2005-08-08 Christopher Faylor <cgf@timesys.com>
150 * cygserver.cc (main): Call wincap.init() earlier to avoid a NULL
153 2005-06-14 Corinna Vinschen <corinna@vinschen.de>
155 * sysv_sem.cc (semu_list): Define static to avoid gcc 4.x compiler
158 2005-04-08 Corinna Vinschen <corinna@vinschen.de>
160 * bsd_mutex.cc (msleep_cnt): Remove.
161 (msleep_max_cnt): Remove.
162 (msleep_arr): Remove.
163 (class msleep_sync_array): New class to encapsulate msleep/wakeup
164 thread synchronization.
165 (msleep_sync): New object pointer.
166 (msleep_init): Initialize new msleep_sync object.
167 (_mutex): Just call msleep_sync->enter() and msleep_sync->leave() for
168 thread synchronization. Improve debug output a bit more.
169 (wakeup): Just call msleep_sync->wakeup().
170 (wakeup_all): Whitespace fix.
172 2005-04-06 Corinna Vinschen <corinna@vinschen.de>
174 * bsd_helper.cc (ipcexit_hookthread): Fix whitespace and handle leak.
175 * bsd_mutex.cc: Include stdlib.h, sys/msg.h and sys/sem.h.
176 (mtx_init): Initialize lock counter to 0.
177 (_mtx_lock): Increment and log mutex lock counter.
178 (mtx_owned): Add winpid argument. Return true only if mutex is
179 actually owned by process winpid.
180 (_mtx_assert): Add winpid argument accordingly.
181 (_mtx_unlock): Log owner and lock count.
182 (MSLEEP_MUTEX): Remove.
184 (MSLEEP_EVENT): Ditto.
185 (msleep_event_name): Ditto.
186 (msleep_cs): New global critical section.
187 (msleep_cnt): New global variable indicating msleep record usage.
188 (msleep_max_cnt): New global variable indicating msleep record size.
189 (msleep_arr): New global pointer to msleep records.
190 (msleep_init): Initialize msleep_cs. Allocate msleep_arr array.
191 (_msleep): Rewrite using new msleep_cs/msleep_arr based thread
192 synchronization. Don't be shy with debug output.
193 (wakeup): Rewrite using new msleep_cs/msleep_arr based thread
195 * bsd_mutex.h (struct mtx): Add lock counter for better debugging.
196 (mtx_owned): Declare with winpid argument.
197 (_mtx_assert): Ditto.
198 (mtx_assert): Define with winpid argument.
199 * cygserver.cc (version): Remove.
200 (SERVER_VERSION): New define, decoupling server version information
201 from source code control system.
202 (print_version): Simplify printing server version.
203 * process.cc (process::process): Fix wrong bracketing (and handle leak).
204 (process::~process): Only try to close _signal_arrived if valid.
205 * sysv_sem.cc: Include sys/smallprint.h.
206 (semundo_clear): Define with additional struct thread pointer argument.
207 Accomodate throughout.
208 (SEMUNDO_LOCKASSERT): Define with winpid argument. Accomodate
210 (struct sem_undo): Define un_proc as pid_t on Cygwin. Accomodate
212 (seminit): Improve debugging by adding the semid to the mutex name.
213 (semget): Correctly print key value as 64 bit hex value in debug
215 (semexit_myhook): Remove Cygwin specific unlocking of mutexes owned
216 by exiting process. Keep semaphore global lock throughout whole
217 function to avoid races.
218 * sysv_shm.cc (GIANT_REQUIRED): Define empty on Cygwin. We know that
221 2005-04-01 Corinna Vinschen <corinna@vinschen.de>
223 * bsd_mutex.cc (_msleep): Whitespace fix.
224 * process.cc (process::process): Handle invalid signal_arrived values
227 2004-12-30 Corinna Vinschen <corinna@vinschen.de>
229 * bsd_mutex.cc: Include limits.h.
230 (MSLEEP_MUTEX): New define for third parameter to msleep_event_name.
232 (MSLEEP_EVENT): Ditto.
233 (msleep_event_name): Add third parameter to allow multiple
234 synchronization objects per ident.
235 (_msleep): Implement new synchronization technique to make sure
236 that all threads have been woken up by a corresponding wakeup call.
239 2004-10-18 Corinna Vinschen <corinna@vinschen.de>
241 * sysv_sem.cc: Redefine offsetof to circumvent build problems with
244 2004-10-04 Corinna Vinschen <corinna@vinschen.de>
246 * bsd_mutex.cc (_msleep): Simplify event creation. Revert change from
247 2004-08-24. It should be unnecessary now.
248 * msg.cc (client_request_msg::serve): Release process critical
249 section as early as possible.
250 * sem.cc (client_request_sem::serve): Ditto.
251 * shm.cc (client_request_shm::serve): Ditto.
252 * process.cc: Use hold and release method calls instead of
253 EnterCriticalSection/LeaveCriticalSection calls throughout.
254 * process.h (_hold): Rename from hold. Take filename and linenumber
255 parameter for logging. Define matching hold macro.
258 2004-10-01 Corinna Vinschen <corinna@vinschen.de>
260 * sysv_sem.cc: Update to FreeBSD version 1.69.
261 1.68: Reduce the overhead of semop() by using the kernel stack
262 instead of malloc'd memory to store the operations array if it
263 is small enough to fit.
264 1.69: Adjust the number of processes waiting on a semaphore properly
265 if we're woken up in the middle of sleeping.
267 2004-09-23 Corinna Vinschen <corinna@vinschen.de>
269 * sysv_shm.cc (kern_shmat): Avoid compiler warning.
271 2004-09-21 Corinna Vinschen <corinna@vinschen.de>
273 * sysv_shm.cc (vm_object_reference): remove Cygwin specific define.
274 (vm_map_find): Ditto.
275 (vm_map_inherit): Ditto.
276 (kern_shmat): On Cygwin, take shmaddr just as is. Don't call vm
277 system calls on Cygwin. Add comment.
279 2004-09-15 Corinna Vinschen <corinna@vinschen.de>
281 Fix copyright throughout.
282 Eliminate use of _impure_ptr outside Cygwin.
283 * bsd_helper.cc: Include errno.h instead of cygerrno.h.
284 * bsd_mutex.cc : Ditto.
286 * cygserver.cc: Ditto.
287 * process.cc: Don't build functions inside Cygwin. Don't include
288 cygerrno.h. Don't set errno.
289 * transport_pipes.cc (SET_ERRNO): New define. Use througout.
290 * transport_sockets.cc (SET_ERRNO): Ditto.
293 2004-09-06 Corinna Vinschen <corinna@vinschen.de>
295 * bsd_mutex.cc (_msleep): Disable resetting event object for now.
297 2004-08-31 Corinna Vinschen <corinna@vinschen.de>
299 * sysv_shm.cc (kern_shmat): Add debug_printf's.
301 2004-08-24 Corinna Vinschen <corinna@vinschen.de>
303 * bsd_mutex.cc (_msleep): Release process object while waiting.
305 2004-08-03 Corinna Vinschen <corinna@vinschen.de>
307 * transport.cc (transport_layer_base::~transport_layer_base): Resurrect.
308 * transport.h (transport_layer_base::~transport_layer_base): Ditto.
310 2004-07-30 Corinna Vinschen <corinna@vinschen.de>
312 * bsd_mutex.cc (_msleep): Reset event object and close it before
313 entering mutex. Turn order of conditional for better readability.
315 2004-07-26 Corinna Vinschen <corinna@vinschen.de>
317 * cygserver.conf: Describe relation between shmmaxpgs and SHMMAX.
319 2004-07-20 Corinna Vinschen <corinna@vinschen.de>
321 * bsd_helper.cc: Whitespace fixes.
322 * bsd_mutex.cc: Ditto.
324 2004-07-19 Corinna Vinschen <corinna@vinschen.de>
326 * transport.cc (transport_layer_base::~transport_layer_base): Remove.
327 * transport.h (transport_layer_base::~transport_layer_base): Ditto.
329 2004-07-19 Corinna Vinschen <corinna@vinschen.de>
331 * bsd_mutex.cc (win_priority): Actually calculate p from priority.
333 2004-06-03 Corinna Vinschen <corinna@vinschen.de>
335 * shm.cc (shmget): Explicitely set td_retval[0] to -1 on error.
337 2004-03-30 Corinna Vinschen <corinna@vinschen.de>
339 * sysv_shm.cc (shmget): Allow to retrieve shared memory segments
340 by shmid when IPC_KEY_IS_SHMID is set.
342 2004-03-02 Corinna Vinschen <corinna@vinschen.de>
344 * sysv_sem.cc (semundo_adjust): Check for process id instead of
345 process struct pointer, which isn't fixed under Cygwin.
346 (semexit_myhook): Ditto. Adjust debug print statements to print
347 Cygwin and Windows PIDs instead of process pointer under Cygwin.
349 2004-02-07 Corinna Vinschen <corinna@vinschen.de>
351 * bsd_mutex.cc (win_priority): Move to msleep helper function section.
352 (set_priority): Ditto. Fix formatting.
353 (_msleep): Cleanup obj formatting. Rearrange obj order.
355 2004-02-06 Corinna Vinschen <corinna@vinschen.de>
357 * bsd_mutex.cc (_msleep): Handle PCATCH using signal_arrived event.
358 * client.cc: Include sigproc.h.
359 * msg.cc (client_request_msg::serve): Accomodate third parameter to
361 * sem.cc (client_request_sem::serve): Ditto.
362 * shm.cc (client_request_shm::serve): Ditto.
363 * process.cc (process::process): Duplicate signal_arrived into
364 Cygserver process space.
365 (process::~process): Close _signal_arrived handle.
366 (process_cache::process): Add signal_arrived handling.
367 * process.h (process::process): Add signal_arrived parameter.
368 (process:signal_arrived): New read accessor.
369 (process:_signal_arrived): New member.
370 (process_cache::process): Add signal_arrived parameter.
372 2004-01-16 Corinna Vinschen <corinna@vinschen.de>
374 * process.h (cleanup_routine::~cleanup_routine): Make pure virtual
375 function to avoid miscompilation with certain versions of gcc.
376 * process.cc (cleanup_routine::~cleanup_routine): Remove.
378 2003-12-26 Christopher Faylor <cgf@redhat.com>
380 * Makefile.in (CFLAGS, CXXFLAGS): Remove unneeded include.
381 (CYGWIN_LIB): Delete.
382 (cygserver.exe target): Add -L$(cygwin_build) to the link line to force
383 linker to use build tree version of the library. Remove specific
384 inclusion of libcygwin.a from the link line.
386 2003-12-16 Corinna Vinschen <corinna@vinschen.de>
388 * bsd_helper.cc (tunable_params): Add entries for kern.ipc.msgmnb and
389 kern.ipc.msgtql. Raise max value for kern.ipc.msgseg to 65535.
390 * cygserver.conf: Add kern.ipc.msgmnb and kern.ipc.msgtql.
391 * sysv_msg.cc (msginit): Add TUNABLE_INT_FETCH call for
392 kern.ipc.msgmnb and kern.ipc.msgtql.
394 2003-11-26 Corinna Vinschen <corinna@vinschen.de>
396 * cygserver.cc (main): Move call to ipcinit() up before installing
398 * sysv_sem.cc: Update to FreeBSD version 1.67.
399 (seminit): Initialize semaphore sequence numbers to 0.
401 2003-11-26 Corinna Vinschen <corinna@vinschen.de>
403 * Makefile.in (CYGWIN_LIB): Variable pointing to libcygwin.a in
404 the parallel cygwin dir.
405 (cygserver.exe): Depend on and link against $CYGWIN_LIB.
407 2003-11-25 Christopher Faylor <cgf@redhat.com>
409 * Makefile.in (CXXFLAGS): Remove duplicate options handled in
412 2003-11-22 Corinna Vinschen <corinna@vinschen.de>
414 * msg.cc (client_request_msg::serve): Add default case to msgop switch.
415 * sem.cc (client_request_sem::serve): Add default case to semop switch.
416 * shm.cc (client_request_shm::serve): Add default case to shmop switch.
418 2003-11-21 Corinna Vinschen <corinna@vinschen.de>
420 * Makefile.in (install): Explicitely create directories. Install
421 README to $(prefix)/share/doc/Cygwin.
424 2003-11-21 Corinna Vinschen <corinna@vinschen.de>
426 * cygserver.cc (print_usage): Fix scrambled output.
428 2003-11-20 Corinna Vinschen <corinna@vinschen.de>
430 * cygserver-config: Slightly modify printed message.
432 2003-11-20 Corinna Vinschen <corinna@vinschen.de>
434 * Makefile.in (install): Install cygserver-config script to bindir.
435 * cygserver-config: New script.
437 2003-11-19 Corinna Vinschen <corinna@vinschen.de>
439 Don't use safe_new but new throughout. Fix copyright dates
441 * Makefile.in: Accomodate all new files and name changes.
442 Add a *.d dependency.
444 (etcdir): Drop in favor of more appropriate sysconfdir definition.
446 (CXXFLAGS): Add -MMD flag. Add SYSCONFDIR definition.
448 (install): Add action items.
449 (libclean): New target.
451 * bsd_helper.cc: New file.
452 * bsd_helper.h: Ditto.
455 * bsd_mutex.cc: Ditto.
456 * bsd_mutex.h: Ditto.
457 * client.cc: Rearrange to build as less as possible if
459 (client_request::handle_request): Add Message Queue and Semaphore
461 * cygserver.cc: Rearrange to build as less as possible if
462 __INSIDE_CYGWIN__. Use new debug/log/panic logging functions.
463 (DEF_CONFIG_FILE): New definition for configuration file. Use
466 (__cygserver__printf): Remove.
467 (client_request_attach_tty::serve): Return error if impersonation
469 (print_usage): Pump up help message.
470 (print_version): Add output of default configuration file.
471 (main): Accommodate new options. Allow overwrite of threading options
472 from config file. Call several new initialization functions. Drop
473 printing dots. Don't define SIGHANDLE inline.
474 * cygserver.conf: New file.
475 * cygserver_process.h: Rename to process.h.
476 * cygserver_transport.h: Rename to transport.h.
477 * cygserver_transport_pipes.h: Rename to transport_pipes.h.
478 * cygserver_transport_sockets.h: Rename to transport_sockets.h.
482 * sysv_msg.cc: New file, derived from FreeBSD version 1.52.
483 * sysv_sem.cc: New file, derived from FreeBSD version 1.66.
484 * sysv_shm.cc: New file, derived from FreeBSD version 1.89.
485 * threaded_queue.cc: Rearrange to build as less as possible if
487 * transport.cc (transport_layer_base::impersonate_client): Define bool.
488 (transport_layer_base::revert_to_self): Ditto.
489 * transport.h (transport_layer_base::impersonate_client): Declare bool.
490 (transport_layer_base::revert_to_self): Ditto.
491 * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
492 Don't call init_security.
493 (init_security): Remove.
494 (transport_layer_pipes::accept): Use global sec_all_nih.
495 (transport_layer_pipes::connect): Ditto.
496 (transport_layer_pipes::impersonate_client): Define bool.
497 (transport_layer_pipes::revert_to_self): Ditt.
498 * transport_pipes.h (transport_layer_pipes::impersonate_client): Declare
500 (transport_layer_pipes::revert_to_self): Ditto.
501 * woutsup.h: Include bsd compatibility headers.
502 (SIGHANDLE): Add definition.
503 (__cygserver__printf): Remove definition.
504 (__noop_printf): Ditto.
505 (debug_printf): Define using debug.
506 (syscall_printf): Define using log.
507 (system_printf): Ditto.
508 Drop all other _printf definitions.
510 2003-10-22 Corinna Vinschen <corinna@vinschen.de>
512 Accomodate moving cygserver header files from cygwin/include/cygwin
513 to here and cygwin dir.
514 * Makefile.in (EXEEXT): Drop as unused.
515 (EXEEXT_FOR_BUILD): Ditto.
516 (all): Don't build libcygserver.a.
517 * cygserver_process.h: Moved from cygwin/include/cygwin to here.
518 * cygserver_transport.h: Ditto.
519 * cygserver_transport_pipes.h: Ditto.
520 * cygserver_transport_sockets.h: Ditto.
521 * ipc.h: Moved to ../cygwin and renamed to cygserver_ipc.h.
522 * shm.h: Moved to ../cygwin and renamed to cygserver_shm.h.
524 2003-08-30 Christopher Faylor <cgf@redhat.com>
529 2003-08-30 Christopher Faylor <cgf@redhat.com>
531 * threaded_queue.h: New file.
533 2003-08-25 Christopher Faylor <cgf@redhat.com>
535 * Makefile.in: Build libcygserver.a.
536 * client.cc: Rename allow_daemon to allow_server.
538 2003-07-25 Christopher Faylor <cgf@redhat.com>
540 * configure.in: Use 'install-sh -c'.
541 * configure: Regenerate.
543 2003-07-25 Christopher Faylor <cgf@redhat.com>
545 * configure.in: Always use install-sh.
546 * configure: Regenerate.
548 2003-07-01 Christopher Faylor <cgf@redhat.com>
550 * Makefile.in (OBJS): Move some more files from cygwin directory.
551 * woutsup.h: Define _MT_SAFE.
553 2003-07-01 Christopher Faylor <cgf@redhat.com>
555 * configure.in: First pass.
556 * Makefile.in: Ditto.
557 * configure: Generate.