1 2003-12-03 Corinna Vinschen <corinna@vinschen.de>
3 * fcntl.cc (fcntl_worker): Remove static storage class.
4 * flock.cc (flock): Use struct __flock64. Call fcntl_worker.
5 Use Cygwin errno functions instead of accessing errno directly.
6 * winsup.h: Declare fcntl_worker.
8 2003-12-03 Corinna Vinschen <corinna@vinschen.de>
10 * fcntl.cc: Whitespace cleanup.
12 2003-12-03 Christopher Faylor <cgf@redhat.com>
14 * cygthread.cc (cygthread::stub): Properly establish _threadinfo
16 (cygthread::stub2): New function.
17 (cygthread::simplestub): Ditto.
18 (cygthread::simplestub2): New function.
19 * cygthread.h (cygthread::stub2): Declare new function.
20 (cygthread::simplestub2): Ditto.
21 * cygtls.h (_threadinfo::call): Declare new function.
22 (_threadinfo::call2): Ditto.
23 * dcrt0.cc (dll_crt0_1): Accommodate new _threadinfo::init which
24 doesn't return pointer to tls.
25 (_dll_crt0): Remove obsolete DECLARE_TLS_STORAGE.
27 * exceptions.cc (_threadinfo::call): New function.
28 (_threadinfo::call2): Ditto.
29 (_threadinfo::init): Don't return pointer.
30 * thread.cc (pthread::thread_init_wrapper): Properly establish
31 _threadinfo environment.
32 (pthread::thread_init_wrapper2): New function.
33 * thread.h (pthread::thread_init_wrapper): Remove noreturn attribute
34 (pthread::thread_init_wrapper2): Declare new function.
35 * winbase.h: Remove obsolete code.
37 2003-12-02 Christopher Faylor <cgf@redhat.com>
39 * Makefile.in: Change the way that -f options are appended to CFLAGS,
42 2003-12-02 Christopher Faylor <cgf@redhat.com>
44 * fcntl.cc (_fcntl): Silence a compiler warning.
46 2003-12-02 Pierre Humblet <pierre.humblet@ieee.org>
48 * pinfo.cc (pinfo::init): Use shared_name to construct the mapname.
50 2003-12-01 Thomas Pfaff <tpfaff@gmx.net>
52 * thread.cc (pthread_rwlock::add_reader): Remove mx parameter for
54 (pthread::prepare): Ensure race safeness when adding function
55 pointers to atfork lists by using List_insert.
56 * thread.h (List_insert): Use InterlockedCompareExchangePointer to
57 ensure race safeness without using a mutex.
58 (List_remove): Use InterlockedCompareExchangePointer to
59 ensure race safeness with List_insert.
60 (List::insert): Remove mx parameter for List_insert call.
62 2003-12-01 Corinna Vinschen <corinna@vinschen.de>
64 * Makefile.in (OBSOLETE_FUNCTIONS): Add fcntl.
65 (NEW_FUNCTIONS): Add fcntl64.
66 * cygwin.din: Export fcntl64. Make fcntl being SIGFE.
67 * fcntl.cc (fcntl_worker): New function.
68 (fcntl64): New function.
69 (_fcntl): Call fcntl_worker. Convert 32 bit flock structure into
70 64 bit flock structure and vice versa.
71 * fhandler.cc (fhandler_base::lock): Change 2nd parameter to
73 * fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto. Rework
75 * fhandler.h: Accomodate above method argument changes.
76 * include/cygwin/types.h: Add struct __flock32 and __flock64.
77 Define struct flock according to setting of __CYGWIN_USE_BIG_TYPES__.
78 * include/cygwin/version.h: Bump API minor number.
80 2003-12-01 Corinna Vinschen <corinna@vinschen.de>
82 * cygheap.cc (cygheap_init): Set cygheap->shared_prefix.
83 * cygheap.h (struct init_cygheap): Add shared_prefix.
84 * shared.cc (shared_name): Use cygheap->shared_prefix.
86 2003-12-01 Pierre Humblet <pierre.humblet@ieee.org>
88 * shared.cc (shared_name): Take into account the SE_CREATE_GLOBAL_NAME
89 privilege when building the name string.
90 (open_shared): Remove the call to OpenFileMapping.
91 (shared_info::initialize): Move cygheap initialization to ...
92 (memory_init): ... here. Suppress now useless shared_h variable.
93 (user_shared_initialize): Make tu a cygpsid.
95 2003-12-01 Dr. Volker Zell <Dr.Volker.Zell@oracle.com>
97 * include/tzfile.h: Remove duplicate definition of TM_SUNDAY.
98 * localtime.cc: Point TZDIR to the /usr/share/zoneinfo directory used
99 by the tzcode package.
101 2003-11-30 Corinna Vinschen <corinna@vinschen.de>
103 * flock.cc: Renamed from flock.c.
105 2003-11-29 Christopher Faylor <cgf@redhat.com>
107 * pinfo.h: Remove global_sigs declaration.
108 * siginfo.h: Move global_sigs declaration here.
109 * Makefile.in: Remove duplicate compiler flag.
111 2003-11-29 Christopher Faylor <cgf@redhat.com>
113 * exceptions.cc (_threadinfo::pop): Zero *contents* of popped stack
114 location rather than the actual stack pointer.
116 2003-11-29 Nicholas Wourms <nwourms@netscape.net>
118 * Makefile.in: (DLL_OFILES): Add flock.o.
119 * cygwin.din: Export flock.
121 * include/sys/file.h: Include sys/cdefs.h.
122 Add function prototype for flock().
123 Add some comments from BSD's header for further clarity.
124 (L_SET, L_CURR, L_INCR, L_XTND): Redefine as the macros
125 SEEK_SET, SEEK_CUR, SEEK_CUR, & SEEK_END respectively.
126 (LOCK_SH,LOCK_EX,LOCK_NB,LOCK_UN): New macros for flock().
127 * include/cygwin/version.h: Bump API minor number.
129 2003-11-28 Christopher Faylor <cgf@redhat.com>
131 * sigproc.cc (no_signals_available): Fix so that non-zero exit state is
132 a true condition rather than errnoneously only checking other states
133 when exist_state was zero.
135 2003-11-28 Christopher Faylor <cgf@redhat.com>
137 * pinfo.h (_pinfo::getthread2signal): Remove obsolete function.
138 * cygtls.h (_threadinfo): Define tid more precisely.
139 (_threadinfo::operator HANDLE): Define.
140 * exceptions.cc (_threadinfo::interupt_now): Use _threadinfo HANDLE
141 operator to derive thread handle.
142 (setup_handler): Ditto.
143 * sigproc.cc: Reorganize includes.
145 2003-11-28 Christopher Faylor <cgf@redhat.com>
147 * pinfo.h (_pinfo::getsig): Remove obsolete function, here and
149 * exceptions.cc: Ditto.
150 * fhandler_termios.cc: Ditto.
154 * Makefile.in: Revert previous change which made a cygwin.din newer
155 than a version.h a warning rather than an error.
157 2003-11-28 Christopher Faylor <cgf@redhat.com>
159 * cygwin.din: Re-add inexplicably missing semaphore/msg functions.
161 2003-11-28 Christopher Faylor <cgf@redhat.com>
163 * gendevices: Issue error when shilka is missing.
165 2003-11-28 Christopher Faylor <cgf@redhat.com>
167 * include/cygwin/signal.h: New file.
169 2003-11-28 Christopher Faylor <cgf@redhat.com>
171 Eliminate use of sigframe and sigthread throughout.
172 * Makefile.in (DLL_OFILES): Add sigfe.o. Remove reliance on cygwin.def
173 from cygwin0.dll dependency since dependence on sigfe.o implies that.
174 Generate def file on the fly using 'gendef'.
175 * configure.in: Don't auto-generate cygwin.def.
176 * configure: Regenerate.
177 * cygwin.din: Add SIGFE stuff where appropriate.
178 * dcrt0.cc (dll_crt0_1): Initialize cygwin tls early in process
179 startup. Set _main_tls to address of the main thread's cygwin tls.
180 * debug.h: Remove now unneeded WFSO and WFMO declarations.
181 * exceptions.cc (_last_thread): Define.
182 (set_thread_state_for_signals): New function.
183 (reset_thread_exception_for_signals): Ditto.
184 (init_thread_for_signals): Ditto.
185 (delete_thread_for_signals): Ditto.
186 (capture_thread_for_signals): Ditto.
187 (handle_exceptions): Set return address explicitly for exceptions prior
189 (interrupt_on_return): Eliminate.
190 (setup_handler): Add preliminary implementation for dealing with
191 thread-specific signals by querying _main_tls.
192 (signal_exit): Use cygthread::main_thread_id instead of mainthread.id.
193 (call_signal_handler_now): For now, just handle the main thread.
194 * fork.cc (vfork): Save and restore main _my_tls.
195 * gendef: New file. Generates def file and sigfe.s file.
196 * gentls_offsets: New file. Generates offsets for perl to use in
198 * how-signals-work.txt: Mention that info is obsolete.
199 * init.cc (dll_entry): Initialize cygwin tls storage here.
200 * miscfuncs.cc (low_priority_sleep): Make a C function for easier
202 * perthread.h (vfork_save::tls): New element.
203 * signal.cc (nanosleep): Replace previous use of
204 sigframe.call_signal_handler_now with straight call to
205 call_signal_handler_now.
207 * syscalls.cc (readv): Ditto.
208 * termios.cc (tcsetattr): Ditto.
209 * wait.cc (wait4): Ditto.
210 * sigproc.cc (sig_dispatch_pending): Ditto.
212 * sigproc.h: Declare call_signal_handler_now.
213 * thread.cc (pthread::thread_init_wrapper): Initialize cygwin tls.
214 Remove obsolete and unworking signal stuff.
215 * thread.h (verifyable_object::sigs): Eliminate.
216 (verifyable_object::sigmask): Eliminate.
217 (verifyable_object::sigtodo): Eliminate.
218 (verifyable_object::exit): Make attribute noreturn.
219 (verifyable_object::thread_init_wrapper): Ditto.
220 (pthread_null::exit): Ditto.
221 * winbase.h (__stackbase): Always define.
222 * winsup.h (low_priority_sleep): Declare as a "C" function.
223 * include/cygwin/version.h: Bump API version to reflect sigwait export.
225 * include/sys/queue.h: Protect SLIST_ENTRY from previous declaration.
227 * signal.cc (sigwait): Implement.
229 * select.cc (fhandler_base::ready_for_read): Add debugging output.
231 * devices.h: Define more device pointers via their storage.
232 * devices.in: Don't parse things like /dev/inet/tcp, as they really
234 * devices.cc: Regenerate.
235 * gendevices: Set proper protection for output file.
237 * cygtls.h: New file.
239 * gentls_offsets: New file.
240 * tlsoffsets.h: New file. Autogenerated.
241 * config/i386/longjmp.c: Remove. File subsumed by gendef output.
242 * config/i386/makefrag: Remove obsolete file.
244 * fhandler.cc: Remove spurious access_worker declaration.
246 * spawn.cc (spawnve): Make debugging output more accurate.
248 * cygwin-gperf: Remove.
249 * devices.cc: Remove.
251 2003-11-28 Christopher Faylor <cgf@redhat.com>
253 * speclib: Use correct EOF marker. Ensure that directory is actually
254 deleted when running under Windows.
256 2003-11-27 Christopher Faylor <cgf@redhat.com>
258 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Reorganize to
259 avoid inappropriate .lnk extensions with munged filenames under managed
262 2003-11-26 Corinna Vinschen <corinna@vinschen.de>
264 * sec_helper.cc (set_process_privilege): Rename restore_priv to
267 2003-11-26 Pierre Humblet <pierre.humblet@ieee.org>
269 * sec_helper.cc (set_process_privilege): Call LookupPrivilegeValue
270 before opening the token.
272 2003-11-26 Corinna Vinschen <corinna@vinschen.de>
274 * dir.cc (mkdir): Use local security_descriptor. Call
275 set_security_attribute appropriately.
276 * external.cc (cygwin_internal): Ditto.
277 * fhandler.cc (fhandler_base::open): Ditto.
278 * fhandler_socket.cc (fhandler_socket::bind): Ditto.
279 * path.cc (symlink_worker): Ditto.
280 * sec_acl.cc (setacl): Ditto. Call read_sd appropriately.
282 * sec_helper.cc (security_descriptor::malloc): New method.
283 (security_descriptor::realloc): New method.
284 (security_descriptor::free): New method.
285 * security.cc (read_sd): Get security_descriptor as parameter instead
286 of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check.
287 Allocate the security_descriptor buffer according to size returned by
288 a call to GetFileSecurity. Return buffer size on success.
289 (write_sd): Get security_descriptor as parameter instead of
290 PSECURITY_DESCRIPTOR and a size.
291 (get_nt_attribute): Use local security_descriptor.
292 (get_nt_object_attribute): Ditto in case of type == SE_REGISTRY_KEY.
293 Allocate security_descriptor buffer according to size returned by
294 a call to RegGetKeySecurity.
295 (alloc_sd): Make static. Get security_descriptor as parameter instead
296 of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check.
297 (set_security_attribute): Get security_descriptor as parameter instead
298 of PSECURITY_DESCRIPTOR and a size.
299 (set_nt_attribute): Use local security_descriptor.
300 (check_file_access): Ditto.
301 * security.h: Add class security_descriptor.
302 (read_sd): Change declaration to get security_descriptor as parameter
303 instead of PSECURITY_DESCRIPTOR and a size.
305 (set_security_attribute): Ditto.
306 (alloc_sd): Remove declaration.
307 * thread.cc (semaphore::semaphore): Use local security_descriptor. Call
308 set_security_attribute appropriately.
310 2003-11-26 Corinna Vinschen <corinna@vinschen.de>
312 * sec_acl.h (getace): Use FILE_*_BITS as permission mask.
313 * security.cc (get_attribute_from_acl): Ditto.
314 * security.h (FILE_READ_BITS): Define to match also GENERIC bits.
315 (FILE_WRITE_BITS): Ditto.
316 (FILE_EXEC_BITS): Ditto.
318 2003-11-25 Christopher Faylor <cgf@redhat.com>
320 * thread.cc: Minor whitespace cleanup. Remove some obsolete code.
322 2003-11-24 Christopher Faylor <cgf@redhat.com>
324 * dtable.cc (build_fh_name): Set error in dummy fhandler when one is
325 noted during path_conv.
326 * fhandler.h (fhandler_base::set_error): New method.
328 2003-11-24 Christopher Faylor <cgf@redhat.com>
330 * configure.in: Avoid using cygserver unless hosting on cygwin.
332 2003-11-23 Christopher Faylor <cgf@redhat.com>
334 * sigproc.cc (sig_send): Correct below checkin. Use
335 thisframe.call_signal_handler.
337 2003-11-23 Christopher Faylor <cgf@redhat.com>
339 * sigproc.cc (proc_exists): A zombie process does not exist.
340 (sig_send): Improve debugging output. Wait for pipe to be created
341 before trying to send to it. Call call_signal_handler_now if sending a
344 2003-11-22 Christopher Faylor <cgf@redhat.com>
346 * dcrt0.cc (check_sanity_and_sync): Correct api major version check so
347 that newer dlls will work with older apps but not vice versa.
349 2003-11-21 Christopher Faylor <cgf@redhat.com>
351 * sem.cc: Always include signal.h to handle SIGSYS raise when
355 2003-11-21 Christopher Faylor <cgf@redhat.com>
357 * msg.cc: Always include signal.h to handle SIGSYS raise when
360 2003-11-20 Christopher Faylor <cgf@redhat.com>
362 * configure.in: Make --use-server the default. Remove powerpc target.
363 * configure: Regenerate.
365 2003-11-20 Corinna Vinschen <corinna@vinschen.de>
367 * msg.cc (msgctl): Raise SIGSYS if call not available.
371 * sem.cc (semctl): Ditto.
374 * shm.cc (shmat): Ditto.
379 2003-11-19 Corinna Vinschen <corinna@vinschen.de>
381 * cygserver.h (client_request::request_code_t): Add
382 CYGSERVER_REQUEST_MSG and CYGSERVER_REQUEST_SEM.
383 (admininstrator_group_sid): Add extern declaration.
384 * cygserver_ipc.h: Rewrite.
385 * cygserver_msg.h: New file.
386 * cygserver_sem.h: New file.
387 * cygserver_shm.h: More or less rewrite.
388 * cygwin.din: Add msgctl, msgget, msgrcv, msgsnd, semctl, semget and
391 * safe_memory.h: Remove.
394 * include/cygwin/ipc.h: Use appropriate guard.
395 (struct ipc_perm): Add seq.
396 (IPCID_TO_IX): New define from BSD.
397 (IPCID_TO_SEQ): Ditto.
398 (IXSEQ_TO_IPCID): Ditto.
402 * include/cygwin/msg.h: Use appropriate guard. #ifdef _KERNEL all stuff
403 not explicitely defined by SUSv3. Use signed types in structs to match
405 (msgqnum_t): Define unsigned.
407 (struct msqid_ds): Add msg_first and msg_last.
408 (struct msginfo): Remove msgpool. Add msgssz and msgseg.
409 * include/cygwin/sem.h: Use appropriate guard. #ifdef _KERNEL all stuff
410 not explicitely defined by SUSv3. Use signed types in structs to match
412 (SEM_UNDO): Define appropriately.
413 (struct semid_ds): Add sem_base.
414 (struct seminfo): Add semmap and semusz.
415 (SEM_A): New define from BSD.
418 (union semun): Define.
419 * include/cygwin/shm.h: Use appropriate guard. #ifdef _KERNEL all stuff
420 not explicitely defined by SUSv3. Use signed types in structs to match
422 (SHMLBA): Define using cygwin_internal(CW_GET_SHMLBA) call.
423 (struct shmid_ds): Add shm_internal.
424 (struct shm_info): Rename shm_ids to used_ids as in BSD. Add define
426 * include/cygwin/sysproto.h: New file.
427 * include/cygwin/version.h: Bump API minor number.
428 * include/sys/ipc.h: New file.
429 * include/sys/msg.h: New file.
430 * include/sys/queue.h: New file from BSD.
431 * include/sys/sem.h: New file.
432 * include/sys/shm.h: New file.
433 * include/sys/sysproto.h: New file.
435 2003-11-19 Corinna Vinschen <corinna@vinschen.de>
437 * dtable.cc (build_fh_pc): Resurrect accidentally removed
438 DEV_CYGDRIVE_MAJOR case.
440 2003-11-17 Brian Ford <ford@vss.fsi.com>
442 * fhandler.cc (fhandler_base::lseek): Include high order offset
443 bits in return value.
445 2003-11-17 Corinna Vinschen <corinna@vinschen.de>
447 * bsdlib.cc (getprogname): New function.
448 (setprogname): New funtion.
449 * cygwin.din: Export getprogname and setprogname.
450 * include/cygwin/version.h: Bumb API version number.
452 2003-11-15 Christopher Faylor <cgf@redhat.com>
454 * include/limits.h: Revert unsanctioned changes below.
455 * include/cygwin/config.h: Ditto.
456 * include/sys/param.h: Ditto.
458 2003-11-14 Robert Collins <rbtcollins@hotmail.com>
459 Ron Parker <rdparker@butlermfg.com>
461 * bsdlib.cc: Update throughout to use CYG_MAX_PATH rather than MAX_PATH.
464 * delqueue.cc: Ditto.
466 * dll_init.cc: Ditto.
471 * exceptions.cc: Ditto.
472 * external.cc: Ditto.
473 * fhandler_disk_file.cc: Ditto.
474 * fhandler_proc.cc: Ditto.
475 * fhandler_process.cc: Ditto.
476 * fhandler_raw.cc: Ditto.
477 * fhandler_registry.cc: Ditto.
478 * fhandler_socket.cc: Ditto.
479 * fhandler_virtual.cc: Ditto.
480 * miscfuncs.cc: Ditto.
488 * registry.cc: Ditto.
490 * shared_info.h: Ditto.
491 * smallprint.c: Ditto.
494 * syscalls.cc: Ditto.
498 * include/limits.h: Ditto.
499 * include/cygwin/config.h: Ditto.
500 * include/sys/param.h: Ditto.
502 2003-11-12 Brian Ford <ford@vss.fsi.com>
504 * dtable.cc (build_fh_pc): Use DEV_SERIAL_MAJOR to catch all serial
505 ports. Remove redundant FH_CYGDRIVE case since it is handled by
508 2003-11-11 Christopher Faylor <cgf@redhat.com>
509 Thomas Pfaff <tpfaff@gmx.net>
511 * thread.cc (pthread::exit): Cleanup on thread exit.
512 (__reent_t::init_clib): Set thread local clib __cleanup var
515 2003-11-10 Christopher Faylor <cgf@redhat.com>
517 * miscfuncs.cc (low_priority_sleep): Make a "C" function.
518 * winsup.h (low_priority_sleep): Revert previous change to declaration.
520 2003-11-10 Corinna Vinschen <corinna@vinschen.de>
522 * winsup.h (low_priority_sleep): Fix declaration to avoid linker
525 2003-11-10 Thomas Pfaff <tpfaff@gmx.net>
527 * thread.cc (__reent_t::init_clib): Set thread local clib
528 __sdidinit var appropriately.
530 2003-11-08 Corinna Vinschen <corinna@vinschen.de>
532 * syscalls.cc (ftruncate64): Log length as long long.
533 (logout): Erase ut_host. Don't write wtmp entry. Return 1 only
534 if matching utmp entry has been found, 0 otherwise.
536 2003-11-08 Corinna Vinschen <corinna@vinschen.de>
538 * external.cc (cygwin_internal): Add CW_GET_UID_FROM_SID and
539 CW_GET_GID_FROM_SID handling.
540 * include/cygwin/version.h: Bump API minor number.
541 * include/sys/cygwin.h (cygwin_getinfo_types): Add
542 CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID.
544 2003-11-07 Christopher Faylor <cgf@redhat.com>
546 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reorganize to
547 handle freeing of memory on error condition.
549 2003-11-07 Christopher Faylor <cgf@redhat.com>
551 * cygthread.cc (cygthread::freerange): Set inuse count. Avoid setting
552 ev from h as h would be NULL at this point.
553 (cygthread::operator new): Issue debugging info when overflowing the
555 (cygthread::cygthread): Set ev from h here after h has been initialized.
557 2003-11-06 Corinna Vinschen <corinna@vinschen.de>
559 * bsdlib.cc (_vwarnx): New function.
568 * cygwin.din: Export above functions.
569 * include/err.h: New file.
570 * include/cygwin/version.h: Bump API minor number.
572 2003-11-06 Corinna Vinschen <corinna@vinschen.de>
574 * syscalls.cc (getshmlba): New function.
575 * external.cc (cygwin_internal): Add CW_GET_SHMLBA handling.
576 * mmap.cc (mmap64): Call getshmlba to evaluate granularity.
577 * winsup.h (getshmlba): Add declaration.
578 * include/cygwin/version.h: Bump API minor number.
579 * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_SHMLBA.
581 2003-11-06 Christopher Faylor <cgf@redhat.com>
583 * winsup.h: Declare access_worker.
585 2003-11-05 Corinna Vinschen <corinna@vinschen.de>
587 * include/cygwin/types.h: Fix preprocessor guards for vm_offset_t and
588 vm_size_t. Add typedef for vm_object_t.
590 2003-11-05 Christopher Faylor <cgf@redhat.com>
592 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Detect attempt
593 to open a directory which lacks read privileges.
595 2003-11-04 Corinna Vinschen <corinna@vinschen.de>
597 * external.cc (cygwin_internal): Add CW_GET_POSIX_SECURITY_ATTRIBUTE
599 * include/cygwin/version.h: Bump API minor number.
600 * include/sys/cygwin.h (cygwin_getinfo_types): Add
601 CW_GET_POSIX_SECURITY_ATTRIBUTE.
603 * exceptions.cc (init_global_security): Move from here...
604 * sec_helper.cc (init_global_security): ...to here.
606 2003-11-04 Christopher Faylor <cgf@redhat.com>
608 * net.cc (dup_ent): Use IsBadStringPtr for alignment checks. Don't use
611 2003-11-03 Corinna Vinschen <corinna@vinschen.de>
613 * net.cc (dup_ent): Move Win 95 misalignment recogition before
614 trying to evaluate string length.
616 2003-10-31 Thomas Pfaff <tpfaff@gmx.net>
618 * thread.cc (pthread::thread_init_wrapper): Initialize exception
621 2003-10-31 Thomas Pfaff <tpfaff@gmx.net>
623 Rename pthread::running to pthread::valid throughout.
625 * thread.h: (pthread::suspend_all_except_self): New static method.
626 (pthread::resume_all): Ditto.
627 (pthread::suspend_except_self): New method.
628 (pthread::resume): Ditto.
629 * thread.cc (pthread::suspend_except_self): Implement.
630 (pthread::resume): Ditto.
632 2003-10-29 Danny Smith <dannysmith@users.sourceforege.net>
634 * include/stdint.h: Prevent signed->unsigned conversion for 32 and
635 64 bit min value constants.
637 2003-10-28 Igor Pechtchanski <pechtcha@cs.nyu.edu>
639 * path.cc (dot_special_chars): New global variable.
640 (special_name): Make files ending in "." special.
641 (fnunmunge): Allow encoded ".".
642 (mount_item::fnmunge): Handle trailing ".".
644 2003-10-28 Christopher Faylor <cgf@redhat.com>
646 * include/stdint.h: Duplicate below effort for rest of *64_*.
648 2003-10-28 Christopher Faylor <cgf@redhat.com>
650 * include/stdint.h: Correctly define INT64_MAX.
652 2003-10-27 Thomas Pfaff <tpfaff@gmx.net>
654 * thread.h (fast_mutex::init): Initialize lock_counter.
656 2003-10-27 Corinna Vinschen <corinna@vinschen.de>
658 * Makefile.in (OBSOLETE_FUNCTION): Add tmpfile.
659 (NEW_FUNCTIONS): Add _tmpfile64 -> tmpfile translation.
660 * cygwin.din: Export _tmpfile64
661 * include/cygwin/version.h: Bump api minor number.
663 2003-10-27 Corinna Vinschen <corinna@vinschen.de>
665 * cygwin.din: Add sem_close, sem_getvalue, sem_open and sem_timedwait.
666 * pthread.cc (+mangle_sem_name): New function.
669 (sem_timedwait): Ditto.
670 (sem_getvalue): Ditto.
671 * thread.cc (semaphore::semaphore): Rearrange member initialization.
672 Use appropriate security attribute for process shared semaphores.
673 (semaphore::semaphore): New constructor for named semaphores.
674 (semaphore::~semaphore): Care for semaphore name.
675 (semaphore::_post): Accomodate failing ReleaseSemaphore. Use value
676 returned by ReleaseSemaphore vor currentvalue.
677 (semaphore::_getvalue): New method.
678 (semaphore::_timedwait): Ditto.
679 (semaphore::_fixup_after_fork): Rearrange. Don't fail for process
681 (semaphore::open): New method.
682 (semaphore::timedwait): Ditto.
683 (semaphore::post): Fix return value. Set errno appropriately.
684 (semaphore::getvalue): New method.
685 * thread.h (class semaphore): Add prototypes for open, getvalue,
686 timedwait, _getvalue, _timedwait. Add prototypes for new constructor.
688 * include/semaphore.h: Add prototypes for sem_open, sem_close,
689 sem_timedwait and sem_getvalue.
690 include/cygwin/version.h: Bump API minor number.
692 2003-10-27 Corinna Vinschen <corinna@vinschen.de>
694 * miscfunc.cc (__check_invalid_read_ptr): New function.
697 2003-10-26 Corinna Vinschen <corinna@vinschen.de>
699 * security.h (cygpsid::debug_print): Avoid compiler warnings.
701 2003-10-25 Corinna Vinschen <corinna@vinschen.de>
703 * path.cc (normalize_posix_path): Test runs of more than two
704 dots for being a run of only dots. Let it pass if not.
706 2003-10-25 Brian Ford <ford@vss.fsi.com>
708 * fhandler.cc (fhandler_base::ioctl): Handle FIONBIO.
710 2003-10-24 Thomas Pfaff <tpfaff@gmx.net>
712 Rename native_mutex to fast_mutex throughout.
713 Rename pthread_key::save_key_to_buffer to
714 pthread_key::_fixup_before_fork throughout.
715 Rename pthread_key::recreate_key_from_buffer to
716 pthread_key::_fixup_after_fork throughout.
718 * thread.cc (native_mutex::init): Remove.
719 (native_mutex::lock): Ditto.
720 (native_mutex::unlock): Ditto.
721 (pthread::push_cleanup_handler): InterlockedExchangePointer
723 (pthread_rwlock::pthread_rwlock): Initialize readers list mutex.
724 (pthread_rwlock::add_reader): Add reader via List_insert.
725 (pthread_rwlock::lookup_reader): Lock list while walking through.
726 (pthread_cond::init): Locking the init mutex is now void.
727 (pthread_rwlock::init): Ditto.
728 (pthread_mutex::init): Ditto.
729 * thread.h: Include security.h.
730 (fast_mutex): New class. Replacement for native_mutex.
731 (List_insert): New template function.
732 (List_remove): Ditto.
733 (List::List): Initialize synchronising mutex.
734 (List::fixup_after_fork): New method.
735 (List::insert): Add node via List_insert.
736 (List::remove): Remove node via List_remove.
738 (List::for_each): Lock list while walking through.
739 (List::mx_init): New method.
740 (pthread_mutex::fixup_after_fork): Fixup mutex list after fork.
741 (pthread::fixup_after_fork): Ditto.
742 (pthread_conds::fixup_after_fork): Ditto.
743 (pthread_rwlock::fixup_after_fork): Ditto.
744 (semaphore::fixup_after_fork): Ditto.
745 (pthread_rwlock::readers_mx): New member.
747 2003-10-24 Brian Ford <ford@vss.fsi.com>
749 * fhandler.cc (fhandler_base::fcntl): Don't clobber O_APPEND when
750 both O_NONBLOCK/O_NDELAY are set for F_SETFL.
752 2003-10-24 Corinna Vinschen <corinna@vinschen.de>
754 * path.cc (win32_device_name): Fix comment.
756 2003-10-23 Christopher Faylor <cgf@redhat.com>
758 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set return
759 value in FIONBIO case.
761 2003-10-23 Corinna Vinschen <corinna@vinschen.de>
763 * fhandler_proc.cc (format_proc_partitions): Use new device code
764 to get major and minor device numbers. Fix size evaluation.
766 2003-10-22 Corinna Vinschen <corinna@vinschen.de>
768 * external.cc (cygwin_internal): Add CW_GET_ERRNO_FROM_WINERROR
770 * include/cygwin/version.h: Bump API minor number.
771 * include/sys/cygwin.h (cygwin_getinfo_types): Add
772 CW_GET_ERRNO_FROM_WINERROR.
774 2003-10-22 Corinna Vinschen <corinna@vinschen.de>
776 * Makefile.in: Add $(LIBSERVER) rule.
777 * cygserver.h: Moved from include/cygwin to here.
778 * cygserver_ipc.h: Moved from ../cygserver to here.
779 * cygserver_shm.h: Ditto.
780 * cygwin.din: Add shmat, shmctl, shmdt and shmget.
781 * fhandler_tty.cc (fhandler_tty_slave::open): Don't warn about handle
782 dup'ing if not build with USE_SERVER.
783 * shm.cc: Include cygerrno.h unconditionally.
784 (shmat): Set errno to ENOSYS and return -1 if not build with
790 * include/cygwin/cygserver_process.h: Moved to ../cygserver directory.
791 * include/cygwin/cygserver_transport.h: Ditto.
792 * include/cygwin/cygserver_transport_pipes.h: Ditto.
793 * include/cygwin/cygserver_transport_sockets.h: Ditto.
794 * include/cygwin/version.h: Bump API minor number.
796 2003-10-16 Pierre Humblet <pierre.humblet@ieee.org>
798 * syscalls.cc (seteuid32): Always construct a default DACL including
799 the new sid, Admins and SYSTEM and copy it to the new thread token.
800 * security.cc (create_token): Use a NULL default DACL in NtCreateToken.
802 2003-10-14 Micha Nelissen <M.Nelissen@student.tue.nl>
804 * dcrt0.cc: Remove local variable alternate_charset_active.
805 * fhandler.h: Add variable alternate_charset_active, functions
806 str_to_con, con_to_str to dev_console structure.
807 * fhandler_console.cc (con_to_str): Move function into dev_console
810 (fhandler_console::read): Call con_to_str on dev_state.
811 (fhandler_console::write_normal): Call str_to_con on dev_state.
812 (fhandler_console::char_command): Change active_charset_active
813 assignment to be on dev_state.
814 * winsup.h: Remove global external variable alternate_charset_active.
816 2003-10-13 Micha Nelissen <M.Nelissen@student.tue.nl>
818 * fhandler_console.cc (char_command): Add escape sequence for codepage
819 ansi <-> oem switching for ncurses frame drawing capabilities.
820 * dcrt0.cc: Add local variable alternate_charset_active.
821 * winsup.h: Add global external variable alternate_charset_active.
823 2003-10-14 Corinna Vinschen <corinna@vinschen.de>
825 * exceptions.cc (ctrl_c_handler): Don't send SIGHUP on
826 CTRL_LOGOFF_EVENT to processes running in invisible Windows Stations.
827 * window.cc (has_visible_window_station): New function.
828 * winsup.h: Add declaration for has_visible_window_station.
830 2003-10-10 Christopher Faylor <cgf@redhat.com>
832 * fhandler_tty.cc (fhandler_tty_slave::open): Don't create a new window
833 station if one already exists.
835 2003-10-10 Christopher Faylor <cgf@redhat.com>
837 * shared.cc (shared_info::initialize): Remove myself check since
838 hMainProc initialization will allow user initialization to work.
840 2003-10-09 Yitzchak Scott-Thoennes <sthoenna@efn.org>
842 * include/sys/mman.h (MAP_FAILED): Define as void *.
844 2003-10-08 Christopher Faylor <cgf@redhat.com>
846 * dcrt0.cc (hMainProc): Initialize to useful value for use when dll is
848 * shared.cc (shared_info::initialize): Don't initialize user stuff if
849 myself doesn't exist.
851 2003-10-08 Corinna Vinschen <corinna@vinschen.de>
853 * syscalls.cc (unlink): Don't even try DELETE_ON_CLOSE technique on
854 systems not supporting it.
856 2003-10-02 Christopher Faylor <cgf@redhat.com>
858 * dcrt0.cc (dll_crt0_1): Call newlib __sinit routine to ensure that
859 stdio buffers are initialized to avoid thread initialization races.
861 2003-10-01 Christopher Faylor <cgf@redhat.com>
863 * path.cc (win32_device_name): Only fill out destination buffer when
864 it's really a device.
866 2003-09-30 Christopher Faylor <cgf@redhat.com>
868 * Makefile.in: Add YA method for generating devices.cc.
869 * child_info.h: YA update of another magic number.
870 * gendevices: New file.
871 * devices.in: New file.
872 * devices.cc: Regenerate.
873 * devices.shilka: Remove.
874 * devices.h: Correctly define device pointers.
875 (device): Remove now obsolete fields.
876 (device::native): Renamed from device::fmt.
877 * dtable.cc (build_fh_dev): Simplify in light of new unit parsing
879 (build_fh_pc): Ditto.
880 * path.cc (win32_device_name): Ditto.
881 * fhandler.h (fhandler_base::get_native_name): Reflect renaming of fmt
883 * fhandler_tty.cc (fhandler_tty_mster::init): Initialize slave device
884 prior to reporting unit.
886 2003-09-30 Corinna Vinschen <corinna@vinschen.de>
888 * fhandler.cc (fhandler_base::fstat): Drop FH_FLOPPY case.
890 2003-09-30 Corinna Vinschen <corinna@vinschen.de>
892 * fhandler.h (class fhandler_dev_raw): Add method fstat.
893 * fhandler_raw.cc (fhandler_dev_raw::fstat): New method.
895 2003-09-30 Corinna Vinschen <corinna@vinschen.de>
897 * devices.h (enum fh_devices): Remove DEV_RAWDRIVE_MAJOR and
899 * devices.shilka (dev_rawdrive_storage): Remove.
900 (unit_devices): Remove pointer to dev_rawdrive_storage.
901 (uniq_devices): Remove rawdrive entry.
902 * dtable.cc (build_fh_pc): Remove DEV_RAWDRIVE_MAJOR case.
903 * path.cc (win32_device_name): ditto.
905 2003-09-29 Corinna Vinschen <corinna@vinschen.de>
907 * syslog.cc (vsyslog): Print debug message if ReportEventA fails.
909 2003-09-28 Pierre Humblet <pierre.humblet@ieee.org>
911 * sigproc.cc (proc_subproc): Restrict permissions on ppid_handle.
913 2003-09-28 Christopher Faylor <cgf@redhat.com>
915 * devices.shilka (device::parse): Restore check for tty in unit
916 handling, but without the previous typo.
917 * devices.cc: Regenerate.
918 * devices.h (DEV_CYGDRIVE_MAJOR): Change major number to one used by
919 linux for "user-mode virtual block device".
921 2003-09-28 Corinna Vinschen <corinna@vinschen.de>
923 * devices.h: Move a few device major numbers. Fix typo of FH_UDP.
924 * device.shilka: Remove /dev/hd device entries, rename all device_hd*
926 (device::parse): Disallow units outside lower and upper bounds.
927 * dtable.cc (build_fh_pc): Fix typo of FH_UDP.
928 * path.cc (win32_device_name): Fix win32 name creation to match new
931 2003-09-27 Christopher Faylor <cgf@redhat.com>
933 * device.shilka (device::parse): Allow units on other than tty.
935 2003-09-27 Corinna Vinschen <corinna@vinschen.de>
937 * wincap.cc (wincapc::init): Allow requesting server info for NT4 SP6.
939 2003-09-27 Christopher Faylor <cgf@redhat.com>
941 * path.cc (symlink_info::check): Use new introducer for mknod'ed files.
942 (parse_device): Ditto.
943 * syscalls.cc (mknod_worker): Ditto.
945 2003-09-27 Christopher Faylor <cgf@redhat.com>
947 * devices.shilka: Add /dev/sda disk devices.
948 * devices.cc: Regenerate.
950 2003-09-27 Christopher Faylor <cgf@redhat.com>
952 * cygwin-shilka: Remove '#line directives' or suffer debugging oddities.
953 Use -length option so that device prefixes are used.
954 * devices.cc: Regenerate.
955 * syscalls.cc (ttyname): Add debugging output.
957 2003-09-26 Vaclav Haisman <V.Haisman@sh.cvut.cz>
959 * Makefile.in: Add libusr32.a to DLL_IMPORTS.
960 * wincap.h (wincaps::is_server): New flag.
961 (wincapc::version): Change type to OSVERSIONINFOEX.
962 (wincapc::is_server): New function.
963 * wincap.cc (wincap_unknown::is_server): New initializer.
965 (wincap_95osr2): Ditto.
970 (wincap_nt4sp4): Ditto.
971 (wincap_2000): Ditto.
973 (wincapc::init): Adapt to OSVERSIONINFOEX. Add detection of NT server
975 * sched.cc: Include windows.h and registry.h.
976 (sched_rr_get_interval): Re-implement for NT systems.
978 2003-09-26 Christopher Faylor <cgf@redhat.com>
980 * fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set
981 ioctl_request event when window size changes. Store failing errno in
982 ioctl_retval (needed?).
984 2003-09-26 Pavel Tsekov <ptsekov@gmx.net>
986 * fhandler_console.c (fhandler_console::read): Record the state of the
987 SHIFT, CTRL and ALT keys at the time of the last keyboard input event.
988 (fhandler_console::ioctl): Handle requests to retrieve the keyboard
989 modifiers via the TIOCLINUX command.
990 * fhandler_tty.c (fhandler_tty_slave::read): Ditto.
991 * include/sys/termios.h (TIOCLINUX): New macro definition.
993 2003-09-26 Pierre Humblet <pierre.humblet@ieee.org>
995 * pinfo.cc (pinfo::init): Do not give FILE_MAP_WRITE access to Everybody.
996 * exceptions.cc (sig_handle_tty_stop): Do not create pinfo parent with
998 * fhandler_process.cc (fhandler_process::fill_filebuf): Ditto for pinfo p.
999 * signal.cc (kill_worker): Ditto for pinfo dest.
1001 2003-09-26 Pierre Humblet <pierre.humblet@ieee.org>
1003 * pinfo.h (pinfo::set_acl): Declare.
1004 * pinfo.cc (pinfo_fixup_after_fork): Duplicate with no rights.
1005 (pinfo::set_acl): New.
1006 * spawn.cc (spawn_guts): Call myself.set_acl.
1008 2003-09-26 Pierre Humblet <pierre.humblet@ieee.org>
1010 * uinfo.cc (cygheap_user::init): Make sure the current user appears
1011 in the default DACL. Rearrange to decrease the indentation levels.
1012 Initialize the effec_cygsid directly.
1013 (internal_getlogin): Do not reinitialize myself->gid. Open the process
1014 token with the required access.
1015 * cygheap.h (class cygheap_user): Delete members pid and saved_psid.
1016 Create members effec_cygsid and saved_cygsid.
1017 (cygheap_user::set_sid): Define inline.
1018 (cygheap_user::set_saved_sid): Ditto.
1019 (cygheap_user::sid): Modify.
1020 (cygheap_user::saved_sid): Modify.
1021 * cygheap.cc (cygheap_user::set_sid): Delete.
1022 (cygheap_user::set_saved_sid): Ditto.
1023 * sec_helper.cc (sec_acl): Set the correct acl size.
1024 * autoload.cc (FindFirstFreeAce): Add.
1025 * security.h: Define ACL_DEFAULT_SIZE.
1027 2003-09-26 Corinna Vinschen <corinna@vinschen.de>
1029 * mmap.cc (munmap): Use correct address and length parameters when
1030 calling fhandler's munmap.
1032 2003-09-26 Corinna Vinschen <corinna@vinschen.de>
1034 * spawn.cc (spawn_guts): Set errno to E2BIG if command line is
1035 longer than CreateProcess allows (32K).
1037 2003-09-25 Christopher Faylor <cgf@redhat.com>
1039 * dtable.cc (build_fh_name): Return pointer to a 'nodevice' rather than
1040 a NULL pointer or suffer SEGVs with invalid paths.
1042 2003-09-25 Christopher Faylor <cgf@redhat.com>
1044 * fork.cc (fork_parent): Detect failed pinfo constructor.
1045 * spawn.cc (spawn_guts): Don't overwrite ENOMEM errno on failed pinfo
1048 2003-09-25 Christopher Faylor <cgf@redhat.com>
1050 * spawn.cc (spawnve): Remove vfork short circuit and let caller deal
1053 2003-09-25 Pierre Humblet <pierre.humblet@ieee.org>
1054 Christopher Faylor <cgf@redhat.com>
1056 * spawn.cc (spawn_guts): Catch potential error from pinfo.remember.
1057 Change debug messages to make sense. Pass correct value to pinfo
1058 constructor. Ensure cleanup after errors. Always reimpersonate after
1061 2003-09-25 Christopher Faylor <cgf@redhat.com>
1063 * spawn.cc (spawn_guts): Move system signal handling stuff after
1064 CreateProcess error check.
1066 2003-09-25 Pierre Humblet <pierre.humblet@ieee.org>
1068 * shared_info.h: Update CURR_USER_MAGIC, CURR_SHARED_MAGIC and
1070 (mount_info::cb): Delete.
1071 (mount_info::version): Delete.
1072 (shared_info::delqueue): Delete.
1073 * Makefile.in: Do magic for USER_MAGIC, class user_info, instead
1076 2003-09-24 Christopher Faylor <cgf@redhat.com>
1078 * include/tzfile.h: Add some missing entries.
1080 2003-09-24 Christopher Faylor <cgf@redhat.com>
1082 * include/paths.h: Add some missing entries.
1084 2003-09-24 Christopher Faylor <cgf@redhat.com>
1086 * shared_info.h (CURR_MOUNT_MAGIC): Fix.
1088 * sigproc.cc (sigpacket): New structure.
1089 (sig_send): Fill out sigpacket structure to send to signal thread
1090 rather than racily sending separate packets.
1091 (wait_sig): Use sigpacket structure to receive info from signal sender.
1093 2003-09-24 Pierre Humblet <pierre.humblet@ieee.org>
1095 * shared_info.h (class user_info): New.
1096 (cygwin_user_h): New.
1098 (enum shared_locations): Replace SH_MOUNT_TABLE by SH_USER_SHARED;
1099 (mount_table): Change from variable to macro.
1100 * shared.cc: Use sizeof(user_info) in "offsets".
1101 (user_shared_initialize): Add "reinit" argument to indicate need
1102 to reinitialize the mapping. Replace "mount_table" by "user_shared"
1103 throughout. Call user_shared->mountinfo.init and
1104 user_shared->delqueue.init.
1105 (shared_info::initialize): Do not call delqueue.init.
1106 (memory_init): Add argument to user_shared_initialize.
1107 * child_info.h (child_info::mount_h): Delete.
1108 (child_info::user_h): New.
1109 * sigpproc.cc (init_child_info): Use user_h instead of mount_h.
1110 * dcrt0.cc (_dll_crt0): Ditto.
1111 * fhandler_disk_file.cc (fhandler_disk_file::close): Use
1112 user_shared->delqueue instead of cygwin_shared->delqueue.
1113 * fhandler_virtual.cc (fhandler_virtual::close): Ditto.
1114 * syscalls.cc (close_all_files): Ditto.
1116 (seteuid32): Add argument to user_shared_initialize.
1118 2003-09-24 Christopher Faylor <cgf@redhat.com>
1120 * devices.cc: New file.
1121 * devices.gperf: New file.
1122 * devices.shilka: New file.
1123 * cygwin-gperf: New file.
1124 * cygwin-shilka: New file.
1125 * fhandler_fifo.cc: New file.
1126 * fhandler_nodevice.cc : New file.
1128 2003-09-24 Christopher Faylor <cgf@redhat.com>
1130 Reorganize headers so that path.h precedes fhandler.h throughout.
1131 Remove device argument and unit arguments from fhandler constructors
1132 throughout. Remove pc arguments to fhandler functions and use internal
1133 pc element instead, throughout. Use dev element in pc throughout. Use
1134 major/minor elements rather than units and device numbers previously in
1135 fhandler class. Use correct methods for fhandler file names rather
1136 than directly accessing file name variables, throughout.
1137 * Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o
1138 * dcrt0.cc (dll_crt0_1): Call device::init.
1139 * devices.h: Renumber devices based on more Linux-like major/minor
1140 numbers. Add more devices. Declare standard device storage.
1141 (device): Declare struct.
1142 * dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_*
1144 * dtable.cc (dtable::get_debugger_info): Ditto.
1145 (cygwin_attach_handle_to_fd): Ditto.
1146 (dtable::release): Remove special FH_SOCKET case in favor of generic
1147 "need_fixup_before" test.
1148 (dtable::init_std_file_from_handle): Use either build_fh_dev or
1149 build_fh_name to build standard fhandler.
1150 (dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name.
1151 Move out of dtable class. Don't accept a path_conv argument. Just
1152 build it here and pass it to:
1153 (build_fh_pc): Renamed from dtable::build_fhandler. Move out of dtable
1154 class. Use intrinsic device type in path_conv to create new fhandler.
1155 (build_fh_dev): Renamed from dtable::build_fhandler. Move out of
1156 dtable class. Simplify arguments to just take new 'device' type and a
1157 name. Just return pointer to fhandler rather than trying to insert
1159 (dtable::dup_worker): Accommodate above build_fh name changes.
1160 (dtable::find_fifo): New (currently broken) function.
1161 (handle_to_fn): Use strechr for efficiency.
1162 * dtable.h: Reflect above build_fh name changes and argument
1164 (fhandler_base *&operator []): Return self rather than copy of self.
1165 * fhandler.cc (fhandler_base::operator =): Use pc element to set
1167 (fhandler_base::set_name): Ditto.
1168 (fhandler_base::raw_read): Use method to access name.
1169 (fhandler_base::write): Correctly use get_output_handle rather than
1171 (handler_base::device_access_denied): New function.
1172 (fhandler_base::open): Eliminate pc argument and use pc element of
1173 fhandler_base throughout.
1174 (fhandler_base::fstat): Detect if device is based in filesystem and use
1175 fstat_fs to calculate stat, if so.
1176 (fhandler_base::fhandler_base): Eliminate handling of file names and,
1177 instead, just free appropriate component from pc.
1178 (fhandler_base::opendir): Remove path_conv parameter.
1179 * fhandler.h: Remove all device flags.
1180 (fhandler_base::pc): New element.
1181 (fhandler_base::set_name): Change argument to path_conv.
1182 (fhandler_base::error): New function.
1183 (fhandler_base::exists): New function.
1184 (fhandler_base::pc_binmode): New function.
1185 (fhandler_base::dev): New function.
1186 (fhandler_base::open_fs): New function.
1187 (fhandler_base::fstat_fs): New function.
1188 (fhandler_base::fstat_by_name): New function.
1189 (fhandler_base::fstat_by_handle): New function.
1190 (fhandler_base::isfifo): New function.
1191 (fhandler_base::is_slow): New function.
1192 (fhandler_base::is_auto_device): New function.
1193 (fhandler_base::is_fs_special): New function.
1194 (fhandler_base::device_access_denied): New function.
1195 (fhandler_base::operator DWORD&): New operator.
1196 (fhandler_base::get_name): Return normalized path from pc.
1197 (fhandler_base::get_win32_name): Return windows path from pc.
1198 (fhandler_base::isdevice): Renamed from is_device.
1199 (fhandler_base::get_native_name): Return device format.
1200 (fhandler_fifo): New class.
1201 (fhandler_nodevice): New class.
1202 (select_stuff::device_specific): Remove array.
1203 (select_stuff::device_specific_pipe): New class element.
1204 (select_stuff::device_specific_socket): New class element.
1205 (select_stuff::device_specific_serial): New class element.
1206 (select_stuff::select_stuff): Initialize new elements.
1207 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base
1208 class from fhandler_disk_file.
1209 (fhandler_base::fstat_by_name): Ditto.
1210 (fhandler_base::fstat_by_name): Ditto.
1211 (fhandler_disk_file::open): Move most functionality into
1212 fhandler_base::open_fs.
1213 (fhandler_base::open_fs): New function.
1214 (fhandler_disk_file::close): Move most functionality into
1215 fhandler_base::close_fs.
1216 (fhandler_base::close_fs): New function.
1217 * fhandler_mem.cc (fhandler_dev_mem::open): Use device name in
1219 * fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy
1220 standard urandom device into appropriate place.
1221 (fhandler_socket::accept): Reflect change in fdsock return value.
1222 * fhandler_tty.cc: See "throughouts" above.
1223 * net.cc: Accommodate fdsock change throughout.
1224 (fdsock): Return success or failure, accept fd argument and device
1226 * path.cc (symlink_info::major): New element.
1227 (symlink_info::minor): New element.
1228 (symlink_info::parse_device): Declare new function.
1229 (fs_info::update): Accommodate changes in path_conv class.
1230 (path_conv::fillin): Ditto.
1231 (path_conv::return_and_clear_normalized_path): Eliminate.
1232 (path_conv::set_normalized_path): New function.
1233 (path_conv::path_conv): Set info in dev element. Use path_conv methods
1234 Check for FH_FS rather than FH_BAD to indicate when to fill in
1235 filesystem stuff. where appropriate rather than direct access. Use
1236 set_normalized_path to set normalized path.
1237 (windows_device_names): Eliminate.
1239 (get_raw_device_number): Ditto.
1240 (get_device_number): Ditto.
1241 (win32_device_name): Call new device name parser to do most of the
1243 (mount_info::conv_to_win32_path): Fill in dev field as appropriate.
1244 (symlink_worker): Handle new device files.
1245 (symlink_info::check): Ditto.
1246 (symlink_info::parse_device): Define new function.
1247 * path.h (executable_states): Move here from fhandler.h.
1248 (fs_info): Rename variables to *_storage and create methods for
1250 (path_conv): Add dev element, remove devn and unit and adjust inline
1251 methods to accommodate.
1252 (set_normalized_path): Declare new function.
1253 * pinfo.cc (_pinfo::commune_recv): Add broken support for handling
1255 (_pinfo::commune_send): Ditto.
1256 * pipe.cc (fhandler_pipe::close): check for existence of handle before
1258 (handler_pipe::create): Rename from make_pipe. Change arguments to
1259 accept fhandler_pipe array. Accommodate fifos.
1260 (pipe): Rework to deal with fhandler_pipe::create changes.
1262 * select.cc: Use individual device_specific types throughout rather
1263 than indexing with obsolete device number.
1264 (set_bits): Use is_socket call rather than checking device number.
1265 * shared_info.h (CURR_MOUNT_MAGIC): Update.
1266 (conv_to_win32_path): Reflect addition of device argument.
1267 * syscalls.cc (mknod_worker): New function.
1268 (open): Use build_fh_name to build fhandler.
1269 (chown_worker): Detect if this is an 'auto' device rather than an
1270 on-filesystem device and handle appropriately.
1271 (chmod_device): New function.
1272 (chmod): Detect if this is an 'auto' device rather than an
1273 on-filesystem device and handle appropriately. Use chmod_device to set
1274 mode of in-filesystem devices.
1275 (stat_worker): Eliminate path_conv argument. Call build_fh_name to
1276 construct fhandler. Use fh->error() rather than pc->error to detect
1277 errors in fhandler construction.
1278 (access_worker): New function pulled from access. Accommodate
1279 in-filesystem devices.
1280 (access): Use access_worker.
1281 (fpathconf): Detect if this is an 'auto' device rather than an
1282 on-filesystem device and handle appropriately.
1283 (mknod_worker): New function.
1284 (mknod32): New function.
1285 (chroot): Free normalized path -- assuming it was actually cmalloced.
1286 * tty.cc (create_tty_master): Tweak for new device class.
1287 (tty::common_init): Ditto.
1288 * winsup.h (stat_worker): Remove.
1289 (symlink_worker): Declare.
1291 * exceptions.cc (set_process_mask): Just call sig_dispatch_pending and
1292 don't worry about pending_signals since sig_dispatch_pending should
1293 always do the right thing now.
1294 (sig_handle): Reorganize SIGCONT handling to more closely conform to
1296 * pinfo.h: Move __SIG enum to sigproc.h.
1297 (PICOM_FIFO): New enum element.
1298 (_pinfo): Remove 'thread2signal' stuff throughout class.
1299 (_pinfo::commune_send): Make varargs.
1300 (_pinfo::sigtodo): Eliminate.
1301 (_pinfo::thread2signal): Ditto.
1302 * signal.cc (kill_worker): Eliminate call to setthread2signal.
1303 * sigproc.cc (local_sigtodo): Eliminate.
1304 (getlocal_sigtodo): Ditto.
1305 (sigelem): New class.
1306 (pending_signals): New class.
1307 (sigqueue): New variable, start of sigqueue linked list.
1308 (sigcatch_nonmain): Eliminate.
1309 (sigcatch_main): Eliminate.
1310 (sigcatch_nosync): Eliminate.
1311 (sigcomplete_nonmain): Eliminate.
1312 (pending_signals): Eliminate.
1313 (sig_clear): Call signal thread to clear pending signals, unless
1314 already in signal thread.
1315 (sigpending): Call signal thread to get pending signals.
1316 (sig_dispatch_pending): Eliminate use of pending_signals and just check
1318 (sigproc_terminate): Eliminate all of the obsolete semaphore stuff.
1319 Close signal pipe handle.
1320 (sig_send): Eliminate all of the obsolete semaphore stuff and use pipe
1322 (getevent): Eliminate.
1323 (pending_signals::add): New function.
1324 (pending_signals::del): New function.
1325 (pending_signals::next): New function.
1326 (wait_sig): Eliminate all of the obsolete semaphore stuff. Use pipe to
1327 communicate and maintain a linked list of signals.
1328 * sigproc.h: Move __SIG defines here. Add __SIGPENDING.
1329 (sig_dispatch_pending): Remove "C" specifier.
1330 (sig_handle): Accept a mask argument.
1331 * thread.cc: Remove signal handling considerations throughout.
1333 2003-09-22 Christopher Faylor <cgf@redhat.com>
1335 * dcrt0.cc (do_exit): Eliminate "C" linkage. Call events_terminate
1337 (exit_states): Move out of source file into header file.
1338 * winsup.h: Move exit_states here. Remove "C" linkage from do_exit
1340 * debug.cc (lock_debug): Remove explicit (and incorrect) external for
1342 * sigproc.cc (sig_dispatch_pending): Don't flush signals if exiting.
1344 2003-09-20 Christopher Faylor <cgf@redhat.com>
1346 * spawn.cc (pthread_cleanup): New struct.
1347 (do_cleanup): New function.
1348 (spawn_guts): Initialize struct for pthread_cleanup handling to ensure
1349 proper restoration of signals if/when thread is cancelled. Restore
1350 settings using pthread_cancel_pop.
1352 2003-09-19 Christopher Faylor <cgf@redhat.com>
1354 * include/cygwin/version.h: Bump DLL minor number to 6.
1356 2003-09-19 Christopher Faylor <cgf@redhat.com>
1358 * thread.h (__reent_t::init_clib): Declare new function.
1359 * thread.cc (__reent_t::init_clib): Define new function.
1360 (pthread::thread_init_wrapper): Use __reent_t::init_clib to init local
1361 clib storage and set std{in,out,err} appropriately.
1363 2003-09-19 Christopher Faylor <cgf@redhat.com>
1365 * syscalls.cc (system): Strip signal considerations from here so that
1366 they are not inherited by a child process.
1367 * spawn.cc (spawn_guts): Handle system() signal stuff here.
1368 * winsup.h (_P_SYSTEM): Define.
1370 2003-09-18 Corinna Vinschen <corinna@vinschen.de>
1372 * fhandler_tty.cc (fhandler_pty_master::process_slave_output):
1373 Handle buf == NULL as flushing the buffer.
1374 (fhandler_tty_slave::read): Handle ptr == NULL as flushing the buffer.
1375 (fhandler_tty_slave::tcflush): Implement input queue flushing by
1376 calling read with NULL buffer.
1377 (fhandler_pty_master::tcflush): Ditto, calling process_slave_output.
1378 * termios.cc (tcflush): Check for legal `queue' value. Return
1381 2003-09-16 Brian Ford <ford@vss.fsi.com>
1383 * syscalls.cc (gethostid): Add lpFreeBytesAvailable argument to
1384 GetDiskFreeSpaceEx call since NT4 requires it.
1386 2003-09-16 Christopher Faylor <cgf@redhat.com>
1388 * fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with
1390 * sigproc.cc (talktome): Ditto for winpids.
1392 2003-09-16 Christopher Faylor <cgf@redhat.com>
1394 * pinfo.h (winpids::pid_access): New element.
1395 (winpids::winpids): Rejigger to set pinfo_access.
1396 * pinfo.cc (winpids::add): Try to open shared memory region with
1397 supplied pinfo_access first, then default to readonly.
1398 * fhandler_termios.cc (tty_min::kill_pgrp): When getting list of pids
1399 to work with, suggest opening with PID_MAP_RW.
1400 * signal.cc (kill_pgrp): Ditto.
1401 * sigproc.cc (sig_send): Perform a write check on todo prior to
1402 attempting to increment it. Return EACCES if we can't write to it.
1404 2003-09-16 Corinna Vinschen <corinna@vinschen.de>
1406 * cygheap.cc (cygheap_user::set_saved_sid): Rename from set_orig_sid.
1407 * cygheap.h (class cygheap_user): Rename orig_psid, orig_uid and
1408 orig_gid to saved_psid, saved_uid and saved_gid respectively.
1409 Rename methods orig_sid and set_orig_sid to saved_sid and set_saved_sid
1411 * sec_helper.cc (sec_acl): Accomodate above changes.
1412 * spawn.cc (spawn_guts): Ditto.
1413 * uinfo.cc (uinfo_init): Ditto.
1415 2003-09-15 Christopher Faylor <cgf@redhat.com>
1417 * getopt.c (opterr): Reinstate initialization.
1420 * pinfo.cc: Include cygheap.h or suffer compile error.
1421 * shared.h: Reset magic number.
1423 2003-09-15 Christopher Faylor <cgf@redhat.com>
1425 * exceptions.cc (sig_handle_tty_stop): Fix boneheaded mistake by using
1426 correct check for parent state rather than inverted check.
1428 2003-09-15 Pierre Humblet <pierre.humblet@ieee.org>
1430 * security.h (__sec_user): Add "access2" argument.
1431 (sec_acl): Add "original" and "access2" arguments.
1432 (sec_user): Add "sid2" and "access2" argument. Remove dependence on
1434 (sec_user_nih): Ditto.
1435 * sec_helper.cc (__sec_user): Add "has_security" test.
1436 Call sec_acl with new arguments, letting it handle original_sid.
1437 (sec_acl): Add "original" and "access2" arguments. Handle original_sid
1438 depending on flag but avoiding duplicates. Use "access2" for sid2.
1439 * pinfo.cc (pinfo::init): Use security attributes created by sec_user
1440 when creating the mapping.
1441 * security.cc (create_token): Adjust arguments in call to sec_acl.
1442 Call sec_user instead of __sec_user.
1443 * syscall.cc (seteuid32): Adjust arguments in call to sec_acl. Remove
1444 now unnecessary test. Remove useless conversions to psid.
1445 * dcrt0.cc (dll_crt0_1): Call cygsid::init before pinfo_init.
1447 2003-09-13 Christopher Faylor <cgf@redhat.com>
1449 * Makefile.in: Make malloc_wrapper -fomit-frame-pointer.
1451 * cygwin.din: Remove extraneous mallinfo definition.
1453 * dcrt0.cc (quoted): Use strechr for efficiency.
1455 * fhandler.cc (fhandler_base::write): Correctly use get_output_handle
1456 rather than get_handle.
1457 (fhandler_base::lseek): Use method for accessing name in debug output.
1459 2003-09-13 Christopher Faylor <cgf@redhat.com>
1461 * fhandler_disk_file.cc (path_conv::ndisk_links): Fix potential
1462 off-by-one problem when first file in a directory is a directory.
1464 2003-09-13 Pierre Humblet <pierre.humblet@ieee.org>
1466 * include/sys/cygwin.h: Rename PID_UNUSED to PID_MAP_RW.
1467 * pinfo.cc (pinfo_init): Initialize myself->gid.
1468 (pinfo::init): Create the "access" variable, set it appropriately and
1469 use it to specify the requested access.
1470 * exceptions.cc (sig_handle_tty_stop): Add PID_MAP_RW in pinfo parent.
1471 * signal.cc (kill_worker): Ditto for pinfo dest.
1472 * syscalls.cc (setpgid): Ditto for pinfo p.
1474 2003-09-13 Christopher Faylor <cgf@redhat.com>
1476 * include/cygwin/version.h: Bump DLL minor number to 5.
1478 2003-09-12 Christopher Faylor <cgf@redhat.com>
1480 * thread.cc (MTinterface::fixup_after_fork): Remove code which
1481 potentially overwrote _impure pointer with contents of thread which
1482 invoked fork since this eliminates important information like the
1483 pointer to the atexit queue.
1485 2003-09-12 Christopher Faylor <cgf@redhat.com>
1487 * fhandler_disk_file.cc (path_conv::ndisk_links): Fix problem where
1488 search characters overwrote the path instead of being tacked on the
1491 2003-09-12 Christopher Faylor <cgf@redhat.com>
1493 * dcrt0.cc (_dll_crt0): Accommodate breaking apart of early_stuff_init.
1494 * exceptions.cc (early_stuff_init): Delete.
1495 (init_console_handler): New function - top half of early_stuff_init.
1496 (init_global_security): New function - bottom half of early_stuff_init.
1497 (sig_handle): Avoid special hExeced test for SIGINT. Just terminate
1498 the captive process.
1499 (signal_exit): Add debugging output.
1500 * fhandler_tty.cc (fhandler_tty_slave::open): Don't allocate a console
1501 if one already seems to exist. Properly initialize ctrl-c handling if
1502 we do allocate a console.
1503 * winsup.h (early_stuff_init): Delete declaration.
1504 (init_console_handler): New declaration.
1505 (init_global_security): New declaration.
1507 2003-09-11 Christopher Faylor <cgf@redhat.com>
1509 * fhandler_disk_file.cc (path_conv::ndisk_links): Rename from
1510 num_entries. Accept an argument and calculate any extra links needed
1511 based on missing . and .. entries.
1512 (fhandler_disk_file::fstat_helper): Always call pc->ndisks_links() to
1513 calculate the number of links.
1514 * path.h (path_conv::ndisk_links): Declare.
1516 2003-09-11 Christopher Faylor <cgf@redhat.com>
1518 * path.cc (normalize_posix_path): Put check for '//' prefix back to
1520 (slash_unc_prefix_p): Remove vestige of old //c method for accessing
1523 2003-09-11 Christopher Faylor <cgf@redhat.com>
1525 * dir.cc (rmdir): Add more samba workarounds.
1527 2003-09-11 Corinna Vinschen <corinna@vinschen.de>
1529 * shared.cc (user_shared_initialize): Revert length attribute for name
1530 variable to be just UNLEN + 1.
1532 2003-09-10 Pierre Humblet <pierre.humblet@ieee.org>
1534 * shared_info.h (shared_info::initialize): Remove argument.
1535 * cygheap.h (cygheap_user::init): New declaration.
1536 * uinfo.cc (cygheap_user::init): New.
1537 (internal_getlogin): Move functionality to cygheap_user::init. Open
1538 the process token to update the group sid.
1539 * shared.cc (user_shared_initialize): Get the user information from
1541 (shared_info::initialize): Remove argument. Call cygheap->user.init
1542 instead of cygheap->user.set_name.
1543 (memory_init): Do not get the user name and do not pass it to
1544 shared_info::initialize.
1545 * registry.cc (get_registry_hive_path): Make csid a cygpsid.
1546 (load_registry_hive): Ditto.
1548 2003-09-10 Christopher Faylor <cgf@redhat.com>
1550 * fhandler_disk_file.cc (num_entries): Take . and .. into account if
1551 they do not exist since cygwin simulates them.
1552 (fhandler_cygdrive::fstat): Ditto.
1553 (fhandler_cygdrive::readdir): Don't do any specific tests on
1554 __d_position when seeing if a drive exists.
1556 2003-09-10 Corinna Vinschen <corinna@vinschen.de>
1558 * Makefile.in (DLL_OFILES): Add getopt.o and iruserok.o.
1559 * cygwin.din: Export __check_rhosts_file, __rcmd_errstr, optarg,
1560 opterr, optind, optopt, optreset, getopt, getopt_long, iruserok
1562 * getopt.c: Moved from lib to here. Define opt* variables as
1564 * iruserok.c: Moved from lib to here. Rearrange function order.
1565 Prefer using 64/32 bit functions.
1566 * syscalls.cc (shell_fp): Define as struct __sFILE64.
1567 (getusershell): Use fopen64 instead of fopen.
1568 * winsup.h: Add declarations for seteuid32, fopen64,
1569 cygwin_gethostbyname and cygwin_inet_addr.
1570 * include/getopt.h: Declare opt* variables dllimport.
1571 * include/cygwin/version.h: Bump API minor number.
1573 2003-09-10 Christopher Faylor <cgf@redhat.com>
1575 * exceptions.cc (sig_handle_tty_stop): Check parent PID_NOCLDSTOP
1576 rather than erroneously checking *my own* sigtodo.
1578 2003-09-10 Christopher Faylor <cgf@redhat.com>
1580 * Makefile.in: Add some more -fomit-frame-pointer files.
1582 * path.cc (conv_path_list_buf_size): Free normalized_path or suffer
1584 * syscalls.cc (chroot): Ditto.
1586 2003-09-10 Corinna Vinschen <corinna@vinschen.de>
1588 * Makefile.in (DLL_OFILES): Add bsdlib.o.
1589 * autoload.cc (RegisterServiceProcess): Add.
1590 * bsdlib.cc: New file.
1591 (daemon): New function.
1595 * cygwin.din: Export daemon, forkpty, login_tty, logwtmp, updwtmp,
1597 * syscalls.cc (updwtmp): New function, writing to wtmp exclusively.
1599 (login): Call updwtmp instead of writing to wtmp by itself.
1601 * tty.cc (revoke): New funtion.
1602 * include/paths.h: Define _PATH_DEVNULL.
1603 * include/pty.h: New header.
1604 * include/cygwin/version.h: Bump API minor number.
1605 * include/sys/utmp.h: Declare logwtmp with const arguments.
1607 * lib/iruserok.c: New file.
1608 (ruserok): New function.
1610 (__ivaliduser): Ditto.
1611 (__icheckhost): Ditto.
1613 2003-09-10 Corinna Vinschen <corinna@vinschen.de>
1615 * fhandler_socket.cc (fhandler_socket::fstat): Don't use PC_POSIX.
1617 2003-09-09 Pierre Humblet <pierre.humblet@ieee.org>
1619 * shared_info.h: Include security.h.
1620 (open_shared): Add psa argument.
1621 (user_shared_initialize): New declaration.
1622 * security.h: Add _SECURITY_H guard.
1623 (sec_user): Use sec_none in the no ntsec case.
1624 * spawn.cc (spawn_guts): Remove call to load_registry_hive.
1625 * syscalls (seteuid32): If warranted, call load_registry_hive,
1626 user_shared_initialize and RegCloseKey(HKEY_CURRENT_USER).
1627 * shared.cc (user_shared_initialize): New.
1628 (open_shared): Add and use psa argument.
1629 (memory_init): Move mount table initialization to
1630 user_shared_initialize. Call it.
1632 2003-09-09 Corinna Vinschen <corinna@vinschen.de>
1634 * mmap.cc (mmap64): Change address types from caddr_t to void *
1639 (mprotect): Ditto. Move to before the fhandler methods.
1640 * include/sys/mman.h: Change prototypes accordingly.
1642 2003-09-08 Christopher Faylor <cgf@redhat.com>
1644 * dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely
1646 * exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since
1647 it is reset automatically.
1648 * fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP.
1649 * include/sys/cygwin.h: Ditto.
1650 * sigproc.cc (sig_send): Use sigframe init method to set frame since it
1651 checks for previous ownership of the frame.
1652 * sigproc.h (sigframe::init): Accept an "is_exception" argument.
1654 2003-09-08 Christopher Faylor <cgf@redhat.com>
1656 * dir.cc (readdir): Reinstate setting of old ino field for legacy
1658 * dirent.h (dirent): Rename unused field to __ino32.
1660 2003-09-08 Christopher Faylor <cgf@redhat.com>
1662 * passwd.cc (getpwnam_r): Initialize pw_comment field.
1664 2003-09-08 Christopher Faylor <cgf@redhat.com>
1666 * passwd.cc (getpwuid_r32): Initialize pw_comment field.
1668 2003-09-08 Christopher Faylor <cgf@redhat.com>
1670 * sigproc.cc (wait_sig_inited): Remove assertion since it is racy.
1672 2003-09-08 Corinna Vinschen <corinna@vinschen.de>
1674 * cygwin.din: Export endusershell, getusershell and setusershell.
1675 * syscalls.cc (getusershell): New function.
1676 (setusershell): Ditto.
1677 (endusershell): Ditto.
1678 * include/cygwin/version.h: Bump API minor number.
1680 2003-09-08 Nicholas Wourms <nwourms@netscape.net>
1682 * cygwin.din: Export argz_add argz_add_sep argz_append argz_count
1683 argz_create argz_create_sep argz_delete argz_extract argz_insert
1684 argz_next argz_replace argz_stringify envz_add envz_entry envz_get
1685 envz_merge envz_remove envz_strip
1686 * include/cygwin/version.h: Bump api minor number.
1688 2003-09-07 Christopher Faylor <cgf@redhat.com>
1690 Throughout, remove __d_u.__d_data fields from DIR structure.
1691 * include/sys/dirent.h (dirent): Remvoe old_d_ino.
1692 (DIR): Make __d_dirhash a 64 bit value. Remove __d_data and __d_u.
1694 * dir.cc (opendir_states): New enum.
1695 (opendir): Clear new DIR __flags field.
1696 (readdir): Fill in '.' and '..' entries if we hit EOF and we haven't
1697 seen them already. Nuke setting of old_d_ino.
1698 (rewinddir): Reset DIR __flags field.
1700 * fhandler_disk_file.cc (fhandler_cygdrive::fhandler_cygdrive): Remove
1701 special handling of "." and ".." since they are now handled
1704 2003-09-07 Christopher Faylor <cgf@redhat.com>
1706 * include/cygwin/in.h: Don't define ipv6 stuff unless we call for it
1707 specifically since it isn't really implemented yet.
1709 2003-09-07 Christopher Faylor <cgf@redhat.com>
1711 * cygheap.cc (_csbrk): More left coercion cleanup.
1712 * fhandler_tty.cc (fhandler_tty_slave::read): Ditto.
1713 (fhandler_tty_slave::write): Ditto.
1714 * fhandler_windows.cc (fhandler_windows::read): Ditto.
1715 * heap.cc (sbrk): Ditto.
1717 2003-09-07 Pierre Humblet <pierre.humblet@ieee.org>
1719 * signal.cc (nanosleep): Improve test for valid values. Round delay up
1720 to resolution. Fix test for negative remainder. Use timeGetTime
1722 (sleep): Round up return value.
1724 2003-09-07 Pierre Humblet <pierre.humblet@ieee.org>
1725 Christopher Faylor <cgf@redhat.com>
1727 * hires.h (HIRES_DELAY_MAX): Define.
1728 (hires_ms::minperiod): Declare static.
1729 (hires_ms::resolution): New.
1730 (hires_ms::dmsecs): New.
1731 (hires_ms::prime): Return UINT.
1733 * times.cc (hires_ms::prime): Always calculate minperiod and set it to
1734 1 in case of failure. Return minperiod.
1735 (hires_ms::resolution): Define.
1736 (hires_ms::~hires_ms): Delete.
1737 (hires_ms::usecs): Check minperiod to prime.
1738 (gtod) Define as global.
1740 2003-09-06 Christopher Faylor <cgf@redhat.com>
1742 Remove left coercion throughout.
1744 2003-09-04 Pierre Humblet <pierre.humblet@ieee.org>
1746 * hires.h (hires_ms::~hires_ms): Delete declaration.
1747 * times.cc (hires_ms::~hires_ms): Delete definition..
1749 2003-09-04 Christopher Faylor <cgf@redhat.com>
1751 * dcrt0.cc (__argc_safe): New variable.
1752 (dll_crt0_1): Store argc in __argc_safe, which will theoretically
1753 remain untouched by the user.
1754 * fhandler_console.cc (fhandler_console::read): Silence some compiler
1756 * fhandler_raw.cc (fhandler_dev_raw::raw_read): Ditto.
1757 * pinfo.cc (_pinfo::commune_recv): Carefully bound argv scan and check
1758 for potentially bad pointers since user could have set argv cell to
1760 * cygheap.h (CYGHEAPSIZE): Bump up size.
1762 2003-09-04 Corinna Vinschen <corinna@vinschen.de>
1764 * sysconf.cc (sysconf): Return more accurate value for _SC_AVPHYS_PAGES.
1766 2003-09-04 Corinna Vinschen <corinna@vinschen.de>
1768 * mmap.cc: Restructure. Add, remove and rewrite comments throughout
1769 for better readability. Change function names for better
1771 (MAP_SET): Accomodate name change from map_map_ to page_map_.
1774 (mmap_record::page_map_): Rename from page_map_.
1775 (mmap_record::get_map): Remove.
1776 (mmap_record::alloc_page_map): Rename from alloc_map. Return bool
1777 indicating success of cygheap memory allocation.
1778 (mmap_record::free_page_map): Rename from free_map.
1779 (mmap_record::fixup_page_map): Rename from fixup_map.
1780 (mmap_record::find_unused_pages): Rename from find_empty.
1781 (mmap_record::map_pages): Rename from map_map.
1782 (mmap_record::unmap_pages): Rename from unmap_map.
1783 (class list): Make all class members private.
1784 (list::list): Remove.
1785 (list::~list): Remove.
1786 (list::get_fd): New attribute reader.
1787 (list::get_hash): Ditto.
1788 (list::get_record): Ditto.
1789 (list::add_record): Manage all allocation for mmap_records. Check
1790 for failed memory allocation and return NULL if so.
1791 (list::set): New function.
1792 (list::del_record): Rename from erase. Return true if last mmap_record
1793 has been deleted, false otherwise. Check for legal incoming index
1795 (list::erase): Remove erase/0.
1796 (list::search_record): Rename from match.
1798 (map::~map): Remove.
1799 (map::add_list): Manage all allocation for lists. Check for failed
1800 memory allocation and return NULL if so.
1801 (map::get_list): New method.
1802 (map::del_list): Rename from erase. Check for legal incoming index
1804 (mmap64): Check for failed mmap_record memory allocation. Return
1805 with MAP_FAILED and errno set to ENOMEM if so.
1806 (munmap): Rearrange loop using new list and mmap_record accessor
1807 functions. Rename loop index variables for better understanding.
1808 Check if list can be deleted after last mmap_record in it has been
1810 (msync): Rearrange loop using new list and mmap_record accessor
1811 functions. Rename loop index variables for better understanding.
1812 (fixup_mmaps_after_fork): Ditto.
1814 2003-09-03 Christopher Faylor <cgf@redhat.com>
1816 * cxx.cc (new): Fix formatting. Just return result of ccalloc rather
1817 than calling memset explicitly.
1819 2003-09-03 Christopher Faylor <cgf@redhat.com>
1821 * exceptions.cc (set_process_mask): Set pending signals only when
1822 signals become unmasked.
1823 * sigproc.cc (pending_signals): Flip back to a global.
1824 (wait_sig): Don't set pending signals when there is an armed semaphore
1825 or signal is blocked.
1827 * shared.cc (shared_info::initialize): Add a username parameter for
1828 user-mode mounts. Reorganize to try to avoid startup race.
1829 (memory_init): Move some stuff into shared_info::initialize.
1830 * shared_info.h (shared_info::initialize): Change declaration.
1831 (CURR_SHARED_MAGIC): Update.
1833 2003-09-01 Christopher Faylor <cgf@redhat.com>
1835 * include/cygwin/version.h: Bump DLL minor number to 4.
1837 2003-09-01 Christopher Faylor <cgf@redhat.com>
1839 * net.cc (dup_ent): Restore check for NULL input.
1841 2003-08-31 Christopher Faylor <cgf@redhat.com>
1843 * include/sys/cygwin.h: Don't define cygwin-specific things if
1846 2003-08-31 Christopher Faylor <cgf@redhat.com>
1848 * cygheap.cc (cygheap_init): Allocate space for sigaction array in
1850 * cygheap.h (cygheap_types): Add HEAP_SIGS.
1851 * exceptions.cc (signal_fixup_after_exec): Remove from this file.
1852 * pinfo.h (pinfo::getsig): Just return global_sigs array.
1853 (pinfo::sigs): Delete.
1854 * sigproc.cc (signal_fixup_after_exec): Move it here.
1855 (global_sigs): New global array, moved from pinfo structure.
1856 (sigalloc): New function. Allocate global sigaction array here.
1857 (proc_subproc): Remove copysigs call. It's automatic now.
1858 * include/sys/cygwin.h (PID_NOCLDSTOP): New value.
1859 * signal.cc (sigaction): Set myself->PID_NODCLDSTOP when appropriate.
1860 * sigproc.h (sigalloc): Declare.
1862 * fnmatch.c (fnmatch): Use C90 parameters.
1863 (rangematch): Ditto.
1865 * fhandler.cc (fhandler_base::raw_read): Use right coercion to avoid a
1868 2003-08-31 Christopher Faylor <cgf@redhat.com>
1870 * net.cc (dup_ent): Make debugging output consistent.
1872 2003-08-31 Christopher Faylor <cgf@redhat.com>
1874 Use dup_ent rather than specific dup_*_ptr functions throughout.
1875 * (gen_ent): Delete.
1876 (dup_ent): Subsume gen_ent functionality.
1877 (dup_host_ptr): Delete.
1878 (dup_proto_ptr): Ditto.
1879 (dup_servent_ptr): Ditto.
1881 2003-08-31 Christopher Faylor <cgf@redhat.com>
1883 * net.cc (gen_ent): Invert sense of null check so that debug output
1886 2003-08-31 Christopher Faylor <cgf@redhat.com>
1888 * net.cc (free_char_list): Delete.
1889 (dup_addr_list): Delete.
1890 (dup_char_list): Delete.
1891 (free_hostent_ptr): Delete.
1892 (free_protoent_ptr): Delete.
1893 (free_servent_ptr): Delete.
1894 (DWORD_round): New function.
1895 (strlen_round): New function. Returns strlen rounded up to word size.
1896 (dup_ent): New, generic function to duplicate a {host,proto,serv}ent
1898 (gen_ent): New macro. Generates a generic dup_{host,proto,serv}ent_ptr
1900 (cygwin_getservbyname): Remove call to free_servent_ptr, pass
1901 servent_buf to dup_servent_ptr.
1902 (cygwin_getservbyport): Ditto.
1903 (cygwin_gethostbyname): Ditto for hostent.
1904 (cygwin_gethostbyaddr): Ditto.
1905 (cygwin_getprotobyname): Ditto for protoent.
1906 (cygwin_getprotobynumber): Ditto.
1908 2003-08-31 Christopher Faylor <cgf@redhat.com>
1910 * Makefile.in (MALLOC_OFILES): Always fill in with correct malloc
1912 * configure.in: Fill in MALLOC_OFILES with either debugging or regular
1914 * configure: Regenerate.
1915 * dlmalloc.c: Make various fruitless changes to attempt to get to work.
1916 * dlmalloc.h: Ditto.
1917 * malloc.cc (free): Check malloc pool when debugging.
1919 * path.cc (win32_device_name): Eliminate compiler warning.
1921 * sigproc.cc (sig_dispatch_pending): Remove use of was_pending. Let
1922 thisframe.call_signal_handler decide if handler should be called rather
1923 than using bogus was_pending check.
1925 * exceptions.cc (interrupt_setup): Remove accidentally checked in
1928 2003-08-30 Christopher Faylor <cgf@redhat.com>
1930 * heap.cc (sbrk): Save rounded addess in user_heap_max.
1932 2003-08-30 Christopher Faylor <cgf@redhat.com>
1934 * sigproc.cc (sig_dispatch_pending): Remove explicit call to
1935 thisframe.call_signal_handler.
1937 2003-08-30 Christopher Faylor <cgf@redhat.com>
1939 Remove some cygserver files.
1941 2003-08-28 Christopher Faylor <cgf@redhat.com>
1943 * sigproc.h: Make some functions regparm.
1944 * sigproc.cc (checkstate): Make regparm.
1945 (getevent): Change parameters in declaration, rename from getsem, make regparm.
1946 (sig_send): Recognize that nosync is now an event. Remove some old
1947 cruft from previous interrupt anywhere signal handler.
1948 (getevent): Change parameters in definition, rename from getsem.
1949 Allocate event rather than semaphore.
1950 (wait_sig): Treat sigcatch_nosync as an event.
1952 2003-08-28 Christopher Faylor <cgf@redhat.com>
1954 * exceptions.cc (sigreturn): Fix problem where old return address was
1955 not properly restored for a nested signal.
1957 2003-08-27 Christopher Faylor <cgf@redhat.com>
1959 * autoload.cc (SwitchToThread): Declare as autoload function.
1960 * cygthread.h (cygthread::main_thread_id): Make public.
1961 * exceptions.cc (setup_handler): Remove unneeded priority stuff.
1962 Rename label to reflect what it does. Add debugging for idiotic
1963 Windows NT problem. Change debugging output to include signal number.
1964 * miscfuncs.cc (low_priority_sleep): If available, use SwitchToThread
1965 function to give time slice to other threads.
1966 * wincap.cc: Properly define have_switch_to_thread throughout.
1967 * wincap.h (wincap::switch_to_thread): New element.
1969 2003-08-27 Christopher Faylor <cgf@redhat.com>
1971 * syscalls.cc (mount): Don't check win32_path when doing cygdrive
1974 2003-08-27 Christopher Faylor <cgf@redhat.com>
1976 * specdir: Correctly remove temporary directory prior to use.
1978 2003-08-27 Christopher Faylor <cgf@redhat.com>
1980 * sigproc.cc (wait_sig): Count number of iterations through
1981 'more_signals' loop and issue a warning if DEBUGGING and excessive.
1982 (WFSO): When debugging and infinite timeout, loop.
1984 2003-08-26 Corinna Vinschen <corinna@vinschen.de>
1986 * include/cygwin/stat.h: Allow definition of internal stat structures
1987 also when compiling newlib.
1989 2003-08-25 Christopher Faylor <cgf@redhat.com>
1991 Throughout, change USE_CYGSERVER to USE_SERVER.
1992 * Makefile.in (LIBSERVER): Define and use.
1993 * configure.in: Set LIBSERVER as appropriate.
1994 * configure: Regenerate.
1995 * acconfig.h: Regenerate.
1996 * environ.cc: Rename allow_daemon to allow_server. Only recognize when
1997 USE_SERVER is defined.
1999 2003-08-23 Christopher Faylor <cgf@redhat.com>
2001 * syscalls.cc (_remove_r): Define.
2003 2003-08-22 Corinna Vinschen <corinna@vinschen.de>
2005 * cygheap.h (enum cygheap_types): Add HEAP_MMAP.
2006 (CYGHEAPSIZE): Add another 64K.
2007 * mmap.cc: Use cmalloc, ccalloc and crealloc with HEAP_MMAP type
2010 2003-08-22 Christopher Faylor <cgf@redhat.com>
2012 * cygheap.cc (user_heap_info::max): New field.
2013 * heap.cc (heap_init): Save pointer to end of heap reserved memory.
2014 (sbrk): Don't attempt to commit memory beyond end of heap reserved
2015 memory. Attempt to honor comment and reserve commitbytes if heapchunk
2018 2003-08-20 Pierre Humblet <pierre.humblet@ieee.org>
2020 * exceptions.cc (sigreturn): Don't clobber ebp in recursive signal
2023 2003-08-22 Christopher Faylor <cgf@redhat.com>
2025 * exceptions.cc (sig_handle): Change so that default signals indicate
2028 2003-08-21 Christopher Faylor <cgf@redhat.com>
2030 * sigproc.cc (wait_sig): Remove redundant test in do/while.
2032 2003-08-21 Christopher Faylor <cgf@redhat.com>
2034 * sigproc.cc (wait_sig): Avoid infinite loop.
2036 2003-08-20 Christopher Faylor <cgf@redhat.com>
2038 * speclib: Reenable removal of temp files.
2040 2003-08-20 Christopher Faylor <cgf@redhat.com>
2042 * miscfuncs.cc (low_priority_sleep): Sleep at same priority as main
2044 * sigproc.cc (wait_sig): Keep looping if there are more signals to
2045 consider and we are flushing signals.
2046 (sig_send): Put nonsync signals in the correct bucket.
2048 2003-08-20 Christopher Faylor <cgf@redhat.com>
2050 * speclib: Fix created lib to avoid "File truncated" problems.
2052 2003-08-20 Pierre Humblet <pierre.humblet@ieee.org>
2054 * exceptions.cc (interrupt_setup): Set sigsave.sig last to avoid a
2057 2003-08-20 Christopher Faylor <cgf@redhat.com>
2059 * sigproc.cc (wait_sig): Ensure that myself->getsigtodo array is
2060 flushed on a __SIGFLUSH.
2062 2003-08-20 Pierre Humblet <pierre.humblet@ieee.org>
2063 Christopher Faylor <cgf@redhat.com>
2065 * exceptions.cc (_sigreturn): Handle nested signals without growing the
2068 2003-08-19 Christopher Faylor <cgf@redhat.com>
2070 * exceptions.cc (pending_signals): Remove unneeded declaration.
2071 * sigproc.cc (pending_signals): Make static.
2072 (wait_sig): Use defined values rather than integers for rc. Never scan
2073 both todo arrays as this could cause hangs if signals arrive from two
2074 different sources. Rename saw_pending_signals to saw_failed_interrupt.
2075 Exit loop when signal found. Enter low-priority sleep, if necessary,
2076 after finished signalling completion. Set pending_signals when blocked
2077 (from Pierre Humblet).
2079 2003-08-19 Christopher Faylor <cgf@redhat.com>
2081 * signal.cc (sigpending): Move.
2082 * sigproc.cc (sigpending): To here.
2083 (getlocal_sigtodo): Return process-local signal array.
2084 (sigpending): Accommodate new process-local signal array.
2086 (sig_set_pending): Ditto.
2089 2003-08-19 Christopher Faylor <cgf@redhat.com>
2091 Throughout, eliminate argument to sig_dispatch_pending.
2092 * exceptions.cc (setup_handler): Move non-interruptible condition
2093 handling (back) to wait_sig.
2094 (set_process_mask): Don't worry about calling sig_dispatch_pending from
2095 sigthread since it is detected in the function anyway.
2096 (sig_handle): Eliminate thisproc arg. Don't call sig_dispatch_pending
2097 on SIGCONT since that should happen automatically.
2098 * sigproc.cc (sig_dispatch_pending): Eliminate justwake argument. Just
2099 return when called from sigthread.
2100 (wait_sig): Change some variables to bool. Change inner while to an
2101 if. Move uninterruptible signal handling here.
2102 (sigproc_terminate): Don't call sig_dispatch_pending. Just increment
2105 * speclib: Use slightly different (but still flawed) method for
2106 determining symbols to extract from libraries.
2108 2003-08-18 Christopher Faylor <cgf@redhat.com>
2110 * exceptions.cc (sigdelayed): Fix race where signal handler could get
2111 the wrong mask (as suggested by Pierre Humblet).
2113 2003-08-18 Christopher Faylor <cgf@redhat.com>
2115 * path.cc (mount): Add null/empty check for input parameters.
2116 (umount): Add null/empty check for input parameters.
2118 2003-08-17 Pierre Humblet <pierre.humblet@ieee.org>
2120 * grp.cc (read_group): Revert previous change.
2121 * uinfo.cc (pwdgrp::load): Always reset curr_lines.
2123 2003-08-17 Corinna Vinschen <corinna@vinschen.de>
2125 * errno.cc (errmap): Map ERROR_INVALID_BLOCK_LENGTH to EIO.
2126 * fhandler_raw.cc (fhandler_dev_raw::raw_read): Set more accurate
2127 errnos instead of EACCES.
2128 (fhandler_dev_raw::raw_write): Ditto.
2130 2003-08-17 Christopher Faylor <cgf@redhat.com>
2132 * path.cc (special_name): Accommodate all special names with
2135 2003-08-15 Corinna Vinschen <corinna@vinschen.de>
2137 * mmap.cc (mmap64): Avoid crash if file size is less than requested
2140 2003-08-13 Igor Pechtchanski <pechtcha@cs.nyu.edu>
2142 * path.cc (special_name): Add checks for some specials followed by
2143 a "." and a FIXME comment.
2145 2003-08-13 Corinna Vinschen <corinna@vinschen.de>
2147 * cygwin.din: Accommodate change from cygwin_lstat to lstat.
2148 * syscalls.cc: Add defines to avoid declaration issues when
2149 renaming cygwin_lstat back to lstat.
2150 (lstat): Reverted name change from cygwin_lstat.
2152 2003-08-12 Corinna Vinschen <corinna@vinschen.de>
2154 * include/sys/param.h (NBBY): Define if not defined.
2156 2003-08-12 Nicholas Wourms <nwourms@netscape.net>
2158 * include/sys/param.h (setbit): Add new bitmap related macro.
2162 (howmany): Add new counting/rounding macro.
2163 (rounddown): Likewise.
2164 (roundup): Likewise.
2165 (roundup2): Likewise.
2166 (powerof2): Likewise
2167 (MIN): Add macro for calculating min.
2168 (MAX): Add macro for calculating max.
2170 2003-08-09 Christopher Faylor <cgf@redhat.com>
2172 * include/cygwin/version.h: Bump DLL minor number to 3.
2174 2003-08-08 Gerrit P. Haase <gp@familiehaase.de>
2176 * include/stdint.h: Correctly define INT32_MIN.
2178 2003-08-08 David Rothenberger <daveroth@acm.org>
2180 * grp.cc (read_group): Set __group32.gr_mem pointer back to &null_ptr
2181 after free() is called.
2183 2003-08-05 Christopher Faylor <cgf@redhat.com>
2185 * Makefile.in: Rework to accommodate new speclib arguments.
2186 * speclib: Rework to extract everything from libcygwin.a rather than
2187 building things from existing object files.
2189 2003-08-05 Pavel Tsekov <ptsekov@gmx.net>
2191 * path.cc (cygdrive_getmntent): Do not skip over drives of type
2194 2003-08-05 Christopher Faylor <cgf@redhat.com>
2196 * fhandler.cc (fhandler_base::lseek): Be more paranoid when
2197 constructing offsets from 64 bit value.
2198 * syscalls.cc (logout): Avoid temp buffer memcpy since new scheme does
2200 (utmp_data): Rework as a macro which returns a pointer into a buffer.
2201 (getutent): Use new buffer allocation mechanism to grab a utmp buffer.
2205 2003-08-05 Pavel Tsekov <ptsekov@gmx.net>
2207 * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Do not change
2208 'errno' if end of directory condition is encountered as per SUSv2.
2209 * fhandler_proc.cc (fhandler_proc::readdir): Ditto.
2210 * fhandler_process (fhandler_process::readdir): Ditto.
2211 * fhandler_registry (fhandler_registry::readdir): Ditto.
2213 2003-07-30 Christopher Faylor <cgf@redhat.com>
2215 * dcrt0.cc (_dll_crt0): Move strace.microseconds initialization to
2216 after pthread initialization.
2217 (dll_crt0_1): i.e., here.
2219 2003-07-28 Christopher Faylor <cgf@redhat.com>
2221 * fhandler_base.cc (fhandler_base::readv): Rework to properly return
2222 number of bytes from read.
2224 2003-07-28 Christopher Faylor <cgf@redhat.com>
2226 * include/cygwin/version.h: Bump DLL minor number to 2.
2228 2003-07-26 Christopher Faylor <cgf@redhat.com>
2230 * exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if
2231 there is a tty associated with the process. Send SIGHUP on
2234 * fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open
2235 handle counter regardless of whether this is a pty or tty.
2236 (fhandler_tty_slave::open): Ditto.
2237 (fhandler_tty_slave::dup): Ditto.
2238 (fhandler_tty_common::set_close_on_exec): Ditto.
2239 (fhandler_tty_master::init_console): Decrement console open handle
2240 counter after init since it will now be handled by all tty open.
2241 * syscalls.cc (setsid): Rework debugging output slightly.
2243 2003-07-25 Christopher Faylor <cgf@redhat.com>
2245 * configure.in: Use 'install-sh -c'.
2246 * configure: Regenerate.
2248 2003-07-25 Christopher Faylor <cgf@redhat.com>
2250 * configure.in: Always use install-sh.
2251 * configure: Regenerate.
2253 2003-07-25 Christopher Faylor <cgf@redhat.com>
2255 * include/cygwin/socket.h: Conditionalize [AP]F_INET6 define.
2257 2003-07-25 Christopher Faylor <cgf@redhat.com>
2259 * Makefile.in (OBSOLETE_FUNCTION): Add fdopen.
2261 2003-07-25 Christopher Faylor <cgf@redhat.com>
2263 * cygwin.din: Export _fdopen64
2264 * Makefile.in (NEW_FUNCTIONS): Add _fdopen64 -> fdopen translation.
2265 * include/cygwin/version.h: Bump api minor number.
2267 * ntdll.h: Remove (now) duplicate FILE_SYNCHRONOUS_IO_NONALERT
2270 2003-07-24 Christopher Faylor <cgf@redhat.com>
2272 * environ.cc (check_case_init): Use strncasematch.
2274 * cygwin.din: Export __mempcpy.
2275 * cygwin/version.h: Bump api minor number.
2277 2003-07-21 Pavel Tsekov <ptsekov@gmx.net>
2279 * mmap.cc: Use proper format specifiers for _off64_t and size_t in
2280 format strings passed to syscall_printf () and debug_printf ()
2283 2003-07-18 Pierre Humblet <pierre.humblet@ieee.org>
2285 * security.cc (verify_token): Fix white space and style.
2286 Use type bool instead of BOOL and char. Use alloca
2287 instead of malloc and free for my_grps.
2289 2003-07-17 Corinna Vinschen <corinna@vinschen.de>
2291 * sysconf.cc (sysconf): Fix OPEN_MAX patch. Return page size on
2294 2003-07-14 Corinna Vinschen <corinna@vinschen.de>
2296 * cygheap.h (class cygheap_user): Use INVALID_HANDLE_VALUE as invalid
2298 * syscalls.cc (seteuid32): Ditto. Set new_token to process token if
2299 process token is suitable.
2300 * uinfo.cc (uinfo_init): Initialize tokens in cygheap user info
2301 to INVALID_HANDLE_VALUE.
2303 2003-07-14 Pierre Humblet <pierre.humblet@ieee.org>
2305 * cygheap.h (enum impersonation): Delete.
2306 (cygheap_user::impersonation_state): Delete.
2307 (cygheap_user::current_token): New.
2308 (cygheap_user::issetuid): Modify to use current_token.
2309 (cygheap_user::token): Ditto.
2310 (cygheap_user::deimpersonate): Ditto.
2311 (cygheap_user::reimpersonate): Ditto.
2312 (cygheap_user::has_impersonation_tokens): Ditto.
2313 (cygheap_user::close_impersonation_tokens): Ditto.
2314 * security.cc (cygwin_set_impersonation_token): Always set the token.
2315 (verify_token): Change type of gsid to cygpsid.
2316 (get_file_attribute): Use the effective ids.
2317 * syscalls.cc (seteuid32): Modify to use cygheap_user::current_token.
2318 * uinfo.cc (uinfo_init) Do not set cygheap->user.impersonation_state.
2320 2003-07-12 Christopher Faylor <cgf@redhat.com>
2322 * pinfo.cc (_pinfo::commune_send): Fix bounds test so that poll of
2323 communicating pid actually stops eventually.
2325 2003-07-10 Christopher Faylor <cgf@redhat.com>
2327 * path.cc (get_device_number): Remove special com? consideration.
2328 (special_chars): Make static.
2329 (special_introducers): New.
2330 (special_char): Allow specified valid_chars args.
2331 (fnunmunge): Handle aux-like filenames correctly.
2332 (special_name): Add con, conin$, conout$.
2333 (mount_item::fnmunge): Use __small_sprintf return value to calculate
2336 2003-07-09 Christopher Faylor <cgf@redhat.com>
2338 * include/cygwin/version.h: Bump DLL minor number to 1.
2340 2003-07-09 Christopher Faylor <cgf@redhat.com>
2342 * fhandler_proc.cc (format_proc_stat): Use correctly sized constants
2343 for filling in zeros on 98.
2345 2003-07-09 Christopher Faylor <cgf@redhat.com>
2347 * fhandler_proc.cc (fhandler_proc::fill_filebuf): Allocate more space
2349 (format_proc_stat): Reorganize to accumulate and report on all cpus.
2351 2003-07-09 Christopher Faylor <cgf@redhat.com>
2353 * sysconf.cc (sysconf): Return processors online rather than bitmask
2354 for _SC_NPROCESSORS_ONLN.
2356 2003-07-08 Christopher Faylor <cgf@redhat.com>
2358 * cygheap.cc (creturn): Set appropriate errno when out of memory.
2359 (ccalloc): Only issue system_printf when debugging.
2360 * dtable.cc (dtable::extend): Only allocate 100 * the incremental growth
2361 size max. Set errno appropriately.
2362 (dtable::build_fhandler): Check for error from set_name.
2363 * fhandler.cc (fhandler_base::set_name): Set errno and return error on OOM.
2364 * fhandler.h (fhandler_base::set_name): Change to bool.
2365 * fhandler_process.cc (format_process_stat): Fix formatting.
2366 * resource.cc (getrlimit): Return greater of OPEN_MAX or fd table size.
2367 * sysconf.cc (sysconf): Ditto.
2369 2003-07-07 Christopher Faylor <cgf@redhat.com>
2371 * rmsym: Don't use ranlib.
2373 2003-07-07 Christopher Faylor <cgf@redhat.com>
2375 * newsym: Reenable removal of tmp directory. Just use ar to generate
2377 * Makefile.in: Don't send ranlib to newsym or rmsym.
2379 2003-07-07 Christopher Faylor <cgf@redhat.com>
2381 * newsym: Create objects that are closer to those created by dlltool so
2382 as not to confuse --export-all-symbols.
2383 * rmsym: Be a little more accepting of object filenames now that
2384 dlltool can create different format files.
2386 2003-07-06 Christopher Faylor <cgf@redhat.com>
2388 * newsym: Oops. Revert below change.
2390 2003-07-06 Christopher Faylor <cgf@redhat.com>
2392 * newsym: Use correct prefix for generating imports.
2393 * pinfo.cc (_pinfo::commune_send): Don't wait forever for a response
2394 from another process.
2396 2003-07-06 Christopher Faylor <cgf@redhat.com>
2398 * syscalls.cc (gethostid): Set thread affinity so that results are
2401 2003-07-05 Corinna Vinschen <corinna@vinschen.de>
2403 * mmap.cc (list::match): Add parameters to return valid address and
2404 length back to munmap(). Evaluate intersection between given
2405 area and mapped area and return it, if any.
2406 (mmap64): On regular files, don't allow mappings beginning beyond
2407 EOF. Return with errno set to ENXIO instead.
2408 (munmap): Rewrite SUSv3 conformant. Check if given memory area is
2409 valid. Unmap all maps inside given memory area. Don't return error
2410 if no mapping has been unmapped.
2412 2003-07-05 N Stephens <nigel@mips.com>
2414 * fhandler.h (fhandler_socket::get_connect_state): New method to
2415 return socket connection state.
2416 * fhandler_socket.cc (dup): Copy socket connect state to new file
2418 * net.cc (cygwin_rcmd): Mark file handles of sockets returned by
2419 rcmd() as CONNECTED state.
2420 (cygwin_rexec): Similarly for rexec().
2421 (socketpair): Mark both ends of a new socket pair as CONNECTED.
2423 2003-07-04 Corinna Vinschen <corinna@vinschen.de>
2425 * mmap.cc (fhandler_disk_file::mmap): Fix address test.
2427 2003-07-03 Christopher Faylor <cgf@redhat.com>
2429 * path.cc (fillout_mntent): Change "posix" to "managed".
2431 2003-07-02 Christopher Faylor <cgf@redhat.com>
2433 * fhandler.h (FH_ENC): New enum.
2434 (fhandler_base::get_encoded): New function.
2435 (fhandler_base::set_encoded): Ditto.
2436 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set encoded flag
2437 in fhandler, as appropriate.
2438 (fhandler_disk_file::readdir): Unmunge filename as appropriate based on
2440 * path.cc (normalize_posix_path): Don't punt on files with colons.
2441 (special_char): New function.
2442 (mount_item::fnmunge): Ditto.
2444 (special_name): Ditto.
2445 (mount_item::build_win32): Avoid drive considerations when file is
2447 (mount_info::conv_to_win32_path): Handle encoded filenames.
2448 (mount_info::conv_to_posix_path): Ditto.
2449 (fillout_mntent): Add posix string when directory is encoded.
2450 * path.h (fnunmunge): Declare.
2451 (path_conv::is_encoded): Declare.
2453 2003-07-03 Christopher Faylor <cgf@redhat.com>
2455 * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize a little
2456 more of the cygserver stuff so that ttys actually work.
2458 2003-07-03 Corinna Vinschen <corinna@vinschen.de>
2460 * mmap.cc (mmap64): Allow MAP_FIXED with pagesize granularity (4K).
2461 If a non-zero addr is given, align it to the next lower 64K boundary.
2462 (fhandler_disk_file::mmap): If a non-zero address is given, try
2463 mapping using the given address first. If it fails and flags is not
2464 MAP_FIXED, try again with NULL address.
2466 2003-07-01 Christopher Faylor <cgf@redhat.com>
2468 * thread.cc: Remove _MT_SAFE conditional.
2470 2003-07-01 Christopher Faylor <cgf@redhat.com>
2472 * configure.in: Fix --enable-server option.
2473 * configure: Regenerate.
2475 2003-07-01 Christopher Faylor <cgf@redhat.com>
2477 * Makefile.in: Remove cygserver stuff.
2478 * acconfig.h: Add USE_CYGSERVER define.
2479 * config.h.in: Regenerate.
2480 * configure.in: Add --enable-server setting.
2481 * configure: Regenerate.
2482 * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize
2483 compilation of cygserver stuff.
2484 * fork.cc (fork_child): Ditto.
2486 * tty.cc (tty::common_init): Ditto.
2488 * dcrt0.cc: Use bool rather than BOOL for CYGWIN environment variable
2490 * environ.cc: Ditto.
2492 * security.cc: Ditto.
2493 * security.h: Ditto.
2494 * syscalls.cc (check_posix_perm): Remove externs that were already
2495 declared in a header.
2496 * winsup.h: Ditto. Declare _MT_SAFE here. Delete it someday since
2497 cygwin should always be _MT_SAFE.
2499 2003-07-01 Christopher Faylor <cgf@redhat.com>
2501 * thread.cc: Remove _MT_SAFE conditional.
2503 2003-07-01 Christopher Faylor <cgf@redhat.com>
2505 * configure.in: Fix --enable-server option.
2506 * configure: Regenerate.
2508 2003-07-01 Christopher Faylor <cgf@redhat.com>
2510 * Makefile.in: Remove cygserver stuff.
2511 * acconfig.h: Add USE_CYGSERVER define.
2512 * config.h.in: Regenerate.
2513 * configure.in: Add --enable-server setting.
2514 * configure: Regenerate.
2515 * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize
2516 compilation of cygserver stuff.
2517 * fork.cc (fork_child): Ditto.
2519 * tty.cc (tty::common_init): Ditto.
2521 * dcrt0.cc: Use bool rather than BOOL for CYGWIN environment variable
2523 * environ.cc: Ditto.
2525 * security.cc: Ditto.
2526 * security.h: Ditto.
2527 * syscalls.cc (check_posix_perm): Remove externs that were already
2528 declared in a header.
2529 * winsup.h: Ditto. Declare _MT_SAFE here. Delete it someday since
2530 cygwin should always be _MT_SAFE.
2532 2003-06-30 Pierre Humblet <pierre.humblet@ieee.org>
2534 * cygheap.h (enum impersonation): New enum.
2535 (cygheap_user::token): Delete.
2536 (cygheap_user::impersonated): Delete.
2537 (cygheap_user::external_token): New member.
2538 (cygheap_user::internal_token): New member.
2539 (cygheap_user::impersonation_state): New member.
2540 (cygheap_user::issetuid): Modify.
2541 (cygheap_user::token): New method.
2542 (cygheap_user::deimpersonate): New method.
2543 (cygheap_user::reimpersonate): New method.
2544 (cygheap_user::has_impersonation_tokens): New method.
2545 (cygheap_user::close_impersonation_tokens): New method.
2546 * dtable.cc (dtable::vfork_child_dup): Use new cygheap_user methods.
2547 * fhandler_socket.cc (fhandler_socket::dup): Ditto.
2548 * fork.cc (fork_child): Ditto.
2549 (fork_parent): Ditto.
2550 * grp.cc (internal_getgroups): Ditto.
2551 * security.cc (verify_token): Ditto.
2552 (check_file_access): Ditto.
2553 (cygwin_set_impersonation_token): Detect conflicts. Set
2554 user.external_token.
2555 * spawn.cc (spawn_guts): Use new cygheap_user methods.
2556 * syscalls.cc (seteuid32): Rearrange to use the two tokens
2558 (setegid32): Use new cygheap_user methods.
2559 * uinfo.cc: (internal_getlogin): Ditto.
2561 2003-06-25 Doru Carastan <doru.carastan@mvista.com>
2563 * Makefile.in: Use INSTALL_PROGRAM to install the cygwin DLL.
2565 2003-06-24 Thomas Pfaff <tpfaff@gmx.net>
2567 * thread.cc (MTinterface::fixup_after_fork): Fix thread list after
2569 (pthread::threads): Instantiate.
2570 (pthread::pthread): Initialize running and suspendend.
2571 Initialize next with NULL.
2572 Add thread to thread list if it is not the null_pthread.
2573 (pthread::~pthread): Remove thread from thread list if it is
2574 not the null_pthread.
2575 (pthread::postcreate): Set running flag.
2576 (pthread::exit): Reset running flag.
2577 (pthread::cancel): Try to cancel thread only if still running.
2578 (pthread::_fixup_after_fork): Implement.
2579 (pthread::detach): Check if thread is still running before detach.
2580 * thread.h (pthread::running): New member.
2581 (pthread::next): Ditto.
2582 (pthread::fixup_after_fork): New static method.
2583 (pthread::threads): New static method.
2584 (pthread::_fixup_after_fork): New method.
2586 2003-06-20 Christopher Faylor <cgf@redhat.com>
2588 * pinfo.cc (_pinfo::commune_send): Don't attempt to communicate with a
2589 pure windows process.
2591 2003-06-18 Pierre Humblet <pierre.humblet@ieee.org>
2593 * autoload.cc (GetNetworkParams): Add.
2594 * net.cc (getdomainname): Call GetNetworkParams and read the
2595 DhcpDomain registry value if warranted.
2597 2003-06-17 Christopher Faylor <cgf@redhat.com>
2599 * path.cc (mount): Do more strict checking on posix path arguments.
2601 2003-06-15 Christopher Faylor <cgf@redhat.com>
2603 Throughout, remove "include <errno.h>" from files which already include
2606 2003-06-15 Thomas Pfaff <tpfaff@gmx.net>
2608 * include/cygwin/config.h (__DYNAMIC_REENT__): Define.
2609 * include/cygwin/version.h: Bump API minor version.
2610 * cygwin.din: Export __getreent
2611 * cygerrno.h: Include errno.h. Fix places where _impure_ptr is used
2612 directly to store the errno value.
2613 * debug.cc (__set_errno): Ditto.
2614 * errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled.
2615 * signal.cc: Rename _reent_clib to _REENT throughout.
2616 * thread.h (reent_clib): Remove prototype.
2617 * thread.cc (reent_clib): Rename reent_clib to __getreent. Return
2618 _impure_ptr until MTinterface is initialized.
2619 (reent_winsup): Fix a possible SEGV when _r == NULL. Return NULL
2621 * MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to
2622 keep signal handling running when fork is called from a thread other
2623 than the mainthread.
2625 2003-06-12 Thomas Pfaff <tpfaff@gmx.net>
2627 * thread.cc (pthread_attr_init): Revert change from 2003-06-11
2628 to return 0 if attribute is already initialized back to EBUSY.
2629 (pthread_condattr_init): Ditto.
2630 (pthread_rwlockattr_init): Ditto.
2631 (pthread_mutexattr_init): Ditto.
2633 2003-06-12 Corinna Vinschen <corinna@vinschen.de>
2635 * exceptions.cc (ctrl_c_handler): Don't send a signal on
2636 CTRL_SHUTDOWN_EVENT. Add a comment to rationalize the patch.
2638 2003-06-11 Thomas Pfaff <tpfaff@gmx.net>
2640 * thread.cc (pthread_attr_init): Return 0 if attribute is already
2642 Fix return code if out of memory.
2643 (pthread_condattr_init): Ditto.
2644 (pthread_rwlockattr_init): Ditto.
2645 (pthread_mutexattr_init): Return 0 if attribute is already
2648 2003-06-09 Pierre Humblet <pierre.humblet@ieee.org>
2650 * spawn.cc (spawn_guts): Call CreateProcess while impersonated,
2651 when the real {u,g}ids and the groups are original.
2652 Move RevertToSelf and ImpersonateLoggedOnUser to the main line.
2653 * uinfo.cc (uinfo_init): Reorganize. If CreateProcess was called
2654 while impersonated, preserve the uids and gids and call
2655 ImpersonateLoggedOnUser. Preserve the uids and gids on Win9X.
2657 * exceptions.cc (error_start_init): Quote the pgm in the command.
2659 2003-06-07 Christopher Faylor <cgf@redhat.com>
2661 * poll.cc: Define FD_SETSIZE to ridiculously large number so that there
2662 will be no artificially small limits.
2664 2003-06-07 Christopher Faylor <cgf@redhat.com>
2666 * fhandler_tty.cc (fhandler_tty_slave::close): Free the console when
2669 2003-06-07 Thomas Pfaff <tpfaff@gmx.net>
2671 * fhandler_socket.cc (fhandler_socket::connect): Change error
2672 handling for nonblocking connects to return EALREADY when
2673 connect is called more than once for the same socket.
2675 2003-06-06 Corinna Vinschen <corinna@vinschen.de>
2677 * cygwin.din: Add vsyslog.
2678 * fhandler.cc (fhandler_base::write): Only make file sparse if the
2679 seeked area is >= 128K.
2680 * syslog.cc (vsyslog): New function, overtaking functionality from
2682 (syslog): Just call vsyslog.
2683 * include/cygwin/version.h: Bump API minor.
2684 * include/sys/syslog.h: Add vsyslog declaration.
2686 2003-06-05 Christopher Faylor <cgf@redhat.com>
2688 * cygthread.cc (cygthread::terminate_thread): Change system_printf to
2691 2003-06-04 Christopher Faylor <cgf@redhat.com>
2693 * shared.cc (shared_info::heap_chunk_size): Be really defensive about
2694 making sure that heap_chunk is set.
2696 2003-06-04 Christopher Faylor <cgf@redhat.com>
2698 * path.cc (conv_path_list): Use correct value when calculating length
2699 to avoid a potential SEGV.
2701 2003-06-03 Pierre Humblet <pierre.humblet@ieee.org>
2703 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Mark the pc
2704 as non-executable if the file cannot be opened for read. Retry query
2705 open only if errno is EACCES. Never change the mode, even if it is 000
2706 when query open() fails.
2708 2003-06-03 Christopher Faylor <cgf@redhat.com>
2710 * configure.in: Allow any i?86 variant.
2711 * configure: Regenerate.
2713 2003-06-03 Corinna Vinschen <corinna@vinschen.de>
2714 Thomas Pfaff <tpfaff@gmx.net>
2716 * fhandler_socket.cc (connect_thread): Remove.
2717 (accept_thread): Remove.
2718 (fhandler_socket::connect): Remove all special blocking handling.
2719 (fhandler_socket::accept): Ditto.
2720 * net.cc (cygwin_connect): Make blocking sockets temporarily
2721 non-blocking and call cygwin_select on them to be interruptible.
2722 (cygwin_accept): Ditto.
2724 2003-06-02 Christopher Faylor <cgf@redhat.com>
2726 * spawn.cc (spawn_guts): Don't hang around if the parent doesn't exist.
2728 2003-06-02 Christopher Faylor <cgf@redhat.com>
2730 * cygthread.h (cygthread::terminate_thread): Mark private.
2731 * cygthread.cc (cygthread::terminate_thread): Deallocate free_range
2734 2003-06-02 Corinna Vinschen <corinna@vinschen.de>
2736 * fhandler_socket.cc (fhandler_socket::accept): Rename `signalled'
2737 to `interrupted' as used in fhandler_socket::connect.
2739 2003-06-02 Corinna Vinschen <corinna@vinschen.de>
2741 * fhandler_socket.cc (fhandler_socket::connect): Simplify previous
2743 (fhandler_socket::accept): Ditto.
2745 2003-06-02 Corinna Vinschen <corinna@vinschen.de>
2747 * fhandler_socket.cc: Include cygthread.h.
2748 (class sock_event): Remove.
2749 (thread_connect): New function.
2750 (thread_accept): Ditto.
2751 (fhandler_socket::connect): Use cygthread instead of socket event
2752 handling for blocking sockets.
2753 (fhandler_socket::accept): Ditto.
2755 2003-06-02 Christopher Faylor <cgf@redhat.com>
2757 * fhandler.cc (fhandler_base::write): Correct minor printf formatting
2760 2003-06-01 Pierre Humblet <pierre.humblet@ieee.org>
2762 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Assume
2763 an existing directory is a root if FindFirstFile fails.
2765 2003-05-30 Christopher Faylor <cgf@redhat.com>
2767 * path.cc (mount_info::conv_to_win32_path): gcc warning about chroot_ok
2768 was actually valid. Fix it.
2770 2003-05-30 Christopher Faylor <cgf@redhat.com>
2772 * cygheap.cc (init_cheap): Temporarily remove inline that newer gcc's
2775 * path.cc (path_conv::check): Rework has_acls logic slightly. Uncouple
2776 exec tests away from filesystem tests.
2778 2003-05-30 Corinna Vinschen <corinna@vinschen.de>
2780 * include/sys/param.h: Add DEV_BSIZE.
2782 2003-05-29 Pierre Humblet <pierre.humblet@ieee.org>
2783 Corinna Vinschen <corinna@vinschen.de>
2785 * fhandler_socket.cc (fhandler_socket::dup): Rearrange. Fix
2788 2003-05-28 Christopher Faylor <cgf@redhat.com>
2790 * mkvers.sh: Avoid "-dontuse" tags.
2792 * path.cc (path_conv::check): Set exec state based on known situations.
2794 * path.cc (mount_item::fnmunge): New function.
2795 (mount_item::build_win32): New function.
2796 (mount_info::conv_to_win32_path): Use build_win32 to build windows
2798 * path.h (mount_item::fnmunge): Declare new function.
2799 (mount_item::build_win32): Ditto.
2800 * sys/mount.h (MOUNT_ENC): Define.
2802 2003-05-28 Corinna Vinschen <corinna@vinschen.de>
2804 * fhandler_socket.cc (fhandler_socket::dup): If running impersonated,
2805 revert to original account before calling fixup_before_fork_exec
2806 and impersonate again afterwards. Change comment accordingly.
2807 Clean up error handling and debug output.
2809 2003-05-27 Thomas Pfaff <tpfaff@gmx.net>
2811 * fhandler_socket.cc (sock_event::~sock_event): New method.
2812 (sock_event::load): Change to void. Check if winsock2 is available.
2813 (socke_event::wait): Return 0 if interruptible mode is not available.
2814 (fhandler_socket::connect): Remove checks for winsock2 availability.
2815 (fhandler_socket::accept): Ditto.
2817 2003-05-27 Corinna Vinschen <corinna@vinschen.de>
2819 * fhandler_socket.cc (fhandler_socket::dup): First try duplicating
2820 using WSADuplicateSocket/WSASocket, if that fails, try DuplicateHandle.
2822 2003-05-27 Bill C. Riemers <cygwin@docbill.net>
2824 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Filter
2825 permissions through umask on FAT or if ntsec is off.
2827 2003-05-26 Pierre Humblet <pierre.humblet@ieee.org>
2829 * syscalls.cc (statfs): Call GetDiskFreeSpaceEx before GetDiskFreeSpace.
2831 2003-05-26 Corinna Vinschen <corinna@vinschen.de>
2833 * fhandler.cc (is_at_eof): Fix conditional. Use INVALID_FILE_SIZE
2834 instead of numeric constant.
2836 2003-05-26 Corinna Vinschen <corinna@vinschen.de>
2838 * fhandler_socket.cc (fhandler_socket::connect): Guard calls to
2839 sock_event methods by a check for WinSock2 availability.
2840 (fhandler_socket::accept): Ditto.
2842 2003-05-26 Corinna Vinschen <corinna@vinschen.de>
2844 * fhandler.h: Rename FH_W95LSBUG flag to FH_LSEEKED.
2845 (fhandler_base::set_did_lseek): Rename from set_check_win95_lseek_bug.
2846 (fhandler_base::get_did_lseek): Rename from get_check_win95_lseek_bug.
2847 (fhandler_base::set_fs_flags): New method.
2848 (fhandler_base::get_fs_flags): Ditto.
2849 * fhandler.cc (fhandler_base::write): Make 64 bit clean. Convert file
2850 to a "sparse" file when writing after a long lseek (>64K) beyond EOF.
2851 (fhandler_base::lseek): Call set_did_lseek() instead of
2852 set_check_win95_lseek_bug().
2853 (fhandler_base::fhandler_base): Initialize fs_flags to 0.
2854 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files
2855 as "sparse" unconditionally. Set fs_flags member.
2857 2003-05-25 Pierre Humblet <pierre.humblet@ieee.org>
2859 * autoload.cc (GetDiskFreeSpaceEx): Add.
2860 * syscalls.cc (statfs): Call full_path.root_dir() instead of
2861 rootdir(full_path). Use GetDiskFreeSpaceEx when available and
2862 report space available in addition to free space.
2863 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name):
2864 Do not call FindFirstFile for disk root directories.
2866 2003-05-24 Joe Buehler <jhpb@draco.hekimian.com>
2868 * fhandler_process.cc (format_process_stat): Use PagefileUsage
2869 instead of VirtualSize.
2870 (get_mem_values): Ditto.
2872 2003-05-21 Corinna Vinschen <corinna@vinschen.de>
2874 * shared_info.h: Match shared_name declaration with below change.
2875 * shared.cc (shared_name): Use incoming char * parameter instead of
2876 local static buffer.
2877 (open_shared): Accommodate new calling convention for shared_name.
2878 * exceptions.cc (events_init): Ditto.
2879 * sigproc.cc (getsem): Ditto.
2880 * syscalls.cc (login): Ditto.
2884 2003-05-20 Corinna Vinschen <corinna@vinschen.de>
2886 * fhandler_socket.cc (secret_event_name): Return void. Use incoming
2887 char * parameter instead of local static buffer.
2888 (fhandler_socket::create_secret_event): Accommodate new calling
2889 convention for secret_event_name.
2890 (fhandler_socket::close_secret_event): Ditto.
2892 2003-05-20 Corinna Vinschen <corinna@vinschen.de>
2894 * fhandler_socket.cc (SECRET_EVENT_NAME): Remove.
2895 (ENTROPY_SOURCE_NAME): Ditto.
2896 (secret_event_name): New static function. Create shared event name
2897 with "Global\" prefix on systems supporting terminal services.
2898 (fhandler_socket::set_connect_secret): Fix conditional.
2899 (fhandler_socket::create_secret_event): Create secret event using
2900 secret_event_name().
2901 (fhandler_socket::close_secret_event): Ditto.
2902 * shared.cc (shared_name): Create shared object name with "Global\"
2903 prefix on systems supporting terminal services.
2904 * wincap.cc: Set has_terminal_services capability throughout.
2905 (wincap_2003): New global object representing Windows 2003 Server
2907 (wincapc::init): Accommodate Windows 2003 Server.
2908 * wincap.h (struct wincaps): Add has_terminal_services capability.
2910 2003-05-20 Charles Wilson <cygwin@cwilson.fastmail.fm>
2912 * winsup/cygwin/include/cygwin/version.h: Bump API minor version.
2913 * winsup/cygwin/include/cygwin/types.h: Define key_t as long long.
2914 * winsup/cygwin/cygwin.din: Add ftok, _ftok.
2915 * winsup/cygwin/ipc.cc (ftok): Rework implementation.
2917 2003-05-18 Joe Buehler <jhpb@hekimian.com>
2919 * spawn.cc (spawn_guts): Show more of command line in strace output.
2921 2003-05-15 Thomas Pfaff <tpfaff@gmx.net>
2923 * thread.h (pthread::init_mainthread): Remove function parameter.
2924 (MTinterface::Init): Ditto.
2925 * thread.cc (MTinterface::Init): Remove function parameter.
2926 Always initialize reent_key.
2927 (pthread::init_mainthread): Remove function parameter.
2928 (MTinterface::fixup_after_fork): Fix pthread::init_mainthread call.
2929 * dcrt0.cc (dll_crt_0_1) Fix calls to MTinterface::Init and
2930 pthread::init_mainthread.
2931 Call pthread::init_mainthread only when not forked.
2933 2003-05-15 Corinna Vinschen <corinna@vinschen.de>
2935 * fhandler_proc.cc (format_proc_meminfo): Make swap memory output
2938 2003-05-13 Corinna Vinschen <corinna@vinschen.de>
2940 * include/cygwin/config.h: Define __USE_INTERNAL_STAT64 appropriately.
2942 2003-05-12 Corinna Vinschen <corinna@vinschen.de>
2944 * Makefile.in (CYGWIN_START): Define as crt0.o. Add to TARGET_LIBS.
2945 * fhandler.h (fhandler_virtual::fstat): Remove useless declaration.
2946 * fhandler_virtual.cc: Remove _COMPILING_NEWLIB define.
2947 * ipc.cc (ftok): Use stat64.
2948 * syscalls.cc (_fstat64): Remove alias.
2951 (_fstat64_r): New function.
2955 * crt0.o: New file, moved from newlib.
2956 * include/sys/param.h: Ditto.
2957 * include/sys/utime.h: Ditto.
2958 * include/sys/utmp.h: Ditto.
2959 * include/sys/dirent.h: Ditto. Expose different struct dirent,
2960 dependening of the environment.
2962 2003-05-11 Corinna Vinschen <corinna@vinschen.de>
2964 Replace ino_t by __ino64_t throughout.
2966 2003-05-11 Corinna Vinschen <corinna@vinschen.de>
2968 * include/cygwin/types.h: Add key_t typedef.
2970 2003-05-10 Christopher Faylor <cgf@redhat.com>
2972 * dir.cc (readdir): Fill out new old_d_ino field.
2973 * fhandler.h (fhandler_base::namehash): Define as ino_t.
2974 (fhandler_base::get_namehash): Ditto.
2975 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Accommodate
2977 * fhandler_socket.cc (fhandler_socket::fstat): Ditto.
2978 * path.cc (hash_path_name): Return ino_t.
2979 * syscalls.cc (stat64_to_stat32): Convert 64 bit inode to 32 bit.
2980 * winsup.h (hash_path_name): Declare as returning ino_t.
2981 * include/cygwin/stat.h (__stat32): Use 32 bit st_ino.
2982 (__stat64): Use 64 bit st_ino.
2983 * include/cygwin/types.h (__ino64_t): Define.
2985 (ino_t): Define appropriately.
2987 2003-05-10 Corinna Vinschen <corinna@vinschen.de>
2989 * Makefile.in (NEW_FUNCTIONS): All 32/64 from 0.79 API get
2991 * cygwin.din: Ditto.
2992 * include/cygwin/version.h: Bump API minor number.
2994 2003-05-09 Corinna Vinschen <corinna@vinschen.de>
2996 * include/cygwin/config.h: New file.
2998 2003-05-09 Christopher Faylor <cgf@redhat.com>
3000 * cygthread.cc (cygthread::detach): Prioritize waiting for I/O
3001 completion over waiting for signal delivery.
3003 2003-05-06 Thomas Pfaff <tpfaff@gmx.net>
3005 * signal.cc (nanosleep): Do not wait twice for signal arrival.
3007 2003-05-03 Corinna Vinschen <corinna@vinschen.de>
3009 * include/cygwin/types.h: Fix erroneous definition of ino_t from
3012 2003-05-03 Corinna Vinschen <corinna@vinschen.de>
3014 * syscalls.cc (chown_worker): Allow chown'ing of socket files.
3016 2003-04-30 Thomas Pfaff <tpfaff@gmx.net>
3018 * Makefile.in: Revert patch from 2003-04-17.
3020 2003-04-28 Brian Ford <ford@vss.fsi.com>
3022 * profil.h (PROFADDR): Prevent overflow when text segments are larger
3024 * profil.c (profthr_func): Raise thread priority for more accurate
3027 2003-04-26 Christopher Faylor <cgf@redhat.com>
3029 * path.cc (hash_path_name): Use ino_t as type.
3031 2003-04-26 Christopher Faylor <cgf@redhat.com>
3033 * errno.cc (_sys_nerr): Fix compile error erroneously checked in on
3036 2003-04-25 Corinna Vinschen <corinna@vinschen.de>
3038 * include/netinet/ip.h: Include netinet/in_systm.h and netinet/in.h
3039 to allow standalone usage (autoconf).
3041 2003-04-23 Christopher Faylor <cgf@redhat.com>
3043 * fork.cc: Change SLOW_PID_REUSE to NO_SLOW_PID_REUSE and invert ifdef
3046 2003-04-22 Christopher Faylor <cgf@redhat.com>
3048 * select.cc (fhandler_pipe::ready_for_read): Assure that get_guard is
3049 called for successful non-blocking pipe reads.
3051 2003-04-22 Corinna Vinschen <corinna@vinschen.de>
3053 * include/inttypes.h: New file.
3054 * include/stdint.h: New file.
3055 * include/cygwin/in.h: Include stdint.h instead of sys/types.h.
3056 * include/cygwin/types.h: Include stdint.h. Remove typedefs for
3057 intN_t and uintN_t since these are defined in stdint.h now.
3059 2003-04-21 Christopher Faylor <cgf@redhat.com>
3061 * include/cygwin/version.h: Bump DLL major number to 1005. Change DLL
3062 minor number to 0. Bump API minor number.
3064 2003-04-20 Corinna Vinschen <corinna@vinschen.de>
3066 * autoload.cc (CreateWindowStationA): Add.
3067 (SetProcessWindowStation): Add.
3069 2003-04-19 Christopher Faylor <cgf@redhat.com>
3071 * wincap.h (wincaps:pty_needs_alloc_console): New element.
3072 (wincapc:pty_needs_alloc_console): New function.
3073 * wincap.cc: Add pty_needs_alloc_console throughout.
3074 * fhandler_tty.cc (fhandler_tty_slave::open): Open an "invisible"
3075 console on first pty allocation.
3077 2003-04-18 Christopher Faylor <cgf@redhat.com>
3079 * fhandler_tty.cc (fhandler_tty_slave::open): Allocate a console
3080 whenever a pty is allocated.
3082 2003-04-18 Christopher Faylor <cgf@redhat.com>
3084 * Makefile.in: Use ${nostdlib} variable.
3086 2003-04-18 Diego Biurrun <diego@biurrun.de>
3088 * fhandler_proc.cc (format_proc_cpuinfo): Change /proc/cpuinfo "vendor
3089 id" string to "vendor_id" to conform with Linux systems.
3091 2003-04-17 Christopher Faylor <cgf@redhat.com>
3093 * syscalls.cc (setsid): Don't call FreeConsole if ctty is already < 0.
3095 2003-04-17 Thomas Pfaff <tpfaff@gmx.net>
3097 * Makefile.in: Add finline-functions optimization to CXXFLAGS.
3098 * autoload.cc (LoadDLLprime): Rename std_dll_init to
3100 (std_dll_init): Remove name mangling prototype. Add attributes
3102 (wsock_init): Ditto.
3103 Change wsock_init to _wsock_init in wsock32 and ws2_32
3105 * exceptions.cc (unused_sig_wrapper): Remove prototype. Add
3106 attributes used and noinline.
3107 * pwdgrp.h ((pwdgrp (passwd *&)): Remove inline code.
3108 (pwdgrp (__group32 *&)): Ditto.
3109 * grp.cc (pwdgrp (passwd *&)): Outline constructor.
3110 (pwdgrp (__group32 *&)): Ditto.
3112 2003-04-17 Thomas Pfaff <tpfaff@gmx.net>
3114 * thread.h (pthread::equal): New static method.
3115 * thread.cc: Rename pthread_equal to pthread::equal throughout.
3116 (pthread_equal): Use pthread::equal to compare threads ids.
3118 2003-04-15 Christopher Faylor <cgf@redhat.com>
3120 * termios.cc (setspeed): New function.
3121 (cfsetospeed): Use setspeed to set speed.
3122 (cfsetispeed): Use setspeed to set speed.
3124 2003-04-15 Chris January <chris@atomice.net>
3126 * autoload.cc: Add load statement for UuidCreate, and
3127 UuidCreateSequential.
3128 * cpuid.h: New file.
3129 * cygwin.din: Export gethostid.
3130 * fhandler_proc.cc (cpuid): Move to cpuid.h.
3131 (can_set_flag): Move to cpuid.h.
3132 * syscalls.cc (gethostid): New function.
3133 * version.h: Bump api minor version number to 83.
3135 2003-04-15 Thomas Pfaff <tpfaff@gmx.net>
3137 * thread.h (pthread_rwlock::release): New method.
3138 * thread.cc (pthread_rwlock::unlock): Use release to signal waiting
3140 (pthread_rwlock::rdlock_cleanup): Signal waiting threads after a
3142 (pthread_rwlock::wrlock_cleanup): Ditto.
3144 2003-04-13 Pierre Humblet <pierre.humblet@ieee.org>
3146 * mkvers.sh: Prefix day with 0 in date only when day < 10.
3148 2003-04-11 Pierre Humblet <pierre.humblet@ieee.org>
3150 * security.cc (get_info_from_sd): New function.
3151 (get_nt_attribute): Only call read_sd and get_info_from_sd.
3153 (get_file_attribute): Move sd error handling to get_info_from_sd.
3154 and symlink handling to fhandler_disk_file::fstat_helper.
3155 (get_nt_object_attribute): Only call read_sd and get_info_from_sd.
3157 (get_object_attribute): Remove symlink handling and simply return -1
3159 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): For
3160 symlinks set the attribute, call get_file_attribute to get the ids
3161 and return. In the normal case call get_file_attribute with the
3162 addresses of the buffer ids and do not recheck if the file is a socket.
3164 2003-04-10 Christopher Faylor <cgf@redhat.com>
3166 * cygthread.cc (cygthread::stub): Initialize stack pointer earlier.
3167 (cygthread::simplestub): Initialize stack pointer.
3168 (cygthread::terminate_thread): Account for possibility that stack
3169 pointer has not been set. Issue warnings for unusual conditions.
3171 2003-04-10 Corinna Vinschen <corinna@vinschen.de>
3173 * regex/regex.h: Define regoff_t as _off_t.
3174 * regex/regex2.h: Ditto.
3176 2003-04-10 Corinna Vinschen <corinna@vinschen.de>
3178 * cygwin.din: Export wcscoll, wcswidth and wcwidth.
3179 * include/cygwin/version.h: Bump API minor number.
3181 2003-04-10 Christopher Faylor <cgf@redhat.com>
3183 * cygthread.h: Change 'avail' cygthread element to 'inuse' throughout.
3184 * cygthread.cc: Ditto.
3185 (cygthread::stub): Don't initialize already initialized events.
3186 (cygthread::freerange): Don't create thread here.
3187 (cygthread::cygthread): Create thread here. Die if thread not created.
3188 (cygthread::operator new): Simplify. Just grab a thread structure from
3189 the pool. Don't try to start the thread.
3190 (cygthread::terminate_thread): Don't close event handles. Just reuse
3191 them. Call MEM_RELEASE rather than MEM_DECOMMIT (from Joe uehler).
3193 2003-04-08 Bob Cassels <bcassels@abinitio.com>
3195 * fhandler_console.cc (fhandler_console::read) Handle certain key up
3196 events, to allow pasting accented characters and typing them using the
3197 "alt + numerics" sequences.
3199 2003-04-07 Christopher Faylor <cgf@redhat.com>
3201 * include/limits.h (IOV_MAX): Set to a number which is small enough to
3204 2003-04-04 Christopher Faylor <cgf@redhat.com>
3206 * cygthread.h (cygthread::avail): Make LONG for easier use with
3207 Interlocked* functions.
3208 * cygthread.cc (cygthread::init): Eliminate unneeded muto.
3209 (cygthread::operator new): Don't lock. Instead change use of avail
3210 variable into tri-state: available (1), not available (-1),
3212 (cygthread::terminate_thread): Set avail to uninitialized.
3213 (cygthread::detach): Eliminate local 'avail'. Always set avail to 1
3216 2003-04-04 Christopher Faylor <cgf@redhat.com>
3218 * cygthread.cc (cygthread::operator new): Be more defensive when messing with
3219 threads that are marked "unavailable".
3221 2003-04-03 Christopher Faylor <cgf@redhat.com>
3223 * fhandler_console.cc (CONVERT_LIMIT): Use a size for the 21st century.
3225 2003-04-03 Corinna Vinschen <corinna@vinschen.de>
3227 * external.cc (check_ntsec): Return general ntsec state on NULL
3228 filename. Check wincap.is_security() additionally.
3230 2003-04-02 Christopher Faylor <cgf@redhat.com>
3232 * Makefile.in (EXTRA_OFILES): Remove debugging object.
3234 2003-04-02 Jason Tishler <jason@tishler.net>
3235 Christopher Faylor <cgf@redhat.com>
3237 * external.cc (check_ntsec): New function.
3238 (cygwin_internal): Add CW_CHECK_NTSEC handling to call check_ntsec()
3240 * include/cygwin/version.h: Bump API minor number.
3241 * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CHECK_NTSEC.
3243 2003-04-02 Christopher Faylor <cgf@redhat.com>
3245 * cygthread.cc (cygthread::new): Add more defensive debugging.
3247 2003-04-01 Pierre Humblet <pierre.humblet@ieee.org>
3249 * fhandler.cc (fhandler_base::fstat): Set the uid and gid fields
3250 from the current effective ids.
3251 * fhandler_socket.cc (fhandler_socket::fstat): Keep the uid and gid set
3252 by fhandler_base::fstat.
3253 * security.cc (get_nt_attribute): Do not test wincap.has_security ().
3254 (get_nt_object_attribute): Ditto.
3255 (get_file_attribute): Add test for wincap.has_security ().
3256 (get_object_attribute): Ditto.
3258 2003-04-01 Corinna Vinschen <corinna@vinschen.de>
3260 * dir.cc: Change __off32_t to _off_t and __off64_t to _off64_t
3262 * fhandler.cc: Ditto.
3263 * fhandler.h: Ditto.
3264 * fhandler_clipboard.cc: Ditto.
3265 * fhandler_disk_file.cc: Ditto.
3266 * fhandler_dsp.cc: Ditto.
3267 * fhandler_floppy.cc: Ditto.
3268 * fhandler_mem.cc: Ditto.
3269 * fhandler_proc.cc: Ditto.
3270 * fhandler_process.cc: Ditto.
3271 * fhandler_random.cc: Ditto.
3272 * fhandler_registry.cc: Ditto.
3273 * fhandler_tape.cc: Ditto.
3274 * fhandler_termios.cc: Ditto.
3275 * fhandler_virtual.cc: Ditto.
3276 * fhandler_zero.cc: Ditto.
3279 * syscalls.cc: Ditto.
3281 * include/cygwin/stat.h: Ditto.
3282 * include/cygwin/types.h: Ditto. Remove definition of __off32_t
3285 2003-03-31 Christopher Faylor <cgf@redhat.com>
3287 * exceptions.cc (setup_handler): Make sure winapi lock is released when
3290 2003-03-30 Christopher Faylor <cgf@redhat.com>
3292 * include/cygwin/fs.h: Remove unneeded include.
3293 * include/cygwin/in.h: Include sys/types.h rather than cygwin/types.h.
3295 2003-03-29 Corinna Vinschen <corinna@vinschen.de>
3297 * syscalls.cc (login): Fix comment.
3300 2003-03-29 Corinna Vinschen <corinna@vinschen.de>
3302 * syscalls.cc: Slightly cleanup all utmp functions.
3303 (login): Use mutex to secure against concurrent access to wtmp file.
3304 (logout): Rewrite using POSIX calls.
3305 (utmp_fd): Initialized to -1 now. Any value < 0 is treated as closed
3306 in subsequent functions.
3307 (utmp_readonly): New variable, indicating utmp file open for reading
3309 (internal_setutent): New function implementing setutent().
3310 (setutent): Call internal_setutent now.
3311 (endutent): Reset utmp_readonly.
3312 (getutent): Return immediately if utmp file can't be opened.
3315 (pututline): Ditto. Use mutex to secure against concurrent access to
3318 2003-03-28 Christopher Faylor <cgf@redhat.com>
3320 * Makefile.in: Remove EXE_LDFLAGS. Fix fhandler_CFLAGS typo. Recognize .s suffix.
3321 * configure.in: Remove EXE_LDFLAGS.
3322 * configure: Regenerate.
3324 2003-03-28 Christopher Faylor <cgf@redhat.com>
3326 * include/sys/cygwin.h: Declare cygwin_internal as unsigned long.
3327 * external.cc (cygwin_internal): Define as unsigned long.
3329 2003-03-27 Christopher Faylor <cgf@redhat.com>
3331 * include/sys/cygwin.h: Move cygwin_internal outside of WINVER
3334 2003-03-27 Thomas Pfaff <tpfaff@gmx.net>
3336 * thread.cc: Change 1==foo equations to foo==1 throughout.
3338 2003-03-27 Thomas Pfaff <tpfaff@gmx.net>
3340 * thread.h: Change class names, methods, members and local vars
3341 according to the GNU coding style.
3343 * dcrt0.cc (dll_crt0_1): Rename pthread::initMainThread call to
3344 pthread::init_mainthread.
3345 * pthread.cc (pthead_getsequence_np): Rename pthread::isGoodObject
3346 call to pthread::is_good_object.
3348 2003-03-27 Joe Buehler <jhpb@draco.hekimian.com>
3350 * autoload.cc: Add RegGetKeySecurity().
3351 * security.cc (get_nt_object_attribute): Use RegGetKeySecurity() for
3354 2003-03-25 Christopher Faylor <cgf@redhat.com>
3355 Joe Buehler <jhpb@draco.hekimian.com>
3357 * fork.cc (fork_parent): Don't copy signals from parent to child here.
3358 * sigproc.cc (proc_subproc): Copy signals from parent to child pinfo
3361 2003-03-23 Thomas Pfaff <tpfaff@gmx.net>
3363 * thread.h (class List): Move inline code inside class declaration.
3364 (List::forEach): Change callback parameter to template class member
3366 (pthread_keys::fixup_before_fork): Change to inline. Use List::forEach
3368 (pthread_keys::fixup_after_fork): Ditto.
3369 (pthread_keys::runAllDestructors): Ditto.
3370 (pthread_key::saveAKey): Remove.
3371 (pthread_key::restoreAKey): Ditto.
3372 (pthread_key::destroyAKey): Ditto.
3373 (pthread_key::run_destructor): Rename to runDestructor.
3374 (pthread_mutex::fixup_after_fork): Change to inline. Use List::forEach
3375 to fixup mutexes after a fork.
3376 (pthread_mutex::FixupAfterFork): New method.
3377 (pthread_mutex::mutexes): New member.
3378 (pthread_cond::fixup_after_fork): Change to inline. Use List::forEach
3379 to fixup conds after a fork.
3380 (pthread_cond::FixupAfterFork): New method.
3381 (pthread_cond::conds): New member.
3382 (pthread_rwlock::fixup_after_fork): Change to inline. Use
3383 List::forEach to fixup rwlocks after a fork.
3384 (pthread_rwlock::FixupAfterFork): New method.
3385 (pthread_rwlock::rwlocks): New member.
3386 (semaphore::fixup_after_fork): Change to inline. Use List::forEach to
3387 fixup mutexes after a fork.
3388 (semaphore::FixupAfterFork): New method.
3389 (semaphore::semaphores): New member.
3390 (MTinterface::mutexs): Remove.
3391 (MTinterface::conds): Ditto.
3392 (MTinterface::rwlocks): Ditto.
3393 (MTinterface::semaphores): Ditto.
3394 (pthread_equal): Add extern "C".
3395 (pthread_mutex_lock): Ditto.
3397 * thread.cc (MTinterface::fixup_after_fork): Change fixup_after_fork
3398 calls for pthread objects.
3399 (semaphore::conds): Instantiate.
3400 (pthread_cond::pthread_cond): Use List::Insert rather than custom list
3402 (pthread_cond::~pthread_cond): Use List::Remove rather than custom list
3404 (pthread_cond::fixup_after_fork): Rename to FixupAfterFork.
3405 (pthread_rwlock::rwlocks): Instantiate.
3406 (pthread_rwlock::pthread_crwlock): Use List::Insert rather than custom
3408 (pthread_rwlock::~pthread_rwlock): Use List::Remove rather than custom
3410 (pthread_rwlock::fixup_after_fork): Rename to FixupAfterFork.
3411 (pthread_key::saveAKey): Remove.
3412 (pthread_key::fixup_before_fork): Ditto.
3413 (pthread_key::restoreAKey): Ditto.
3414 (pthread_key::fixup_after_fork): Ditto.
3415 (pthread_key::destroyAKey): Ditto.
3416 (pthread_key::runAllDestructors): Ditto.
3417 (pthread_key::run_destructor): Rename to runDestructor.
3418 (pthread_mutex::mutexes): Instantiate.
3419 (pthread_mutex::pthread_mutex): Use List::Insert rather than custom
3421 (pthread_mutex::~pthread_mutex): Use List::Remove rather than custom
3423 (pthread_mutex::fixup_after_fork): Rename to FixupAfterFork.
3424 (semaphore::conds): Instantiate.
3425 (semaphore::semaphore): Use List::Insert rather than custom list code.
3426 (semaphores::~semaphore): Use List::Remove rather than custom list
3428 (semaphore::fixup_after_fork): Rename to FixupAfterFork.
3430 2003-03-22 Christopher Faylor <cgf@redhat.com>
3432 * pipe.cc (fhandler_pipe::dup): Don't dup input_handle if it doesn't
3435 2003-03-22 Christopher Faylor <cgf@redhat.com>
3437 * syscalls.cc (unlink): Be more defensive when SetFileAttributes is
3438 called. Fix typo in debugging output.
3440 2003-03-21 Christopher Faylor <cgf@redhat.com>
3442 * fork.cc: Conditionalize use of slow_pid_reuse throughout. It's not
3443 necessary for newer versions of bash.
3445 2003-03-20 Corinna Vinschen <corinna@vinschen.de>
3447 * fhandler_socket.cc (fhandler_socket::sendto): Restrict EPIPE and
3448 SIGPIPE handling to connection oriented sockets. Add comment.
3450 2003-03-19 Christopher Faylor <cgf@redhat.com>
3452 * sigproc.h (signal_fixup_after_exec): Eliminate argument in declaration.
3453 * exceptions.cc (signal_fixup_after_exec): Eliminate argument in
3454 definition. Don't reset signal handlers after spawm. Just treat like
3456 * dcrt0.cc (dll_crt0_1): Don't pass PROC_SPAWN argument to
3457 signal_fixup_after_exec.
3458 * syscalls.cc (unlink): Don't change attributes of file if not readonly/system.
3459 Ditto for resetting of arguments.
3461 2003-03-19 Corinna Vinschen <corinna@vinschen.de>
3463 * glob.c: Eliminate __INSIDE_CYGWIN__ preprocessor conditionals
3466 2003-03-19 Corinna Vinschen <corinna@vinschen.de>
3468 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Fix
3469 wrong usage of S_IFDIR.
3470 * security.cc (get_attribute_from_acl): Ditto.
3471 (get_file_attribute): Fix wrong usage of S_IFLNK.
3472 (get_object_attribute): Ditto.
3473 (alloc_sd): Fix wrong usage of S_IFDIR.
3474 * syscalls.cc (chmod): Allow chmod'ing of socket files.
3476 2003-03-19 Corinna Vinschen <corinna@vinschen.de>
3478 * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES):
3480 * glob.c (g_lstat): Use CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES
3481 instead of numerical constants.
3484 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
3486 * pthread.cc (pthread_attr_init): Remove
3487 (pthread_attr_destroy): Ditto.
3488 (pthread_attr_setdetachstate): Ditto.
3489 (pthread_attr_getdetachstate): Ditto.
3490 (pthread_attr_setstacksize): Ditto.
3491 (pthread_attr_getstacksize): Ditto.
3492 (pthread_attr_setinheritsched): Ditto.
3493 (pthread_attr_getinheritsched): Ditto.
3494 (pthread_attr_setschedparam): Ditto.
3495 (pthread_attr_getschedparam): Ditto.
3496 (pthread_attr_setschedpolicy): Ditto.
3497 (pthread_attr_getschedpolicy): Ditto.
3498 (pthread_attr_setscope): Ditto.
3499 (pthread_attr_getscope): Ditto.
3500 (pthread_attr_setstackaddr): Ditto.
3501 (pthread_attr_getstackaddr): Ditto.
3502 (pthread_key_create): Ditto.
3503 (pthread_key_delete): Ditto.
3504 (pthread_setspecific): Ditto.
3505 (pthread_getspecific): Ditto.
3506 (pthread_kill): Ditto.
3507 (pthread_sigmask): Ditto.
3508 (pthread_equal): Ditto.
3509 (pthread_mutex_lock): Ditto.
3510 (pthread_mutex_trylock): Ditto.
3511 (pthread_mutex_unlock): Ditto.
3512 (pthread_mutex_destroy): Ditto.
3513 (pthread_mutex_setprioceiling): Ditto.
3514 (pthread_mutex_getprioceiling): Ditto.
3515 (pthread_mutexattr_destroy): Ditto.
3516 (pthread_mutexattr_getprioceiling): Ditto.
3517 (pthread_mutexattr_getprotocol): Ditto.
3518 (pthread_mutexattr_getpshared): Ditto.
3519 (pthread_mutexattr_gettype): Ditto.
3520 (pthread_mutexattr_init): Ditto.
3521 (pthread_mutexattr_setprioceiling): Ditto.
3522 (pthread_mutexattr_setprotocol): Ditto.
3523 (pthread_mutexattr_setpshared): Ditto.
3524 (pthread_mutexattr_settype): Ditto.
3525 (pthread_cond_destroy): Ditto.
3526 (pthread_cond_signal): Ditto.
3527 (pthread_cond_broadcast): Ditto.
3528 (pthread_condattr_init): Ditto.
3529 (pthread_condattr_destroy): Ditto.
3530 (pthread_condattr_getpshared): Ditto.
3531 (pthread_condattr_setpshared): Ditto.
3532 (pthread_rwlock_destroy): Ditto.
3533 (pthread_rwlock_rdlock): Ditto.
3534 (pthread_rwlock_tryrdlock): Ditto.
3535 (pthread_rwlock_wrlock): Ditto.
3536 (pthread_rwlock_trywrlock): Ditto.
3537 (pthread_rwlock_unlock): Ditto.
3538 (pthread_rwlockattr_init): Ditto.
3539 (pthread_rwlockattr_getpshared): Ditto.
3540 (pthread_rwlockattr_setpshared): Ditto.
3541 (pthread_rwlockattr_destroy): Ditto.
3542 (pthread_getconcurrency): Ditto.
3543 (pthread_setconcurrency): Ditto.
3544 (pthread_getschedparam): Ditto.
3545 (pthread_setschedparam): Ditto.
3547 * thread.h (__pthread_attr_init): Remove prototype.
3548 (__pthread_attr_destroy): Ditto.
3549 (__pthread_attr_setdetachstate): Ditto.
3550 (__pthread_attr_getdetachstate): Ditto.
3551 (__pthread_attr_setstacksize): Ditto.
3552 (__pthread_attr_getstacksize): Ditto.
3553 (__pthread_attr_setinheritsched): Ditto.
3554 (__pthread_attr_getinheritsched): Ditto.
3555 (__pthread_attr_setschedparam): Ditto.
3556 (__pthread_attr_getschedparam): Ditto.
3557 (__pthread_attr_setschedpolicy): Ditto.
3558 (__pthread_attr_getschedpolicy): Ditto.
3559 (__pthread_attr_setscope): Ditto.
3560 (__pthread_attr_getscope): Ditto.
3561 (__pthread_attr_setstackaddr): Ditto.
3562 (__pthread_attr_getstackaddr): Ditto.
3563 (__pthread_key_create): Ditto.
3564 (__pthread_key_delete): Ditto.
3565 (__pthread_setspecific): Ditto.
3566 (__pthread_getspecific): Ditto.
3567 (__pthread_kill): Ditto.
3568 (__pthread_sigmask): Ditto.
3569 (__pthread_equal): Ditto.
3570 (__pthread_mutex_lock): Ditto.
3571 (__pthread_mutex_trylock): Ditto.
3572 (__pthread_mutex_unlock): Ditto.
3573 (__pthread_mutex_destroy): Ditto.
3574 (__pthread_mutex_setprioceiling): Ditto.
3575 (__pthread_mutex_getprioceiling): Ditto.
3576 (__pthread_mutexattr_destroy): Ditto.
3577 (__pthread_mutexattr_getprioceiling): Ditto.
3578 (__pthread_mutexattr_getprotocol): Ditto.
3579 (__pthread_mutexattr_getpshared): Ditto.
3580 (__pthread_mutexattr_gettype): Ditto.
3581 (__pthread_mutexattr_init): Ditto.
3582 (__pthread_mutexattr_setprioceiling): Ditto.
3583 (__pthread_mutexattr_setprotocol): Ditto.
3584 (__pthread_mutexattr_setpshared): Ditto.
3585 (__pthread_mutexattr_settype): Ditto.
3586 (__pthread_cond_destroy): Ditto.
3587 (__pthread_cond_signal): Ditto.
3588 (__pthread_cond_broadcast): Ditto.
3589 (__pthread_condattr_init): Ditto.
3590 (__pthread_condattr_destroy): Ditto.
3591 (__pthread_condattr_getpshared): Ditto.
3592 (__pthread_condattr_setpshared): Ditto.
3593 (__pthread_rwlock_destroy): Ditto.
3594 (__pthread_rwlock_rdlock): Ditto.
3595 (__pthread_rwlock_tryrdlock): Ditto.
3596 (__pthread_rwlock_wrlock): Ditto.
3597 (__pthread_rwlock_trywrlock): Ditto.
3598 (__pthread_rwlock_unlock): Ditto.
3599 (__pthread_rwlockattr_init): Ditto.
3600 (__pthread_rwlockattr_getpshared): Ditto.
3601 (__pthread_rwlockattr_setpshared): Ditto.
3602 (__pthread_rwlockattr_destroy): Ditto.
3603 (__pthread_getconcurrency): Ditto.
3604 (__pthread_setconcurrency): Ditto.
3605 (__pthread_getschedparam): Ditto.
3606 (__pthread_setschedparam): Ditto.
3608 * thread.cc: Rename __pthread_equal to pthread_equal throughout.
3609 Change pthread_self parameter appropriate.
3610 (__pthread_attr_init): Remove __ prefix. Change to extern "C".
3611 (__pthread_attr_destroy): Ditto.
3612 (__pthread_attr_setdetachstate): Ditto.
3613 (__pthread_attr_getdetachstate): Ditto.
3614 (__pthread_attr_setstacksize): Ditto.
3615 (__pthread_attr_getstacksize): Ditto.
3616 (__pthread_attr_setinheritsched): Ditto.
3617 (__pthread_attr_getinheritsched): Ditto.
3618 (__pthread_attr_setschedparam): Ditto.
3619 (__pthread_attr_getschedparam): Ditto.
3620 (__pthread_attr_setschedpolicy): Ditto.
3621 (__pthread_attr_getschedpolicy): Ditto.
3622 (__pthread_attr_setscope): Ditto.
3623 (__pthread_attr_getscope): Ditto.
3624 (__pthread_attr_setstackaddr): Ditto.
3625 (__pthread_attr_getstackaddr): Ditto.
3626 (__pthread_key_create): Ditto.
3627 (__pthread_key_delete): Ditto.
3628 (__pthread_setspecific): Ditto.
3629 (__pthread_getspecific): Ditto.
3630 (__pthread_kill): Ditto.
3631 (__pthread_sigmask): Ditto.
3632 (__pthread_equal): Ditto.
3633 (__pthread_mutex_lock): Ditto.
3634 (__pthread_mutex_trylock): Ditto.
3635 (__pthread_mutex_unlock): Ditto.
3636 (__pthread_mutex_destroy): Ditto.
3637 (__pthread_mutex_setprioceiling): Ditto.
3638 (__pthread_mutex_getprioceiling): Ditto.
3639 (__pthread_mutexattr_destroy): Ditto.
3640 (__pthread_mutexattr_getprioceiling): Ditto.
3641 (__pthread_mutexattr_getprotocol): Ditto.
3642 (__pthread_mutexattr_getpshared): Ditto.
3643 (__pthread_mutexattr_gettype): Ditto.
3644 (__pthread_mutexattr_init): Ditto.
3645 (__pthread_mutexattr_setprioceiling): Ditto.
3646 (__pthread_mutexattr_setprotocol): Ditto.
3647 (__pthread_mutexattr_setpshared): Ditto.
3648 (__pthread_mutexattr_settype): Ditto.
3649 (__pthread_cond_destroy): Ditto.
3650 (__pthread_cond_signal): Ditto.
3651 (__pthread_cond_broadcast): Ditto.
3652 (__pthread_condattr_init): Ditto.
3653 (__pthread_condattr_destroy): Ditto.
3654 (__pthread_condattr_getpshared): Ditto.
3655 (__pthread_condattr_setpshared): Ditto.
3656 (__pthread_rwlock_destroy): Ditto.
3657 (__pthread_rwlock_rdlock): Ditto.
3658 (__pthread_rwlock_tryrdlock): Ditto.
3659 (__pthread_rwlock_wrlock): Ditto.
3660 (__pthread_rwlock_trywrlock): Ditto.
3661 (__pthread_rwlock_unlock): Ditto.
3662 (__pthread_rwlockattr_init): Ditto.
3663 (__pthread_rwlockattr_getpshared): Ditto.
3664 (__pthread_rwlockattr_setpshared): Ditto.
3665 (__pthread_rwlockattr_destroy): Ditto.
3666 (__pthread_getconcurrency): Ditto.
3667 (__pthread_setconcurrency): Ditto.
3668 (__pthread_getschedparam): Ditto.
3669 (__pthread_setschedparam): Ditto.
3671 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
3673 * cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init,
3674 pthread_rwlock_rdlock, pthread_rwlock_tryrdlock,
3675 pthread_rwlock_wrlock, pthread_rwlock_trywrlock,
3676 pthread_rwlock_unlock, pthread_rwlockattr_init,
3677 pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared,
3678 and pthread_rwlockattr_destroy.
3679 * include/cygwin/version.h: Bump API minor number.
3680 * include/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Define a
3682 Add prototypes for pthread_rwlock_destroy, pthread_rwlock_init,
3683 pthread_rwlock_rdlock, pthread_rwlock_tryrdlock,
3684 pthread_rwlock_wrlock, pthread_rwlock_trywrlock,
3685 pthread_rwlock_unlock, pthread_rwlockattr_init,
3686 pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared,
3687 and pthread_rwlockattr_destroy.
3688 * thread.h (PTHREAD_ONCE_MAGIC): Remove superflous semicolon.
3689 (PTHREAD_RWLOCK_MAGIC): New define.
3690 (PTHREAD_RWLOCKATTR_MAGIC): Ditto.
3691 (pthread_rwlockattr): New class.
3692 (pthread_rwlock): Ditto.
3693 (MTinterface::rwlocks): New member.
3694 (MTinterface::MTinterface): Initialize rwlocks.
3695 Add prototypes for __pthread_rwlock_destroy,
3696 __pthread_rwlock_wrlock, __pthread_rwlock_trywrlock,
3697 __pthread_rwlock_unlock, __pthread_rwlockattr_init,
3698 __pthread_rwlockattr_getpshared, __pthread_rwlockattr_setpshared,
3699 and __pthread_rwlockattr_destroy.
3700 * thread.cc (MTinterface::Init): Initialize rwlock internal mutex.
3701 (MTinterface::fixup_after_fork): Fixup rwlocks after fork.
3702 (pthread_rwlockattr::isGoodObject): Implement.
3703 (pthread_rwlockattr::pthread_rwlockattr): Ditto.
3704 (pthread_rwlockattr::~pthread_rwlockattr): Ditto.
3705 (pthread_rwlock::initMutex): Ditto.
3706 (pthread_rwlock::pthread_rwlock): Ditto.
3707 (pthread_rwlock::~pthread_rwlock): Ditto.
3708 (pthread_rwlock::RdLock): Ditto.
3709 (pthread_rwlock::TryRdLock): Ditto.
3710 (pthread_rwlock::WrLock): Ditto.
3711 (pthread_rwlock::TryWrLock): Ditto.
3712 (pthread_rwlock::UnLock): Ditto.
3713 (pthread_rwlock::addReader): Ditto.
3714 (pthread_rwlock::removeReader): Ditto.
3715 (pthread_rwlock::lookupReader): Ditto.
3716 (pthread_rwlock::RdLockCleanup): Ditto.
3717 (pthread_rwlock::WrLockCleanup): Ditto.
3718 (pthread_rwlock::fixup_after_fork): Ditto.
3719 (pthread_rwlock::isGoodObject): Ditto.
3720 (pthread_rwlock::isGoodInitializer): Ditto.
3721 (pthread_rwlock::isGoodInitializerOrObject): Ditto.
3722 (pthread_rwlock::isGoodInitializerOrBadObject): Ditto.
3723 (__pthread_rwlock_destroy): Ditto.
3724 (pthread_rwlock::init): Ditto.
3725 (__pthread_rwlock_rdlock): Ditto.
3726 (__pthread_rwlock_tryrdlock): Ditto.
3727 (__pthread_rwlock_wrlock): Ditto.
3728 (__pthread_rwlock_trywrlock): Ditto.
3730 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
3732 * thread.h (pthread_cond::ExitingWait): Remove.
3733 (pthread_cond::mutex): Ditto.
3734 (pthread_cond::cond_access): Ditto.
3735 (pthread_cond::win32_obj_id): Ditto.
3736 (pthread_cond::TimedWait): Ditto.
3737 (pthread_cond::BroadCast): Ditto.
3738 (pthread_cond::Signal): Ditto.
3739 (pthread_cond::waiting): Change type to unsigned long.
3740 (pthread_cond::pending): New member.
3741 (pthread_cond::semWait): Ditto.
3742 (pthread_cond::mtxIn): Ditto.
3743 (pthread_cond::mtxOut): Ditto.
3744 (pthread_cond::mtxCond): Ditto.
3745 (pthread_cond::UnBlock): New method.
3746 (pthread_cond::Wait): Ditto.
3747 * thread.cc: Update list of cancellation points.
3748 (pthread_cond::pthread_cond): Rewrite.
3749 (pthread_cond::~pthread_cond): Ditto.
3750 (pthread_cond::TimedWait): Remove.
3751 (pthread_cond::BroadCast): Ditto.
3752 (pthread_cond::Signal): Ditto.
3753 (pthread_cond::UnBlock): Implement.
3754 (pthread_cond::Wait): Ditto.
3755 (pthread_cond::fixup_after_fork): Rewrite.
3756 (pthread_mutex::fixup_after_fork): Remove DETECT_BAD_APP
3758 (__pthread_cond_broadcast): Just return 0 if the condition is
3759 not initialized. Call pthread_cond::UnBlock to release blocked
3761 (__pthread_cond_signal): Ditto.
3762 (__pthread_cond__dowait): Rewrite.
3763 (pthread_cond_timedwait): Add pthread_testcancel call. Fix
3764 waitlength calculation.
3765 (pthread_cond_wait): Add pthread_testcancel call.
3767 2003-03-18 Thomas Pfaff <tpfaff@gmx.net>
3769 * include/pthread.h (PTHREAD_MUTEX_NORMAL): New define.
3770 * thread.cc: Remove errno.h include.
3771 (pthread::precreate): Change internal mutex type to normal.
3772 (pthread_mutex::canBeUnlocked): Implement.
3773 (pthread_mutex::pthread_mutex): Initialize lock_counter with 0.
3774 (pthread_mutex::Lock): Rename to _Lock. Add self parameter.
3775 Change lock_counter logic. Update SetOwner call.
3776 (pthread_mutex::TryLock): Rename to _TryLock. Add self parameter.
3777 Change lock_counter logic. Update SetOwner call.
3778 (pthread_mutex::UnLock): Rename to _UnLock. Add self parameter.
3779 Change lock_counter logic.
3780 (pthread_mutex::Destroy): Rename to _Destroy. Update TryLock call.
3781 (pthread_mutex::SetOwner): Move to thread.h as inline.
3782 (pthread_mutex::LockRecursive): Ditto.
3783 (pthread_mutex::fixup_after_fork): Change lock_counter logic.
3784 (__pthread_mutexattr_settype): Add PTHREAD_MUTEX_NORMAL to valid
3786 * thread.h: Include errno.h and limits.h.
3787 (MUTEX_LOCK_COUNTER_INITIAL): Remove.
3788 (MUTEX_OWNER_ANONYMOUS): New define.
3789 (pthread_mutex::canBeUnlocked): New static method.
3790 (pthread_mutex::lock_counter): Change type to unsigned long.
3791 (pthread_mutex::GetPthreadSelf): New method.
3792 (pthread_mutex::Lock): Call _Lock with pthread_self pointer.
3793 (pthread_mutex::TryLock): Call _TryLock with pthread_self pointer.
3794 (pthread_mutex::UnLock): Call _UnLock with pthread_self pointer.
3795 (pthread_mutex::Destroy): Call _Destroy with pthread_self pointer.
3796 (pthread_mutex::SetOwner): Moved from thread.cc as inline.
3797 (pthread_mutex::LockRecursive): Ditto.
3798 (pthread_mutex::_Lock): New method.
3799 (pthread_mutex::_TryLock): New method.
3800 (pthread_mutex::_UnLock): New method.
3801 (pthread_mutex::_Destroy): New method.
3803 2003-03-18 Christopher January <chris@atomice.net>
3805 * fhandler_proc.cc (format_proc_cpuinfo): Use IsProcessorFeaturePresent
3806 only on Windows NT. Read CPU Mhz value only on NT. Revert previous
3807 change so cpuid instruction is called even on non-NT systems.
3809 2003-03-17 Corinna Vinschen <corinna@vinschen.de>
3811 * glob.c (g_lstat): Change API minor test to match API minor number
3812 change in previous patch.
3815 2003-03-17 Christopher Faylor <cgf@redhat.com>
3817 * include/cygwin/version.h: Reorganize last two api versions so that
3818 btowc and trunc exports show up before previous bump since there has
3819 been no exported version of the DLL with the 64 bit changes yet but
3820 1.3.22 will have the btowc and trunc.
3822 2003-03-17 Christopher Faylor <cgf@redhat.com>
3824 * cygwin.din: Export btowc, trunc.
3825 * include/cygwin/version.h: Reflect new exports.
3826 * syscalls.cc (_stat): Rename to stat to avoid newlib wrapper.
3827 * syscalls.cc (_fstat): Ditto.
3829 2003-03-16 Christopher Faylor <cgf@redhat.com>
3831 * fhandler_console.cc (fhandler_console::close): Correct check for
3832 current tty. Add debugging output when console is freed.
3833 (set_console_state_for_spawn): Add debugging output.
3834 * fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console
3835 open flag when vforking.
3836 * sigproc.cc (sigproc_terminate): Fix debugging output.
3837 * spawn.cc (handle): Eliminate second argument.
3838 (spawn_guts): Reflect elimination of argument change to handle.
3839 * syscalls.cc (setsid): Add debugging output when console is freed.
3841 2003-03-14 Christopher Faylor <cgf@redhat.com>
3843 * syscalls.cc (rename): Revert assumption that DELETE_ON_CLOSE works on
3846 2003-03-13 Christopher Faylor <cgf@redhat.com>
3848 * include/cygwin/version.h: Bump DLL minor number to 23.
3850 2003-03-13 Corinna Vinschen <corinna@vinschen.de>
3852 * autoload.cc (IsProcessorFeaturePresent): Add.
3853 * fhandler_proc.cc (format_proc_cpuinfo): Add case for 9x systems.
3855 2003-03-13 Corinna Vinschen <corinna@vinschen.de>
3857 * fhandler_proc.cc (format_proc_cpuinfo): Fix vendor id in cpuid case.
3859 2003-03-13 Corinna Vinschen <corinna@vinschen.de>
3861 * net.cc (cygwin_rcmd): Use correct file descriptor in call to fdsock.
3862 (cygwin_rexec): Ditto.
3864 2003-03-13 Christopher Faylor <cgf@redhat.com>
3866 * fhandler_tty.cc (fhandler_tty_slave::close): Fix typo in debug
3869 * syscalls.cc (rename): Assume that DELETE_ON_CLOSE works on Win9x.
3871 2003-03-11 Corinna Vinschen <corinna@vinschen.de>
3873 * fhandler_socket.cc (fhandler_socket::dup): Don't call
3874 fhandler_base::dup() but call DuplicateHandle directly instead to have
3875 control over socket inheritence.
3877 2003-03-11 Corinna Vinschen <corinna@vinschen.de>
3879 * fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid
3880 using WinSock2 socket duplication methods. Add comment.
3882 2003-03-11 Pierre Humblet <pierre.humblet@ieee.org>
3884 * fhandler_socket.cc (fhandler_socket::fixup_after_fork):
3885 Set io_handle to INVALID_SOCKET in case of failure.
3886 (fhandler_socket::dup): Return 0 if the io_handle is valid.
3888 2003-03-10 Corinna Vinschen <corinna@vinschen.de>
3890 * sec_acl.cc (setacl): Don't handle DELETE flag specially.
3891 * security.cc (alloc_sd): Ditto.
3893 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
3895 * winver.rc: Change Copyright hint to include 2003.
3897 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
3899 Switch to 32/64 datatypes:
3900 * Makefile.in (OBSOLETE_FUNCTIONS): Add open acl aclcheck aclfrommode
3901 aclfrompbits aclfromtext aclsort acltomode acltopbits acltotext chown
3902 facl fchown fgetpos fopen freopen fseeko fsetpos fstat ftello
3903 ftruncate getegid geteuid getgid getgrent getgrgid getgrnam getgroups
3904 getpwuid getpwuid_r getuid initgroups lchown lseek lstat mknod mmap
3905 seekdir setegid seteuid setgid setgroups setregid setreuid setuid stat
3907 (NEW_FUNCTIONS): Add _open64 acl32 aclcheck32 aclfrommode32
3908 aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32
3909 acltotext32 chown32 facl32 fchown32 fgetpos64 fopen64 freopen64
3910 fseeko64 fsetpos64 fstat64 ftello64 ftruncate64 getegid32 geteuid32
3911 getgid32 getgrent32 getgrgid32 getgrnam32 getgroups32 getpwuid32
3912 getpwuid_r32 getuid32 initgroups32 lchown32 lseek64 lstat64 mknod32
3913 mmap64 seekdir64 setegid32 seteuid32 setgid32 setgroups32 setregid32
3914 setreuid32 setuid32 stat64 telldir64 truncate64 to substitute the
3916 * cygserver_shm.h (class client_request_shm): Change uid_t and gid_t
3917 members to __uid32_t and __gid32_t.
3918 * cygwin.din: Add symbols acl32 aclcheck32 aclfrommode32
3919 aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32
3920 acltotext32 facl32 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64
3921 _fstat64 ftello64 _lseek64 mknod32 _open64.
3922 * glob.c: Include perprocess.h.
3923 (globtilde): Call getpwuid32 and getuid32 instead of getpwuid and
3925 (g_lstat): Check for applications API version to call the appropriate
3926 typed gl_lstat function.
3927 (g_stat): Ditto for gl_stat.
3928 * shm.cc (client_request_shm::client_request_shm): Call geteuid32
3929 and getegid32 instead of geteuid and getegid throughout.
3930 * syscalls.cc (_open64): New alias for open.
3931 (_lseek64): New alias for lseek64.
3932 (_fstat64): New alias for fseek64.
3933 (mknod32): New function.
3934 (mknod): Calls mknod32 now.
3935 * winsup.h: Make function declarations for getuid32, geteuid32,
3936 and getpwuid32 accessible for plain C sources. Add declarations
3937 for getegid32 and getpwnam.
3938 * include/cygwin/version.h: Bum API minor number to 78.
3939 * include/sys/cygwin.h: Guard C++ specific members of struct
3940 per_process against inclusion in plain C sources.
3941 * include/sys/mman.h (mman): Add guard to avoid type clash when
3944 2003-03-09 Christopher Faylor <cgf@redhat.com>
3946 * include/cygwin/version.h: Bump DLL minor number to 22.
3948 2003-03-09 Christopher Faylor <cgf@redhat.com>
3950 Do some minor reformatting of 'extern "C"' use throughout.
3952 2003-03-06 Christopher January <chris@atomice.net>
3954 * autoload.cc (GetSystemTimes): Define new autoload function.
3955 * fhandler_proc.cc (proc_listing): Add cpuinfo and partitions entries.
3956 (fhandler_proc::fill_filebuf): Add PROC_CPUINFO and PROC_PARTITIONS
3958 (format_proc_uptime): Use GetSystemTimes if available.
3959 (read_value): New macro.
3961 (cpuid): New function.
3962 (can_set_flag): New function.
3963 (format_proc_cpuinfo): New function.
3964 (format_proc_partitions): New function.
3966 2003-03-09 Christopher Faylor <cgf@redhat.com>
3968 * syscalls.cc (unlink): Attempt to be more clever about setting
3969 attributes of file. Only open file in query mode to avoid having to
3970 mess with security stuff for reading.
3972 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
3974 * rmsym: Fix regular expression.
3976 2003-03-09 Christopher Faylor <cgf@redhat.com>
3978 * Makefile.in: Change from using new-* to cygwin0 for temporary
3981 2003-03-09 Corinna Vinschen <corinna@vinschen.de>
3983 * include/cygwin/socket.h: Set SOMAXCONN to Winsock2 value.
3985 2003-03-08 Christopher Faylor <cgf@redhat.com>
3987 * syscalls.cc (unlink): Always attempt to use FILE_FLAG_CLOSE_ON_DELETE
3988 to delete files since this allows us to preserve the protection of hard
3990 (link): Generate full path for potentially recalculated .lnk target.
3992 2003-03-08 Christopher Faylor <cgf@redhat.com>
3994 Revert below changes regarding _pinfo::cmdline.
3996 2003-03-08 Corinna Vinschen <corinna@vinschen.de>
3998 * external.cc (cygwin_internal): Change n to __off64_t to match change
4000 * fhandler.h (class fhandler_virtual): Change filesize member to
4002 * fhandler_proc.cc (format_proc_meminfo): Change to return __off64_t.
4003 (format_proc_stat): Ditto.
4004 (format_proc_uptime): Ditto.
4005 * fhandler_process.cc (format_process_stat): Ditto.
4006 (format_process_status): Ditto.
4007 (format_process_statm): Ditto.
4008 * pinfo.cc (_pinfo::cmdline): Expect __off64_t parameter.
4009 * pinfo.h (class _pinfo): Change declaration of cmdline accordingly.
4011 2003-03-07 Christopher Faylor <cgf@redhat.com>
4013 * path.h (PATH_LNK): New enum val.
4014 (path_conv::is_lnk_symlink): New function. True if path represents
4016 * path.cc (check_shortcut): Set PATH_LNK in pflags when appropriate.
4017 (symlink_info::check): Ditto. Remove PATH_LNK from pflags initially.
4018 * syscalls.cc (unlink): Always remove readonly attribute from a symlink
4020 (link): (from Corinna Vinschen) Allow links to symlinks. Reset
4021 attributes on a symlink after successful link creation.
4022 (chmod): Use is_lnk_symlink where appropriate.
4025 2003-03-07 Pierre Humblet <pierre.humblet@ieee.org>
4027 * tty.cc (create_tty_master): Call GetComputerName instead of
4028 cygwin_gethostname. Set ut_id.
4029 * syscalls.cc (login): Call endutent.
4030 (setutent): Do not seek after a fresh open.
4032 2003-03-07 Corinna Vinschen <corinna@vinschen.de>
4034 * syscalls.cc (seteuid32): Fix formatting.
4036 2003-03-04 Thomas Pfaff <tpfaff@gmx.net>
4038 * thread.cc (MTinterface::fixup_after_fork): Initialize mainthread
4039 prior to pthread objects.
4041 2003-03-04 Jason Tishler <jason@tishler.net>
4043 * fhandler_socket.cc (fhandler_socket::dup): Initialize type.
4045 2003-03-03 Christopher Faylor <cgf@redhat.com>
4047 * fhandler.h (fhandler_tty_slave::close): Declare new function.
4048 (fhandler_tty_slave::dup): Declare new function.
4049 (fhandler_tty_slave::fixup_after_function): Declare new function.
4050 * fhandler_tty.cc (fhandler_tty_slave_open): Only increment
4051 fhandler_console::open_fhs when associated with a pty.
4052 (fhandler_tty_slave::close): Define new function. Decrement
4053 fhandler_console::open_fhs when associated with a pty.
4054 (fhandler_tty_slave::dup): Define new function. Increment
4055 fhandler_console::open_fhs when associated with a pty.
4056 (fhandler_tty_slave::fixup_after_fork): Define new function. Increment
4057 fhandler_console::open_fhs when associated with a pty.
4059 2003-03-03 Christopher Faylor <cgf@redhat.com>
4061 * fhandler_tty.cc (fhandler_pty_slave::open): Grudgingly increment
4062 fhandler_console::open_fhs here.
4063 (fhandler_pty_slave::close): Ditto for close.
4065 2003-03-02 Christopher Faylor <cgf@redhat.com>
4067 * lib/getopt.c: Refresh from NetBSD sources.
4069 2003-03-02 Christopher Faylor <cgf@redhat.com>
4071 * fhandler_console.cc (fhandler_console::close): Don't decrement
4072 in use counter if in vfork fixup stage.
4074 2003-03-02 Christopher Faylor <cgf@redhat.com>
4076 * lib/getopt.c: Nuke use of unneeded BSDisms.
4078 2003-03-02 Christopher Faylor <cgf@redhat.com>
4080 * dll_init.cc (dll_list::load_after_fork): Don't revert to LoadLibrary
4081 if LoadLibraryEx fails.
4082 * dtable.cc (dtable::dec_console_fds): Eliminate.
4083 (dtable::release): Don't treat console specially.
4084 (dtable::build_fhandler): Ditto.
4085 * dtable.h (console_fds): Eliminate.
4086 (dtable::dec_console_fds): Eliminate.
4087 (dtable::inc_console_fds): Eliminate.
4088 * fhandler.h (fhandler_console::open_fhs): New static element.
4089 * fhandler_console.cc (fhandler_console::open): Increment open_fs.
4090 (fhandler_console::close): Call FreeConsole if no more open consoles
4091 and ctty is not associated with the console.
4092 * syscalls.cc (setsid): Simplify check for when to call FreeConsole.
4093 (check_pty_fds): Eliminate definition.
4094 * winsup.h (check_pty_fds): Eliminate declaration.
4096 2003-03-02 Christopher Faylor <cgf@redhat.com>
4098 * dll_init.cc (dll_list::load_after_fork): Fix typo where result of
4099 LoadLibrary was ignored.
4101 2003-03-01 Corinna Vinschen <corinna@vinschen.de>
4103 * fhandler_socket.cc (fhandler_socket::bind): Open and write socket
4104 file using Win32 calls.
4106 2003-03-01 Corinna Vinschen <corinna@vinschen.de>
4108 * fhandler_socket.cc (get_inet_addr): Open and read socket file using
4111 2003-02-28 Christopher Faylor <cgf@redhat.com>
4113 * cygwin.din: Wrap atexit and exit with cygwin, thread-safe functions.
4114 * dcrt0.cc (cygwin_atexit): New function.
4115 (cygwin_exit): Ditto.
4117 2003-02-28 Pierre Humblet <pierre.humblet@ieee.org>
4119 * syscalls.cc (fstat64): Pass get_name () to pc.
4120 (access): Pass fn to stat_worker.
4122 2003-03-27 Corinna Vinschen <corinna@vinschen.de>
4124 * fhandler_socket.cc (class sock_event): New class managing Winsock
4125 events for interruptible socket calls.
4126 (fhandler_socket::connect): Move support for interruptible call to
4127 class sock_event. Use class object instead.
4128 (fhandler_socket::accept): Ditto. Remove useless casts.
4130 2003-03-27 Thomas Pfaff <tpfaff@gmx.net>
4132 * fhandler_socket.cc (fhandler_socket::connect): Add support for
4133 an interruptable connect.
4135 2003-02-27 Pierre Humblet <pierre.humblet@ieee.org>
4137 * uinfo.cc (internal_getlogin): Only update user.groups.pgsid
4138 if the call to set the primary group succeeds.
4140 2003-02-27 Christopher Faylor <cgf@redhat.com>
4142 * cygthread::detach: Improve error message.
4144 2003-02-26 Pierre Humblet <pierre.humblet@ieee.org>
4146 * sec_helper.cc (get_sids_info): debug_print owner_sid and group_sid.
4148 2003-02-25 Corinna Vinschen <corinna@vinschen.de>
4150 * mmap.cc (mmap64): Fix returned address by taking the granularity
4153 2003-02-23 Pierre Humblet <pierre.humblet@ieee.org>
4155 * syslog.cc (syslog): Do not unlock the file before closing it
4156 and remove debug_printf about stream errors.
4158 2003-02-22 Christopher Faylor <cgf@redhat.com>
4160 * cygmalloc.h: Remove MORECORE_CANNOT_TRIM. It's not true.
4161 # cygwin.din: Export mallinfo.
4162 # malloc_wrapper.cc (mallinfo): New function.
4164 2003-02-22 Pierre Humblet <pierre.humblet@ieee.org>
4166 * syslog.cc (syslog): Do not print the Windows pid. Print the Cygwin
4167 pid as an unsigned decimal. On Win95 print a timestamp and attempt to
4168 lock the file up to four times in 3 ms.
4170 2003-02-21 Corinna Vinschen <corinna@vinschen.de>
4172 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Fix compiler
4174 (fhandler_socket::fstat): Simplify. Set st_uid/st_gid to effective
4175 uid/gid of current process in case of open sockets.
4177 2003-02-21 Corinna Vinschen <corinna@vinschen.de>
4179 * dtable.cc (dtable::build_fhandler_from_name): Set some fhandler
4180 data on sockets to evaluate AF_LOCAL sockets correctly.
4181 (dtable::build_fhandler): Set unit number on sockets.
4182 * fhandler.h (fhandler_socket): Add unit number.
4183 (fhandler_socket::get_unit): New method.
4184 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Set unit
4186 (fhandler_socket::fstat): Reorganize to return more Linux-like
4188 * net.cc: include ctype.h.
4189 (fdsock): Set unit number when building fhandler.
4190 * path.cc (path_conv::check): Set device type to FH_SOCKET if file
4191 is a AF_UNIX socket.
4192 (get_devn): Evaluate unit for virtual socket devices.
4193 (win32_device_name): Set windows path for sockets to unix_path with
4194 just backslashes to keep the different names.
4195 * syscalls.cc (fstat64): Don't override st_ino, st_dev and st_rdev
4197 (stat_worker): Ditto.
4199 2003-02-21 Pierre Humblet <pierre.humblet@ieee.org>
4201 * autoload.cc (AccessCheck): Add.
4202 (DuplicateToken): Add.
4203 * security.h (check_file_access): Declare.
4204 * syscalls.cc (access): Convert path to Windows, check existence
4205 and readonly attribute. Call check_file_access instead of acl_access.
4206 * security.cc (check_file_access): Create.
4207 * sec_acl (acl_access): Delete.
4209 2003-02-19 Christopher Faylor <cgf@redhat.com>
4211 * fhandler.cc (fhandler_base::open): Move some filesystem specific
4213 (fhandler_disk_file::open): Accept some filesystem specific stuff.
4214 * sigproc.cc (wait_for_sigthread): Become slightly more thread safe.
4215 (sig_send): Don't assume that signal thread is ready.
4217 2003-02-20 Corinna Vinschen <corinna@vinschen.de>
4219 * wincap.h (wincap): Remove unnecessary definition of
4220 supports_sparse_files.
4223 2003-02-20 Corinna Vinschen <corinna@vinschen.de>
4225 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check descriptor
4226 created by cygheap_fdnew constructor.
4227 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
4228 * fhandler_socket.cc (fhandler_socket::accept): Ditto and move
4229 creation of file descriptor behind blocking OS call.
4230 * net.cc (cygwin_socket): Ditto.
4231 (cygwin_rcmd): Ditto.
4232 (cygwin_rresvport): Ditto.
4233 (cygwin_rexec): Ditto.
4234 (socketpair): Ditto.
4236 2003-02-20 Corinna Vinschen <corinna@vinschen.de>
4238 * autoload.cc (GetCompressedFileSize): Add.
4239 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Compute
4240 st_blocks value from GetCompressedFileSize() if available.
4242 2003-02-18 Vaclav Haisman <V.Haisman@sh.cvut.cz>
4244 * wincap.h (wincaps::supports_sparse_files): New flag.
4245 (wincapc::supports_sparse_files): New method.
4246 * wincap.cc (wincap_unknown): Define value for the new flag.
4248 (wincap_95osr2): Ditto.
4250 (wincap_98se): Ditto.
4252 (wincap_nt3): Ditto.
4253 (wincap_nt4): Ditto.
4254 (wincap_nt4sp4): Ditto.
4255 (wincap_2000): Ditto.
4257 * path.h (path_conv::fs_flags): New method.
4258 * fhandler_disk_file.cc: Include winioctl.h for DeviceIoControl.
4259 (fhandler_disk_file::open): Set newly created and truncated files as
4260 sparse on platforms that support it.
4262 2003-02-17 Pierre Humblet <pierre.humblet@ieee.org>
4264 * grp.cc (internal_getgroups): Handle properly tokens with
4265 no groups. Fix bug introduced on 2003-02-04.
4267 2003-02-16 Christopher Faylor <cgf@redhat.com>
4269 * cygwin.din: Export all appropriate newlib libm functions. Sort.
4270 * include/cygwin/version.h: Bump API minor number.
4272 2003-02-15 Christopher Faylor <cgf@redhat.com>
4274 * cygwin.din: Export all appropriate newlib libc functions.
4275 * include/cygwin/version.h: Bump API minor number.
4277 2003-02-14 Jason Tishler <jason@tishler.net>
4279 * mmap.cc (mprotect): Add missing break.
4281 2003-02-13 Christopher Faylor <cgf@redhat.com>
4283 * exceptions.cc (try_to_debug): Don't reset priority when returning
4284 from non-waitloop call.
4286 2003-02-13 Vaclav Haisman <V.Haisman@sh.cvut.cz>
4287 Christopher Faylor <cgf@redhat.com>
4289 * fhandler_console.cc (fhandler_console::write_normal): Use MessageBeep
4291 * autoload.cc (MessageBeep): Add.
4293 2003-02-13 Christopher Faylor <cgf@redhat.com>
4295 * include/cygwin/types.h: Use correct ifdef guard for u_ definitions.
4297 2003-02-13 Christopher Faylor <cgf@redhat.com>
4299 * environ.cc (environ_init): Use strechr.
4301 2003-02-13 Christopher Faylor <cgf@redhat.com>
4303 * include/cygwin/in.h (sockaddr_in): Fix typo.
4305 2003-02-12 Christopher Faylor <cgf@redhat.com>
4307 * path.h (path_conv): Reorganize slightly.
4309 2003-02-12 Christopher Faylor <cgf@redhat.com>
4311 * fhandler_tty.cc (process_input): Add sanity check to ensure that
4312 console typeahead is cleared on signal.
4314 2003-02-12 Christopher Faylor <cgf@redhat.com>
4316 * spawn.cc (linebuf::~linebuf): Resurrect commented out (for
4319 2003-02-10 Ralf Habacker <ralf.habacker@freenet.de>
4321 * include/cygwin/in.h (in_attr_t): Define new type.
4322 * include/arpa/inet.h (inet_addr): Change return type to in_addr_t.
4323 (inet_lnaof): Ditto.
4324 (inet_netof): Ditto.
4325 (inet_network): Ditto.
4327 2003-02-10 Christopher Faylor <cgf@redhat.com>
4329 * include/cygwin/types.h: Move many *_t typedefs here. Protect them
4331 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Change ntsec_atts to mode_t.
4332 * security.cc (get_attribute_from_acl): Accept mode_t attribute.
4333 (get_nt_attribute): Ditto.
4334 (get_file_attribute): Ditto.
4335 (get_nt_object_attribute): Ditto.
4336 (get_object_attribute): Ditto.
4337 * security.h: Reflect above changes.
4338 * syscalls.cc (chown_worker): Change attrib to mode_t.
4340 2003-02-08 Christopher Faylor <cgf@redhat.com>
4342 * include/cygwin/version.h: Bump DLL minor number to 21.
4344 2003-02-07 Christopher Faylor <cgf@redhat.com>
4346 * malloc.cc (DEFAULT_MMAP_THRESHOLD): Bump down to 16MB thanks to below
4349 2003-02-07 Corinna Vinschen <corinna@vinschen.de>
4351 * mmap.cc (mmap_record::alloc_map): De-inline. Add offset and length
4352 parameter. Only protect pages actually unused currently. Do job
4353 of map_map() when initializing a map.
4354 (mmap_record::map_map): Reduce functionality for the reuse case
4355 of private anonymous mapping.
4356 (mmap_record::fixup_map): Format change.
4357 (list::add_record): Add offset and length parameter to call
4358 mmap_record::alloc_map() correctly.
4359 (mmap64): Rename `l' variable to `map_list'. Accommodate above changes.
4360 (munmap): Rename `l' variable to `map_list'.
4362 (fhandler_disk_file::mmap): Streamline code.
4364 (fixup_mmaps_after_fork): Rename `l' variable to `map_list'.
4366 2003-02-07 Vaclav Haisman <V.Haisman@sh.cvut.cz>
4367 Christopher Faylor <cgf@redhat.com>
4369 * exceptions.cc (try_to_debug): Set priority of current thread rather
4370 than the main thread. Make busy waiting loop less busy. Restore
4371 priority when function returns.
4373 2003-02-07 Christopher Faylor <cgf@redhat.com>
4375 * malloc.cc (DEFAULT_MMAP_THRESHOLD): Set high to avoid mmaps.
4377 2003-02-07 Christopher Faylor <cgf@redhat.com>
4379 * pipe.cc (fhandler_pipe::close): Avoid extraneous this->.
4381 2003-02-06 Christopher Faylor <cgf@redhat.com>
4383 * heap.cc (heap_init): Remove debugging code.
4385 2003-02-06 Pierre Humblet <pierre.humblet@ieee.org>
4387 * security.h: Introduce names UNKNOWN_UID and UNKNOWN_GID and delete
4388 declaration of is_grp_member.
4389 * uinfo.cc (internal_getlogin): Use UNKNOWN_GID.
4390 * passwd.cc (pwdgrp::read_passwd): Use UNKNOWN_UID.
4391 * grp.cc (pwdgrp::read_group): Change group name to provide better
4393 (getgrgid): Use gid16togid32.
4394 * sec_helper.cc (is_grp_member): Delete.
4396 2003-02-05 Christopher Faylor <cgf@redhat.com>
4398 * path.cc: Change 'to_posix_p' to 'to_posix' throughout.
4399 (conv_path_list_buf_size): Accommodate relative paths.
4401 2003-02-05 Christopher Faylor <cgf@redhat.com>
4403 * path.cc (etc::dir_changed): Fix debug printf.
4405 2003-02-05 Corinna Vinschen <corinna@vinschen.de>
4407 * sec_acl.cc (setacl): Move all permission settings to beginning of
4408 loop. Set default rights to same values as in alloc_sd(). Set DELETE
4409 for owner and default owner only if S_IWOTH is given.
4411 2003-02-05 Pierre Humblet <pierre.humblet@ieee.org>
4413 * sec_acl.cc: Change all __aclent16_t to __aclent32_t except in
4414 wrapper function definitions. Replace call to the aclXYZ functions by
4416 (searchace): Change type of third argument to __uid32_t and use
4417 ILLEGAL_UID instead of -1;
4418 (setacl): Remove some initializations. Only give STANDARD_RIGHTS_WRITE
4419 for S_IWOTH. Replace -1 by ILLEGAL_UID.
4420 (getacl): Change type of owner_sid, group_sid and ace_sid to cygpsid.
4421 In last else clause, suppress second call to ace_sid.get_id and use
4422 TRUE in first call. Replace EqualSid by ==.
4423 (acl_access): Call internal_getgroups in USER and GROUP cases.
4424 (acecmp: Define static.
4425 (acl32): Create from 16 bit type.
4428 (aclcheck32): Ditto.
4430 (acltomode32): Ditto.
4431 (aclfrommode32): Ditto.
4432 (acltopbits32): Ditto.
4433 (aclfrompbits32): Ditto.
4434 (acltotext32): Ditto.
4435 (aclfromtext32): Ditto, and use strechr.
4436 (acl16to32): Create.
4437 (acl): Make it a wrapper function.
4443 (aclfrommode): Ditto.
4444 (acltopbits): Ditto.
4445 (aclfrompbits): Ditto.
4447 (aclfromtext): Ditto.
4448 * security.cc (write_sd): Call set_process_privilege and check
4450 (alloc_sd): Remove call to set_process_privilege and the owner check.
4452 2003-02-05 Christopher Faylor <cgf@redhat.com>
4454 * include/sys/cygwin.h: Use C-style comments.
4456 2003-02-05 Pierre Humblet <pierre.humblet@ieee.org>
4458 * sec_helper.cc (get_sids_info): New function.
4459 * security.cc (extract_nt_dom_user): Simplify with strechr.
4460 (get_user_groups): Initialize glen to MAX_SID_LEN.
4461 (get_user_local_groups): Ditto.
4462 (get_attribute_from_acl): Define ace_sid as cygpsid.
4463 (get_nt_attribute): Define owner_sid and group_sid as cygpsid.
4464 Call get_sids_info instead of cygsid.get_{u,g}id and is_grp_member.
4465 (get_nt_object_attribute): Ditto.
4466 (alloc_sd): Define ace_sid as cygpsid.
4468 2003-02-04 Thomas Pfaff <tpfaff@gmx.net>
4470 * syscalls.cc (struct system_cleanup_args): New struct.
4471 (system_cleanup): New function.
4472 (system): Use pthread_cleanup_push and _pop to save and restore
4473 signal handlers and sigprocmask.
4475 2003-02-04 Corinna Vinschen <corinna@vinschen.de>
4477 * path.cc (symlink): Create security attributes so that only the
4478 user can modify the symlink.
4479 * security.cc (set_security_attribute): Remove symlink special
4482 2003-02-04 Pierre Humblet <pierre.humblet@ieee.org>
4484 * grp.cc (internal_getgroups): Do not return without closing
4487 2003-02-04 Pierre Humblet <pierre.humblet@ieee.org>
4489 * security.h (class cygpsid): New class.
4490 (class cygsid): Use cygpsid as base. Remove members psid, get_id,
4491 get_uid, get_gid, string, debug_printf and the == and != operators.
4492 (cygsidlist::clear_supp): Only do work if setgroups has been called.
4493 * sec_helper.cc: Define sid_auth NO_COPY.
4494 (cygpsid::operator==): New operator.
4495 (cygpsid::get_id): New function.
4496 (cygpsid::string): New function.
4497 (cygsid::string): Delete.
4498 (cygsid::get_id): Delete.
4499 * pwdgrp.h: Change arguments of internal_getpwsid,
4500 internal_getgrsid and internal_getgroups to cygpsid.
4501 * passwd.cc (internal_getpwsid): Change argument from cygsid to cygpsid.
4502 * grp.cc (internal_getgrsid): Ditto.
4503 (internal_getgroups): Ditto.
4505 2003-02-03 Christopher Faylor <cgf@redhat.com>
4507 Eliminate most unneeded this-> pointers throughout.
4509 2003-02-03 Pierre Humblet <pierre.humblet@ieee.org>
4511 * security.h: Add third argument to set_process_privilege.
4512 * autoload.cc: Add OpenThreadToken.
4513 * sec_helper.cc (set_process_privilege): Add and use use_thread
4515 * security.cc (alloc_sd): Modify call to set_process_privilege.
4516 Remember the result in each process. If failed and file owner is not
4519 2003-02-03 Corinna Vinschen <corinna@vinschen.de>
4521 * fhandler_socket.cc (fhandler_socket::recvfrom): Return buffer
4522 length and don't set errno in case of WSAEMSGSIZE error.
4523 (fhandler_socket::recvmsg): Ditto.
4525 2003-02-01 Christopher Faylor <cgf@redhat.com>
4527 * grp.cc (getgrent32): Only refresh group entries when at beginning.
4528 (internal_getgrsid): Only refresh if uninitialized.
4529 (internal_getgrent): Ditto.
4530 * passwd.cc (getpwent): Only refresh passwd entries when at beginning.
4531 (pwdgrp::read_passwd): linebuf *cannot* be NO_COPY.
4532 (internal_getpwsid): Only refresh if uninitialized.
4533 (getpass): No need to refresh passwd data here.
4534 * pwdgrp.h (refresh): Eliminate default.
4536 2003-01-31 Christopher Faylor <cgf@redhat.com>
4538 * dlfcn.cc (dlerror): Only report load errors once per error.
4540 2003-01-31 Christopher Faylor <cgf@redhat.com>
4542 * fhandler_serial.cc (fhandler_serial::open): Avoid extraneous setting
4545 * termios.cc (tcsetattr): Correctly record errno after tcsetattr call.
4547 2003-01-31 Troy Curtiss <troyc@usa.net>
4549 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add error-checking
4550 so that if any Win32 SetComm*() calls fail, errno gets set to EINVAL
4551 and tcsetattr() returns -1. Catch invalid bitrates, mostly. If baud
4552 rate setting is B0, just drop DTR and leave Win32 DCB bitrate as-is
4553 since 0 is not a valid Win32 setting.
4554 (fhandler_serial::tcgetattr): If DTR is low, populate the bitrate as
4555 B0, otherwise get it from the DCB.
4557 2003-01-31 Christopher Faylor <cgf@redhat.com>
4559 * passwd.cc (pwdgrp::read_passwd): linebuf *must* be static (from
4561 * pwdgrp.h (pwdgrp::refresh): Avoid calling read function if we already
4562 have lock since that means we are in the process of reading the file.
4564 2003-01-31 Jason Tishler <jason@tishler.net>
4566 * shared.cc (shared_info::heap_chunk_size): Use correct variable when
4569 2003-01-30 Christopher Faylor <cgf@redhat.com>
4571 * fhandler_registry.cc (fhandler_registry::exists): Fix off-by-one
4572 error when inspecting path.
4574 2003-01-29 Christopher Faylor <cgf@redhat.com>
4576 * lib/getopt.c: Allow environment variable control of POSIXLY_INCORRECT
4579 2003-01-28 Corinna Vinschen <corinna@vinschen.de>
4581 * fhandler_socket.cc (fhandler_socket::accept): On successful execution
4582 set connection state of returned socket to CONNECTED.
4584 2003-01-27 Christopher Faylor <cgf@redhat.com>
4586 * passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about
4589 2003-01-26 Christopher Faylor <cgf@redhat.com>
4591 * uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no
4592 longer a valid return from next_str.
4593 (pwdgrp::add_line): Duh. Revert to use strchr.
4595 2003-01-26 Christopher Faylor <cgf@redhat.com>
4597 * string.h (strechr): New function.
4598 * uinfo.cc (pwdgrp::next_str): Search only for input char in string.
4599 Return EOS on failure. Don't check for NULL since it shouldn't be
4601 (pwdgrp::add_line): Revert to replacing '\n' in input line with '\0'.
4602 (pwdgrp::next_num): Pass explicit separator character to next_str.
4603 * grp.cc (pwdgrp::parse_group): Ditto.
4604 * passwd.cc (pwdgrp::parse_passwd): Ditto. Revamp test for garbage
4606 * pwdgrp.h (pwdgrp::next_str): Don't use default parameter.
4608 2003-01-26 Christopher Faylor <cgf@redhat.com>
4610 * uinfo.cc (pwdgrp::load): Regularize strace output. Add warning for
4613 2003-01-26 Christopher Faylor <cgf@redhat.com>
4615 * passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The
4616 structure should always be completely filled out.
4617 * grp.cc (pwdgrp::parse_group): Ditto.
4619 2003-01-26 Christopher Faylor <cgf@redhat.com>
4621 * grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating
4624 2003-01-26 Christopher Faylor <cgf@redhat.com>
4626 * include/sys/strace.h (paranoid_printf): Define as not being part of
4629 2003-01-25 Christopher Faylor <cgf@redhat.com>
4631 * pwdgrp.h (pwdgrp::next_num): Rename from next_int. Returns
4632 true/false if parse operation succeeded.
4633 (pwdgrp::reparse): Remove.
4634 (pwdgrp::raw_ptr): New function. Returns pointer in line.
4635 (pwdgrp::next_num): New functions for parsing other than unsigned long.
4636 * grp.cc (pwdgrp::parse_group): Reinstate previous parsing behavior.
4637 Don't fill in fields with NULL and assign empty gr_mem to known pointer
4638 rather than doing a pointless calloc. Streamline gr_mem parsing.
4639 Don't increment curr_lines here.
4640 * passwd.cc (pwdgrp::parse_passwd): Use new behavior of next_num.
4641 Don't increment curr_lines here.
4642 * uinfo.cc (pwdgrp::next_str): Keep returning EOL if out of data.
4643 (pwdgrp::reparse): Remove.
4644 (pwdgrp::next_num): Rename from next_int. Return bool indicating
4645 success of parse, argument returns value parsed.
4646 (pwdgrp::add_line): Increment curr_lines here on successful parse.
4647 (pwdgrp::load): (from Pierre Humblet) Don't return status. Just report
4650 2003-01-25 Christopher Faylor <cgf@redhat.com>
4652 * pwdgrp.cc (pwdgrp::reparse): Declare.
4653 * uinfo.cc (pwdgrp::reparse): Define.
4654 * grp.cc (pwdgrp::parse_group): Use reparse.
4656 2003-01-25 Pierre Humblet <pierre.humblet@ieee.org>
4658 * syscalls.cc (seteuid32): On Win95 get the pw entry. If it exists
4659 update the euid and call cygheap->user.set_name. Remove special
4660 handling of ILLEGAL_UID.
4661 (setgid32): Add a debug_printf. On Win95, always set the egid.
4662 Remove special handling of ILLEGAL_GID. Do not compare gid and gr_gid.
4663 * child_info.h (class cygheap_exec_info): Remove uid.
4664 * spawn.cc (spawn_guts): Do not set ciresrv.moreinfo->uid.
4665 * dcrto.cc (dll_crt0_1): Always call uinfo_init.
4666 * uinfo.cc (uinfo_init): Reorganize and close handle if needed.
4667 (cygheap_user::ontherange): Do not call internal_getpwnam if pw is NULL.
4669 2003-01-24 Christopher Faylor <cgf@redhat.com>
4671 * fhandler_console.cc (fhandler_console::send_winch_maybe): Reset
4672 scroll region if size changes.
4674 2003-01-24 Pierre Humblet <pierre.humblet@ieee.org>
4675 Jason Tishler <jason@tishler.net>
4677 * cygwin.din: Export setreuid32, setreuid, setregid32, setregid.
4678 * syscalls.cc (setreuid32): New function.
4680 (setregid32): Ditto.
4682 * include/cygwin/version.h: Bump API minor number.
4684 2003-01-23 Christopher Faylor <cgf@redhat.com>
4686 * pwdrp.h (pwdgrp::refresh): Lock entire test prior to reading.
4688 2003-01-23 Christopher Faylor <cgf@redhat.com>
4690 * grp.cc (pwdgrp::parse_group): Eliminate arg and use class member
4691 instead. Use next_str and next_int to parse arguments.
4692 * passwd.cc (pwdgrp::parse_passwd): Ditto.
4693 (grab_string): Eliminate.
4695 * pwdgrp.h (pwdgrp::parse): Eliminate input arg.
4696 (pwdgrp::parse_passwd): Reflect above change.
4697 (pwdgrp::parse_group): Reflect above change.
4698 (pwdgrp::next_str): New function.
4699 (pwdgrp::next_int): Ditto.
4700 (pwdgrp::gets): Eliminate.
4701 * uinfo.cc (pwdgrp::next_str): New function.
4702 (pwdgrp::next_int): Ditto.
4703 (pwdgrp::add_line): Subsume gets.
4704 (pwdgrp::gets): Eliminate.
4705 (pwdgrp::load): Just call add_line to parse input buffer.
4707 2003-01-22 Thomas Pfaff <tpfaff@gmx.net>
4709 * include/pthread.h (PTHREAD_MUTEX_RECURSIVE): Revert changes from
4710 2003-01-09 mutex patch.
4711 (PTHREAD_MUTEX_ERRORCHECK): Ditto.
4713 2003-01-22 Corinna Vinschen <corinna@vinschen.de>
4715 * cygrun.c: Move from here to ../testsuite.
4716 * Makefile.in: Remove cygrun.exe dependencies.
4718 2003-01-21 Jason Tishler <jason@tishler.net>
4720 * cygwin.din: Export nanosleep().
4721 * signal.cc (nanosleep): New function.
4722 (sleep): Move old functionality to nanosleep(). Call nanosleep().
4723 (usleep): Remove old functionality. Call nanosleep().
4724 * include/cygwin/version.h: Bump API minor number.
4726 2003-01-21 Christopher Faylor <cgf@redhat.com>
4728 * grp.cc: Call gr.refresh() rather than doing isunitialized tests
4730 (gr): Use constructor (sigh).
4731 (pwdgrp::parse_group): Rename from parse_grp.
4732 (pwdgrp::read_group): Rename from read_etc_group. Just call gr.load
4733 with a single argument.
4734 * passwd.cc: Call pr.refresh() rather than doing isunitialized tests
4736 (pr): Use constructor (sigh).
4737 (pwdgrp::parse_passwd): Rename from "parse_pwd".
4738 (pwdgrp::read_passwd): Rename from read_etc_passwd. Just call pr.load
4739 with a single argument.
4740 * pwdgrp.h (pwdgrp_state): Eliminate.
4741 (pwdgrp): Reflect above renamings.
4742 (pwdgrp::etc_ix): Rename from pwd_ix.
4743 (pwdgrp::read): New element.
4744 (pwdgrp::lock): New element.
4745 (pwdgrp::refresh): New function.
4746 (pwdgrp::load): Eliminate variations which take buffer arguments.
4747 (pwdgrp::pwdgrp): New constructors. Initialize mutex here.
4748 * uinfo.cc (pwdgrp::load): Accommodate pwd_ix -> etc_ix renaming.
4749 (pwdgrp::load): Set initialized state to true rather than setting state
4752 2003-01-21 Christopher Faylor <cgf@redhat.com>
4754 * include/cygwin/version.h: Bump DLL minor number.
4756 2003-01-21 Pierre Humblet <pierre.humblet@ieee.org>
4758 * path.h (etc::change_possible): Revert the type to bool.
4759 (etc::set_last_modified): Remove obsolete function.
4760 * path.cc (etc::change_possible): Revert type to bool.
4761 (etc::test_file_change): Do not test for negative values of
4762 change_possible and do not set it to -res.
4763 (etc::dir_changed): When the handle is NULL, call memset instead of
4764 test_file_changed. When the handle is invalid, return true. Detect
4765 filename change in /etc.
4766 (etc::file_changed): Remove unneeded check for !fn[n].
4767 * uinfo.cc (pwdgrp::load): Eliminate spurious setting of fh to NULL.
4768 * pwdgrp.h (pwdgrp::operator =): Eliminate.
4770 2003-01-19 Christopher Faylor <cgf@redhat.com>
4772 * pwdgrp.h (etc): Move to path.h.
4773 (pwdgrp::max_lines): New field.
4774 (pwdgrp::curr_lines): New field.
4775 (pwdgrp::pwdgrp_buf): Ditto.
4776 (pwdgrp_buf_elem_size): Ditto.
4777 (pwdgrp_parse): Ditto.
4778 (pwdgrp::gets): Just declare here.
4779 (pwdgrp::load): Ditto. Just take one argument.
4780 (pwdgrp::load): Define overloaded function accepting passwd buf.
4781 (pwdgrp::load): Define overloaded function accepting group buf.
4782 * grp.cc: Use pwdgrp elements rather than standalone static variables
4784 (curr_lines): Eliminate.
4786 (add_grp_line): Ditto.
4787 (parse_grp): Define as returning boolean. Accept void * arg and line
4788 count. Coerce first argument into __group32 buf reference. Increment
4789 curr_line as appropriate.
4790 (read_etc_group): Pass pwdgrp buffer to gr.load.
4791 * passwd.cc: Use pwdgrp elements rather than standalone static variables
4793 (curr_lines): Eliminate.
4795 (add_grp_line): Ditto.
4796 (parse_passwd): Define as returning boolean. Accept void * arg and line
4797 count. Coerce first argument into passwd buf reference. Increment
4798 curr_line as appropriate.
4799 (read_etc_group): Pass pwdgrp buffer to pr.load.
4800 * path.cc (etc::fn): Extend buffer size to allow index by 1 rather than
4802 (etc::last_modified): Ditto.
4803 (etc::change_possible): Ditto. Renamed from sawchange. Change to
4804 signed char since elements are now tri-state.
4805 (etc::init): Assume "handle" is 1 based rather than 0.
4806 (etc::test_file_change): New function. Sets change_possible based on
4807 file date comparison.
4808 (etc::dir_changed): Check file states immediately after changed_h is
4809 initialized to avoid a race.
4810 (etc::file_changed): Use test_file_change to detect if file needs to be
4812 * path.h (etc): Move class here from pwdgrp.h.
4813 * uinfo.cc: Move etc:: functions to path.cc. Move pwdgrp functions
4815 (pwdgrp::gets): Eliminate buf checks. Just check eptr and set lptr.
4816 (pwdgrp::add_line): New function.
4817 (pwdgrp::load): Call generic add_line function which will call correct
4820 2003-01-17 Christopher Faylor <cgf@redhat.com>
4822 * cygheap.cc: Change most 'int's to 'unsigned's.
4823 (_cmalloc): Only check for size of malloced region when calculating
4824 bucket. Add overhead when performing the sbrk. Previous change broke
4827 2003-01-17 Christopher Faylor <cgf@redhat.com>
4829 * dcrt0.cc (initialize_env): Use colon for CYGWIN_DEBUG separator.
4830 * grp.cc: Change most statics to NO_COPY throughout.
4833 2003-01-17 Christopher Faylor <cgf@redhat.com>
4835 * pwdgrp.h: Change some BOOLs to bools.
4836 (pwdgrp::pwdgrp): Remove unneeded constructor.
4837 * passwd.cc: Change BOOL to bool throughout.
4839 2003-01-17 Corinna Vinschen <corinna@vinschen.de>
4841 * cygwin.din: Add strerror_r.
4842 * include/cygwin/version.h: Bump API minor number.
4844 2003-01-17 Christopher Faylor <cgf@redhat.com>
4846 * uinfo.cc (etc::dir_changed): Don't print a warning if can't open
4847 /etc, unless debugging.
4849 2003-01-17 Pierre Humblet <pierre.humblet@ieee.org>
4851 * grp.cc (read_etc_group): On NT, add a line for gid = -1. Change name
4852 "unknown" to "mkgroup".
4853 (internal_getgrgid): Do not return default in nontsec case.
4854 (internal_getgroups): Add argument srchsid and look for it in groups if
4856 * passwd.cc (read_etc_passwd): On NT, add a line for uid = -1. Use
4857 same default uid for Win95 and NT. Call cygheap_user::ontherange to
4860 2003-01-16 Christopher Faylor <cgf@redhat.com>
4862 * cygheap.cc (init_cygheap::etc_changed): Move to uinfo.cc.
4863 * cygheap.h (init_cygheap::etc_changed_h): Remove.
4864 (init_cygheap::etc_changed): Ditto.
4865 * grp.cc (group_state): Remove. Use gr instead throughout.
4866 (gr): Define as class pwdgrp.
4867 (read_etc_group): Remove gr definition. Remove calls to
4868 set_last_modified and close. Pass add_grp to gr.load to load file.
4869 * passwd.cc (passwd_state): Remove. Use pr instead, throughout.
4870 (pr): Define as class pwdgrp.
4871 (read_etc_passwd): Remove pr definition. Remove calls to
4872 set_last_modified and close. Pass add_pwd_line to pr.load to load
4874 * pwdgrp.h (etc): New helper class for pwdgrp.
4875 (pwdgrp): Combine pwdgrp_check and pwdgrp_read into one class. Remove
4876 file_w32 and last_modified fields.
4877 (pwdgrp::set_last_modified): Remove.
4878 (pwdgrp::isinitializing): Remove FindFirstFile stuff. Move to
4880 (pwdgrp::load): Rename from 'open'. Call etc::init to initialize etc
4881 scanning. Close file handle after reading buffer into memory. Parse
4882 buffer by calling second argument.
4883 (pwdgrp::gets): Reorganize slightly to rely on eptr starting at
4884 beginning of buffer.
4885 (pwdgrp::close): Remove.
4886 * uinfo.cc (etc::dir_changed): New function.
4888 (etc::file_changed): Ditto.
4889 (etc::set_last_modified): Ditto.
4891 2003-01-16 Jason Tishler <jason@tishler.net>
4893 * mmap.cc (fixup_mmaps_after_fork): Add ERROR_NOACCESS to the list of
4894 ReadProcessMemory() error codes that trigger a retry with temporary
4895 PAGE_READONLY access. Note that this can occur on NT 4.0.
4897 2003-01-15 Christopher Faylor <cgf@redhat.com>
4899 * path.cc (normalize_posix_path): Convert win32 path separators to
4900 slashes when full path is specified.
4902 2003-01-15 Pierre Humblet <pierre.humblet@ieee.org>
4904 * cmalloc.cc (_cmalloc): Fix memory leak.
4906 2003-01-15 Corinna Vinschen <corinna@vinschen.de>
4908 * autoload.cc: Fix copyright date.
4909 * fhandler_dsp.cc: Ditto.
4914 * syscalls.cc: Ditto.
4918 2003-01-14 Corinna Vinschen <corinna@vinschen.de>
4920 * mmap.cc (fixup_mmaps_after_fork): Copy protection to child process.
4921 Change ambiguous debug output.
4923 2003-01-14 Corinna Vinschen <corinna@vinschen.de>
4925 * mmap.cc (mmap_record::access): Change argument type to caddr_t
4927 (mprotect): Protect against calling VirtualProtect() for shared
4929 (fixup_mmaps_after_fork): If ReadProcessMemory() fails, try to
4930 change protection of parent page to PAGE_READONLY, then try again.
4931 Revert protection afterwards.
4933 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
4935 * syscalls.cc (system): Add pthread_testcancel call.
4936 * thread.cc: Update list of cancellation points.
4938 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
4940 * wait.cc: Include thread.h
4941 (wait4): Add pthread_testcancel call.
4942 Wait for child process and cancellation event.
4943 * thread.cc: Update list of cancellation points.
4945 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
4947 * signal.cc (sleep): Add pthread_testcancel call.
4948 Wait for signal and cancellation event.
4951 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
4953 * exceptions.cc (handle_sigsuspend): Add pthread_testcancel call.
4954 Wait for signal and cancellation event.
4955 * thread.cc: Update list of cancellation points.
4957 2003-01-14 David Huang <davehzhr@hotmail.com>
4959 * fhandler_dsp.cc (fhandler_dsp::ioctl): Add limited support for
4962 2003-01-12 Christopher Faylor <cgf@redhat.com>
4964 * ntdll.h: Fix typo.
4966 2003-01-12 Corinna Vinschen <corinna@vinschen.de>
4968 * uname.cc (uname): Use cygwin_gethostname() to retrieve hostname.
4970 2003-01-12 Pierre Humblet <pierre.humblet@ieee.org>
4972 * sec_acl.cc (search_ace): Use id == -1, instead of < 0, as wildcard.
4973 (setacl): Start the search for a matching default at the next entry.
4974 Invalidate the type of merged entries instead of clearing it.
4975 Use well_known_creator for default owner and owning group and do
4976 not try to merge non-default and default entries in these cases.
4977 (getacl): Recognize well_known_creator for default owner and group.
4978 (acl_worker): Improve errno settings and streamline the nontsec case.
4979 * security.cc (write_sd): Remove the call to set_process_privilege.
4980 (alloc_sd): If the owner changes, call set_process_privilege and return
4981 immediately on failure. Change inheritance rules: on new directories add
4982 inherit only allow ACEs for creator_owner, creator_group and everyone.
4983 Preserve all inheritances through chmod and chown calls. Introduce
4984 isownergroup to implement the uid == gid case, to keep the inheritance
4985 code simple. Do not initialize owner_sid and group_sid and stop using
4988 2003-01-10 Christopher Faylor <cgf@redhat.com>
4990 * net.cc: Use gethostname define from winsock2.h.
4992 2003-01-10 Christopher Faylor <cgf@redhat.com>
4994 * path.cc: Unrevert below reversion except for
4995 mount_info::conv_to_posix_path part.
4997 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
4999 * path.cc: Revert patch from 2003-01-09 to normalize a windows path
5000 rather than converting to posix.
5002 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
5004 * autoload.cc (gethostname): Make call optional, return 1 if function
5006 * net.cc (cygwin_gethostname): Call GetComputerName if return value
5007 of gethostname is non-zero.
5009 2003-01-10 Charles Wilson <cwilson@ece.gatech.edu>
5011 * cygwin.din: Add asprintf and vasprintf, as well as the reentrant
5012 versions and underscore variants.
5013 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR.
5015 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
5017 * net.cc (cygwin_gethostname): Fix call to wsock function gethostname.
5019 2003-01-09 Christopher Faylor <cgf@redhat.com>
5021 * cygthread.cc (cygthread::cygthread): Be more noisy about odd
5023 * miscfuncs.cc (low_priority_sleep): Sleep in regular priority if
5024 that's what we're currently running at.
5026 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
5028 * include/semaphore.h: Modify typedef for sem_t.
5029 * include/cygwin/types.h: Modify typedefs for pthread_t,
5030 pthread_mutex_t, pthread_key_t, pthread_attr_t,
5031 pthread_mutexattr_t, pthread_condattr_t, pthread_cond_t,
5032 pthread_rwlock_t and pthread_rwlockattr_t.
5034 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
5036 * thread.h (WAIT_CANCELED): New define.
5037 (pthread::cancelable_wait): New static method.
5038 * thread.cc (pthread::cancelable_wait): Implement.
5039 (semaphore::Wait): Wait on semaphore and thread cancellation.
5040 (pthread::join): Wait on joined thread and thread cancellation.
5041 (semaphore::wait): Add testcancel to check for thread
5042 cancellation even if the semaphore is available.
5044 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
5046 * include/pthread.h: Add define for errorchecking mutexes.
5047 Change default mutex type.
5048 * thread.cc (pthread_cond::TimedWait): Update mutex unlock
5050 (pthread_mutex::pthread_mutex): New implement.
5051 (pthread_mutex::~pthread_mutex): Ditto.
5052 (pthread_mutex::Lock): Ditto.
5053 (pthread_mutex::TryLock): Ditto.
5054 (pthread_mutex::UnLock): Ditto.
5055 (pthread_mutex::Destroy): Implement new method.
5056 (pthread_mutex::SetOwner): Ditto.
5057 (pthread_mutex::LockRecursive): Ditto.
5058 (pthread_mutex::fixup_after_fork): Restore locking state after
5060 (__pthread_mutex_lock): Return pthread_mutex::Lock errorcode.
5061 (__pthread_mutex_trylock): Return pthread_mutex::TryLock
5063 (__pthread_mutex_unlock): Return pthread_mutex::UnLock
5065 (__pthread_mutex_destroy): Call pthread_mutex::Destroy to
5067 (__pthread_mutexattr_settype): Allow errorchecking and recursive
5069 * thread.h (MUTEX_LOCK_COUNTER_INITIAL): New define.
5070 (pthread_mutex::criticalsection): Remove.
5071 (pthread_mutex::lock_counter): New member.
5072 (pthread_mutex::recursion_counter): Ditto.
5073 (pthread_mutex::owner): Ditto.
5074 (pthread_mutex::type): Ditto.
5075 (pthread_mutex::Destroy): New method.
5076 (pthread_mutex::SetOwner): Ditto.
5077 (pthread_mutex::LockRecursive): Ditto.
5079 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
5081 * pthread.cc (pthread_cond_init): Use new pthread_cond::init.
5082 * thread.cc: Some white spaces cleanups.
5083 Change __pthread_cond_init to pthread_cond::init throughout.
5084 (nativeMutex): Move class methods outside pthread_mutex.
5085 (MTinterface::Init): Initialize pthread_cond init lock.
5086 (pthread_cond::condInitializationLock): Instantiate.
5087 (pthread_cond::initMutex): New Method.
5088 (pthread_cond::isGoodInitializerOrBadObject): Ditto.
5089 * thread.h: Some white spaces cleanups.
5090 (nativeMutex): Move class declaration outside pthread_mutex.
5091 (pthread_cond::condInitializationLock): New static member.
5092 (pthread_cond::initMutex): New Method.
5093 (pthread_cond::isGoodInitializerOrBadObject): Ditto.
5094 (__pthread_cond_init): Remove prototype.
5096 2003-01-09 Corinna Vinschen <corinna@vinschen.de>
5098 * fhandler_disk_file.cc (num_entries): Return 2 as link count if
5099 directory unreadable.
5101 2003-01-09 Corinna Vinschen <corinna@vinschen.de>
5103 * security.cc (get_nt_attribute): Always return -1 when read_sd()
5105 (get_file_attribute): Set permissions to 0 and owner/group to -1
5106 if security descriptor is unreadable.
5108 2003-01-09 Christopher Faylor <cgf@redhat.com>
5110 Use isdirsep rather than SLASH_P throughout.
5111 * path.cc (iscygdrive): Disallow /cygdrive\x.
5112 (normalize_posix_path): "Normalize" a windows path, if detected, rather
5113 than converting to posix.
5115 2003-01-06 Troy Curtiss <troyc@usa.net>
5117 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support and
5118 capability checking for B230400 bitrate.
5119 (fhandler_serial::tcgetattr): Add support for B230400 bitrate.
5120 * include/sys/termios.h: Add B230400 definition for Posix support of
5123 2003-01-05 Christopher Faylor <cgf@redhat.com>
5125 * pinfo.cc (_pinfo::commune_send): Use myself->lock rather than just
5128 2003-01-03 Christopher Faylor <cgf@redhat.com>
5130 * dtable.h (dtable::in_vfork_cleanup): New function. True if vfork
5132 * dtable.cc (dtable::vfork_parent_restore): Remove assertion.
5133 * pipe.cc (fhandler_pipe::close): Don't close read_state during
5134 fork_fixup since it wasn't inherited.
5136 2003-01-01 Christopher Faylor <cgf@redhat.com>
5138 * passwd.cc (getpwuid_r32): Revert previous change.
5140 2003-01-01 Christopher Faylor <cgf@redhat.com>
5142 * sysconf.cc (sysconf): Return arbitrary values for
5143 _SC_GETGR_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_GETPW_R_SIZE_MAX.
5145 * passwd.cc (getpwuid_r32): Add uid/gid fields to size check