1 2007-08-02 Christopher Faylor <me+cygwin@cgf.cx>
3 * Makefile.in: Add -lntdll to link line.
4 (CYGWIN_OBJS): Include strfuncs.o.
6 2007-08-02 Corinna Vinschen <corinna@vinschen.de>
8 * smallprint.c: New file.
9 * Makefile.in (OBJS): Add smallprint.o.
10 (CYGWIN_OBJS): Remove smallprint.o from Cygwin dir.
12 2007-07-21 Corinna Vinschen <corinna@vinschen.de>
14 * bsd_helper.cc: Drop unnecessary security.h include.
16 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
18 Throughout remove using wincap.
19 * Makefile.in (OBJS): Remove wincap.o.
20 * README: Don't mention 9x.
21 * bsd_mutex.cc (_mtx_unlock): Drop checking for 9x error codes.
22 * cygserver.cc (server_submission_loop::request_loop): Add FIXME
26 * woutsup.h: Don't include wincap.h.
28 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
30 * Makefile.in (OBJS): Drop transport_sockets.o.
31 * sysv_shm.cc (shmget_allocate_segment): Remove spurious cast.
32 * transport.cc: Don't include transport_sockets.h.
33 (create_server_transport): Always create transport_layer_pipes.
34 * transport_sockets.cc: Remove.
35 * transport_sockets.h: Remove.
37 2006-05-24 Christopher Faylor <cgf@timesys.com>
39 * configure.in: Update to newer autoconf.
40 (thanks to Steve Ellcey)
41 * configure: Regenerate.
42 * aclocal.m4: New file.
44 2006-01-12 Corinna Vinschen <corinna@vinschen.de>
46 * wincap.cc: New file.
48 * Makefile.in: Accomodate having our own wincap implementation now.
50 2006-01-09 Corinna Vinschen <corinna@vinschen.de>
52 Check FreeBSD upstream changes and apply important patches.
53 * sysv_sem.cc (__semctl): Check copyin return value (from 1.76).
54 * sysv_shm.cc (shminit): Actually use the iterating variable in the
55 for loop when trying to avoid overflow (from 1.102).
57 2005-11-10 Corinna Vinschen <corinna@vinschen.de>
59 * bsd_helper.cc (securityinit): New function. Move initialization
60 of security related variables from ipcinit here.
61 * bsd_helper.h (securityinit): Add prototype.
62 * cygserver.cc (main): Call securityinit right after wincap.init.
64 2005-11-10 Corinna Vinschen <corinna@vinschen.de>
66 * bsd_log.cc (_vpanic): LOG_EMERG is overkill, use LOG_CRIT.
68 2005-11-09 Corinna Vinschen <corinna@vinschen.de>
70 * process.cc (process_cache::process): Fix maximum process condition.
72 2005-10-24 Corinna Vinschen <corinna@vinschen.de>
74 * README: Add description for new -p/--process-cache option.
75 * bsd_helper.cc (default_tun_check): Add kern.srv.process_cache_size
76 entry to tunable_params. Set max value of kern.srv.request_threads
78 * cygserver.cc (SERVER_VERSION): Set to 1.20.
79 (print_usage): Print usage of new parameter -p.
80 (main): Add process cache parameter handling. Accomodate new max
81 value of request threads.
82 * cygserver.conf: Add kern.srv.process_cache_size tunable parameter.
83 Accomodate new max value of kern.srv.request_threads.
84 * process.cc: Fix a comment.
85 (process_cache::process_cache): Add max process cache size parameter.
86 Change _cache_add_trigger to manual reset event.
87 (struct pcache_wait_t): New struct used as parameter to
89 (pcache_wait_thread): New thread function used for threaded process
91 (process_cache::wait_for_processes): Use threaded waiting if number
92 of processes to wait for is bigger than 62. Always check all processes
93 to avoid race under heavy load.
94 (process_cache::sync_wait_array): Remove useless assert. Reset
95 _cache_add_trigger right at the start since it's manual reset now.
96 Accomodate threaded waiting.
97 * process.h (process_cache::process_cache): Add max_procs parameter.
98 (process_cache::_max_process_count): New member.
99 (process_cache::_wait_array: Raise to allow up to 5 wait threads.
100 (process_cache::_process_array): Ditto.
102 2005-08-08 Christopher Faylor <cgf@timesys.com>
104 * cygserver.cc (main): Call wincap.init() earlier to avoid a NULL
107 2005-06-14 Corinna Vinschen <corinna@vinschen.de>
109 * sysv_sem.cc (semu_list): Define static to avoid gcc 4.x compiler
112 2005-04-08 Corinna Vinschen <corinna@vinschen.de>
114 * bsd_mutex.cc (msleep_cnt): Remove.
115 (msleep_max_cnt): Remove.
116 (msleep_arr): Remove.
117 (class msleep_sync_array): New class to encapsulate msleep/wakeup
118 thread synchronization.
119 (msleep_sync): New object pointer.
120 (msleep_init): Initialize new msleep_sync object.
121 (_mutex): Just call msleep_sync->enter() and msleep_sync->leave() for
122 thread synchronization. Improve debug output a bit more.
123 (wakeup): Just call msleep_sync->wakeup().
124 (wakeup_all): Whitespace fix.
126 2005-04-06 Corinna Vinschen <corinna@vinschen.de>
128 * bsd_helper.cc (ipcexit_hookthread): Fix whitespace and handle leak.
129 * bsd_mutex.cc: Include stdlib.h, sys/msg.h and sys/sem.h.
130 (mtx_init): Initialize lock counter to 0.
131 (_mtx_lock): Increment and log mutex lock counter.
132 (mtx_owned): Add winpid argument. Return true only if mutex is
133 actually owned by process winpid.
134 (_mtx_assert): Add winpid argument accordingly.
135 (_mtx_unlock): Log owner and lock count.
136 (MSLEEP_MUTEX): Remove.
138 (MSLEEP_EVENT): Ditto.
139 (msleep_event_name): Ditto.
140 (msleep_cs): New global critical section.
141 (msleep_cnt): New global variable indicating msleep record usage.
142 (msleep_max_cnt): New global variable indicating msleep record size.
143 (msleep_arr): New global pointer to msleep records.
144 (msleep_init): Initialize msleep_cs. Allocate msleep_arr array.
145 (_msleep): Rewrite using new msleep_cs/msleep_arr based thread
146 synchronization. Don't be shy with debug output.
147 (wakeup): Rewrite using new msleep_cs/msleep_arr based thread
149 * bsd_mutex.h (struct mtx): Add lock counter for better debugging.
150 (mtx_owned): Declare with winpid argument.
151 (_mtx_assert): Ditto.
152 (mtx_assert): Define with winpid argument.
153 * cygserver.cc (version): Remove.
154 (SERVER_VERSION): New define, decoupling server version information
155 from source code control system.
156 (print_version): Simplify printing server version.
157 * process.cc (process::process): Fix wrong bracketing (and handle leak).
158 (process::~process): Only try to close _signal_arrived if valid.
159 * sysv_sem.cc: Include sys/smallprint.h.
160 (semundo_clear): Define with additional struct thread pointer argument.
161 Accomodate throughout.
162 (SEMUNDO_LOCKASSERT): Define with winpid argument. Accomodate
164 (struct sem_undo): Define un_proc as pid_t on Cygwin. Accomodate
166 (seminit): Improve debugging by adding the semid to the mutex name.
167 (semget): Correctly print key value as 64 bit hex value in debug
169 (semexit_myhook): Remove Cygwin specific unlocking of mutexes owned
170 by exiting process. Keep semaphore global lock throughout whole
171 function to avoid races.
172 * sysv_shm.cc (GIANT_REQUIRED): Define empty on Cygwin. We know that
175 2005-04-01 Corinna Vinschen <corinna@vinschen.de>
177 * bsd_mutex.cc (_msleep): Whitespace fix.
178 * process.cc (process::process): Handle invalid signal_arrived values
181 2004-12-30 Corinna Vinschen <corinna@vinschen.de>
183 * bsd_mutex.cc: Include limits.h.
184 (MSLEEP_MUTEX): New define for third parameter to msleep_event_name.
186 (MSLEEP_EVENT): Ditto.
187 (msleep_event_name): Add third parameter to allow multiple
188 synchronization objects per ident.
189 (_msleep): Implement new synchronization technique to make sure
190 that all threads have been woken up by a corresponding wakeup call.
193 2004-10-18 Corinna Vinschen <corinna@vinschen.de>
195 * sysv_sem.cc: Redefine offsetof to circumvent build problems with
198 2004-10-04 Corinna Vinschen <corinna@vinschen.de>
200 * bsd_mutex.cc (_msleep): Simplify event creation. Revert change from
201 2004-08-24. It should be unnecessary now.
202 * msg.cc (client_request_msg::serve): Release process critical
203 section as early as possible.
204 * sem.cc (client_request_sem::serve): Ditto.
205 * shm.cc (client_request_shm::serve): Ditto.
206 * process.cc: Use hold and release method calls instead of
207 EnterCriticalSection/LeaveCriticalSection calls throughout.
208 * process.h (_hold): Rename from hold. Take filename and linenumber
209 parameter for logging. Define matching hold macro.
212 2004-10-01 Corinna Vinschen <corinna@vinschen.de>
214 * sysv_sem.cc: Update to FreeBSD version 1.69.
215 1.68: Reduce the overhead of semop() by using the kernel stack
216 instead of malloc'd memory to store the operations array if it
217 is small enough to fit.
218 1.69: Adjust the number of processes waiting on a semaphore properly
219 if we're woken up in the middle of sleeping.
221 2004-09-23 Corinna Vinschen <corinna@vinschen.de>
223 * sysv_shm.cc (kern_shmat): Avoid compiler warning.
225 2004-09-21 Corinna Vinschen <corinna@vinschen.de>
227 * sysv_shm.cc (vm_object_reference): remove Cygwin specific define.
228 (vm_map_find): Ditto.
229 (vm_map_inherit): Ditto.
230 (kern_shmat): On Cygwin, take shmaddr just as is. Don't call vm
231 system calls on Cygwin. Add comment.
233 2004-09-15 Corinna Vinschen <corinna@vinschen.de>
235 Fix copyright throughout.
236 Eliminate use of _impure_ptr outside Cygwin.
237 * bsd_helper.cc: Include errno.h instead of cygerrno.h.
238 * bsd_mutex.cc : Ditto.
240 * cygserver.cc: Ditto.
241 * process.cc: Don't build functions inside Cygwin. Don't include
242 cygerrno.h. Don't set errno.
243 * transport_pipes.cc (SET_ERRNO): New define. Use througout.
244 * transport_sockets.cc (SET_ERRNO): Ditto.
247 2004-09-06 Corinna Vinschen <corinna@vinschen.de>
249 * bsd_mutex.cc (_msleep): Disable resetting event object for now.
251 2004-08-31 Corinna Vinschen <corinna@vinschen.de>
253 * sysv_shm.cc (kern_shmat): Add debug_printf's.
255 2004-08-24 Corinna Vinschen <corinna@vinschen.de>
257 * bsd_mutex.cc (_msleep): Release process object while waiting.
259 2004-08-03 Corinna Vinschen <corinna@vinschen.de>
261 * transport.cc (transport_layer_base::~transport_layer_base): Resurrect.
262 * transport.h (transport_layer_base::~transport_layer_base): Ditto.
264 2004-07-30 Corinna Vinschen <corinna@vinschen.de>
266 * bsd_mutex.cc (_msleep): Reset event object and close it before
267 entering mutex. Turn order of conditional for better readability.
269 2004-07-26 Corinna Vinschen <corinna@vinschen.de>
271 * cygserver.conf: Describe relation between shmmaxpgs and SHMMAX.
273 2004-07-20 Corinna Vinschen <corinna@vinschen.de>
275 * bsd_helper.cc: Whitespace fixes.
276 * bsd_mutex.cc: Ditto.
278 2004-07-19 Corinna Vinschen <corinna@vinschen.de>
280 * transport.cc (transport_layer_base::~transport_layer_base): Remove.
281 * transport.h (transport_layer_base::~transport_layer_base): Ditto.
283 2004-07-19 Corinna Vinschen <corinna@vinschen.de>
285 * bsd_mutex.cc (win_priority): Actually calculate p from priority.
287 2004-06-03 Corinna Vinschen <corinna@vinschen.de>
289 * shm.cc (shmget): Explicitely set td_retval[0] to -1 on error.
291 2004-03-30 Corinna Vinschen <corinna@vinschen.de>
293 * sysv_shm.cc (shmget): Allow to retrieve shared memory segments
294 by shmid when IPC_KEY_IS_SHMID is set.
296 2004-03-02 Corinna Vinschen <corinna@vinschen.de>
298 * sysv_sem.cc (semundo_adjust): Check for process id instead of
299 process struct pointer, which isn't fixed under Cygwin.
300 (semexit_myhook): Ditto. Adjust debug print statements to print
301 Cygwin and Windows PIDs instead of process pointer under Cygwin.
303 2004-02-07 Corinna Vinschen <corinna@vinschen.de>
305 * bsd_mutex.cc (win_priority): Move to msleep helper function section.
306 (set_priority): Ditto. Fix formatting.
307 (_msleep): Cleanup obj formatting. Rearrange obj order.
309 2004-02-06 Corinna Vinschen <corinna@vinschen.de>
311 * bsd_mutex.cc (_msleep): Handle PCATCH using signal_arrived event.
312 * client.cc: Include sigproc.h.
313 * msg.cc (client_request_msg::serve): Accomodate third parameter to
315 * sem.cc (client_request_sem::serve): Ditto.
316 * shm.cc (client_request_shm::serve): Ditto.
317 * process.cc (process::process): Duplicate signal_arrived into
318 Cygserver process space.
319 (process::~process): Close _signal_arrived handle.
320 (process_cache::process): Add signal_arrived handling.
321 * process.h (process::process): Add signal_arrived parameter.
322 (process:signal_arrived): New read accessor.
323 (process:_signal_arrived): New member.
324 (process_cache::process): Add signal_arrived parameter.
326 2004-01-16 Corinna Vinschen <corinna@vinschen.de>
328 * process.h (cleanup_routine::~cleanup_routine): Make pure virtual
329 function to avoid miscompilation with certain versions of gcc.
330 * process.cc (cleanup_routine::~cleanup_routine): Remove.
332 2003-12-26 Christopher Faylor <cgf@redhat.com>
334 * Makefile.in (CFLAGS, CXXFLAGS): Remove unneeded include.
335 (CYGWIN_LIB): Delete.
336 (cygserver.exe target): Add -L$(cygwin_build) to the link line to force
337 linker to use build tree version of the library. Remove specific
338 inclusion of libcygwin.a from the link line.
340 2003-12-16 Corinna Vinschen <corinna@vinschen.de>
342 * bsd_helper.cc (tunable_params): Add entries for kern.ipc.msgmnb and
343 kern.ipc.msgtql. Raise max value for kern.ipc.msgseg to 65535.
344 * cygserver.conf: Add kern.ipc.msgmnb and kern.ipc.msgtql.
345 * sysv_msg.cc (msginit): Add TUNABLE_INT_FETCH call for
346 kern.ipc.msgmnb and kern.ipc.msgtql.
348 2003-11-26 Corinna Vinschen <corinna@vinschen.de>
350 * cygserver.cc (main): Move call to ipcinit() up before installing
352 * sysv_sem.cc: Update to FreeBSD version 1.67.
353 (seminit): Initialize semaphore sequence numbers to 0.
355 2003-11-26 Corinna Vinschen <corinna@vinschen.de>
357 * Makefile.in (CYGWIN_LIB): Variable pointing to libcygwin.a in
358 the parallel cygwin dir.
359 (cygserver.exe): Depend on and link against $CYGWIN_LIB.
361 2003-11-25 Christopher Faylor <cgf@redhat.com>
363 * Makefile.in (CXXFLAGS): Remove duplicate options handled in
366 2003-11-22 Corinna Vinschen <corinna@vinschen.de>
368 * msg.cc (client_request_msg::serve): Add default case to msgop switch.
369 * sem.cc (client_request_sem::serve): Add default case to semop switch.
370 * shm.cc (client_request_shm::serve): Add default case to shmop switch.
372 2003-11-21 Corinna Vinschen <corinna@vinschen.de>
374 * Makefile.in (install): Explicitely create directories. Install
375 README to $(prefix)/share/doc/Cygwin.
378 2003-11-21 Corinna Vinschen <corinna@vinschen.de>
380 * cygserver.cc (print_usage): Fix scrambled output.
382 2003-11-20 Corinna Vinschen <corinna@vinschen.de>
384 * cygserver-config: Slightly modify printed message.
386 2003-11-20 Corinna Vinschen <corinna@vinschen.de>
388 * Makefile.in (install): Install cygserver-config script to bindir.
389 * cygserver-config: New script.
391 2003-11-19 Corinna Vinschen <corinna@vinschen.de>
393 Don't use safe_new but new throughout. Fix copyright dates
395 * Makefile.in: Accomodate all new files and name changes.
396 Add a *.d dependency.
398 (etcdir): Drop in favor of more appropriate sysconfdir definition.
400 (CXXFLAGS): Add -MMD flag. Add SYSCONFDIR definition.
402 (install): Add action items.
403 (libclean): New target.
405 * bsd_helper.cc: New file.
406 * bsd_helper.h: Ditto.
409 * bsd_mutex.cc: Ditto.
410 * bsd_mutex.h: Ditto.
411 * client.cc: Rearrange to build as less as possible if
413 (client_request::handle_request): Add Message Queue and Semaphore
415 * cygserver.cc: Rearrange to build as less as possible if
416 __INSIDE_CYGWIN__. Use new debug/log/panic logging functions.
417 (DEF_CONFIG_FILE): New definition for configuration file. Use
420 (__cygserver__printf): Remove.
421 (client_request_attach_tty::serve): Return error if impersonation
423 (print_usage): Pump up help message.
424 (print_version): Add output of default configuration file.
425 (main): Accommodate new options. Allow overwrite of threading options
426 from config file. Call several new initialization functions. Drop
427 printing dots. Don't define SIGHANDLE inline.
428 * cygserver.conf: New file.
429 * cygserver_process.h: Rename to process.h.
430 * cygserver_transport.h: Rename to transport.h.
431 * cygserver_transport_pipes.h: Rename to transport_pipes.h.
432 * cygserver_transport_sockets.h: Rename to transport_sockets.h.
436 * sysv_msg.cc: New file, derived from FreeBSD version 1.52.
437 * sysv_sem.cc: New file, derived from FreeBSD version 1.66.
438 * sysv_shm.cc: New file, derived from FreeBSD version 1.89.
439 * threaded_queue.cc: Rearrange to build as less as possible if
441 * transport.cc (transport_layer_base::impersonate_client): Define bool.
442 (transport_layer_base::revert_to_self): Ditto.
443 * transport.h (transport_layer_base::impersonate_client): Declare bool.
444 (transport_layer_base::revert_to_self): Ditto.
445 * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
446 Don't call init_security.
447 (init_security): Remove.
448 (transport_layer_pipes::accept): Use global sec_all_nih.
449 (transport_layer_pipes::connect): Ditto.
450 (transport_layer_pipes::impersonate_client): Define bool.
451 (transport_layer_pipes::revert_to_self): Ditt.
452 * transport_pipes.h (transport_layer_pipes::impersonate_client): Declare
454 (transport_layer_pipes::revert_to_self): Ditto.
455 * woutsup.h: Include bsd compatibility headers.
456 (SIGHANDLE): Add definition.
457 (__cygserver__printf): Remove definition.
458 (__noop_printf): Ditto.
459 (debug_printf): Define using debug.
460 (syscall_printf): Define using log.
461 (system_printf): Ditto.
462 Drop all other _printf definitions.
464 2003-10-22 Corinna Vinschen <corinna@vinschen.de>
466 Accomodate moving cygserver header files from cygwin/include/cygwin
467 to here and cygwin dir.
468 * Makefile.in (EXEEXT): Drop as unused.
469 (EXEEXT_FOR_BUILD): Ditto.
470 (all): Don't build libcygserver.a.
471 * cygserver_process.h: Moved from cygwin/include/cygwin to here.
472 * cygserver_transport.h: Ditto.
473 * cygserver_transport_pipes.h: Ditto.
474 * cygserver_transport_sockets.h: Ditto.
475 * ipc.h: Moved to ../cygwin and renamed to cygserver_ipc.h.
476 * shm.h: Moved to ../cygwin and renamed to cygserver_shm.h.
478 2003-08-30 Christopher Faylor <cgf@redhat.com>
483 2003-08-30 Christopher Faylor <cgf@redhat.com>
485 * threaded_queue.h: New file.
487 2003-08-25 Christopher Faylor <cgf@redhat.com>
489 * Makefile.in: Build libcygserver.a.
490 * client.cc: Rename allow_daemon to allow_server.
492 2003-07-25 Christopher Faylor <cgf@redhat.com>
494 * configure.in: Use 'install-sh -c'.
495 * configure: Regenerate.
497 2003-07-25 Christopher Faylor <cgf@redhat.com>
499 * configure.in: Always use install-sh.
500 * configure: Regenerate.
502 2003-07-01 Christopher Faylor <cgf@redhat.com>
504 * Makefile.in (OBJS): Move some more files from cygwin directory.
505 * woutsup.h: Define _MT_SAFE.
507 2003-07-01 Christopher Faylor <cgf@redhat.com>
509 * configure.in: First pass.
510 * Makefile.in: Ditto.
511 * configure: Generate.