OSDN Git Service

* select.cc (select_stuff::wait): Temporarily disallow APCS.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / ChangeLog-2001
1 2001-12-31  Christopher Faylor  <cgf@redhat.com>
2
3         * Makefile.in: Strip path when installing library.
4
5 2001-12-30  Christopher Faylor  <cgf@redhat.com>
6
7         * include/getopt.h: Fix define.
8
9 2001-12-30  Christopher Faylor  <cgf@redhat.com>
10             Ralf Habacker  <Ralf.Habacker@freenet.de>
11
12         * speclib: New file.
13         * Makefile.in: Create library versions of automode.o, textmode.o, and
14         binmode.o for easier use on command line.  Create libpthread.a, libm.a,
15         and libc.a with subsets of exports found in libcygwin.a.
16
17 2001-12-30  Ralf Habacker  <Ralf.Habacker@freenet.de>
18
19         * cygmagic: Eliminate unneeded use of 'tr' and 'bc'.
20
21 2001-12-30  Corinna Vinschen  <corinna@vinschen.de>
22
23         * security.cc (open_local_policy): Use POLICY_EXECUTE instead of
24         enumerating user rights.
25
26 2001-12-29  Corinna Vinschen  <corinna@vinschen.de>
27
28         * security.cc (open_local_policy): Initialize lsa handle to NULL.
29         Request only needed access rights in call to LsaOpenPolicy().
30         (create_token): Check for NULL lsa pointer.
31
32 2001-12-28  Corinna Vinschen  <corinna@vinschen.de>
33
34         * cygwin.din: Add symbols for endutent(), getutent(), getutid(),
35         getutline(), setutent() and utmpname().
36         * syscalls.cc (setutent): New function.
37         (endutent): Ditto.
38         (utmpname): Ditto.
39         (getutent): Ditto.
40         (getutid): Ditto.
41         (getutline): Ditto.
42         * include/cygwin/version.h: Bump API minor version.
43
44 2001-12-26  Christopher Faylor  <cgf@redhat.com>
45
46         * cygmagic: Add define name to warning.
47         * dcrt0.cc (_dll_crt0): Check for changes in child_info size.
48         (multiple_cygwin_problem): Avoid "proc" errors when testing.  Just
49         assume new cygwin proc.
50         * shared_info.h (mount_info): Add 'cb' element for sanity checks.
51         (shared_info): Ditto.
52         * child_info.h (child_info): Add fhandler_union_size element for sanity
53         checking.
54         * shared.cc (open_shared): Detect shared region size mismatch between
55         parent and child.
56         (shared_info::initialize): Detect shared region size mismatch with
57         expectation.
58         (memory_Init): Ditto.
59         * sigproc.cc (init_child_info): Correctly set cb in passed structure.
60         * shared.cc (open_shared):
61
62 2001-12-26  Christopher Faylor  <cgf@redhat.com>
63
64         * include/getopt.h: Protect a declaratin.
65
66 2001-12-26  Robert Collins  <rbtcollins@hotmail.com>
67
68         * thread.cc (pthread_cond::Signal): Use a separate flag for signal
69         detection and broadcast semantics.
70         (__pthread_cond_dowait): Ditto.
71         * thread.h (pthread_cond): New flag for testing when a waiter has
72         woken.
73
74 2001-12-26  Christopher Faylor  <cgf@redhat.com>
75
76         * Makefile.in: Quote arguments to shell scripts.
77         (clean): Remove new *_magic.h autogenerated files.
78
79 2001-12-25  Christopher Faylor  <cgf@redhat.com>
80
81         * Makefile.in: Autogenerate some header files which provide magic
82         numbers.  Force dependencies for files which depend on autogenerated
83         headers to ensure that they are always built.
84         * child_info.h (child_info): Add new fields to accommodate new magic
85         number header stuff.
86         * dcrt0.cc: Rely on "child_info_magic.h" to ensure that correct
87         child_info magic numbers are used.
88         (dll_crt0_1): Temporarily remove _cygwin_testing_magic test.
89         (_dll_crt0): Do more testing on magic numbers from fork_info structure.
90         Call "multiple_cygwin_problem" where appropriate.
91         (multiple_cygwin_problem): Rename from multiple_cygwin_die.  Issue a
92         warning or die, as appropriate based on cygwin version/magic number
93         mismatch.
94         * pinfo.cc (pinfo::exit): Don't attempt to dereference `this' if it
95         doesn't exist.  This can happen when a fatal error occurs early in
96         process initialization.
97         * shared.cc: Rely on "shared_info_magic.h" to accommodate that new
98         magic number header stuff.
99         (shared_info::initialize): Use new magic number stuff, for shared
100         region.
101         (memory_init): Ditto, for mount table.
102         * shared_info.h: Accomodate new magic number stuff for shared region
103         and mount table.
104         * sigproc.cc: Rely on "child_info_magic.h" to accommodate new magic
105         number header stuff.
106         (init_child_info): Initialize new fields in child_info) to accomodate
107         magic numbers.
108         * winsup.h: Rename multiple_cygwin_die to multiple_cygwin_problem.
109         * include/cygwin/version.h: Define macros for manipulating version
110         magic.
111         * cygmagic: New shell script for generating magic numbers.
112
113 2001-12-20  Christopher Faylor  <cgf@redhat.com>
114
115         * include/cygwin/version.h: Bump API minor version for below changes.
116
117 2001-12-19  Christopher Faylor  <cgf@redhat.com>
118
119         * Makefile.in (VPATH): Add regex directory.
120         (NM): new variable.
121         (OBSOLETE_FUNCTIONS): Ditto.
122         (NEW_FUNCTIONS): Ditto.
123         (install-headers): Install regex.h.
124         (install-man): New target.
125         (install): Use new target.
126         (DLL_OFILES): Add v8_reg* stuff.
127         (new-cygwin1.dll): Eliminate stamp-cygwin-lib creation.
128         (libcygwin.a): Remove obsolete functions from import lib.  Add new functions.
129         * configure.in: Detect 'nm' tool.
130         * configure: Regenerate.
131         * cygwin.din: Export posix_reg* functions.  Eliminate export of v8 reg* functions.
132         This is now handled in object files themselves.
133         * regex/*: New files.
134         * regexp/v8_*.c: New files, renamed from non v8_ equivalents.
135
136 2001-12-17  Corinna Vinschen  <corinna@vinschen.de>
137
138         * include/getopt.h: Don't define getopt_long() and friends when
139         included through unistd.h.
140
141 2001-12-17  Christopher Faylor  <cgf@redhat.com>
142
143         * dtable.cc (dtable::init_std_file_from_handle): Avoid initializing
144         using an invalid handle.
145
146 2001-12-16  David Billinghurst <David.Billinghurst@riotinto.com>
147
148         * include/limits.h: Define LLONG_MIN, LLONG_MAX, ULLONG_MAX.
149
150 2001-12-11  Christopher Faylor  <cgf@redhat.com>
151
152         * include/getopt.h: Add HAVE_DECL_GETOPT to save pain elsewhere.
153
154 2001-12-10  Christopher Faylor  <cgf@redhat.com>
155
156         * fhandler.h (fhandler_serial::ev): New class member.
157         * fhandler_serial.cc (fhandler_serial::raw_read): Use class member for
158         event status.
159         * select.cc (peek_serial): Ditto.
160
161 2001-12-07  Christopher Faylor  <cgf@redhat.com>
162
163         * path.cc (path_conv::check): Use full path name for determining
164         attributes when /cygdrive/x/foo.
165
166 2001-12-06  Christopher Faylor  <cgf@redhat.com>
167
168         * path.cc (path_conv::check): Reset FH_CYGDRIVE if iterating through
169         path.
170
171 2001-12-06  Christopher Faylor  <cgf@redhat.com>
172
173         * path.cc (path_conv::check): Don't complain if /dev/x/foo when x
174         doesn't exist.
175         (mount_info::conv_to_win32_path): Keep translating when a /cygdrive is
176         found.  Don't attempt to translate to a device name when devn ==
177         FH_CYGDRIVE.
178         (cygwin_conv_to_win32_path): Set buffer to empty on error.
179         (cygwin_conv_to_full_win32_path): Ditto.
180
181         * window.cc: Include unistd.h to verify definitions.
182
183 2001-12-05  Christopher Faylor  <cgf@redhat.com>
184
185         * dir.cc (opendir): Detect error return from build_fhandler_from_name.
186
187 2001-12-04  David Rothenberger  <daveroth@acm.org>
188
189         * net.cc (cygwin_getsockopt): Dereference optlen pointer when passing
190         to __check_null_invalid_struct_errno.
191
192 2001-12-03  Christopher Faylor  <cgf@redhat.com>
193
194         * net.cc (cygwin_getsockopt): Allow NULL optval.
195         (cygwin_setsockopt): Ditto.
196         (cygwin_recvfrom): Allow NULL from.
197
198         * path.cc (mount_info::read_cygdrive_info_from_registry): Don't write
199         cygdrive to registry if it doesn't exist.
200
201 2001-12-03  Christopher Faylor  <cgf@redhat.com>
202
203         * path.cc (mount_info::conv_to_win32_path): Avoid returning error if
204         cygdrive == '/'.
205         (mount_info::cygdrive_win32_path): Return 0 if invalid cygdrive path.
206
207 2001-11-30  Christopher Faylor  <cgf@redhat.com>
208
209         * debug.cc (makethread): Eliminate unneeded function call.
210         * miscfuncs.cc (tls_ix): Predefine.
211         * perthread.h (set_reent): Eliminate.
212         (get_reent): Ditto.
213         * winbase.h (my_tlsalloc): Use global stack base pointer.  Set newly
214         allocated location to NULL.
215         (my_tlssetvalue): Use global stack base pointer.
216         (my_tlsgetvalue): Ditto.
217
218 2001-11-27  Christopher Faylor  <cgf@redhat.com>
219
220         * winsup.h: Reorganize to avoid use of experimental stuff.
221         * shortcut.cc: Move winsup.h first in include order.
222
223 2001-11-27  Christopher Faylor  <cgf@redhat.com>
224
225         * cygwin.din (ualarm): New export.
226         * dcrt0.cc (_dll_crt0): Add experimental tls storage declaration.
227         (dll_crt0): Ditto.
228         * debug.cc (thread_stub): Ditto.
229         * thread.cc: Minor cleanup.
230         (__pthread_create): Add experimental tls storage declaration.
231         * miscfuncs.cc: Define tls index.
232         * winsup.h: Declare experimental tls storage.
233
234         * window.cc (alarm): Use old timer return from setitimer.
235         (ualarm): New function.  From Alexandr V. Shutko.
236
237 2001-11-26  Christopher Faylor  <cgf@redhat.com>
238
239         * Makefile.in (libcygwin.a): Use ar commands to build libcygwin.a since
240         adding an archive doesn't work the way we want it to.
241
242 2001-11-24  Christopher Faylor  <cgf@redhat.com>
243
244         * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Avoid reporting
245         inaccessible drives.
246
247 2001-11-24  Corinna Vinschen  <corinna@vinschen.de>
248
249         * net.cc (cygwin_hstrerror): Allow s == NULL.
250         (cygwin_rcmd): Add parameter checking.
251         (cygwin_rexec): Ditto.
252
253 2001-11-24  Corinna Vinschen  <corinna@vinschen.de>
254
255         * net.cc (cygwin_inet_ntoa): Add parameter checking.
256         (cygwin_inet_network): Return INADDR_NONE instead of 0 in case of
257         EFAULT.
258         (cygwin_hstrerror): Add parameter checking.
259         (cygwin_rresvport): Ditto.
260         (socketpair): Ditto.
261         * winsup.h (check_null_str): Add extern declaration.
262
263 2001-11-24  Christopher Faylor  <cgf@redhat.com>
264
265         * path.cc (path_conv::check): Tighten FH_CYGDRIVE check to avoid
266         matching trailing component, like other devices.
267
268 2001-11-24  Christopher Faylor  <cgf@redhat.com>
269
270         * autoload.cc (IsDebuggerPresent): Make conditional load since it is
271         not available everywhere.
272
273         * path.cc (mount_info::conv_to_win32_path): Only consider /cygdrive to
274         be FH_CYGDRIVE, not /cygdrive/x.
275
276 2001-11-24  Christopher Faylor  <cgf@redhat.com>
277
278         * net.cc (inet_makeaddr): Revert previous change.
279
280 2001-11-23  Christopher Faylor  <cgf@redhat.com>
281
282         * path.cc (chdir): Allow 'cd /cygdrive'.
283
284 2001-11-23  Christopher Faylor  <cgf@redhat.com>
285
286         * dtable.cc (dtable::vfork_parent_restore): Add debugging statement.
287
288         * exceptions.cc (try_to_debug): Spin only as long as we don't have a
289         debugger attached.
290
291         * fhandler.h (fhandler_base::set_nohandle): New method.
292         (fhandler_base::get_nohandle): New method.
293         * fhandler.cc (fhandler_base::dup): Avoid duplicating handle if there
294         is no handle.
295         * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set nohandle
296         flag on dummy fd.
297
298 2001-11-23  Christopher Faylor  <cgf@redhat.com>
299
300         * Makefile.in: Make intermediate library for eventual inclusion in
301         libcygwin.a
302
303         * fhandler.h (fhandler_pipe::fhandler_pipe): Remove default argument
304         setting since it is no longer used.
305
306         * miscfuncs.cc (check_null_str): New function.
307         (check_null_str_errno): Ditto.
308         * net.cc: Add defensive buffer checking throughout.
309         (cygwin_sendto): Protect against invalid fd.
310         (cygwin_recvfrom): Ditto.
311         (cygwin_getpeername): Ditto.
312         (cygwin_recv): Ditto.
313         (cygwin_send): Ditto.
314         * winsup.h: Declare a new function.
315
316 2001-11-23  Corinna Vinschen  <corinna@vinschen.de>
317
318         * select.cc (set_bits): Fix conditional for setting fd in exceptfds.
319         * dtable.cc (dtable::build_fhandler): Create fhandler_pipe using
320         correct device type.
321         * path.cc (get_devn): Set correct pipe device type from device name.
322
323 2001-11-22  Christopher Faylor  <cgf@redhat.com>
324
325         * path.cc (conv_path_list): Fix wild indexing into path due to
326         conflicting methods for setting src pointer.
327
328         * dir.cc (opendir): Only pass path_conv argument to opendir, since name
329         is already part of the fhandler.
330         * dtable.cc (dtable::build_fhandler): Accomodate new FH_CYGDRIVE type.
331         * fhandler.cc (fhandler_base::opendir): Nuke name argument.
332         * fhandler.h: Add FH_CYGDRIVE to "device" enum.
333         (fhandler_base::opendir): Nuke name argument.
334         (fhandler_disk_file::opendir): Ditto.
335         (fhandler_disk_file::fhandler_disk_file): Declare new method which
336         passes devtype through.
337         (fhandler_cygdrive): Add elements for tracking drives.
338         (fhandler_cygdrive::set_drives): Declare new method.
339         (fhandler_cygdrive::iscygdrive_root): Declare new method.
340         (fhandler_cygdrive::opendir): Declare new method.
341         (fhandler_cygdrive::readdir): Declare new method.
342         (fhandler_cygdrive::telldir): Declare new method.
343         (fhandler_cygdrive::seekdir): Declare new method.
344         (fhandler_cygdrive::rewinddir): Declare new method.
345         (fhandler_cygdrive::closedir): Declare new method.
346         (fhandler_cygdrive::fstat): Declare new method.
347         * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file):
348         Define new method which passes devtype through.
349         (fhandler_disk_file::open): Tweak debug output.
350         (fhandler_disk_file::opendir): Nuke first argument.  Use info from
351         path_conv and class rather than calling fstat.
352         (fhandler_cygdrive::set_drives): New method.
353         (fhandler_cygdrive::iscygdrive_root): New method.
354         (fhandler_cygdrive::opendir): New method.
355         (fhandler_cygdrive::readdir): New method.
356         (fhandler_cygdrive::telldir): New method.
357         (fhandler_cygdrive::seekdir): New method.
358         (fhandler_cygdrive::rewinddir): New method.
359         (fhandler_cygdrive::closedir): New method.
360         (fhandler_cygdrive::fstat): New method.
361         * path.cc (iscygdrive_device): Assume cygdriveness is already verified.
362         (path_conv::check): Treat FH_CYGDRIVE "method" as a special case,
363         setting file attributes as needed.
364         (mount_info::conv_to_win32_path): Allow stand-alone /cygdrive, meaning
365         "the directory which contains all of the drives on the system".
366         (fillout_mntent): Use cyg_tolower for conversions.
367         (mount_info::cygdrive_win32_path): Replace unused argument with unit
368         number.
369         * shared_info.h (mount_info::cygdrive_win32_path): Reflect argument
370         change.
371
372 2001-11-21  Christopher Faylor  <cgf@redhat.com>
373
374         * Makefile.in (DLL_OFILES): Add fhandler_disk_file.o.
375         * cygheap.h (cygheap_fdnew::operator =): New operator.
376         * dir.cc: Add invalid struct checking throughout.  Use methods for all
377         directory manipulation throughout.
378         * fhandler.cc: Move fhandler_disk_file stuff to own file.
379         (fhandler_base::opendir): New method.
380         (fhandler_base::readdir): New method.
381         (fhandler_base::telldir): New method.
382         (fhandler_base::seekdir): New method.
383         (fhandler_base::rewinddir): New method.
384         (fhandler_base::closedir): New method.
385         * fhandler_disk_file.cc: New file.
386         * fhandler.h (fhandler_base): Declare new virtual methods.
387         (fhandler_disk_file): Ditto.
388         (fhandler_cygdrive): New class.
389
390         * path.cc (conv_path_list): Use strccpy to break apart path.
391
392 2001-11-17  Nick Duffek  <nick@duffek.com>
393
394         * path.cc (conv_path_list): Copy source paths before modifying them.
395
396 2001-11-17  Corinna Vinschen  <corinna@vinschen.de>
397
398         * fhandler_raw.cc (fhandler_dev_raw::clear): Don't reset unit.
399         * fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): Add debug
400         output.
401
402 2001-11-15  Egor Duda  <deo@logos-m.ru>
403
404         * include/pthread.h (PTHREAD_COND_INITIALIZER): Define.
405         * thread.cc (__pthread_cond_destroy): Add support for
406         PTHREAD_COND_INITIALIZER.
407         (__pthread_cond_init): Ditto.
408         (__pthread_cond_broadcast): Ditto.
409         (__pthread_cond_signal): Ditto.
410         (__pthread_cond_dowait): Ditto.
411         (__pthread_mutex_init): Handle PTHREAD_MUTEX_INITIALIZER correctly,
412         don't return error when it's passed as parameter.
413         * winsup.h (check_null_invalid_struct): Call correct function.
414
415 2001-11-14  Christopher Faylor  <cgf@redhat.com>
416
417         * exceptions.cc: Add stdlib.h include for alloca declaration.
418         * poll.cc: Ditto.
419         * termios.cc: Ditto.
420
421 2001-11-14  Christopher Faylor  <cgf@redhat.com>
422
423         * syscalls.cc (_write): Only allow zero length when fd is valid.
424
425 2001-11-14  Corinna Vinschen  <corinna@vinschen.de>
426
427         * fhandler.cc (fhandler_disk_file::fstat): Add setting access time
428         and creation time to last modification time for files on filesystems
429         not supporting multiple timestamps.
430         (fhandler_disk_file::fstat_helper): Set access time and creation
431         time in incoming Windows structure instead of in stat buf to avoid
432         incorrectly overwriting Epoch timestamp.
433
434 2001-11-14  Corinna Vinschen  <corinna@vinschen.de>
435
436         * winsup.h: Remove alloca definition since it's now defined through
437         inclusion of stdlib.h.
438         * lib/cygwin_crt0.c: Ditto.
439
440 2001-11-13  Christopher Faylor  <cgf@redhat.com>
441
442         * syscalls.cc (_write): Allow zero length as per SUSv2.
443
444 2001-11-13  Corinna Vinschen  <corinna@vinschen.de>
445
446         * dir.cc (mkdir): Add HIDDEN file attribute if file has leading dot
447         and HIDDEN_DOT_FILES is defined.
448         * fhandler.cc (fhandler_base::open): Ditto.
449         * path.cc (symlink): Ditto.
450         * syscalls.cc (_rename): Ditto and remove HIDDEN file attribute if
451         new filename does not begin with a dot.
452
453 2001-11-12  Christopher Faylor  <cgf@redhat.com>
454
455         * fhandler_console.cc (fhandler_console::read): Revert 2001-10-23
456         change to only honor keydown events.
457
458 2001-11-11  Christopher Faylor  <cgf@redhat.com>
459
460         * include/cygwin/version.h: Bump version to 1.3.6.
461
462 2001-11-10  Christopher Faylor  <cgf@redhat.com>
463
464         * dtable.cc (dtable::build_fhandler): Don't increment console fd count
465         if new operation fails.  Increment fork_fixup field here.
466         (dtable::dup2): Don't increment fork_fixup field here.
467         * net.cc (fdsock): Ditto.
468
469 2001-11-08  Corinna Vinschen  <corinna@vinschen.de>
470
471         * select.cc: Set errno using set_sig_errno() throughout.
472         * signal.cc (signal): Always set SA_RESTART flag.
473         * syscalls.cc (_read): Revert previous patch.
474
475 2001-11-08  Corinna Vinschen  <corinna@vinschen.de>
476
477         * select.cc (fhandler_tty_slave::ready_for_read):  Return 0 on EBADF.
478         * syscalls.cc (_read): If ready_for_read() failed, save errno from
479         being overwritten by signal handler call.
480
481 2001-11-07  Corinna Vinschen  <corinna@vinschen.de>
482
483         * lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset
484         is not set.
485
486 2001-11-06  Christopher Faylor  <cgf@redhat.com>
487
488         * select.cc (fhandler_tty_slave::ready_for_read): Correct inverted
489         not_open test.
490
491 2001-11-05  Christopher Faylor  <cgf@redhat.com>
492
493         * include/cygwin/version.h: Bump version to 1.3.5.
494
495 2001-11-05  Corinna Vinschen  <corinna@vinschen.de>
496
497         * mmap.cc (mmap_record::find_empty): Add input parameter check.
498
499 2001-11-04  Christopher Faylor  <cgf@redhat.com>
500
501         * dtable.cc (dtable::build_fhandler): Fix debug_printf to avoid SEGV
502         due to incorrect parameter placement.
503
504 2001-11-04  Christopher Faylor  <cgf@redhat.com>
505
506         * fhandler.h (fhandler_pipe::broken_pipe): Renamed from saweof.
507         (fhandler_pipe::set_eof): Reflect above change.
508         * pipe.cc (fhandler_pipe::fhandler_pipe): Ditto.
509         (fhandler_pipe::read): Ditto.
510         (fhandler_pipe::hiteof): Ditto.
511
512 2001-11-04  Christopher Faylor  <cgf@redhat.com>
513
514         * pipe.cc (fhandler_pipe::read): Narrow eof return to just the "broken
515         pipe" test.
516
517 2001-11-04  Christopher Faylor  <cgf@redhat.com>
518
519         * select.cc: Add more comments throughout.  Use bool 'true' where
520         appropriate throughout.
521         (fhandler_socket::select_read): Remove duplicate setting for *_ready
522         which inadvertently overrode previous, correct setting.
523         (fhandler_socket::select_write): Ditto.
524
525 2001-11-03  Christopher Faylor  <cgf@redhat.com>
526
527         * select.cc (verify_console): New function.
528         (verify_windows): Ditto.
529         (fhandler_console::select_read): Really do need to verify that there is
530         something to read.
531         (fhandler_console::select_windows): Ditto.
532
533 2001-11-03  Christopher Faylor  <cgf@redhat.com>
534
535         * fhandler.h (fhandler_base::ready_for_read): Remove unused argument.
536         (fhandler_tty_slave::ready_for_read): Ditto.
537         (select_record): Remove poll, initialize peek.
538         * select.cc: Remove all poll functions, throughout.  Change second
539         argument of peek_* functions to 'bool' throughout.  Specifically
540         initialize *_ready variables throughout.
541         (select_stuff::poll): Subsume previous poll functionality.
542         (peek_pipe): Don't grab guard mutex when in select loop.
543         select()/read() is racy by design so there is no need to worry about a
544         race in select().
545         (fhandler_base::ready_for_read): Remove unused argument.
546         (fhandler_tty_slave::ready_for_read): Ditto.
547         * syscalls.cc (_read): Eliminate third argument in ready_for_read call.
548
549 2001-11-03  Corinna Vinschen  <corinna@vinschen.de>
550
551         * security.cc (get_supplementary_group_sidlist): New function.
552         (get_group_sidlist): Call get_supplementary_group_sidlist() to
553         retrieve list of supplementary groups SIDs from /etc/group and
554         add them to the user's group list.
555
556 2001-11-03  Christopher Faylor  <cgf@redhat.com>
557
558         * fhandler.cc (fhandler_base::read): Return just read ahead characters
559         if slow device.
560         * fhandler.h (fhandler_base::set_eof): New virtual method.
561         (fhandler_pipe::set_eof): New method.
562         * pipe.cc (fhandler_pipe::fhandler_pipe): Clear saweof flag.
563         (fhandler_pipe::read): Return immediately if hit eof.
564         (fhandler_pipe::hit_eof): Return true if saweof flag is set.
565         * select.cc (peek_pipe): Don't call PeekNamedPipe if we couldn't grab
566         the guard mutex.
567
568 2001-11-02  Egor Duda  <deo@logos-m.ru>
569
570         * dll_init.h (class dll_list): Reorder functions to avoid compiler
571         "can't inline" warnings.
572         * security.h (class cygsid): Ditto.
573         * sigproc.cc (get_proc_lock): Ditto.
574         * sigproc.h (class sigframe): Ditto.
575         * sync.h (class muto): Ditto.
576
577 2001-11-02  Christopher Faylor  <cgf@redhat.com>
578
579         * fhandler.h (fhandler_base::get_guard): Actually MAKE virtual as
580         previously indicated.
581         * pipe.cc (make_pipe): Remove extraneous set_errno.
582         * syscalls.cc (_open): Ditto.
583         * select.cc (peek_pipe): Need to check that there is still something to
584         read from the pipe after acquiring the mutex since another
585         process/thread could have eaten the input before we got to acquiring
586         the lock.  (Thanks to Nick Duffek for this inspiration.)
587
588 2001-11-01  Christopher Faylor  <cgf@redhat.com>
589
590         * fhandler.h: Change Windows 'BOOL's to c++ 'bool's for all variables.
591         * select.cc (fhandler_base::ready_for_read): Set read_ready to zero
592         prior to testing it or it will be uninitialized.
593
594         * Makefile.in (CFLAGS): Move setting to Makefile.common.
595
596 2001-11-01  Christopher Faylor  <cgf@redhat.com>
597
598         * cygheap.h (cygheap_fdmanip::isopen): Set appropriate errno if fd not
599         open.
600         * select.cc (fhandler_base::ready_for_read): Release an open guard
601         mutex when exiting with an error condition.
602         * syscalls.cc (_read): Check frequently for closed fd as a kludge until
603         something better is invented.
604
605 2001-11-01  Christopher Faylor  <cgf@redhat.com>
606
607         * dtable.cc (dtable::build_fhandler): Issue internal error on unknown
608         device.
609         * fhandler.cc (fhandler_base::close): Show both name and handle in
610         debugging output.
611
612         * fhandler.h (fhandler_base::get_guard): New virtual method.
613         (fhandler_pipe::get_guard): New method.
614         (fhandler_socket::ready_for_read): Delete declaration.
615         (fhandler_pipe::ready_for_read): Ditto.
616         (fhandler_serial::ready_for_read): Ditto.
617         (fhandler_console::ready_for_read): Ditto.
618         (fhandler_tty_common::ready_for_read): Ditto.
619         (fhandler_windows::ready_for_read): Ditto.
620         (struct select_record::peek): Declare new method.
621         * select.cc (MAKEready): Delete.
622         (peek_pipe): Use get_guard method to retrieve potential guard mutex
623         handle.
624         (fhandler_base::ready_for_read): Rewrite as generic ready-for-read
625         handler.  Should only be called for "slow" devices.
626         (fhandler_socket::ready_for_read): Delete definition.
627         (fhandler_pipe::ready_for_read): Ditto.
628         (fhandler_serial::ready_for_read): Ditto.
629         (fhandler_console::ready_for_read): Ditto.
630         (fhandler_tty_common::ready_for_read): Ditto.
631         (fhandler_windows::ready_for_read): Ditto.
632         (fhandler_pipe::select_read): Fill in new peek record in select_record
633         structure.
634         (fhandler_console::select_read): Ditto.
635         (fhandler_tty_common::select_read): Ditto.
636         (fhandler_serial::select_read): Ditto.
637         (fhandler_socket::select_read): Ditto.
638         (fhandler_socket::select_read): Ditto.
639         (fhandler_tty_slave::ready_for_read): Check for tty not open.  Set
640         errnos appropriately.
641         * syscalls.cc (_read): Allow ready_for_read to set errno.
642
643         * pinfo.cc (pinfo::init): Return spawn/NO_WAIT process as valid if it
644         is initializing.
645         * sigproc.cc (getsem): Adjust wait for process to initialize downward
646         to avoid huge waits.
647
648 2001-10-31  Christopher Faylor  <cgf@redhat.com>
649
650         * environ.cc: Set reset_com to false to mimic linux behavior more
651         closely.
652
653 2001-10-31  Corinna Vinschen  <corinna@vinschen.de>
654
655         * dtable.cc (dtable::vfork_child_dup): Revert impersonation
656         before duplicating fhandler.
657
658 2001-10-30  Christopher Faylor  <cgf@redhat.com>
659
660         * exceptions.cc (signal_exit): Weight the odds against the main thread
661         running when signal thread is exiting.
662
663 2001-10-30  Christopher Faylor  <cgf@redhat.com>
664
665         * sigproc.cc (sigproc_terminate): Don't signal main thread when exiting.
666         * sigproc.h (sigframe): Decorate some methods with `inline'.
667         (new_muto): Coerce pointer to new to void *.
668
669 2001-10-30  Christopher Faylor  <cgf@redhat.com>
670
671         * fhandler.cc (fhandler_base::fork_fixup): Pass old handle to
672         setclexec_pid.
673
674 2001-10-30  Christopher Faylor  <cgf@redhat.com>
675
676         * cygheap.h (cygheap_fdmanip::cygheap_fdmanip): Clear fh.
677         (cygheap_fdmanip::isopen): New method.
678         * syscalls.cc (_read): Avoid accessing closed fd.
679
680         * path.h (fe_types): New enum.
681         (path_conv::set_path): New method.
682         (find_exec): Change null_if_not_found argument to something more
683         generic.
684         * spawn.cc (find_exec): Default to returning the POSIX path rather than
685         the windows path, unless instructed otherwise.
686         (spawn_guts): Force call to find_exec to use native paths.
687         * dlfcn.cc (check_path_access): Accommodate new find_exec arguments.
688         * environ.h (win_env::get_posix): New method.
689
690 2001-10-30  Corinna Vinschen  <corinna@vinschen.de>
691
692         * fhandler_socket.cc (fhandler_socket::close): Add error handling.
693
694 2001-10-30  Corinna Vinschen  <corinna@vinschen.de>
695
696         * fhandler_socket.cc (fhandler_socket::dup): Revert previous change.
697
698 2001-10-30  Christopher Faylor  <cgf@redhat.com>
699
700         * dtable.cc (dtable::dup2): Add some debugging.  Use methods from
701         passed in class rather than cygheap->fdtab.
702         * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add
703         more debugging output.
704         (fhandler_socket::dup): Allocate new space for prot_info_ptr for
705         duplicated entry.
706         (fhandler_socket::close): Loop closesocket() as long as WSAEWOULDBLOCK
707         is returned.
708         * syscalls.cc (stat_worker): Always delete fh if it has been created.
709
710 2001-10-29  Corinna Vinschen  <corinna@vinschen.de>
711
712         * security.cc (is_group_member): Call NetLocalGroupGetMembers() for
713         local machine only.
714         (get_user_local_groups): Ditto for NetLocalGroupEnum().
715
716 2001-10-29  Christopher Faylor  <cgf@redhat.com>
717
718         * fhandler.cc (fhandler_base::set_name): Set namehash here to catch
719         name changes.
720         (fhandler_base::open): Remove namehash setting.
721         (fhandler_base::fstat): Subtract 1 from arbitrary time setting to avoid
722         strange ls -l granularity problem.
723
724 2001-10-29  Christopher Faylor  <cgf@redhat.com>
725
726         * select.cc (MAKEready): Remove extraneous select_read.
727
728 2001-10-29  Corinna Vinschen  <corinna@vinschen.de>
729
730         * uinfo.cc (internal_getlogin): Set environment variable $HOME
731         from either /etc/passwd or $HOMEDRIVE/$HOMEPATH if necessary.
732
733 2001-10-29  Christopher Faylor  <cgf@redhat.com>
734
735         * fhandler.h (fhandler_serial::fhandler_serial): Change to only accept
736         unit argument.
737         * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto.
738         (fhandler_serial::open): Avoid else when previous clause is a return().
739         * path.cc (get_devn): Alias /dev/ttyS0 -> /dev/com1, etc.
740         (get_device_number): Reallow standalone "com1" as a valid name for
741         /dev/com1.
742
743 2001-10-26  Christopher Faylor  <cgf@redhat.com>
744
745         * select.cc (MAKEready): Check for read_ready in loop since select_read
746         could set it.
747         (peek_socket): Check ready/write/except specifically since they could
748         have been set even prior to peek_socket call.
749
750 2001-10-24  Christopher Faylor  <cgf@redhat.com>
751
752         * shared_info.h (MOUNT_VERSION): Change to a smaller, still arbitrary
753         number.
754         * shared.cc (open_shared): Accept a number to denote the shared memory
755         region.
756         (memory_init): Use shared memory version as part of the object name of
757         the shared region.  Ditto for the mount table.
758         * path.cc (CYGWIN_REGNAME): New define used in place of
759         CYGWIN_INFO_CYGWIN_REGISTRY_NAME throughout.
760         * external.cc (cygwin_internal): Implement CW_[GS]ET_CYGWIN_REGISTRY_NAME.
761         * cygheap.h (init_cygheap::cygwin_regname): New element.
762
763 2001-10-23  Christopher Faylor  <cgf@redhat.com>
764
765         Ensure that all fhandler_*::read definitions are __stdcall throughout.
766         * fhandler.cc (fhandler_base::set_inheritance): Be more defensive in
767         debugging code.
768         * fhandler.h: Adjust regparms throughout to reflect passing 'this'
769         parameter.
770         * fhandler_console.cc (fhandler_console::read): Remove unneeded test.
771         Only honor "key down" events.
772         * miscfuncs.cc (strcasestr): Reorganize for efficient code use.
773         (check_null_empty_str_errno): Ditto.
774         (__check_null_invalid_struct_errno): Ditto.
775         (__check_invalid_read_ptr_errno): Ditto.
776         * syscalls.cc (_read): Return 0 when length == 0, as per Single UNIX
777         Specification.
778
779 2001-10-22  Christopher Faylor  <cgf@redhat.com>
780
781         * debug.cc (set_errno): Return value of errno that was set, just like
782         the macro.
783         (setclexec_pid): Replace old handle with new handle.
784         * debug.h: Reflect change in arguments for setclexec_pid.
785         * fhandler.cc (fhandler_base::set_inheritance): Ditto.
786         (fhandler_base::fork_fixup): Ditto.
787         * cygerrno.h: Reflect return value change for set_errno.
788
789 2001-10-22  Christopher Faylor  <cgf@redhat.com>
790
791         Remove 'cb' parameter and modify fhandler_* constructors throughout.
792         * dtable.cc (dtable::build_fhandler): Remove debugging output which
793         uses 'cb'.
794         * exec.cc (execvp): New function.
795         (execvpe): Ditto.
796         * fhandler.cc (fhandler_base::fhandler_base): Use constructor
797         initialization.
798         * fhandler.h (fhandler_tty_common::fhandler_tty_common): Ditto.
799         * fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard):
800         Ditto.
801         * fhandler_console.cc (fhandler_console::fhandler_console): Ditto.
802         * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Ditto.
803         * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto.
804         * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Ditto.
805         (fhandler_tty_slave::fhandler_tty_slave): Ditto.
806         (fhandler_pty_master::fhandler_pty_master): Ditto.
807         * fhandler_windows.cc (fhandler_windows::fhandler_windows): Ditto.
808
809 2001-10-22  Corinna Vinschen  <corinna@vinschen.de>
810
811         Patch suggested by Ian Ray <ian.ray@nokia.com>:
812         * syscalls.cc (seteuid): Unset environment variables HOMEDRIVE and
813         HOMEPATH before calling internal_getlogin().
814         * uinfo.cc (internal_getlogin): Use default HOMEPATH and HOMEDRIVE
815         from environment if both are present, else query NetUserGetInfo().
816
817 2001-10-22  Corinna Vinschen  <corinna@vinschen.de>
818
819         * net.cc (get_2k_ifconf): Change multiple IP address naming scheme
820         to Linux style.
821
822 Sun Oct 21 19:04:37 2001 Alexander Gottwald <ago@informatik.tu-chemnitz.de>
823
824         * net.cc (get_2k_ifconf): Added support for multiple IP addresses on
825         one interface.
826
827 2001-10-22  Corinna Vinschen  <corinna@vinschen.de>
828
829         * miscfuncs.cc (__check_invalid_read_ptr_errno): Return error, if any.
830
831 2001-10-21  Christopher Faylor  <cgf@redhat.com>
832
833         * resource.cc (fill_rusage): Perform paranoid zero structure passed to
834         GetProcessMemoryInfo.
835
836 2001-10-22  Robert Collins  <rbtcollins@hotmail.com>
837
838         * autoload.cc: Autoload GetProcessMemoryInfo.
839         * resource.cc (fill_rusage): Calculate ru_maxrss and ru_majflt entries.
840         (Bug report on this from Guido Serassio in the squid project).
841         This requires including psapi.h.
842
843 2001-10-20  Christopher Faylor  <cgf@redhat.com>
844
845         * dll_init.cc (dll_list::alloc): Increase retry count to 1000.
846
847 2001-10-20  Christopher Faylor  <cgf@redhat.com>
848
849         * miscfuncs.cc (__check_invalid_read_ptr_errno): New function.
850         * syscalls.c (_write): Validate that write buffer is accessible for
851         reading, not writing.
852         * winsup.h: Declare new function, increase regparmization of check_*
853         functions.
854
855 2001-10-19  Corinna Vinschen  <corinna@vinschen.de>
856
857         * path.cc (getcwd): Allow len == 0 when buf == NULL.
858
859 2001-10-18  Christopher Faylor  <cgf@redhat.com>
860
861         * syscalls.cc (_read): Validate input pointer.
862         (_write): Ditto.
863         (system): Ditto.
864
865 2001-10-16  Frederic Devernay  <Frederic.Devernay@sophia.inria.fr>
866
867         * poll.cc (poll): Call cygwin_select() if any fd is valid.
868
869 2001-10-16  Corinna Vinschen  <corinna@vinschen.de>
870
871         * fhandler_raw.cc (fhandler_dev_raw::open): Eliminate compatibility
872         code since no Win32 device names are used anymore.
873         * fhandler_tape.cc (fhandler_dev_tape::tape_set_blocksize): Allow
874         0 as blocksize to indicate variable blocksize.
875         * path.cc (win32_device_name): Generate NT internal device names
876         using upper/lower case names for readability.
877         Generate \DosDevices\<letter>: device name for mount table
878         compatibility devices.
879
880 2001-10-16  Corinna Vinschen  <corinna@vinschen.de>
881
882         * fhandler_tape.cc (fhandler_dev_tape::tape_status): Report
883         EOTWarningZoneSize in get->mt_eotwarningzonesize.
884         * include/cygwin/mtio.h: Define DEFTAPE.
885         (struct mtget): Add member `mt_eotwarningzonesize'. Add a comment.
886         * include/cygwin/version.h: Bump API minor version to 47.
887
888 2001-10-16  Christopher Faylor  <cgf@redhat.com>
889
890         * fhandler.cc (fhandler_base::fork_fixup): Guard against compiler
891         warning.
892
893 2001-10-16  Corinna Vinschen  <corinna@vinschen.de>
894
895         * autoload.cc: Add load statement for `NtOpenFile'.
896         * fhandler.h (fhandler_dev_raw::get_unit): New method.
897         (fhandler_dev_tape::norewind): Eliminate.
898         (fhandler_dev_tape::is_rewind_device): New method.
899         * fhandler_raw.cc (fhandler_dev_raw::open): Open new
900         fixed device name devices using NT internal method.
901         Keep calling fhandler_base::open() for old mount table
902         device mapping compatibility devices.
903         (fhandler_dev_raw::fstat): Eliminate.  Settings are done
904         by fhandler_base::fstat() already.
905         * fhandler_tape.cc: Remove `norewind' usage throughout.
906         * ntdll.h: Define FILE_SYNCHRONOUS_IO_NONALERT.
907         Define struct _IO_STATUS_BLOCK.
908         Declare NtOpenFile().
909         * path.cc (get_raw_device_number): Add new approach for
910         using fixed device names.
911         (win32_device_name): Ditto.
912         (get_device_number): Ditto.  Require POSIX path to begin
913         with "/dev/".
914         (mount_info::conv_to_win32_path): Call win32_device_name()
915         instead of get_device_number() after evaluating mount points
916         to allow changing the win32 destination path again.
917         * security.cc (str2buf2uni): Remove `static' to be able to
918         call function from fhandler_dev_raw::open().
919         * wincap.cc: Set flag has_raw_devices appropriately.
920         * wincap.h: Add flag has_raw_devices.
921
922 2001-10-16  Christopher Faylor  <cgf@redhat.com>
923
924         * cygheap.h (cygheap_fdget::cygheap_fdget): Remove debugging operation
925         from set_errno.
926
927 2001-10-16  Christopher Faylor  <cgf@redhat.com>
928
929         * mmap.cc (mmap): Assign 'fh' from cygheap_fdget.  Use 'fh' everywhere.
930
931 2001-10-15  Christopher Faylor  <cgf@redhat.com>
932
933         * cygerrno.h (set_errno): Define more informative version of this
934         function for debugging.
935         (__set_errno): Declare when DEBUGGING.
936         * cygheap.h (cygheap_fdget::cygheap_fdget): Add a flag to control when
937         errno is set.
938         * debug.cc (__set_errno): New function.
939         * fcntl.cc (_fcntl): Fix so that correct fd is used for second argument
940         to dup2.
941         * syscalls.cc (_cygwin_istext_for_stdio): Don't set errno here when
942         using cygheap_fdget.
943
944 2001-10-15  Christopher Faylor  <cgf@redhat.com>
945
946         * fhandler.cc (fhandler_base::fork_fixup): Don't protect handle.
947
948         * dlfcn.cc: Fix to confirm to coding standards.
949
950         Reorganize includes throughout to accommodate new cygheap.h usage.
951         * cygheap.h (cygheap_fdmanip): New class: simplifies locking and
952         retrieval of fds from cygheap->fdtab.
953         (cygheap_fdget): Ditto.
954         (cygheap_fdnew): Ditto.
955         * fcntl.cc (_fcntl): Use new method to lock fdtab and retrieve info.
956         * ioctl.cc (ioctl): Ditto.
957         * mmap.cc (mmap): Ditto.
958         * net.cc: Ditto, throughout.
959         * passwd.cc (getpass): Ditto.
960         * path.cc (fchdir): Ditto.
961         * pipe.cc (make_pipe): Ditto.
962         * sec_acl.cc (facl): Ditto.
963         * syscalls.cc: Ditto, throughout.
964         * termios.cc: Ditto, throughout.
965
966 2001-10-15  Corinna Vinschen  <corinna@vinschen.de>
967
968         * uname.cc (uname):  Use `wProcessorLevel' unless OS sets it wrong.
969         Use `dwProcessorType' then instead.
970         * wincap.cc: Set flag has_valid_processorlevel appropriately.
971         * wincap.h: Add flag has_valid_processorlevel.
972
973 2001-10-14  Christopher Faylor  <cgf@redhat.com>
974
975         * dtable.cc (dtable::build_fhandler_from_name): Use PC_FULL to
976         determine path name.
977         * path.cc (fchdir): Remove rel -> abs path conversion.
978
979 Sun Oct 14 08:10:12 2001  Gary R. Van Sickle
980
981         * fork.cc (fork_parent): Correct the "unable to allocate
982         forker_finished event" error message.  It named the wrong event before.
983
984 2001-10-13  Christopher Faylor  <cgf@redhat.com>
985
986         * autoload.cc (load_wsock32): Declare dummy function to force loading
987         of winsock.
988         * fhandler.cc (fhandler_base::set_inheritance): Make debugging output
989         more verbose.
990         * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Force loading
991         of winsock32 if winsock2 not available.
992         * net.cc (set_socket_inheritance): Use DuplicateHandle in all cases to
993         set inheritance correctly.
994         (fdsock): Use winsock2_active macro to determine when to set socket
995         inheritance.  Remove fdtab resource locking since this function should
996         already be protected.
997         (cygwin_accept): Simplify logic.  Ensure that fdtab unlock is not
998         called inappropriately.
999         (cygwin_rcmd): Use fdtab locking.
1000         (cygwin_rresvport): Ditto.
1001         (cygwin_rexec): Ditto.
1002         * select.cc (peek_socket): Set errno appropriately if winsock select
1003         fails.
1004
1005 2001-10-13  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
1006
1007         * winsup.h: Declare check_pty_fds.
1008         * syscalls.cc (check_pty_fds): Rename from check_ttys_fds.  Also check
1009         pty master.
1010         (setsid): Use check_pty_fds.
1011         * dtable.cc (dtable::dec_console_fds): Add check on pty fds.
1012
1013 2001-10-13  Ralf Habacker  <Ralf.Habacker@freenet.de>
1014
1015         * fhandler_dsp.cc (fhandler_dsp::ioctl): Return 0 for successful
1016         SNDCTL_DSP_GETBLKSIZE operation.
1017
1018 2001-10-13  Christopher Faylor  <cgf@redhat.com>
1019
1020         Remove obsolete 'name' arg from fhandler_* constructors throughout.
1021         * winsup.h (winsock_active): New macro.
1022         (winsock2_active): Ditto.
1023         * autoload.cc (wsock_init): Use new macros to decide if winsock or
1024         winsock2 is loaded.
1025         (nonexist_wsock32): Dummy function to force winsock load.
1026         (nonexist_ws2_32): Dummy function to force winsock2 load.
1027         * fhandler.h (fhandler_socket::fstat): Declare new method.  Currently
1028         unused.
1029         * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Check
1030         that winsock2 is active before trying WSADuplicateSocketA.
1031         (fhandler_socket::fixup_after_fork): Add extra check for
1032         winsock2_active.  Otherwise use iffy procedures for Windows 95.
1033         (fhandler_socket::fixup_after_exec): Add debugging.
1034         (fhandler_socket::dup): Add debugging.
1035         (fhandler_socket::fstat): New method.
1036         (fhandler_socket::set_close_on_exec): Attempt to perform iffy stuff on
1037         Windows 95.
1038
1039         * errno.cc (_sys_nerr): Work around compiler strangeness.
1040
1041         * pinfo.cc (winpids::add): Add extra element at end of allocated array
1042         for setting to NULL.
1043         (winpids::enumNT): Ditto.
1044         (winpids::init): Don't modify pidlist if it hasn't been allocated
1045         (possibly due to malloc problem).
1046
1047 2001-10-12  Christopher Faylor  <cgf@redhat.com>
1048
1049         * autoload.cc (wsock_init): Reorganize slightly to accommodate a new
1050         compiler.
1051
1052 2001-10-11  Egor Duda  <deo@logos-m.ru>
1053
1054         * net.cc (cygwin_sendto): Use correct socket address when sending
1055         data to AF_UNIX socket.
1056
1057 Wed Oct 10 16:10:41 2001  Alexander Gottwald <ago@informatik.tu-chemnitz.de>
1058
1059         * net.cc (get_95_ifconf): Using other registry values pointing to
1060         correct networkdevice identification for Windows95.
1061
1062 Tue Oct  9 22:22:45 2001  Christopher Faylor <cgf@cygnus.com>
1063
1064         Throughout, rename PROC_FORK1 to PROC_FORK.
1065         * child_info.h: Rename PROC_* to _PROC_*.  Define PROC_* with
1066         additional testing magic.  Eliminate old PROC_FORK and rename
1067         PROC_FORK1 to PROC_FORK.
1068         * dcrt0.cc (_cygwin_testing_magic): New variable.  Added to magic
1069         number in proc_info.
1070         (alloc_stack): Eliminate old PROC_FORK test.
1071         (dll_crt0_1): Ditto.  Use _PROC_* enums for test.  Subtract
1072         _cygwin_testing_magic from child_proc_info->type so that normal cygwin
1073         programs invoked by test suite programs do not consider themselves to
1074         be in a cygwin environment.
1075         (_dll_crt0): Ditto.  Move environment checks to initial_env function to
1076         conserve on stack space.
1077         (initial_env): New function.  Checks for testing and debugging
1078         environment variables.
1079         * init.cc (cygwin_hmodule): Move declaration.
1080         * winsup.h: Declare variables used for cygwin testing.
1081
1082 Tue Oct  9 19:17:53 2001  Christopher Faylor <cgf@cygnus.com>
1083
1084         * uinfo.cc (internal_getlogin): Reorganize slightly to minimize work in
1085         default condition.
1086
1087 Tue Oct  9 18:53:00 2001  Corinna Vinschen <corinna@vinschen.de>
1088
1089         * fhandler.cc (fhandler_disk_file::open): Add missing case clash check.
1090
1091 Mon Oct  8 01:47:27 2001  Christopher Faylor <cgf@cygnus.com>
1092
1093         * dtable.cc (dtable::build_fhandler): Allocate correct amount for given
1094         fhandler class.
1095         * fhandler.h (fhandler_union): Properly define rather than relying on
1096         fhandler_console being "big enough".
1097
1098 Mon Oct  8 00:25:18 2001  Christopher Faylor <cgf@cygnus.com>
1099
1100         * external.cc (fillout_pinfo): Reset counter whenever we initialize the
1101         pid list.
1102
1103 Sun Oct  7 17:16:05 2001  Christopher Faylor <cgf@cygnus.com>
1104
1105         * path.cc (normalize_posix_path): Don't eat a '.' after a '\\' since it
1106         has special meaning on NT.
1107
1108         * syscalls.cc (access): Use stat_worker.
1109
1110 Fri Oct  5 21:01:14 2001  Christopher Faylor <cgf@cygnus.com>
1111
1112         * fhandler.cc (fhandler_base::fork_fixup): Protect dup'ed handle and
1113         record it as non-inheritable for debugging purposes in case there is a
1114         subsequent fork or exec.
1115         * fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Allow
1116         fork_fixup to call ProtectHandle.
1117
1118 Fri Oct  5 14:22:47 2001  Christopher Faylor <cgf@cygnus.com>
1119
1120         * path.cc (get_raw_device_number): Correct length arguments for
1121         wdeveqn.
1122
1123 Fri Oct  5 11:05:32 2001  Christopher Faylor <cgf@cygnus.com>
1124
1125         * path.cc (getcwd): Allow NULL first argument.
1126
1127 Fri Oct  5 00:31:35 2001  Christopher Faylor <cgf@cygnus.com>
1128
1129         * heap.h (inheap): Check for NULL.
1130
1131 Thu Oct  4 23:17:49 2001  Christopher Faylor <cgf@cygnus.com>
1132
1133         Add second path_conv * argument to fstat()s throughout.
1134         * fhandler.h: Change read and fstat to regparm/stdcall throughout.
1135         (fhandler_base::fstat): Just declare.  Don't define.
1136         (fhandler_disk_file::fstat_helper): Declare.
1137         * fhandler.cc (fhandler_base::fstat): Move here from fhandler.h, adapt
1138         from former stat_dev().
1139         (fhandler_disk_file::fstat): Move most of the disk-file-specific logic
1140         from stat_worker to here.  Use fstat_helper to derive final fstat
1141         output.
1142         (fhandler_disk_file::fstat_helper): New method, renamed from former
1143         fstat method.
1144         (num_entries): Moved here from syscalls.cc.
1145         * fhandler_mem.cc (fhandler_dev_mem::fstat): Use base class to
1146         initialize most stuff.  Invert has_physical_mem_access test for
1147         establishing permissions.
1148         * fhandler_raw.cc (fhandler_dev_raw::fstat): Eliminate unneed test and
1149         memory clearing.  Use base class to initialize most stuff.
1150         * syscalls.cc (stat_dev): Eliminate.
1151         (stat_worker): Simply call fstat method to generate fstat output.  Move
1152         all device specific code to appropriate fstats.
1153
1154         * dir.cc (opendir): Pass correct arg to stat_worker to allow following
1155         symlinks.
1156
1157 Thu Oct  4 21:37:57 2001  Christopher Faylor <cgf@cygnus.com>
1158
1159         * spawn.cc (perhaps_suffix): Return NULL on non-existence of file as
1160         well as "directoryness".  Previous code modified on 2001/09/30 actually
1161         had an arguable bug which was unmasked by the change on that day.
1162
1163 Thu Oct  4 20:52:42 2001  Christopher Faylor <cgf@cygnus.com>
1164
1165         * path.cc (path_conv::check): Return ENOTDIR when leading device and
1166         trailing component.
1167
1168 Thu Oct  4 18:49:23 2001  Christopher Faylor <cgf@cygnus.com>
1169
1170         * syscalls.cc (stat_worker): Make global.  Accept path_conv parameter
1171         for passing information back to caller.
1172         * winsup.h: Declare stat_worker.
1173         * dir.cc (opendir): Use stat_worker rather than stat and pass path_conv
1174         parameter to stat_worker for later inspection.
1175
1176 2001-10-04 Karellen (karellen@boreworms.com)
1177
1178         * syslog.cc (syslog): Teach syslog about syslog priorities other than
1179         LOG_ERR, LOG_WARNING and LOG_INFO
1180
1181 Thu Oct  4 15:50:03 2001  Christopher Faylor <cgf@cygnus.com>
1182
1183         * path.cc (path_conv::check): Don't perform file system or rootdir
1184         checks on devices.
1185
1186 Wed Oct  3 19:40:36 2001  Christopher Faylor <cgf@cygnus.com>
1187
1188         * dcrt0.cc (dll_crt0_1): Don't close hexec_proc if it is NULL.
1189
1190         * fork.cc (vfork): Add debugging statements.
1191
1192         * path.cc (get_device_number): Make static.  Rewrite to inspect both unix
1193         and windows paths.
1194         (get_raw_device_number): Just check for parts of raw device that we
1195         care about.
1196         (get_devn): New function, pulled from get_device_number.
1197         (win32_device_name): Accommodate arg changes to get_device_number.
1198         (mount_info::get_device_number): Call get_device_number on translated
1199         Windows path.
1200
1201         * spawn.cc (spawn_guts): Don't treat P_VFORK differently from P_NOWAIT.
1202         Add handle to child's shared region to child so that it will be
1203         preserved if the parent goes away.
1204         * fhandler.h: Throughout, simplify to one open method for all fhandler
1205         classes, requiring a path_conv first element.
1206         * fhandler.cc (fhandler_base::open): Remove obsolete method.
1207         Generalize to require path_conv * as first argument.
1208         (fhandler_disk_file::open): Remove obsolete method.
1209         (fhandler_disk_file::open): Use path_conv pointer rather than
1210         reference.
1211         * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Use new open
1212         method.
1213         (fhandler_dev_clipboard::open): Accommodate new argument for open
1214         methods.
1215         * fhandler_console.cc (fhandler_console::open): Ditto.
1216         (fhandler_console::dup): Use new open method.
1217         (fhandler_console::fixup_after_fork): Ditto.
1218         (fhandler_console::fixup_after_exec): Ditto.
1219         * fhandler_dsp.cc (fhandler_dev_dsp::open): Accommodate new argument for
1220         open methods.
1221         * fhandler_floppy.cc (fhandler_dev_floppy::open): Ditto.
1222         * fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
1223         * fhandler_random (fhandler_dev_random::open): Ditto.
1224         * fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
1225         * fhandler_serial.cc (fhandler_serial::open): Ditto.
1226         * fhandler_tape.cc (fhandler_dev_tape::open): Ditto.
1227         * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
1228         (fhandler_pty_master::open): Ditto.
1229         * fhandler_windows.cc (fhandler_windows::open): Ditto.
1230         * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
1231         * fhandler_socket.cc (fhandler_socket::set_connect_secret): Accommodate
1232         new argument for open methods.
1233         * syscalls.cc (_open): Ditto.
1234         (stat_worker): Ditto.
1235
1236 Tue Oct  2 23:49:18 2001  Christopher Faylor <cgf@cygnus.com>
1237
1238         * cygheap.cc (cfree): Remove malloc debugging probe.
1239         * dlmalloc.c (errprint): Remove abort() call which causes interesting
1240         error message printing to abort prematurely.
1241         * environ.cc: Sprinkle MALLOC_CHECKs liberally throughout.
1242         (_addenv): Allocate two empty elements at end of environ to
1243         (apparently) work around problems with some buggy applications.
1244         (winenv): Avoid calling alloca if no forced environment variable is
1245         present.
1246
1247         * exceptions.cc (open_stackdumpfile): Don't print "Dumping stack trace
1248         to..." when running in a cygwin environment (i.e., the parent is a
1249         cygwin process).
1250
1251         * dtable.cc (dtable::init_std_file_from_handle): Move device type
1252         detection code from build_fhandler here since it is only used by this
1253         function.
1254         (dtable::build_fhandler_from_name): New method.  Renamed from
1255         dtable::build_fhandler.
1256         (dtable::build_fhandler): Use build_fhandler_from_name.
1257         (cygwin_attach_handle_to_fd): Ditto.
1258         * syscalls.cc (_open): Ditto.
1259         (stat_worker): Ditto.
1260         * dtable.h (dtable::build_fhandler_from_name): Rename declaration from
1261         dtable::build_fhandler.
1262
1263 Mon Oct  1 16:52:23 2001  Christopher Faylor <cgf@cygnus.com>
1264
1265         * dtable.h (dtable::build_fhandler): Make path_conv parameter
1266         non-optional.
1267         (dtable::init_std_file_from_handle): Eliminate name parameter.
1268         * dtable.cc (stdio_init): Don't pass bogus name to
1269         init_std_file_from_handle.  The function will figure out the name
1270         itself.
1271         (dtable::init_std_file_from_handle): Eliminate name parameter.  Assume
1272         that we're always called with an appropriate fd.  Pass name as NULL if
1273         we can't simply figure it out from context.
1274         (cygwin_attach_handle_to_fd): Pass path_conv argument to
1275         build_fhandler.
1276         (dtable::build_fhandler): Make path_conv argument mandatory.  Eliminate
1277         specific call to get_device_number.  With unknown device names, set
1278         name from handle context for parsing by path_conv.
1279         (dtable::build_fhandler): Pass path_conv argument to build_fhandler.
1280         * path.h (path_conv::set_isdisk): Set disk device type.
1281         (path_conv::is_device): Don't consider FH_DISK a "device".
1282         * syscalls.cc (_open): Pass path_conv argument by reference.
1283         (stat_worker): Ditto.
1284         (_rename): Use path_conv operators.  Add bounds to DeleteFile/MoveFile
1285         for loop.
1286
1287 Mon Oct 1 14:25:00 2001  Charles Wilson  <cwilson@ece.gatech.edu>
1288
1289         * cygwin.din: export strtoll and strtoull
1290
1291 Sun Sep 30 22:51:41 2001  Christopher Faylor <cgf@cygnus.com>
1292
1293         Add "path.h" include throughout, where needed.  Use new path_conv
1294         methods and operators to simplify testing for directory and attributes,
1295         throughout.
1296         * path.h (path_conv::exists): New method.
1297         (path_conv::has_attribute): Ditto.
1298         (path_conv::isdir): Ditto.
1299         (path_conv::DWORD &): New operator.
1300         (path_conv::int &): Ditto.
1301         * dir.cc (rmdir): Eliminate a goto.
1302         * dtable.cc (dtable::build_fhandler): Accept opt and suffix info for
1303         path_conv.check.  Return fh == NULL on path_conv error.  Pass unit to
1304         set_name as appropriate.
1305         (dtable::reset_unix_path_name): New method.
1306         * dtable.h (dtable): Declare new method.  Reflect arg changes to
1307         build_fhandler.
1308         * fhandler.cc (fhandler_disk_dummy_name): Eliminate.
1309         (fhandler_base::set_name): Expect paths to be NULL.  Build
1310         unix_path_name from win32_path_name when it is a device.
1311         (fhandler_base::reset_unix_path_name): New method.
1312         (fhandler_base::raw_read): Report EISDIR when ERROR_INVALID_FUNCTION
1313         or ERROR_INVALID_PARAMETER and reading a directory.
1314         (fhandler_disk_file::fstat): Don't call stat_dev since we should now
1315         never be calling fhandler_disk_file methods with devices.
1316         (fhandler_base::fhandler_base): Clear {unix,win32}_path_name.
1317         (fhandler_base::~fhandler_base): Always free {unix,win32}_path_name.
1318         (fhandler_disk_file::fhandler_disk_file): Remove set_no_free_names
1319         kludge.
1320         (fhandler_disk_file::open): Ditto.
1321         * fhandler.h (fhandler_base::no_free_names): Eliminate.
1322         (fhandler_base::set_no_free_names): Ditto.
1323         * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Don't set
1324         unix_path_name here.
1325         * path.cc (fchdir): Lock fd table throughout.  Use new
1326         dtable::reset_unix_path_name method to reset path.
1327         * syscalls.cc (stat_worker): Reorganize to always call fstat method.
1328         Pass path_conv method to fhandler_*::open.
1329         (chroot): Elminate a goto.
1330
1331 Sun Sep 30 17:37:43 2001  Christopher Faylor <cgf@cygnus.com>
1332
1333         * environ.cc (winenv): Allocate exact amount of space needed for forced
1334         windows environment variable rather than just using MAX_PATH.
1335
1336 Sun Sep 30 17:10:18 2001  Christopher Faylor <cgf@cygnus.com>
1337
1338         * Makefile.in: Depend on stamp to ensure rebuilding.  Remove stamp file
1339         when we've just built the DLL.
1340
1341 Mon Oct  1 00:34:00 2001  Robert Collins <rbtcollins@hotmail.com>
1342
1343         * thread.cc (pthread_cond_dowait): Hopefully eliminate a race on multiple thread
1344         wakeups.
1345
1346 Sat Sep 29 18:26:00 2001  Robert Collins <rbtcollins@hotmail.com>
1347
1348         * pthread.cc (pthread_cond_timedwait): Deleted - exported from thread.cc.
1349         (pthread_cond_wait): Deleted - exported from thread.cc.
1350         * thread.cc (pthread_cond::BroadCast): Update to use the new syntax for
1351         verifyable_object_isvalid ().
1352         (pthread_cond::Signal): Ditto. Also attempt to fix the lost signal race
1353         with pthread_cond::TimedWait().
1354         (check_valid_pointer): Change definiton to void const *.
1355         (verifyable_object_isvalid): Add new parameter to allow identification of
1356         static initializers, and return a enum rather than magic numbers.
1357         (__pthread_create): Ditto.
1358         (__pthread_cleanup): Ditto.
1359         (__pthread_attr_init): Ditto.
1360         (__pthread_attr_getinheritsched): Ditto.
1361         (__pthread_attr_getschedparam): Ditto.
1362         (__pthread_attr_getschedpolicy): Ditto.
1363         (__pthread_attr_getscope): Ditto.
1364         (__pthread_attr_setdetachstate): Ditto.
1365         (__pthread_attr_getdetachstate): Ditto.
1366         (__pthread_attr_setinheritsched): Ditto.
1367         (__pthread_attr_setschedparam): Ditto.
1368         (__pthread_attr_setschedpolicy): Ditto.
1369         (__pthread_attr_setscope): Ditto.
1370         (__pthread_attr_setstacksize): Ditto.
1371         (__pthread_attr_getstacksize): Ditto.
1372         (__pthread_attr_destroy): Ditto.
1373         (__pthread_join): Ditto.
1374         (__pthread_detach): Ditto.
1375         (__pthread_suspend): Ditto.
1376         (__pthread_continue): Ditto.
1377         (__pthread_getschedparam): Ditto.
1378         (__pthread_getsequence_np): Ditto.
1379         (__pthread_key_create): Ditto.
1380         (__pthread_key_delete): Ditto.
1381         (__pthread_setschedparam): Ditto.
1382         (__pthread_setspecific): Ditto.
1383         (__pthread_getspecific): Ditto.
1384         (__pthread_cond_destroy): Ditto.
1385         (__pthread_cond_init): Ditto.
1386         (__pthread_cond_broadcast): Ditto.
1387         (__pthread_cond_signal): Ditto.
1388         (__pthread_condattr_init): Ditto.
1389         (__pthread_condattr_getpshared): Ditto.
1390         (__pthread_condattr_setpshared): Ditto.
1391         (__pthread_condattr_destroy): Ditto.
1392         (__pthread_kill): Ditto.
1393         (__pthread_mutex_init): Ditto.
1394         (__pthread_mutex_getprioceiling): Ditto.
1395         (__pthread_mutex_lock): Ditto.
1396         (__pthread_mutex_trylock): Ditto.
1397         (__pthread_mutex_unlock): Ditto.
1398         (__pthread_mutex_destroy): Ditto.
1399         (__pthread_mutex_setprioceiling): Ditto.
1400         (__pthread_mutexattr_getprotocol): Ditto.
1401         (__pthread_mutexattr_getpshared): Ditto.
1402         (__pthread_mutexattr_gettype): Ditto.
1403         (__pthread_mutexattr_init): Ditto.
1404         (__pthread_mutexattr_destroy): Ditto.
1405         (__pthread_mutexattr_setprotocol): Ditto.
1406         (__pthread_mutexattr_setprioceiling): Ditto.
1407         (__pthread_mutexattr_getprioceiling): Ditto.
1408         (__pthread_mutexattr_setpshared): Ditto.
1409         (__pthread_mutexattr_settype): Ditto.
1410         (__sem_init): Ditto.
1411         (__sem_destroy): Ditto.
1412         (__sem_wait): Ditto.
1413         (__sem_trywait): Ditto.
1414         (__sem_post): Ditto.
1415         (__pthread_cond_dowait): New function, contains core logic from
1416         __pthread_cond_wait and __pthread_cond_timedwait. Decrement (*cond)->waiting
1417         before reentering the cond access mutex to allow detection of lost signals.
1418         (__pthread_cond_timedwait): Rename to pthread_cond_timedwait, and call
1419         __pthread_cond_dowait after calculating the wait length.
1420         (__pthread_cond_wait): Rename to pthread_cond_wait, and call
1421         __pthread_cond_dowait.
1422         * thread.h: New enum for use with verifyable_object_isvalid.
1423         Remove the extern exporting of __pthread_cond_timedwait and __pthread_cond_wait.
1424
1425 Fri Sep 28 21:18:50 2001  Christopher Faylor <cgf@cygnus.com>
1426
1427         * pipe.cc (fhandler_pipe::fixup_after_fork): New method.
1428         * fhandler.h (fhandler_pipe::fixup_after_fork): Declare new method.
1429
1430 Fri Sep 28 03:23:04 2001  Christopher Faylor <cgf@cygnus.com>
1431
1432         * passwd.cc (read_etc_passwd): Bother with unlocking when not
1433         in cygwin initialization.
1434         * grp.cc (read_etc_group): Ditto.
1435
1436 Fri Sep 28 02:57:03 2001  Christopher Faylor <cgf@cygnus.com>
1437
1438         * passwd.cc (read_etc_passwd): Don't bother with locking when
1439         in cygwin initialization since there is only one thread.
1440         * grp.cc (read_etc_group): Ditto.
1441
1442 Fri Sep 28 01:50:09 2001  Christopher Faylor <cgf@cygnus.com>
1443
1444         * pipe.cc (fhandler_pipe::hit_eof): Return correct value when there is
1445         no EOF event available.
1446
1447 Sat Sep 28 00:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
1448
1449         * mmap.cc (mmap): Move setting the access after evaluating fd.
1450         Remove useless comment.  Explain copy-on-write problem of 9x
1451         more detailed.  Don't set access to FILE_MAP_COPY on 9x only
1452         when anonymous mapping is requested.
1453         (fhandler_disk_file::mmap): Remove useless device check.
1454         Add debug output.
1455
1456 Fri Sep 27 07:35:00 2001  Robert Collins <rbtcollins@hotmail.com>
1457
1458         * Makefile.in: Only stamp winver_stamp on success.
1459
1460 Wed Sep 26 16:02:35 2001  Christopher Faylor <cgf@cygnus.com>
1461
1462         * select.cc (peek_pipe): REALLY only grab mutex when we actually got
1463         something from the pipe.
1464
1465 Tue Sep 25 21:25:00 2001  Robert Collins <rbtcollins@hotmail.com>
1466
1467         * thread.cc (pthread_cond::BroadCast): Use address with verifyable_object_isvalid().
1468         (pthread_cond::Signal): Ditto.
1469         (__pthread_create): Ditto.
1470         (__pthread_cleanup): Ditto.
1471         (__pthread_attr_init): Ditto.
1472         (__pthread_attr_getinheritsched): Ditto.
1473         (__pthread_attr_getschedparam): Ditto.
1474         (__pthread_attr_getschedpolicy): Ditto.
1475         (__pthread_attr_getscope): Ditto.
1476         (__pthread_attr_setdetachstate): Ditto.
1477         (__pthread_attr_getdetachstate): Ditto.
1478         (__pthread_attr_setinheritsched): Ditto.
1479         (__pthread_attr_setschedparam): Ditto.
1480         (__pthread_attr_setschedpolicy): Ditto.
1481         (__pthread_attr_setscope): Ditto.
1482         (__pthread_attr_setstacksize): Ditto.
1483         (__pthread_attr_getstacksize): Ditto.
1484         (__pthread_attr_destroy): Ditto.
1485         (__pthread_join): Ditto.
1486         (__pthread_detach): Ditto.
1487         (__pthread_suspend): Ditto.
1488         (__pthread_continue): Ditto.
1489         (__pthread_getschedparam): Ditto.
1490         (__pthread_getsequence_np): Ditto.
1491         (__pthread_key_create): Ditto.
1492         (__pthread_key_delete): Ditto.
1493         (__pthread_setschedparam): Ditto.
1494         (__pthread_setspecific): Ditto.
1495         (__pthread_getspecific): Ditto.
1496         (__pthread_cond_destroy): Ditto.
1497         (__pthread_cond_init): Ditto.
1498         (__pthread_cond_broadcast): Ditto.
1499         (__pthread_cond_signal): Ditto.
1500         (__pthread_cond_timedwait): Ditto.
1501         (__pthread_cond_wait): Ditto.
1502         (__pthread_condattr_init): Ditto.
1503         (__pthread_condattr_getpshared): Ditto.
1504         (__pthread_condattr_setpshared): Ditto.
1505         (__pthread_condattr_destroy): Ditto.
1506         (__pthread_kill): Ditto.
1507         (__pthread_mutex_init): Ditto.
1508         (__pthread_mutex_getprioceiling): Ditto.
1509         (__pthread_mutex_lock): Ditto.
1510         (__pthread_mutex_trylock): Ditto.
1511         (__pthread_mutex_unlock): Ditto.
1512         (__pthread_mutex_destroy): Ditto.
1513         (__pthread_mutex_setprioceiling): Ditto.
1514         (__pthread_mutexattr_getprotocol): Ditto.
1515         (__pthread_mutexattr_getpshared): Ditto.
1516         (__pthread_mutexattr_gettype): Ditto.
1517         (__pthread_mutexattr_init): Ditto.
1518         (__pthread_mutexattr_destroy): Ditto.
1519         (__pthread_mutexattr_setprotocol): Ditto.
1520         (__pthread_mutexattr_setprioceiling): Ditto.
1521         (__pthread_mutexattr_getprioceiling): Ditto.
1522         (__pthread_mutexattr_setpshared): Ditto.
1523         (__pthread_mutexattr_settype): Ditto.
1524         (__sem_init): Ditto.
1525         (__sem_destroy): Ditto.
1526         (__sem_wait): Ditto.
1527         (__sem_trywait): Ditto.
1528         (__sem_post): Ditto.
1529         (verifyable_object_isvalid): Recieve a pointer to a pointer for verification.
1530         (__pthread_mutexattr_getprotocol): Fix typo in magic number.
1531         (__pthread_mutexattr_getpshared): Ditto.
1532         (__pthread_mutexattr_gettype): Ditto.
1533         * thread.h (verifyable_object_isvalid): Change prototype to recieve a pointer to a
1534         pointer for verification.
1535         * include/pthread.h: Fix typo for __cleanup_routine_type typedef. (Contrib from Net).
1536
1537 Tue Sep 25 02:09:42 2001  Christopher Faylor <cgf@redhat.com>
1538
1539         * select.cc (fhandler_tty_common::ready_for_read): Rewrite to correctly
1540         call peek_pipe.
1541
1542 Mon Sep 24 18:46:39 2001  Christopher Faylor <cgf@cygnus.com>
1543
1544         * select.cc (peek_pipe): Only grab mutex when we actually got something
1545         from the pipe.
1546
1547 Mon Sep 24 17:41:03 2001  Christopher Faylor <cgf@redhat.com>
1548
1549         * fhandler.h (fhandler_pipe::hit_eof): New method.
1550         (writepipe_exists): New class element.
1551         (orig_pid): Ditto.
1552         (id): Ditto.
1553         (is_slow): Eliminate.
1554         * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance on
1555         writepipe_exists, if it exists.
1556         (fhandler_pipe::hit_eof): New method, modelled after tty.
1557         (fhandler_pipe::dup): Duplicate writepipe_exists, if it exists.
1558         (make_pipe): Set up a dummy event for pipes on windows 9x.  The
1559         nonexistence of this event means that the write side of the
1560         pipe has closed.
1561         (_dup): Move to syscalls.cc
1562         (_dup2): Ditto.
1563
1564         * dtable.cc (dtable::build_fhandler): Fill out set_names here, if
1565         appropriate.
1566         * syscalls.cc (_open): Call set_names in build_fhandler.
1567
1568 Sun Sep 23 16:55:00 2001  Corinna Vinschen <corinna@vinschen.de>
1569
1570         * syscalls.cc (_open): Set name in fhandler object after successful
1571         creation.
1572         (stat_dev): Set device type to block device in FH_FLOPPY case.
1573
1574 Sun Sep 23 11:15:00 2001  Corinna Vinschen <corinna@vinschen.de>
1575
1576         * dtable.cc (dtable::build_fhandler): Initialize unit when using
1577         optional path_conv argument.
1578
1579 Sat Sep 22 17:33:45 2001  Christopher Faylor <cgf@cygnus.com>
1580                           Corinna Vinschen <corinna@vinschen.de>
1581
1582         * dtable.cc (dtable::build_fhandler): Accept an optional path_conv
1583         argument.  If available, use this to calculate path name and device
1584         number.
1585         * dtable.h (dtable): Reflect above change.
1586         * fhandler.h (fhandler_base): Declare virtual method which accepts
1587         path_conv rather than path string as first argument.
1588         * fhandler.cc (fhandler_base::open): Define above new method.
1589         * syscalls.cc (_open): Set aside a path_conv variable for use in
1590         build_fhandler and subsequent call to open.
1591
1592 Sat Sep 22 12:44:57 2001  Christopher Faylor <cgf@cygnus.com>
1593
1594         * exceptions.cc (setup_handler): Always relinquish lock after we've
1595         interrupted.
1596         * fhandler.cc: Move pipe methods to pipe.cc.
1597         * fhandler.h (fhandler_pipe): Add new methods.
1598         * fork.cc (sync_with_parent): Make error messages more informative.
1599         * pipe.cc (fhandler_pipe::fhandler_pipe): Move here from fhandler.cc.
1600         (fhandler_pipe::lseek): Ditto.
1601         (fhandler_pipe::set_close_on_exec): New method.
1602         (fhandler_pipe::read): Ditto.
1603         (fhandler_pipe::close): Ditto.
1604         (fhandler_pipe::dup): Ditto.
1605         (make_pipe): Create the guard mutex on the read side of the pipe.
1606         * select.cc (peek_pipe): Use guard_mutex to discover if we have the
1607         right to read on this pipe.
1608         (fhandler_pipe::readh_for_read): Pass the read pipe guard mutex to
1609         peek_pipe.
1610         * syscalls.cc (_read): Always detect signal catchers, for now.
1611
1612         * debug.cc (makethread): Eliminate hack to make thread inheritable.
1613         * sigproc.cc (subproc_init): Don't use hack to make thread inheritable.
1614
1615 Thu Sep 20 16:48:44 2001  Christopher Faylor <cgf@cygnus.com>
1616
1617         * fhandler.cc (fhandler_base::set_inheritance): Just use
1618         DUPLICATE_CLOSE_SOURCE to change inheritance.  Eliminate all other
1619         logic dealing with closed handles.
1620         * fhandler.h (fhandler_base::set_inheritance): Reflect above change.
1621         * fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Ditto.
1622
1623 Thu Sep 20 13:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
1624
1625         * fhandler_socket.cc (fhandler_socket::fixup_after_exec): Close
1626         socket only when not using Winsock2.
1627
1628 Thu Sep 20 13:20:00 2001  Corinna Vinschen <corinna@vinschen.de>
1629
1630         * fhandler.h (fhandler_socket::fixup_after_exec): Remove inline
1631         implementation.
1632         (fhandler_dev_raw::fixup_after_exec): Ditto.
1633         * fhandler_raw.cc (fhandler_dev_raw::fixup_after_fork): Don't
1634         duplicate buffer on fork to avoid memory leak.
1635         (fhandler_dev_raw::fixup_after_exec): New implementation equal to
1636         former fixup_after_fork() implementation.
1637         * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Do
1638         nothing when not using Winsock2.
1639         (fhandler_socket::fixup_after_exec): New implementation.
1640         (fhandler_socket::set_close_on_exec): Never call set_inheritance().
1641
1642 Thu Sep 20  9:55:00 2001  Corinna Vinschen <corinna@vinschen.de>
1643
1644         * fhandler.cc (fhandler_base::set_inheritance): If available,
1645         use SetHandleInformation() to set inheritance.
1646         * wincap.cc: Set flag has_set_handle_information_on_console_handles
1647         appropriately.
1648         * wincap.h: Add flag has_set_handle_information_on_console_handles.
1649
1650 Wed Sep 19 12:24:09 2001  Christopher Faylor <cgf@cygnus.com>
1651
1652         * lib/getopt.c (__progname): Don't declare if not compiling for cygwin.
1653
1654 Wed Sep 19 18:07:00 2001  Corinna Vinschen <corinna@vinschen.de>
1655
1656         * lib/getopt.c (getopt_long): Avoid compiler warning.
1657
1658 Wed Sep 19 11:52:42 2001  Christopher Faylor <cgf@cygnus.com>
1659
1660         * lib/getopt.c: Use __progname==__argv[0] when not compiling for cygwin.
1661
1662         * scandir.cc (scandir): Use correct default when compar == NULL.
1663
1664 Wed Sep 19 17:49:00 2001  Corinna Vinschen <corinna@vinschen.de>
1665
1666         * fhandler_socket.cc (fhandler_socket::fhandler_socket): Revert
1667         memory allocation to use cmalloc again.
1668
1669 Tue Sep 18 21:04:26 2001  Christopher Faylor <cgf@cygnus.com>
1670
1671         * cygwin.din (__argv): Export.
1672         (__argc): Ditto.
1673         (__progname): Ditto.
1674         * include/getopt.h (getopt_long): constify arguments.
1675         * lib/getopt.c: Import new file from NetBSD.
1676
1677 Tue Sep 18 18:21:00 2001  Corinna Vinschen <corinna@vinschen.de>
1678
1679         * mmap.cc (mmap): Don't reuse anonymous memory in MAP_FIXED case.
1680
1681 Mon Sep 17 17:29:25 2001  Christopher Faylor <cgf@cygnus.com>
1682
1683         * include/io.h: Add access declaration.
1684
1685 Mon Sep 17 14:04:27 2001  Christopher Faylor <cgf@cygnus.com>
1686
1687         * syscalls.cc (rmdir): Set cwd to some other location if attempting to
1688         rmdir current working directory.
1689
1690 Sun Sep 16 23:04:31 2001  Christopher Faylor <cgf@cygnus.com>
1691
1692         * dtable.h (not_open): Assure inline.
1693         * fhandler.h (operator []): Make const.
1694
1695 Sun Sep 16 23:02:57 2001  Robert Collins <rbtcollins@hotmail.com>
1696
1697         * sync.cc (muto::~muto): Fix typo which stopped muto event handle from
1698         ever being closed.
1699
1700 2001-09-16  Egor Duda  <deo@logos-m.ru>
1701
1702         * path.cc (symlink): Check arguments for validity.
1703         (getcwd): Ditto.
1704         * syscalls.cc (ftruncate): Ditto.
1705         * times.cc (times): Ditto.
1706         * uname.cc (uname): Ditto.
1707
1708 Sat Sep 15 22:54:49 2001  Christopher Faylor <cgf@cygnus.com>
1709
1710         * net.cc (dup_servent_ptr): Detect old Windows 95 misaligned structure
1711         and realign appropriately.
1712
1713 Sat Sep 15 00:28:40 2001  Christopher Faylor <cgf@cygnus.com>
1714
1715         * Makefile.in: Generate libcygwin.a during the link pass rather than as
1716         a separate dlltool step.
1717         * dcrt0.cc (_dll_crt0): pppid_handle could be NULL.  Don't close it if
1718         so.
1719
1720 Fri Sep 14 20:48:18 2001  Christopher Faylor <cgf@cygnus.com>
1721
1722         * dcrt0.cc (dll_crt0_1): Create vfork main storage here so that it can
1723         be queried in waitsig later.
1724         * sigproc.cc (wait_sig): Don't deliver a signal if in a vfork.
1725         * sigproc.h (sigframe::init): New method.
1726         (sigframe): Use init.
1727         * perthread.h: Declare main_vfork.
1728         * fork.cc (vfork): Deliver all signals on parent return from vfork.
1729
1730 Fri Sep 14 10:21:00 2001  Corinna Vinschen <corinna@vinschen.de>
1731
1732         * dcrt0.cc (_dll_crt0()): Don't call wincap.init() here.
1733
1734 Fri Sep 14 00:37:54 2001  Christopher Faylor <cgf@cygnus.com>
1735
1736         * fork.cc (vfork): Avoid recursive vforks.
1737
1738 Fri Sep 14 00:18:52 2001  Christopher Faylor <cgf@cygnus.com>
1739
1740         * fhandler.h (fhandler_pipe::is_slow): Return true only if pipes are
1741         reliable (i.e., not Win9x).
1742         * wincap.cc: Make statics NO_COPY to avoid fork overhead.
1743
1744 Thu Sep 13 23:01:00 2001  Christopher Faylor <cgf@cygnus.com>
1745
1746         * grp.cc (read_etc_group): Just reuse group_buf storage for subsequent
1747         reread of /etc/group.
1748         * passwd.cc (read_etc_passwd): Just reuse passwd_buf storage for
1749         subsequent reread of /etc/passwd.
1750
1751 Thu Sep 13 20:46:05 2001  Christopher Faylor <cgf@cygnus.com>
1752
1753         * cygheap.cc (dup_now): New function.
1754         (cygheap_setup_for_child): Accept new argument controlling whether to
1755         delay copying of cygheap to shared memory region.
1756         (cygheap_setup_for_child_cleanup): Accept new arguments controlling
1757         whether to copy cygheap at this point.
1758         * cygheap.h: Reflect above changes.
1759         * fork.cc (fork_parent): Break copying of cygheap into two parts when
1760         fork_fixup is required so that the child can see the parent's changes.
1761         (vfork): Do stack cleanup prior to forcing a fork error.
1762         * spawn.cc (spawn_guts): Ditto.
1763
1764 Thu Sep 13 17:14:59 2001  Christopher Faylor <cgf@cygnus.com>
1765
1766         * cygheap.cc (ccalloc): Pass correct length to creturn so that
1767         cygheap_max is correctly calculated.
1768
1769 Wed Sep 12 21:06:38 2001  Christopher Faylor <cgf@cygnus.com>
1770
1771         * sync.cc (muto::acquire): Fix while/if typo.
1772
1773 Wed Sep 12 23:06:00 2001  Corinna Vinschen <corinna@vinschen.de>
1774
1775         * wincap.cc (wincapc::init): Simplify W2K/XP case.
1776
1777 Wed Sep 12 23:02:00 2001  Corinna Vinschen <corinna@vinschen.de>
1778
1779         * wincap.cc (wincapc::init): Set os name to "NT" on XP, too.
1780
1781 Wed Sep 12 19:00:00 2001  Corinna Vinschen <corinna@vinschen.de>
1782
1783         * Makefile.in: Build wincap.o.
1784         * wincap.cc: New file.
1785         * wincap.h: Ditto.
1786         * autoload.cc: Add dynamic load statement for `CreateHardLinkA'.
1787         * dcrt0.cc (os_being_run): Eliminated.
1788         (osname): Ditto.
1789         (iswinnt): Ditto.
1790         (set_os_type): Ditto.
1791         (dll_crt0_1): Call wincap.init() instead of set_os_type().
1792         (_dll_crt0): Ditto.
1793         * environ.cc (set_chunksize): New function.
1794         (parse_thing): `forkchunk' setting now invokes function `set_chunksize'.
1795         * fork.cc (chunksize): Eliminated. Moved to be member of wincap.
1796         * host_dependent.h: Removed.
1797         * syscalls.cc (_link): Try using `CreateHardLinkA' first, if available.
1798         * cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc,
1799         environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc,
1800         fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h,
1801         security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc,
1802         times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap
1803         capability check throughout.
1804         * winsup.h: Include wincap.h. Eliminate extern declarations of
1805         `os_being_run' and `iswinnt'. Eliminate `os_type" definition.
1806         * include/cygwin/version.h: Bump version to 1.3.4.
1807
1808 Wed Sep 12 01:03:36 2001  Christopher Faylor <cgf@cygnus.com>
1809
1810         * exceptions.cc (call_signal_handler_now): Add additional guard against
1811         inappropriately calling signal handler.
1812         * syscalls.cc (_read): Reset errno if not exiting due to signal.
1813
1814 Wed Sep 12 13:03:00 2001  Robert Collins <rbtcollins@hotmail.com>
1815
1816         * autoload.cc (LoadDLLfuncEx): Auto load TryEnterCriticalSection - it's
1817         an NT only call.
1818         * thread.cc (pthread_cond::TimedWait): Use critical sections for NT.
1819         (pthread_cond::fixup_after_fork): Don't detect bad apps.
1820         (pthread_mutex::pthread_mutex): Use critical sections for NT.
1821         (pthread_mutex::~pthread_mutex): Ditto.
1822         (pthread_mutex::Lock): Ditto.
1823         (pthread_mutex::TryLock): Ditto.
1824         (pthread_mutex::UnLock): Ditto.
1825         (pthread_mutex::fixup_after_fork): Ditto.  Also do not detect bad apps.
1826         (__pthread_mutex_trylock): Move WIN32 specific test into the class
1827         method.
1828         (__pthread_mutex_destroy): Prevent dereferencing passed pointer without
1829         valid address.
1830         * thread.h (pthread_mutex): Use critical sections for NT.
1831
1832 Tue Sep 11 21:55:37 2001  Christopher Faylor <cgf@cygnus.com>
1833
1834         * sigproc.h (sigframe::unregister): Return true/false whether this
1835         frame is capable of responding to signals.
1836         * exceptions.cc (sigframe::call_signal_handler): Don't call signal
1837         handler if it is not armed for this thread.
1838
1839 Tue Sep 11 11:23:10 2001  Christopher Faylor <cgf@cygnus.com>
1840
1841         * cygwin.din: Remove cygwin_getshared.
1842         * shared.cc: Ditto.
1843         * include/cygwin/version.h: Bump API minor number.
1844
1845 Tue Sep 11 11:14:11 2001  Dmitry Timoshkov  <dmitry@baikal.ru>
1846
1847         * dtable.cc (dtable::build_fhandler): Fix incorrect test for socket.
1848
1849 Tue Sep 11 21:22:00 2001  Robert Collins <rbtcollins@hotmail.com>
1850
1851         * thread.cc (pthread_cond::~pthread_cond): Fix incorrect use of
1852         InterlockExchangePointer.
1853         (pthread_mutex::~pthread_mutex): Ditto.
1854         (semaphore::~semaphore): Ditto.
1855
1856 Tue Sep 11 18:15:00 2001  Robert Collins <rbtcollins@hotmail.com>
1857
1858         * dcrt0.cc (cygwin_finished_initializing): Copy _mtinterf on fork.
1859         * fork.cc (fork_child): Fixup thread-related structures after fork.
1860         * thread.cc (MTinterface::Init): Initialise the new mutex, condition
1861         and semaphore lists.
1862         (MTinterface::fixup_after_fork): Iterate through each list and fixup
1863         the objects.
1864         (pthread_cond::pthread_cond): Add this to the condition list.
1865         (pthread_cond::~pthread_cond): Remove this from the condition list.
1866         (pthread_cond::fixup_after_fork): Recreate as best we can the pre-fork
1867         state.
1868         (pthread_mutex::pthread_mutex): Add this to the mutex list.
1869         (pthread_mutex::~pthread_mutex): Remove this from the mutex list.
1870         (pthread_mutex::fixup_after_fork): Recreate as best we can the pre-fork
1871         state.
1872         (semaphore::semaphore): Store the initial value, and add this to the
1873         semaphore list.
1874         (semaphore::~semaphore): Remove this from the semaphore list.
1875         (semaphore::Post): Increment the current semaphore value.
1876         (semaphore::TryWait): Decrement the current semaphore value.
1877         (semaphore::Wait): Ditto.
1878         (semaphore::fixup_after_fork): Recreate the pre-fork state as best we
1879         can.
1880         * thread.h (pthread_mutex): New members to allow fixup_after_fork.
1881         (pthread_cond): Ditto.
1882         (semaphore): Ditto.
1883         (MTinterface): New list heads for tracking conds and semaphores.
1884
1885 Sun Sep  9 22:11:27 2001  Christopher Faylor <cgf@cygnus.com>
1886
1887         * dtable.cc (dtable::fixup_after_fork): Use SetStdHandle appropriately
1888         on inherited fds.
1889
1890 Sun Sep  9 20:09:11 2001  Christopher Faylor <cgf@cygnus.com>
1891
1892         * sigproc.cc (NZOMBIES): Reduce substantially to minimize memory use.
1893
1894 Mon Sep 10 08:28:00 2001  Robert Collins <rbtcollins@hotmail.com>
1895
1896         * thread.h (MT_Interface): Remove pshared mutex array.  Add a
1897         threadsafe list for mutex tracking (for fixup after fork).
1898         * thread.cc (MTInterface::Init): Remove pshared mutex array.
1899         (pthread_mutex::pthread_mutex): Remove pshared mutex functionality.
1900         Fail with EINVAL on attempts to use pshared functionality.
1901         (__pthread_mutex_getpshared): Remove.
1902         (__pthread_cond_timedwait): Remove pshared mutex functionality.
1903         (__pthread_cond_wait): Ditto.
1904         (__pthread_mutex_init): Ditto.
1905         (__pthread_mutex_getprioceiling): Ditto.
1906         (__pthread_mutex_lock): Ditto.
1907         (__pthread_mutex_trylock): Ditto.
1908         (__pthread_mutex_unlock): Ditto.
1909         (__pthread_mutex_destroy): Ditto.
1910         (__pthread_mutex_setprioceiling): Ditto.
1911         (__pthread_mutexattr_setpshared): Ditto.
1912
1913 Sun Sep 9 23:09:00 2001 Corinna Vinschen <corinna@vinschen.de>
1914
1915         * pwdgrp.h (pwdgrp_check::set_last_modified): Call GetFileTime()
1916         instead of GetFileInformationByHandle().
1917
1918 Sun Sep  9 15:59:53 2001  Christopher Faylor <cgf@cygnus.com>
1919
1920         * heap.h (inheap): Rewrite macro to accommodate removal of brk macros
1921         below.
1922
1923 Sun Sep  9 15:02:44 2001  Christopher Faylor <cgf@cygnus.com>
1924
1925         * cygheap.cc (cygheap_fixup_in_child): Clear cygheap->base so that heap
1926         is not forced to start at the same place in execed process.
1927         * heap.cc: Remove brk* macros for clarity throughout.
1928         * heap.h: Ditto.
1929         * shared.cc (shared_info::initialize): Move heap_chunk test into
1930         heap_chunk_size().
1931         (heap_chunk_size): Check for chunk size here.  Don't go to registry if
1932         heap_chunk_in_mb is already set.
1933
1934         * smallprint.c (console_printf): Add Windows 95 concessions.
1935
1936 Sun Sep  9 13:01:06 2001  Christopher Faylor <cgf@cygnus.com>
1937
1938         * child_info.h (PROC_MAGIC): Bump magic number.
1939
1940 Sun Sep  9 18:36:00 2001  Corinna Vinschen <corinna@vinschen.de>
1941                           Christopher Faylor <cgf@cygnus.com>
1942
1943         * cygheap.cc (init_cygheap::etc_changed): New method to signal
1944         a change in /etc.
1945         * cygheap.h (struct init_cygheap): Add member `etc_changed_h'
1946         and method `etc_changed'.
1947         * grp.cc (enum grp_state): Eliminate.
1948         (class grp_check): Ditto.
1949         (group_state): Define as `class pwdgrp_check'.
1950         (parse_grp): Remeber path and modification time of /etc/group file.
1951         * passwd.cc (enum_pwd_state): Eliminate.
1952         (class pwd_check): Ditto.
1953         (passwd_state): Define as `class pwdgrp_check'.
1954         (read_etc_passwd): Remember path and modification time of /etc/passwd
1955         file.
1956         * pwdgrp.h: New file.
1957         (enum pwdgrp_state): Substitutes `pwd_state' and `grp_state'.
1958         (class pwdgrp_check): Substitutes `pwd_check' and `grp_check'.
1959
1960 Sun Sep  9 14:31:00 2001  Corinna Vinschen <corinna@vinschen.de>
1961
1962         * include/cygwin/version.h: Bump API minor version to 45 according
1963         to adding the gamm*_r functions.
1964
1965 Sat Sep  8 23:32:18 2001  Christopher Faylor <cgf@cygnus.com>
1966
1967         * fork.cc (fork_parent): Stop malloc activity while fork is in control
1968         of the heap.
1969         * sigproc.cc (NZOMBIES): Rename from ZOMBIEMAX for clarity.
1970         (zombies): Revert to original behavior.  Allocating zombie array
1971         resulted in performance hit.
1972         * winsup.h: Declare malloc lock routines.
1973
1974 Fri Sep  7 21:35:35 2001  Christopher Faylor <cgf@cygnus.com>
1975
1976         * cygwin.din: Add gamm*_r function exports.
1977
1978 Fri Sep  7 17:11:11 2001  Christopher Faylor <cgf@cygnus.com>
1979
1980         * cygheap.h (init_cygheap): Move heap pointers here.
1981         * include/sys/cygwin.h (perprocess): Remove heap pointers.
1982         * dcrt0.cc (__cygwin_user_data): Reflect obsolete perprocess stuff.
1983         (_dll_crt0): Don't initialize heap pointers.
1984         (cygwin_dll_init): Ditto.
1985         (release_upto): Use heap pointers from cygheap.
1986         * heap.h: Ditto.
1987         * fork.cc (fork_parent): Ditto.  Don't set heap pointers in ch.
1988         (fork_child): Remove obsolete sigproc_fixup_after_fork.
1989         * shared.cc (memory_init): Reorganize so that cygheap initialization is
1990         called prior to regular heap since regular heap uses cygheap now.
1991         * sigproc.cc (proc_subproc): Eliminate zombies allocation.
1992         (sigproc_init): Move zombies alloation here.  Don't free up array on
1993         fork, just reuse it.
1994         (sigproc_fixup_after_fork): Eliminate.
1995         * sigproc.h: Ditto.
1996         * include/cygwin/version.h: Reflect change to perprocess structure.
1997
1998 Fri Sep  7 10:53:34 2001  Jason Tishler <jason@tishler.net>
1999
2000         * poll.cc (poll): Change implementation to only call select() when no
2001         invalid file descriptors are specified.
2002
2003 Fri Sep  7 10:27:00 2001  Corinna Vinschen <corinna@vinschen.de>
2004
2005         * include/limits.h: Define PIPE_BUF.
2006         * syscalls.cc (fpathconf): Use PIPE_BUF instead of numerical constant.
2007         (pathconf): Ditto.
2008
2009 Thu Sep  6 20:04:05 2001  Christopher Faylor <cgf@cygnus.com>
2010
2011         * fhandler_socket.cc (fhandler_socket::fhandler_socket): Ensure that
2012         prot_info_ptr is zeroed for later use.
2013
2014 Thu Sep  6 14:03:49 2001  Christopher Faylor <cgf@cygnus.com>
2015
2016         * cygheap.cc (cygheap_fixup_in_child): Don't consider a NULL bucket as
2017         a candidate for deletion.  It is actually the end of a linked list
2018         chain.
2019
2020         * exceptions.cc (open_stackdumpfile): Default to "unknown" program name
2021         if myself->progname hasn't been filled out yet.
2022
2023 Thu Sep  6 01:16:44 2001  Christopher Faylor <cgf@cygnus.com>
2024
2025         Move appropriate variables to NO_COPY segment, throughout.
2026
2027 Thu Sep  6 00:40:35 2001  Christopher Faylor <cgf@cygnus.com>
2028
2029         Remove initialization of static or global values to zero, throughout.
2030         This just needlessly grows the size of the DLL.
2031         * tty.cc (tty::alive): Make inuse handle non-inheriting on open, just
2032         for thread safety.
2033
2034 Wed Sep  5 23:36:03 2001  Christopher Faylor <cgf@cygnus.com>
2035
2036         * cygheap.h (init_cygheap): Move bucket array here from cygheap.cc.
2037         * cygheap.cc: Throughout use bucket array from cygheap.
2038
2039         * sigproc.cc (proc_subproc): Dynamically allocate zombie buffer to save
2040         DLL space.
2041         (sigproc_fixup_after_fork): Free zombie array after a fork.
2042         * sigproc.h (sigproc_fixup_after_fork): Declare.
2043
2044 2001-09-06  Egor Duda  <deo@logos-m.ru>
2045
2046         * dir.cc (mkdir): Expand buffer for security descriptor to 4K to avoid
2047         stack corruption.
2048         * fhandler.cc (fhandler_base::open): Ditto.
2049         * path.cc (symlink): Ditto.
2050
2051 Wed Sep  5 21:35:00 2001  Corinna Vinschen <corinna@vinschen.de>
2052
2053         * winver.rc: Change copyright to include 2001.
2054
2055 Wed Sep  5 12:12:00 2001  Corinna Vinschen <corinna@vinschen.de>
2056
2057         * fhandler_floppy.cc (fhandler_floppy::lseek): Remove iswinnt check.
2058
2059 Wed Sep  5 11:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
2060
2061         * fhandler_socket.cc (fhandler_socket::close): Change 2MSL value
2062         according to MSDN.
2063
2064 Wed Sep  5 10:14:00 2001  Corinna Vinschen <corinna@vinschen.de>
2065
2066         * net.cc (cygwin_connect): Add WSAEALREADY and WSAEINVAL handling
2067         for non-blocking sockets.
2068
2069 Tue Sep  4 22:42:13 2001  Christopher Faylor <cgf@cygnus.com>
2070
2071         * exceptions.cc (ctrl_c_handler): Only send SIGINT when we have a
2072         controlling terminal and we are the head of the process group.
2073
2074 Tue Sep  4 16:48:14 2001  Christopher Faylor <cgf@cygnus.com>
2075
2076         * thread.cc (InterlockedExchangePointer): Don't define if it already
2077         exists.
2078
2079 Tue Sep  4 22:14:00 2001  Corinna Vinschen <corinna@vinschen.de>
2080
2081         * uname.cc (uname): Eliminate os specific retrieving of x86
2082         processor type.
2083
2084 2001-09-04  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
2085
2086         * fhandler_console.cc (fhandler_console::char_command): Save the cursor
2087         position relative to the top of the window.
2088         * fhandler_cc (fhandler_console::write): Ditto.
2089
2090 Mon Sep  3 21:06:00 2001  Corinna Vinschen <corinna@vinschen.de>
2091
2092         * dir.cc (opendir): Write version information to __d_dirent->d_version.
2093
2094 Mon Sep  3 18:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
2095
2096         * cygwin.din: Add `dirfd'.
2097         * dir.cc (dirfd): New function.
2098         (opendir): Open a directory file descriptor and save it in
2099         __d_dirent->d_fd.
2100         (closedir): Close directory file descriptor.
2101         * include/cygwin/version.h: Bump API minor version to 44.
2102
2103 Sun Sep  2 22:09:31 2001  Christopher Faylor <cgf@cygnus.com>
2104
2105         * child_info.h: Modify magic number.
2106         * dcrt0.cc (_cygwin_testing): Define.
2107         (_dll_crt0): Set _cygwin_testing if CYGWIN_TESTING environment variable
2108         exists.  Don't issue "conflicting versions" error if _cygwin_testing is
2109         true.
2110         * shared.cc (shared_name): Use _cygwin_testing global rather than
2111         testing the environment.
2112         * syscalls.cc (_write): Remove debugging info.
2113
2114 Sat Sep  1 01:37:13 2001  Christopher Faylor <cgf@cygnus.com>
2115
2116         * tty.cc (tty::create_inuse): Eliminate unneeded argument.
2117         * tty.h: Reflect above change.
2118         * fhandler_tty.cc: Reflect argument reduction in tty::create_inuse,
2119         throughout.  Always make inuse inheritable.
2120
2121 Sat Sep  1 01:10:07 2001  Christopher Faylor <cgf@cygnus.com>
2122
2123         * debug.cc (mark_closed): Rename from debug_mark_closed and make
2124         static.
2125         (setclexec_pid): New function for marking saved handle as
2126         close-on-exec.
2127         (delete_handle): New function.
2128         (debug_fixup_after_fork): New function.
2129         * debug.h: Declare new functions, remove obsolete ones.
2130         * fork.cc (debug_fixup_after_fork): Call to cleanup close-on-exec
2131         handles.
2132
2133         * fhandler.cc (fhandler_disk_file::close): Minor reorg.
2134         (fhandler_base::set_inheritance): Set flag appropriately for debugging
2135         when close-on-exec so forked process can delete closed handles.
2136         * tty.h (open_output_mutex): Eliminate unneeded argument.
2137         (open_input_mutex): Ditto.
2138         * fhandler_tty.cc (fhandler_tty_slave::open): reflect open_*_mutex
2139         argument changes.
2140         * fhandler.h (fhandler_socket): Make saw_shutdown_* functions type
2141         bool.
2142         * tty.cc (tty::get_event): Eliminate unneeded argument.
2143         (tty::common_init): Reflect change to get_event.  Events should always
2144         be inherited.
2145
2146 Fri Aug 31 21:39:00 2001  Corinna Vinschen <corinna@vinschen.de>
2147
2148         * security.cc (create_token): Change initialization of `exp' to comply
2149         with new LARGE_INTEGER definition in winnt.h.
2150
2151 Fri Aug 31 13:58:51 2001  Christopher Faylor <cgf@cygnus.com>
2152
2153         * cygwin.sc: Revert to previous NO_COPY behavior.
2154         * winsup.h: Ditto.
2155         * sigproc.cc: Ditto.
2156         * autoload.cc: Ditto.
2157
2158 Fri Aug 31 00:56:26 2001  Christopher Faylor <cgf@cygnus.com>
2159
2160         * cygwin.sc: New file -- linker script for building cygwin DLL.
2161         * Makefile.in: Use linker script to control location of cygheap.
2162         * cygheap.cc (buckets): Make static.
2163         (init_cheap): Remove special iswinnt handling.  Allocate cygheap at a
2164         fixed location.  Display more info when allocation fails.
2165         (cygheap_fixup_in_child): Try harder to move cygheap to correct
2166         location.  Display more info when allocation fails.
2167         * fhandler.h (fhandler_socket): Add macros for tracking socket shutdown
2168         state.
2169         * net.cc (cygwin_shutdown): Set appropriate shutdown value for future
2170         use.
2171         * select.cc (select_stuff::cleanup): New method.
2172         (cygwin_select): Call cleanup explicitly to avoid a race.
2173         (select_stuff:~select_stuff): Call cleanup chain via cleanup method.
2174         (fhandler_socket::select_read): Set *_ready when shutdown has been
2175         called on the socket.
2176         (fhandler_socket::select_write): Ditto.
2177         (fhandler_socket::select_except): Ditto.
2178
2179         * winsup.h: Move NO_COPY to "COMMON" section.
2180         * autoload.cc (wsock_started): Avoid initializing NO_COPY value.
2181         * sigproc.cc: Remove initialization from NO_COPY variables.
2182         (sigproc_init): Initialize sig_loop_wait here, rather than via
2183         initialization.
2184         (subproc_init): Initialize proc_loop_wait here, rather than via
2185         initialization.
2186
2187 Thu Aug 30 10:19:00 2001  Christopher Faylor <cgf@cygnus.com>
2188
2189         * select.cc (select_read): Add setting read_ready flag.
2190         (select_write): Add setting write_ready flag.
2191
2192 Wed Aug 29 00:40:42 2001  Christopher Faylor <cgf@cygnus.com>
2193
2194         * path.cc (path_conv::check): Avoid splitting off leading '/' in path
2195         component when building a symlink.
2196
2197 Wed Aug 29  0:45:00 2001  Corinna Vinschen <corinna@vinschen.de>
2198
2199         * resource.cc (getrlimit): Return actual values on RLIMIT_STACK.
2200
2201 Tue Aug 28 16:37:17 2001  Christopher Faylor <cgf@cygnus.com>
2202
2203         * dir.cc (rmdir): Report ENOENT when file doesn't exist rather than
2204         ENOTDIR.
2205
2206 Mon Aug 27 11:58:19 2001  Christopher Faylor <cgf@cygnus.com>
2207
2208         * select.cc (cygwin_select): Ensure that arguments are zeroed on
2209         timeout.
2210         (select_stuff::wait): Ditto.
2211
2212 2001-08-24  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
2213
2214         * syscalls.cc (check_tty_fds): New function.  Check whether there is a
2215         fd referring to pty slave.
2216         (setsid): Don't detach console if the process has a pty slave.
2217
2218 Fri Aug 24  8:54:00 2001  Corinna Vinschen <corinna@vinschen.de>
2219
2220         * net.cc (free_addr_list): Add define for symmetry.
2221         (free_hostent_ptr): Use free_addr_list to free h_addr_list element.
2222
2223 Thu Aug 23 16:00:09 2001  Jason Tishler <jason@tishler.net>
2224
2225         * net.cc (dup_addr_list): New static function.
2226         (dup_hostent_ptr): Use dup_addr_list instead of dup_char_list in order
2227         to handle embedded null characters.
2228
2229 Wed Aug 22 22:23:14 2001  Christopher Faylor <cgf@cygnus.com>
2230
2231         * dtable.cc (dtable::dup2): Allow extension of fd table by dup2.
2232         * syscalls.cc: Minor code cleanup.
2233         (fpathconf): Check for bad fd before doing anything else.
2234         * termios.cc (tcsetattr): Don't convert to new termios if bad fd.
2235         (tcgetattr): Minor debugging tweak.
2236
2237 Wed Aug 22 23:41:00 2001  Corinna Vinschen <corinna@vinschen.de>
2238
2239         * net.cc (cygwin_inet_ntoa): Rearrange previous patch to use
2240         thread local buffer space when compiled thread safe.
2241         (cygwin_getprotobyname): Ditto.
2242         (cygwin_getprotobynumber): Ditto.
2243         (cygwin_getservbyname): Ditto.
2244         (cygwin_getservbyport): Ditto.
2245         (cygwin_gethostbyname): Ditto.
2246         (cygwin_gethostbyaddr): Ditto. Move near to cygwin_gethostbyname.
2247         * thread.h (struct _winsup_t): Add pointers for above used buffer space.
2248         * passwd.cc (getpwduid): Remove initializing passwd.
2249         (setpwent): Ditto.
2250         (endpwent): Ditto.
2251         (setpassent): Ditto.
2252
2253 Wed Aug 22 13:41:09 2001  Christopher Faylor <cgf@cygnus.com>
2254
2255         * smallprint.c (console_printf): New function.
2256         * dcrt0.cc (dll_crt0_1): Use console_printf for debugging output.
2257         * debug.cc (debug_mark_closed): New function.
2258         (close_handle): Use debug_mark_closed.
2259         * debug.h: Declare new functions.
2260         * dtable.cc (dtable::build_fhandler): Remove unneeded extern.
2261         * spawn.cc: Cosmetic changes.
2262         * winsup.h: Define NO_COPY for C files, too.  Declare a global.
2263
2264 Wed Aug 22 17:31:00 2001  Corinna Vinschen <corinna@vinschen.de>
2265
2266         * net.cc (free_char_list): New static function.
2267         (dup_char_list): Ditto.
2268         (free_protoent_ptr): Ditto.
2269         (dup_protoent_ptr): Ditto.
2270         (free_servent_ptr): Ditto.
2271         (dup_servent_ptr): Ditto.
2272         (free_hostent_ptr): Ditto.
2273         (dup_hostent_ptr): Ditto.
2274         (cygwin_inet_ntoa): Use local static buffer to allow propagating of
2275         the result to child processes.
2276         (cygwin_getprotobyname): Ditto.
2277         (cygwin_getprotobynumber): Ditto.
2278         (cygwin_getservbyname): Ditto.
2279         (cygwin_getservbyport): Ditto.
2280         (cygwin_gethostbyname): Ditto.
2281         (cygwin_gethostbyaddr): Ditto.
2282
2283 Mon Aug 20 11:56:19 2001  Christopher Faylor <cgf@cygnus.com>
2284
2285         * cygheap.cc (init_cheap): Allocate cygheap in shared memory for Windows NT.
2286
2287 Thu Aug 16 09:38:59 2001  Jason Tishler <jason@tishler.net>
2288
2289         * fhandler_socket.cc (fhandler_socket::create_secret_event): Relax
2290         security of secret_event so AF_UNIX socket clients can connect to
2291         servers even if running under a different user account.
2292         (fhandler_socket::check_peer_secret_event): Ditto.
2293
2294 Thu Aug 16 16:26:00 2001  Corinna Vinschen <corinna@vinschen.de>
2295
2296         * resource.cc (getrlimit): Return getdtablesize () as current limit
2297         on RLIMIT_NOFILE.
2298         * syscalls.cc (getdtablesize): Return OPEN_MAX if current dtable size
2299         is less than OPEN_MAX, the current dtable size otherwise.
2300         * sysconf.cc (sysconf): Return getdtablesize () on _SC_OPEN_MAX.
2301
2302 Thu Aug 16 16:17:00 2001  Corinna Vinschen <corinna@vinschen.de>
2303
2304         * resource.cc (getrlimit): Return OPEN_MAX as current limit
2305         on RLIMIT_NOFILE.
2306         * syscalls.cc (getdtablesize): Return OPEN_MAX.
2307         * sysconf.cc (sysconf): Return OPEN_MAX on _SC_OPEN_MAX.
2308         * include/limits.h (OPEN_MAX): Define as 256.
2309
2310 Wed Aug 15 12:43:00 2001  Corinna Vinschen <corinna@vinschen.de>
2311
2312         * times.cc (utimes): Revert previous change. Just open the
2313         file using FILE_WRITE_ATTRIBUTES instead of GENERIC_WRITE
2314         on NT/W2K.
2315
2316 Wed Aug 15 12:18:00 2001  Corinna Vinschen <corinna@vinschen.de>
2317
2318         * security.cc (set_nt_attribute): Return always -1 in case of
2319         a failure.
2320         * times.cc (utimes): On NTFS with ntsec ON, change the file's
2321         security descriptor temporarily to acquire write access if
2322         opening the file failed.
2323
2324 Wed Aug 15  9:42:00 2001  Corinna Vinschen <corinna@vinschen.de>
2325
2326         * fhandler.cc (fhandler_base::is_nonblocking): New method.
2327         (fhandler_base::set_nonblocking): Ditto.
2328         * fhandler.h (fhandler_base): Declare new methods `is_nonblocking' and
2329         `set_nonblocking'.
2330         * fhandler_socket.cc (fhandler_socket::ioctl): Use `set_nonblocking'.
2331         * fhandler_tty.cc (fhandler_pty_master::process_slave_output):
2332         Use `is_nonblocking'.
2333         (fhandler_tty_slave::read): Ditto.
2334         (fhandler_tty_slave::ioctl): Use `set_nonblocking'.
2335         (fhandler_pty_master::ioctl): Ditto.
2336         * net.cc (cygwin_sendto): Fallback to winsock 1 functionality
2337         in case of nonblocking IO.
2338         (cygwin_recvfrom): Ditto.
2339         (cygwin_recv): Ditto.
2340         (cygwin_send): Ditto.
2341         * syscalls.cc (_read): Use `is_nonblocking'.
2342
2343 Tue Aug 14 11:05:26 2001  Christopher Faylor <cgf@cygnus.com>
2344
2345         * include/cygwin/version.h: Bump API version.
2346
2347 2001-08-14  Egor Duda  <deo@logos-m.ru>
2348
2349         * spawn.cc (spawn_guts): Enable appropriate privilege before
2350         loading user's registry hive.
2351
2352 Mon Aug 13 22:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
2353
2354         * fhandler.cc (fhandler_base::fcntl): Use new O_NONBLOCK_MASK define.
2355         * fhandler.h: Move definitions of O_NOSYMLINK, O_DIROPEN and
2356         OLD_O_NDELAY from winsup.h to here. Add O_NONBLOCK_MASK define.
2357         * fhandler_socket.cc (fhandler_socket::close): Add hack to allow
2358         a graceful shutdown even if shutdown() hasn't been called by the
2359         application. Add debug output.
2360         (fhandler_socket::ioctl): Set fhandler's NONBLOCK flag according
2361         to FIONBIO setting.
2362         (fhandler_socket::fcntl): Use new O_NONBLOCK_MASK define. Actually
2363         set `request' before using it.
2364         * fhandler_tty.cc: Use new O_NONBLOCK_MASK define throughout.
2365         (fhandler_tty_slave::ioctl): Set fhandler's NONBLOCK flag according
2366         to FIONBIO setting.
2367         (fhandler_pty_master::ioctl): Ditto.
2368         * net.cc (wsock_event::prepare): Compare WSACreateEvent return code
2369         with `WSA_INVALID_EVENT' according to MSDN.
2370         * syscalls.cc (_read): Use new O_NONBLOCK_MASK define.
2371
2372 Wed Aug  8 15:24:59 2001  Christopher Faylor <cgf@cygnus.com>
2373
2374         * include/wchar.h: Define __need_wint_t.
2375
2376 Wed Aug  8 11:46:00 2001  Corinna Vinschen <corinna@vinschen.de>
2377
2378         * security.cc (alloc_sd): Revert to setting inheritance attribute for
2379         permissions given to directories. Never set inheritance on NULL ACE.
2380
2381 Tue Aug  7 18:11:00 2001  Corinna Vinschen <corinna@vinschen.de>
2382
2383         * security.cc (alloc_sd): Don't set FILE_DELETE_CHILD for group
2384         if S_ISVTX attribute is given.
2385         * dir.cc (mkdir): Allow immediate setting of S_ISUID, S_ISGID and
2386         S_ISVTX attribute.
2387         * syscalls.cc (_open): Ditto.
2388
2389 Tue Aug  7 16:24:00 2001  Corinna Vinschen <corinna@vinschen.de>
2390
2391         * dir.cc (mkdir): Set security attributes correctly for
2392         CreateDirectoryA () call if ntsec is on. Don't call
2393         set_file_attributes () then.
2394         * fhandler.cc (fhandler_base::open): Ditto for CreateFileA () call.
2395         * path.cc (symlink): Ditto.
2396         * security.cc (set_security_attribute): New function.
2397         * security.h: Add declaration for `allow_ntea' and
2398         `set_security_attribute'.
2399
2400 Tue Aug  7 10:54:00 2001  Corinna Vinschen <corinna@vinschen.de>
2401
2402         * grp.cc (class grp_check): New class. Make `group_state'
2403         a member of class grp_check.
2404         (read_etc_group): Free former allocated memory on reread.
2405         * passwd.cc (class pwd_check): New class Make `passwd_state'
2406         a member of class pwd_check.
2407         (read_etc_passwd): Free former allocated memory on reread.
2408
2409 Tue Aug  7 01:13:58 2001  Christopher Faylor <cgf@cygnus.com>
2410
2411         * fhandler_console.cc (get_tty_stuff): Don't initialize shared memory
2412         console area if it is already initialized.
2413
2414         * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Augment debugging
2415         info.
2416
2417 Mon Aug  6 19:58:43 2001  Christopher Faylor <cgf@cygnus.com>
2418
2419         * cygheap.cc (cygheap_root::set): Avoid treating '/' specially.
2420
2421         * fhandler.cc (fhandler_base::fcntl): Only set specific O_NDELAY style
2422         flag passed in from application.
2423         * fhandler_socket.cc (fhandler_socket::fcntl): Ditto.
2424         * fhandler.h: Set constant for future use.
2425         * winsup.h: Define OLD_O_NDELAY only for old programs.
2426         * include/cygwin/version.h: Define
2427         CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK.
2428
2429 Sat Aug  4 16:52:03 2001  Christopher Faylor <cgf@cygnus.com>
2430
2431         Throughout, change check for running under Windows NT to 'iswinnt'.
2432         * dcrt0.cc (set_os_type): Set 'iswinnt' appropriately.
2433         * cygheap.cc (init_cheap): Revert to using VirtualAlloc for allocating
2434         cygheap.
2435         (cygheap_setup_for_child_cleanup): New function.  Standard function to
2436         call after calling CreateProcess to cleanup cygheap info passed to
2437         child.
2438         (cygheap_fixup_in_child): Copy cygheap from shared memory into
2439         allocated space under Windows 9x or if can't relocate shared space
2440         under NT.
2441         * cygheap.h: Declare new function.
2442         * spawn.cc (spawn_guts): Use cygheap_fixup_in_child.
2443         * fork.cc (fork_parent): Ditto.
2444         * winsup.h: Declare iswinnt.
2445
2446 2001-08-04  Egor Duda  <deo@logos-m.ru>
2447
2448         * dtable.cc (dtable::release): Avoid messing with console when
2449         closing socket.
2450
2451 Fri Aug  3 14:02:00 2001  Corinna Vinschen <corinna@vinschen.de>
2452
2453         * net.cc (cygwin_accept): Allow NULL peer and len parameters.
2454         * include/cygwin/socket.h: Define socklen_t as int.
2455
2456 Fri Aug  3 13:04:00 2001  Corinna Vinschen <corinna@vinschen.de>
2457
2458         * path.cc (fchdir): Set the fhandler's path to absolute value to ensure
2459         changing to the correct directory even if the fhandler originally
2460         points to a relative path.
2461
2462 Thu Aug  2 17:59:00 2001  Corinna Vinschen <corinna@vinschen.de>
2463
2464         * security.cc (set_file_attribute): Clean up. Don't call
2465         `set_nt_attribute' when ntsec isn't set.
2466
2467 Sat Jul 28 22:30:55 2001  Christopher Faylor <cgf@cygnus.com>
2468
2469         * dcrt0.cc (alloc_stack_hard_way): Make half-hearted attempt to deal
2470         with growing stack under Windows 95.
2471
2472 Fri Jul 27 12:36:07 2001  Christopher Faylor <cgf@cygnus.com>
2473
2474         * Makefile.in: Add install-lib and install-headers.
2475
2476 Fri Jul 27 12:28:12 2001  Christopher Faylor <cgf@cygnus.com>
2477
2478         * cygwin.din: Export sys_errlist, sys_nerr.
2479         * include/cygwin/version.h: Bump minor version number.
2480
2481 Fri 27 Jul 2001 10:29:00  Corinna Vinschen <corinna@vinschen.de>
2482
2483         * security.cc (get_user_primary_group): Fix compiler warning.
2484         (alloc_sd): Add DELETE permission for user when S_IWUSR is given.
2485
2486 Thu Jul 26 16:43:39 2001  Pieter de Visser <pieterdv@knoware.nl>
2487
2488         * thread.cc (__pthread_equal): Invert return value so that true is
2489         returned when threads are equal.
2490
2491 Thu Jul 26 15:50:38 2001  Charles Wilson <cwilson@ece.gatech.edu>
2492                           Christopher Faylor <cgf@cygnus.com>
2493
2494         * cygwin.din: Export __signgam.
2495         * include/cygwin/version.h: Bump minor version number.
2496
2497 Thu Jul 26 15:19:50 2001  Christopher Faylor <cgf@cygnus.com>
2498
2499         Throughout, reorganize header file inclusion to put security.h prior to
2500         fhandler.h.
2501         * fhandler.h (fhandler_base::get_inheritance): New method.
2502         * fhandler_socket.cc (fhandler_socket::create_secret_event): Use proper
2503         close-on-exec inheritance when creating.
2504         (fhandler_socket::check_peer_secret_event): Create handle as
2505         non-inheritable.
2506
2507 2001-07-25  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
2508
2509         * syscalls.cc (setsid): Detach process from its console if the current
2510         controlling tty is the console and already closed.
2511         * dtable.h (class dtable): Add members to count descriptors referring
2512         to the console.
2513         * dtable.cc (dtable::dec_console_fds): New function to detach process
2514         from its console.
2515         (dtable::release): Decrement the counter of console descriptors.
2516         (dtable::build_fhandler): Increment it.
2517         * exception.cc (ctrl_c_handler): Send SIGTERM to myself when catch
2518         CTRL_SHUTDOWN_EVENT.
2519
2520 Tue 24 Jul 2001 02:28:00 PM  Trevor Forbes <t4bs@hotmail.com>
2521
2522         * thread.cc (verifyable_object_isvalid): Don't validate
2523         PTHREAD_MUTEX_INITIALIZER pointer as it will cause an exception
2524         in IsBadWritePtr() when running GDB.
2525
2526 Wed 25 Jul 2001 23:46:00  Corinna Vinschen <corinna@vinschen.de>
2527
2528         * localtime.c: Changed whole file to become C++ clean. Rename to
2529         localtime.cc.
2530         * localtime.cc (tzload): Preserve errno.
2531
2532 Fri 20 Jul 2001 11:15:50 PM EDT  Christopher Faylor <cgf@cygnus.com>
2533
2534         * cygheap.cc (cygheap_fixup_in_child): Attempt Win95 workaround.
2535         * dtable.cc (dtable::dup_worker): Add debugging output.
2536         (dtable::vfork_child_dup): Correctly set close_on_exec.
2537         * fhandler.cc (fhandler_base::fork_fixup): Don't mess with handle if
2538         there is no need to get it from the parent.
2539         * fhandler_tty.cc (fhandler_tty_common::close): Add debugging output.
2540
2541 Fri 20 Jul 2001 09:15:00  Mark Bradshaw <bradshaw@staff.crosswalk.com>
2542
2543         * dir.cc (readdir): Protect FindNextFileA against INVALID_HANDLE_VALUE.
2544
2545 Wed 18 Jul 2001 01:00:47 PM EDT  Christopher Faylor <cgf@cygnus.com>
2546
2547         * cygheap.cc (_cmalloc): Use correct constants for size calculation.
2548         * dcrt0.cc (dll_crt0_1): Move uid initialization earlier.
2549         * fork.cc (fork_parent): Move cygheap_setup_in_child to just prior to
2550         CreateProcess so that all contents of cygheap are copied.
2551         * spawn.cc (spawn_guts): Ditto.
2552
2553 Wed 18 Jul 2001 12:54:17  Corinna Vinschen <corinna@vinschen.de>
2554
2555         * security.cc (get_user_groups): Call Net function with NULL server
2556         name under specific error conditions.
2557         (is_group_member): Ditto.
2558         (get_user_local_groups): Ditto.
2559         (get_user_primary_group): Ditto.
2560
2561 Wed 18 Jul 2001 11:56:00  Corinna Vinschen <corinna@vinschen.de>
2562
2563         * syscalls.cc (_unlink): Explicitly check for non-existant file.
2564
2565 Tue 17 Jul 2001 10:19:00  Corinna Vinschen <corinna@vinschen.de>
2566
2567         * delqueue.h: Remove obsolete file.
2568
2569 Mon 16 Jul 2001 10:47:17 PM EDT  Christopher Faylor <cgf@cygnus.com>
2570
2571         * child_info.h: Bump magic number.
2572         (class child_info): Add an element.
2573         * cygheap.cc (init_cheap): Allocate cygwin heap in shared memory area.
2574         (cygheap_fixup_in_child): Map cygwin heap, passed from parent via
2575         shared memory into correct address.
2576         (cygheap_setup_for_child): New function.
2577         * cygheap.h: Declare new functions.
2578         * dcrt0.cc (dll_crt0_1): Accommodate new cygheap_fixup_in_child
2579         arguments.  Avoid protecting subproc_ready unless it is spawn/nowait.
2580         * fork.cc (fork_parent): Use new cygheap_setup_for_child function to
2581         setup cygwin heap info.  Close passed cygheap shared memory handle.
2582         * spawn.cc (spawn_guts): Ditto.  Also, reorganize to avoid
2583         synchronization between parent and child in non-P_OVERLAY case.
2584         * sigproc.cc (wait_sig): Only signal subproc_ready when execing.
2585
2586 Mon 16 Jul 2001 15:21:00  Corinna Vinschen <corinna@vinschen.de>
2587
2588         * grp.cc: Add missing Copyright date 2001.
2589
2590 Mon 16 Jul 2001 00:11:00  Corinna Vinschen <corinna@vinschen.de>
2591
2592         Change well_known_admin_sid to well_known_admins_sid throughout.
2593         * sec_acl.cc (setacl): Never set DELETE permission. Set
2594         FILE_DELETE_CHILD only on readable and executable directories.
2595         * sec_helper.cc: Add constructor for `well_known_null_sid'.
2596         * security.cc (get_nt_attribute): Set S_ISVTX for directories if
2597         FILE_WRITE_DATA and FILE_EXECUTE but not FILE_DELETE_CHILD is set.
2598         Add evaluation of S_ISVTX, S_ISGID and S_ISUID from NULL ACE.
2599         (alloc_sd): Never set DELETE permission. Set FILE_DELETE_CHILD
2600         only on readable and executable directories.
2601         Add creation of NULL ACE for S_ISVTX, S_ISGID and S_ISUID permissions.
2602         * security.h: Add extern declaration for `well_known_null_sid'.
2603
2604 Fri 13 Jul 2001 08:08:49 PM EDT  Christopher Faylor <cgf@cygnus.com>
2605
2606         * syscalls.cc (stat_worker): Simplify previous change.
2607
2608 Fri Jul 13 13:13:09 2001  Christopher Faylor <cgf@cygnus.com>
2609
2610         * syscalls.cc (_unlink): Correct (?) logic which determines when
2611         to report an access violation and when to queue file for eventual
2612         deletion.
2613         (stat_worker): Check for invalid buf argument.
2614
2615 Tue Jul 10 23:01:00 2001  Corinna Vinschen <corinna@vinschen.de>
2616
2617         * mmap.cc (fhandler_disk_file::mmap): Try to open file mappings
2618         by a unified name when running under 9x/ME. If that failes, create
2619         the file mapping using the unified name.
2620
2621 Mon Jul  9 10:43:00 2001  Corinna Vinschen <corinna@vinschen.de>
2622
2623         * uinfo.cc (internal_getlogin): Add pointer check.
2624
2625 Mon Jul  9 10:05:00 2001  Corinna Vinschen <corinna@vinschen.de>
2626
2627         * security.cc (alloc_sd): Don't set inheritance attribute for
2628         permissions given to directories.
2629
2630 Thu Jun 28 22:19:08 2001  Christopher Faylor <cgf@cygnus.com>
2631
2632         * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Return 0 for success.
2633
2634 Wed Jun 27 22:19:07 2001  Christopher Faylor <cgf@cygnus.com>
2635
2636         * path.cc (path_conv::check): Add signal protection here since
2637         retrieving info about remote shares can take some time.
2638
2639 Wed Jun 27 23:30:00 2001  Robert Collins <rbtcollins@hotmail.com>
2640                           Christopher Faylor <cgf@cygnus.com>
2641
2642         Change check_null_empty_path* to check_null_empty_str* throughout.
2643         * path.h (check_null_empty_str_errno): Convert to a function prototype.
2644         * path.cc (check_null_empty_str): Move to miscfuncs.cc.
2645         * miscfuncs.cc (check_null_empty_str_errno): New function.
2646         (__check_null_invalid_struct): Ditto.
2647         (__check_null_invalid_struct_errno): Ditto.
2648         (check_null_empty_str): Change from VirtualQuery to IsBadWritePtr.
2649         * thread.cc (check_valid_pointer): Ditto.
2650         * resource.cc (getrlimit): Use check_null_invalid_struct macro for
2651         checking validity of pointer.
2652         (setrlimit): Ditto.
2653
2654 Tue Jun 26 16:59:16 2001  Christopher Faylor <cgf@cygnus.com>
2655
2656         * fhandler.cc (fhandler_disk_file::fstat): Don't rely on exactly 3
2657         characters being read for executable test since we could be checking
2658         for less than that.
2659         * syscalls.cc (stat_worker): Try opening the file the "correct" way
2660         first so that #! processing can potentially happen.  If that fails,
2661         then use "query open" method.
2662
2663         * spawn.cc (spawn_guts): Delay processing of signal until after we've
2664         notified parent about reparenting.
2665
2666 Tue Jun 26 10:47:24 2001  Christopher Faylor <cgf@cygnus.com>
2667
2668         * mmap.cc: Clean up *ResourceLock calls throughout.
2669
2670 Tue Jun 26 22:10:00 2001  Robert Collins rbtcollins@hotmail.com
2671
2672         * thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well
2673         as WAIT_ABANDONED.
2674         (__pthread_cond_timedwait): Calculate a relative wait from the abstime
2675         parameter.
2676
2677 Sun Jun 24 17:38:19 2001  Christopher Faylor <cgf@cygnus.com>
2678
2679         * exceptions.cc (interrupt_setup): Move actions from setup_handler to
2680         here.
2681         (setup_handler): Move actions after a successful interrupt to
2682         interrupt_setup.
2683         * fork.cc (vfork): Augment debugging output.
2684         * sigproc.cc (proc_subproc): Ditto.
2685         * spawn.cc (spawn_guts): Ditto.  Correctly fill out progname when spawn
2686         NO_WAIT.  Call signal handler when a signal arrives.
2687         * sigproc.h: Declare a function.
2688
2689 Fri Jun 22 16:50:00 2001  Corinna Vinschen <corinna@vinschen.de>
2690
2691         * fhandler.h class fhandler_socket): Declare new method
2692         `set_close_on_exec'.
2693         * fhandler_socket.cc (fhandler_socket::set_close_on_exec):
2694         New method.
2695
2696 Fri Jun 22 16:12:00 2001  Corinna Vinschen <corinna@vinschen.de>
2697
2698         * fhandler_tape.cc (fhandler_dev_tape::tape_erase): Set size
2699         parameter to value expected by GetTapeParameters().
2700
2701 Thu Jun 21 22:01:39 2001  Marius Gedminas <mgedmin@delfi.lt>
2702
2703         * fhandler_console.cc (fhandler_console::read): Detect AltGr more
2704         robustly on WinNT.
2705
2706 2001-06-22  Robert Collins  <rbbtcollins@hotmail.com>
2707
2708         * thread.cc (__pthread_cond_timedwait): Lock the waiting mutex before
2709         the condition protect mutex to avoid deadlocking. (Found by Greg Smith).
2710         (__pthread_cond_wait): Ditto.
2711
2712 2001-06-30  Egor Duda  <deo@logos-m.ru>
2713
2714         * fhandler.cc (fhandler_base::open): Work around windows bug when
2715         CreateFile() with dwDesiredAccess == 0 called on remote share returns
2716         valid handle even if file doesn't exist.
2717
2718 2001-06-20  Egor Duda  <deo@logos-m.ru>
2719
2720         * fhandler_socket.cc (fhandler_socket::signal_secret_event): New
2721         function.
2722         * fhandler.h: Declare it.
2723         * fhandler_socket.cc (fhandler_socket::create_secret_event): Don't
2724         signal secret event immediately.
2725         (fhandler_socket::check_peer_secret_event): Do it after peer event
2726         was opened.
2727         * net.cc (cygwin_connect): Or if socket is non-blocking.
2728         (cygwin_accept): Ditto.
2729
2730 Mon Jun 18 17:09:25 2001  Christopher Faylor <cgf@cygnus.com>
2731
2732         * fhandler_tty.cc (fhandler_tty_slave::init): Revert 2001-06-16 change.
2733
2734         * fork.cc (fork_copy): Print more debugging info.
2735         (fork_parent): Change order of arguments to accomdate buggy gcc.
2736         (fork): Ditto.
2737
2738 Sun Jun 17 18:54:46 2001  Christopher Faylor <cgf@cygnus.com>
2739
2740         * syscalls.cc (_unlink): Reorganize to try harder to delete file with
2741         DeleteFile and to recover more gracefully if FILE_FLAG_DELETE_ON_CLOSE
2742         doesn't work properly.
2743
2744 Sat Jun 16 13:06:49 2001  Christopher Faylor <cgf@cygnus.com>
2745
2746         * exceptions.cc (sig_handle_tty_stop): Reset PID_STOPPED if not
2747         actually stopping.
2748         * fhandler_console.cc (fhandler_console::fixup_after_fork): Don't set
2749         controlling terminal if just inheriting a handle.
2750         (fhandler_console::fixup_after_exec): Ditto.
2751         * fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
2752         * signal.cc (kill_worker): Set appropriate errno if proc_exists
2753         determines that process does not really exist.
2754
2755 Fri Jun 15 14:34:19 2001  Christopher Faylor <cgf@cygnus.com>
2756
2757         * path.cc (path_conv::check): Deal more robustly with foo/ behavior.
2758
2759 Fri Jun 15 11:15:00 2001  Corinna Vinschen <corinna@vinschen.de>
2760
2761         * fhandler_tape.cc (fhandler_dev_tape::tape_status): Set size
2762         parameter to value expected by GetTapeParameters().
2763
2764 Thu Jun 14 20:19:46 2001  Christopher Faylor <cgf@cygnus.com>
2765
2766         * fhandler.cc (fhandler_disk_file::fstat): Properly set executable bits
2767         for directory when !ntsec && !ntea.  Also move common code prior to
2768         call to get_attributes.
2769
2770 Fri June 15 09:25:00  Robert Collins <rbtcollins@hotmail.com>
2771
2772         * thread.cc (pthread_cond::Signal): Release the condition access
2773         variable correctly.
2774
2775 2001-06-14  Egor Duda  <deo@logos-m.ru>
2776
2777         * fhandler.cc (fhandler_base::open): Set win32 access flags to 0, when
2778         requested.
2779         * fhandler.h: New status flag FH_QUERYOPEN.
2780         (fhandler::get_query_open): New function.
2781         (fhandler::set_query_open): Ditto.
2782         * syscalls.cc (stat_worker): Request query-only open mode.
2783
2784 2001-06-12  Egor Duda  <deo@logos-m.ru>
2785
2786         * environ.cc (set_file_api_mode): New function. Move setting
2787         of file APIs mode (OEM/ANSI) here.
2788         (codepage_init): From here.
2789         * winsup.h (set_file_api_mode): Declare it.
2790         * fork.cc (fork_child): Set file APIs mode in forkee.
2791
2792 Mon Jun 11 14:19:49 2001  Christopher Faylor <cgf@cygnus.com>
2793
2794         * pinfo.cc: Use autoloaded ToolHelp functions throughout for Win9x.
2795         * autoload.cc: Autoload ToolHelp functions.
2796
2797         * sigproc.cc (proc_subproc): Incorporate SIGCHLD == SIG_IGN special
2798         handling of zombie processes.  Ensure that zombie processes which are
2799         at the end of the zombie array are properly cleaned up.
2800
2801 Mon Jun 11 11:18:56 2001  Christopher Faylor <cgf@cygnus.com>
2802
2803         * path.cc (chdir): Fix call to path_conv constructor so that it REALLY
2804         doesn't check for the null/non-empty path.
2805
2806 Sun Jun 10 23:34:09 2001  Christopher Faylor <cgf@cygnus.com>
2807
2808         * path.cc (path_conv::update_fs_info): Don't consider remote drives to
2809         be NTFS.  Set root_dir before invoking GetDriveType (from Kazuhiro
2810         Fujieda <fujieda@jaist.ac.jp>).  Eliminate extra checks for rootdir.
2811
2812 Sun Jun 10 20:19:47 2001  Christopher Faylor <cgf@cygnus.com>
2813
2814         * path.cc (chdir): Pre-check path for validity before eating trailing
2815         space.  Then, ensure that path_conv doesn't check the path for validity
2816         again.
2817
2818 Sun Jun 10 12:56:00 2001  Christopher Faylor <cgf@redhat.com>
2819
2820         * exceptions.cc (sigdelayed): Ensure that signal is cleared as
2821         the last operation or suffer races.
2822         * sigproc.cc (proc_subproc): Deal with zombie array overflow.
2823
2824 Sun Jun 10 11:56:00 2001  Corinna Vinschen <corinna@vinschen.de>
2825
2826          * cygwin.din: Add fchdir symbols.
2827          * path.cc (chdir): Guard against invalid parameter.
2828          (fchdir): New function.
2829          * include/cygwin/version.h: Bump API minor version to 40.
2830          * uinfo.cc (internal_getlogin): Remove unused variable.
2831
2832 Sat Jun  9 23:20:00 2001  Corinna Vinschen <corinna@vinschen.de>
2833
2834         * syscalls.cc (seteuid): Set environment variables USERNAME and
2835         USERDOMAIN before impersonation to workaround a LookupAccountSid()
2836         misbehaviour.
2837         * uinfo.cc (internal_getlogin): Revert most of the previous change.
2838         Don't set environment variables USERNAME and USERDOMAIN. That's
2839         the job of seteuid() now. Try to get logon server from Lsa
2840         only if logon server isn't already known.
2841
2842 Thu Jun  7 15:54:32 2001  Robert Collins <rbtcollins@hotmail.com>
2843
2844         * thread.cc (pthread_cond::Broadcast): Don't print error messages on
2845         invalid mutexs - user programs are allowed to call
2846         pthread_cond_broadcast like that.
2847         (__pthread_cond_timedwait): Initialise themutex properly.
2848         (__pthread_cond_wait): Initialise themutex properly.
2849
2850 Tue Jun  5 19:56:00 2001  Corinna Vinschen <corinna@vinschen.de>
2851
2852         * fhandler_console.cc (fhandler_console::dup): Allocate space for
2853         savebuf on Cygwin heap.
2854         (fhandler_console::char_command): Ditto. Use correct values for size.
2855
2856 2001-06-05  Egor Duda  <deo@logos-m.ru>
2857
2858         * security.h (NTWriteEA): Change prototype.
2859         * ntea.cc (NTReadEA): Don't check for global ntea setting, now
2860         it's caller responsibility.
2861         (NTWriteEA): Ditto.
2862         * security.cc (get_file_attribute): Read attribute from EA only
2863         if 'ntea' is enabled.
2864         (set_file_attribute): Ditto.
2865         * path.h: (class path_conv): Add members to store file system
2866         information.
2867         (path_conv::get_drive_type): New function.
2868         * syscalls.cc (stat_worker): Use it.
2869         * path.cc (path_conv::update_fs_info): New functions.
2870         (path_conv::check): Get file system information from device where
2871         file resides. On NTFS, try to read symlink contents from EA.
2872         (get_symlink_ea): New function.
2873         (set_symlink_ea): Ditto.
2874         (symlink): Store symlink in extended attribute, if possible.
2875
2876 Tue Jun  5 11:18:00 2001  Corinna Vinschen <corinna@vinschen.de>
2877
2878         * fhandler.cc (fhandler_disk_file::fstat): Always reset file position
2879         to original value after checking for executable magic.
2880
2881 Mon Jun  4 16:21:00 2001  Corinna Vinschen <corinna@vinschen.de>
2882
2883         * cygheap.h (cygheap_user::cygheap_user): Initialize token to
2884         INVALID_HANDLE_VALUE.
2885         * uinfo.cc (uinfo_init): Close token handle if needed.
2886
2887 Sun Jun  3 20:52:13 2001  Christopher Faylor <cgf@cygnus.com>
2888
2889         * path.cc (normalize_posix_path): Revert ..  check removed by previous
2890         changes.
2891         * cygheap.h: Temporarily declare path_prefix_p here.
2892
2893 Mon Jun  4  0:14:00 2001  Corinna Vinschen <corinna@vinschen.de>
2894
2895         * net.cc (wsock_event): Add destructor.
2896
2897 Sun Jun  3 09:49:55 2001  Robert Collins  <rbtcollins@hotmail.com>
2898
2899         * dlfcn.cc (dlclose): Do not call FreeLibrary if the symbol to close
2900         was obtained by dlopen(NULL,...).
2901
2902 Sat Jun  2 23:11:52 2001  Christopher Faylor <cgf@cygnus.com>
2903
2904         * syscalls.cc (sleep): Try to be a little more accomodating of signal
2905         arrival.  Ensure that the signal handler is called.
2906
2907 Sat Jun  2 14:07:28 2001  Christopher Faylor <cgf@cygnus.com>
2908
2909         * cygheap.cc (cygheap_root::cygheap_root): Remove constructor.
2910         (cygheap_root::~cygheap_root): Remove destructor.
2911         (cygheap_root::operator =): Remove.
2912         (cygheap_root::set): New method.
2913         * cygheap.h (cygheap_root): Reflect above changes.  Store root info in
2914         mount-like structure.
2915         (cygheap_root:posix_ok): New method.
2916         (cygheap_root::ischroot_native): Ditto.
2917         (cygheap_root::unchroot): Ditto.
2918         (cygheap_root::exists): Ditto.
2919         (cygheap_root::posix_length): Ditto.
2920         (cygheap_root::posix_path): Ditto.
2921         (cygheap_root::native_length): Ditto.
2922         (cygheap_root::native_path): Ditto.
2923         * dir.cc (opendir): Remove special chroot test.
2924         * path.cc (path_prefix_p): Remove front end.
2925         (normalize_posix_path): Reorganize chroot tests to accommodate new
2926         convention of allowing paths using posix chroot prefix.
2927         (path_conv::check): Pass a "already ran normalize" option to
2928         conv_to_win32_path.  Return if there is an error from this function.
2929         (mount_info::conv_to_win32_path): Add extra argument.  Don't call
2930         normalize_posix_path if caller has already done so.  Substitute chroot
2931         setting, if any, for root translation.  Add chroot checking to final
2932         output step.
2933         * shared_info (mount_info): Accommodate additional argument to
2934         conv_to_win32_path.
2935         * syscalls.cc (chroot): Store both normalized posix path and native
2936         path in chroot.
2937
2938 Fri Jun  1 10:57:19 2001  Christopher Faylor <cgf@cygnus.com>
2939
2940         * path.cc (chdir): Really make sure that isspace gets only an unsigned
2941         char.
2942
2943 Fri Jun  1 13:45:00 2001  Corinna Vinschen <corinna@vinschen.de>
2944
2945         * syscalls.cc (_rename): Handle the case that `foo' is renamed to
2946         `bar' while `bar.lnk' is an existing shortcut-symlink.
2947
2948 Thu May 31 15:57:57 2001  Christopher Faylor <cgf@cygnus.com>
2949
2950         * fhandler.cc (fhandler_disk_file::fstat): Avoid clearing S_IFMT bits
2951         since we've already pre-cleared everything anyway.
2952
2953 Wed May 30 23:51:32 2001  Earnie Boyd  <earnie_boyd@yahoo.com>
2954
2955         * path.cc (chdir): Always send unsigned chars to isspace since newlib's
2956         isspace doesn't deal well with "negative" chars.
2957
2958 Wed May 30 23:51:32 2001  Christopher Faylor <cgf@cygnus.com>
2959
2960         * fhandler.cc (fhandler_disk_file::open): Propagate remote status of
2961         file garnered from path_conv.  Move #! checking to fstat.
2962         (fhandler_disk_file::fstat): Reorganize st_mode setting to eliminate
2963         duplication.  Move check for #! here from fhandler::open.
2964
2965         * fhandler.h (fhandler_base::isremote): New method.
2966         (fhandler_base::set_isremote): Ditto.
2967         (fhandler_base::set_execable_p): Also record "don't care if executable
2968         state".
2969         (fhandler_base::dont_care_if_execable): New method.
2970         * path.cc (path_conv::check): Clear new flags.  Appropriately set
2971         vol_flags, drive_type, and is_remote_drive.
2972         * path.h: Add new flags and methods for manipulating them.
2973         * syscalls.cc (_unlink): Use isremote() to determine if a path is
2974         remote rather than calling GetDriveType.
2975         (stat_worker): Ditto.
2976         * security.cc (get_file_attribute): Or attribute with result of
2977         NTReadEA to be consistent with get_nt_attribute.
2978
2979 Tue May 29 19:02:00 2001  Corinna Vinschen <corinna@vinschen.de>
2980
2981         * sec_helper.cc (cygsid::getfrompw): Change parameter to `const'.
2982         (cygsid::getfromgr): Ditto.
2983         * security.cc: Use `sys_mbstowcs' and `sys_wcstombs' throughout.
2984         (extract_nt_dom_user): Try to get user and domain from SID in
2985         pw->pw_gecos first.
2986         * security.h (class cygsid): Change parameter of getfrompw() and
2987         getfromgr() to `const'.
2988         * uinfo.cc (internal_getlogin): Change order for evaluating user
2989         information in winNT case. Drop usage of NetWkstaUserGetInfo().
2990
2991 Mon May 28 21:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
2992
2993         * shortcut.c (check_shortcut): Treat only Cygwin shortcuts as symlinks.
2994
2995 Fri May 25 11:07:07 2001  Christopher Faylor <cgf@cygnus.com>
2996
2997         * path.cc (symlink_info::check): Correctly set 'ext_tacked_on'.  Use
2998         this to determine if user specified 'foo.lnk' explicitly.  Reorganize
2999         slightly to get rid of one goto.
3000
3001 Fri May 25 10:15:00 2001  Corinna Vinschen <corinna@vinschen.de>
3002
3003         * path.cc (symlink_info::check): Add a check to return correctly
3004         if incoming `*.lnk' file is not a symlink.
3005
3006 Thu May 24 15:46:50 2001  Christopher Faylor <cgf@cygnus.com>
3007
3008         * path.cc (slash_drive_prefix_p): Remove.
3009         (mount_info::slash_drive_to_win32_path): Ditto.
3010         (mount_info::conv_to_win32_path): Remove slash drive prefix check.
3011         (mount_info::add_item): Ditto.
3012         (mount_info::del_item): Ditto.
3013         * shared_info.h (mount_info): Remove slash_drive_to_win32_path
3014         declaration.
3015
3016 Thu May 24 01:17:33 2001  Christopher Faylor <cgf@cygnus.com>
3017
3018         * exceptions.cc (handle_exceptions): Bump repeat count for debugging
3019         kick out.
3020
3021         * fhandler.h (fhandler_dev_dsp): Add a fixup_after_exec.
3022         * fhandler_dsp.cc (class Audio): Add TOT_BLOCK_SIZE to enum.
3023         (operator new): New.
3024         (bigwavebuffer): Declare using TOT_BLOCK_SIZE to avoid buffer overruns.
3025         (Audio::Audio): Optimize slightly.
3026         (fhandler_dev_dsp::open): Allocate s_audio using static buffer.
3027         (fhandler_dev_dsp::fixup_after_exec): New function.  Ditto.
3028
3029 Wed May 23 17:45:00 2001  Corinna Vinschen <corinna@vinschen.de>
3030
3031         * syscalls.cc (seteuid): Restrict overriding external provided
3032         user tokens to ntsec. Don't test external tokens for primary
3033         group to evaluate if it should be overridden. Restrict creating
3034         internal tokens to ntsec.
3035
3036 Wed May 23 10:11:00 2001  Corinna Vinschen <corinna@vinschen.de>
3037
3038         * syscalls.cc (chown_worker): Don't check for ENOSYS.
3039
3040 Tue May 22 12:20:07 2001  Christopher Faylor <cgf@cygnus.com>
3041
3042         * signal.cc (sleep): Protect with sigframe.
3043
3044 Tue May 22 17:58:00 2001  Corinna Vinschen <corinna@vinschen.de>
3045
3046         * security.cc (get_file_attribute): Don't set errno.
3047
3048 Mon May 21 15:08:00 2001  Christopher Faylor <cgf@cygnus.com>
3049
3050         * configure.in: Allow --enable-newvfork to turn NEWVFORK on and off.
3051         * configure: Regenerate.
3052
3053 Mon May 21 11:46:01 2001  Christopher Faylor <cgf@cygnus.com>
3054
3055         * include/cygwin/version.h: Bump minor version number.
3056
3057 Sun May 20 13:26:25 2001  Christopher Faylor <cgf@cygnus.com>
3058
3059         * fhandler_dsp.cc: Reformat to GNU standards.
3060         (s_audio): Change to a pointer throughout.
3061         (fhandler_dev_dsp::open): Initialize s_audio, if required.
3062
3063 Sat May 19 23:40:00 2001  Corinna Vinschen <corinna@vinschen.de>
3064
3065         * autoload.cc: Add load statements for `LookupAccountNameW',
3066         `LsaClose', `LsaEnumerateAccountRights', `LsaFreeMemory',
3067         `LsaOpenPolicy', `LsaQueryInformationPolicy', `NetLocalGroupEnum',
3068         `NetLocalGroupGetMembers', `NetServerEnum', `NetUserGetGroups' and
3069         `NtCreateToken'.
3070         * ntdll.h: Add declaration for `NtCreateToken'.
3071         * sec_helper.cc: Add `well_known_local_sid', `well_known_dialup_sid',
3072         `well_known_network_sid', `well_known_batch_sid',
3073         `well_known_interactive_sid', `well_known_service_sid' and
3074         `well_known_authenticated_users_sid'.
3075         (cygsid::string): Define as const method.
3076         (cygsid::get_sid): Set psid to NO_SID on error.
3077         (cygsid::getfromstr): Ditto.
3078         (cygsid::getfrompw): Simplify.
3079         (cygsid::getfromgr): Check for gr == NULL.
3080         (legal_sid_type): Move to security.h.
3081         (set_process_privilege): Return -1 on error, otherwise 0 or 1 related
3082         to previous privilege setting.
3083         * security.cc (extract_nt_dom_user): Remove `static'.
3084         (lsa2wchar): New function.
3085         (open_local_policy): Ditto.
3086         (close_local_policy): Ditto.
3087         (get_lsa_srv_inf): Ditto.
3088         (get_logon_server): Ditto.
3089         (get_logon_server_and_user_domain): Ditto.
3090         (get_user_groups): Ditto.
3091         (is_group_member): Ditto.
3092         (get_user_local_groups): Ditto.
3093         (sid_in_token_groups): Ditto.
3094         (get_user_primary_group): Ditto.
3095         (get_group_sidlist): Ditto.
3096         (get_system_priv_list): Ditto.
3097         (get_priv_list): Ditto.
3098         (get_dacl): Ditto.
3099         (create_token): Ditto.
3100         (subauth): Return immediately if SE_TCB_NAME can't be assigned.
3101         Change all return statements in case of error to jumps to `out'
3102         label. Add `out' label to support cleanup.
3103         * security.h: Add extern declarations for `well_known_local_sid',
3104         `well_known_dialup_sid', `well_known_network_sid',
3105         `well_known_batch_sid', `well_known_interactive_sid',
3106         `well_known_service_sid' and `well_known_authenticated_users_sid'.
3107         Add extern declarations for functions `create_token',
3108         `extract_nt_dom_user' and `get_logon_server_and_user_domain'.
3109         (class cygsid): Add method `assign'. Change operator= to call new
3110         `assign' method. Add `debug_print' method.
3111         (class cygsidlist): New class.
3112         (legal_sid_type): Moved from sec_helper.cc to here.
3113         * spawn.cc (spawn_guts) Revert reversion of previous patch.
3114         Call `RevertToSelf' and `ImpersonateLoggedOnUser' instead of `seteuid'
3115         again.
3116         * syscalls.cc (seteuid): Rearranged. Call `create_token' now when
3117         needed. Call `subauth' if `create_token' fails. Try setting token
3118         owner and primary group only if token was not explicitely created
3119         by `create_token'.
3120         * uinfo.cc (internal_getlogin): Try harder to generate correct user
3121         information. Especially don't trust return value of `GetUserName'.
3122
3123 Sat May 19 21:16:07 2001  Christopher Faylor <cgf@cygnus.com>
3124
3125         * fork.cc (fork_parent): Move atforkprepare call here.
3126         (fork): From here.
3127
3128 Sat May 19 18:35:00 2001  Corinna Vinschen <corinna@vinschen.de>
3129
3130         * autoload.cc: Add missing load statement for `CancelIo'.
3131
3132 Sat May 19 01:22:43 2001  Christopher Faylor <cgf@cygnus.com>
3133
3134         * grp.cc (read_etc_group): Don't copy mutex on fork.
3135         * pwd.cc (read_etc_passwd): Ditto.
3136         * autoload.cc (LoadDLLfuncEx): Use LoadDLLprime to initialize DLL
3137         specific area.
3138
3139 Fri May 18 10:31:00 2001  Corinna Vinschen <corinna@vinschen.de>
3140
3141         * net.cc (wsock_event::wait): Explicitely cancel IO when a signal
3142         arrived to avoid data loss. Fallback to blocking IO when canceling
3143         fails.
3144
3145 Thu May 17 15:29:00 2001  Corinna Vinschen <corinna@vinschen.de>
3146
3147         * security.cc (cygwin_set_impersonation_token): Never destroy
3148         previous token object.
3149         (subauth): Create token source with well defined identifier.
3150
3151 Wed May 16 23:27:00 2001  Corinna Vinschen <corinna@vinschen.de>
3152
3153         * uinfo.cc (uinfo_init): Just set user token to INVALID_HANDLE_VALUE.
3154         Token value is already invalid at that point.
3155
3156 Wed May 16 21:34:00 2001  Fred Yankowski <fred@ontosys.com>
3157
3158         * net.cc (errmap): Add missing mapping from WSAEINTR to EINTR.
3159
3160 Wed May 16 09:20:00 2001  Corinna Vinschen <corinna@vinschen.de>
3161
3162         * sec_helper.cc (legal_sid_type): Fix conditional. Change to
3163         inline function.
3164
3165 Wed May 16 01:01:48 2001  Christopher Faylor <cgf@cygnus.com>
3166
3167         * autoload.h: Eliminate.
3168         * autoload.cc: Pull in autoload.h.  Eliminate many macros.  Rewrite to
3169         avoid necessity of initialization routines.  Just use a standard one.
3170         (wsock_init): New function.  Moved from net.cc.
3171         * net.cc (wsock_init): Move to autoload.cc.
3172         (wsadata): Make global.
3173         * dtable.cc (dtable::build_fhandler): Use more reliable method for
3174         checking if net stuff has been loaded.
3175
3176 Tue May 15 19:52:00 2001  Corinna Vinschen <corinna@vinschen.de>
3177
3178         * fork.cc (fork): Eliminate superfluous call to getuid().
3179         * security.h: New define `NO_SID'. Remove declarations of functions
3180         moved to methods into class cygsid.
3181         (class cygsid): Declare new methods `getfromstr', `get_sid',
3182         `getfrompw', `getfromgr', `get_rid', `get_uid', `get_gid', `string'
3183         and new constructors and operators =, == and !=.
3184         Declare new global cygsids `well_known_XXX_sid' substituting the
3185         corresponding `get_XXX_sid' functions. Remove declarations of
3186         these functions.
3187         * sec_helper.cc (well_known_admin_sid): New global variable.
3188         (well_known_system_sid): Ditto
3189         (well_known_creator_owner_sid): Ditto
3190         (well_known_world_sid): Ditto
3191         (cygsid::string): New method, substituting `convert_sid_to_string_sid'.
3192         (cygsid::get_sid): New method, substituting `get_sid'.
3193         (cygsid::getfromstr): New method, substituting
3194         `convert_string_sid_to_sid'.
3195         (cygsid::getfrompw): New method, substituting `get_pw_sid'.
3196         (cygsid::getfromgr): New method, substituting `get_gr_sid'.
3197         (cygsid::get_id): New method, substituting `get_id_from_sid'.
3198         (get_admin_sid): Eliminated.
3199         (get_system_sid): Ditto.
3200         (get_creator_owner_sid): Ditto.
3201         (get_world_sid): Ditto.
3202         * grp.cc: Use new cygsid methods and well known sids throughout.
3203         * registry.cc: Ditto.
3204         * sec_acl.cc: Ditto.
3205         * security.cc: Ditto.
3206         * shared.cc: Ditto.
3207         * syscalls.cc (seteuid): Ditto. Eliminate redundant conditional.
3208         * uinfo.cc (internal_getlogin): Ditto.
3209         * spawn.cc (spawn_guts) Revert previous patch.
3210
3211 Tue May 15 10:20:00 2001  Corinna Vinschen <corinna@vinschen.de>
3212
3213         * fhandler_socket.cc (fhandler_socket::ioctl): Convert s_addr
3214         field to host byte order before comparing with INADDR_LOOPBACK.
3215
3216 Tue May 15  9:03:00 2001  Corinna Vinschen <corinna@vinschen.de>
3217
3218         * autoload.cc: Add autoload statements for ws2_32 functions
3219         `WSACloseEvent', `WSACreateEvent', `WSAGetOverlappedResult',
3220         `WSARecv', `WSARecvFrom', `WSASend', `WSASendTo' and `WSASetEvent',
3221         `WSAWaitForMultipleEvents'.
3222         * net.cc: Define wsock_evt.
3223         (wsock_event): New class.
3224         (cygwin_sendto): Use overlapped socket io if available.
3225         (cygwin_recvfrom): Ditto.
3226         (cygwin_recv): Ditto.
3227         (cygwin_send): Ditto.
3228         * security.cc (subauth): Set Win32 error to 0 to safely ask for the
3229         error code of dynamically loaded function `LsaRegisterLogonProcess'.
3230
3231 Mon May 14 15:37:29 2001  Christopher Faylor <cgf@cygnus.com>
3232
3233         * errno.cc (_sys_errlist): Add missing commas.
3234
3235 Mon May 14 16:13:00 2001  Corinna Vinschen <corinna@vinschen.de>
3236
3237         * security.cc (subauth): Check if Secur32.dll could be loaded.
3238
3239 Sun May 13 22:49:04 2001  Christopher Faylor <cgf@cygnus.com>
3240
3241         * path.cc (path_conv::check): Revert allow_ntsec check so that volume
3242         info is always retrieved and isdisk setting is properly set.
3243
3244 Sun May 13 14:02:36 2001  Christopher Faylor <cgf@cygnus.com>
3245
3246         * fhandler_tty.cc (fhandler_tty_common::dup): Preserve O_NOCTTY when
3247         duping a filehandle.
3248
3249 Sat May 12 18:19:00 2001  Corinna Vinschen <corinna@vinschen.de>
3250
3251         * dir.cc (rmdir): Rearrange slightly to allow removing directories
3252         even when R/O attribute is set.
3253
3254 Fri May 11 16:53:38 2001  Christopher Faylor <cgf@cygnus.com>
3255
3256         * external.cc (fillout_pinfo): Use correct pids.
3257         * path.cc (mount_info::conv_to_win32_path): Correct test for whether to
3258         include a slash.
3259
3260 Fri May 11 01:04:17 2001  Christopher Faylor <cgf@cygnus.com>
3261
3262         * exceptions.cc (handle_exceptions): Don't print message when executing
3263         from a cygwin program.
3264
3265 2001-05-10  Egor Duda  <deo@logos-m.ru>
3266             Christopher Faylor <cgf@redhat.com>
3267
3268         * environ.cc (winenv): Always add SYSTEMDRIVE and SYSYEMROOT to
3269         win32-style environment if they don't already exist.
3270
3271 2001-05-10  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
3272
3273         * path.cc (mount_info::conv_to_win32_path): Treat UNC paths the same as
3274         paths including `:' or `\'.
3275
3276 Wed May  9 14:46:32 2001  Christopher Faylor <cgf@cygnus.com>
3277
3278         * fhandler.h (fhandler_termios::echo_erase): Declare new method.
3279         * fhandler_termios.cc (fhandler_termios::echo_erase): New method for
3280         echoing erase characters.
3281         (fhandler_termios::line_edit): Check the echo flag before echoing
3282         control characters (from Kazuhiro Fujieda <fujieda@jaist.ac.jp>).
3283
3284 Wed May  9 10:43:30 2001  Christopher Faylor <cgf@cygnus.com>
3285
3286         * include/pthread.h: Remove C++ comment.
3287
3288 Tue May  8 11:09:59 2001  Christopher Faylor <cgf@cygnus.com>
3289
3290         * cygheap.cc (_cfree): Add regparm attribute.
3291         (_crealloc): Ditto.
3292
3293         * dcrt0.cc (dll_crt0_1): Default to always checking for executable for now.
3294
3295         * dtable.cc (dtable::not_open): Move method.
3296         * dtable.h (dtable): Here.
3297
3298         * exceptions.cc (ctrl_c_handler): Don't expect process group leader to
3299         handle a signal if it doesn't exist.
3300
3301         * fhandler.h (fhandler_base): Make openflags protected.
3302
3303         * localtime.c (tzsetwall): Check for __CYGWIN__ as well as __WIN32__.
3304
3305         * path.cc (path_conv::check): Add some comments. Change strcat to assignment.
3306
3307         * lib/_cygwin_S_IEXEC.cc (_cygwin_bob__): Eliminate.
3308
3309         * fhandler_tty.cc (fhandler_console::dup): Set controlling terminal if necessary.
3310         * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
3311
3312 Mon May  7 21:33:17 2001  Christopher Faylor <cgf@cygnus.com>
3313
3314         * include/sys/file.h: Revert special X_OK usage.  Just make it a
3315         constant.
3316
3317 Sun May  6 17:05:00 2001  Robert Collins <rbtcollins@hotmail.com>
3318
3319         * thread.h (pthread_cond): New element cond_access to allow atomic
3320         broadcasts.
3321         * thread.cc (pthread_cond::pthread_cond): Initialise cond_access.
3322         (pthread_cond::~pthread_cond): Destroy cond_access.
3323         (pthread_cond::Broadcast): Use cond_access.
3324         (pthread_cond::Signal): Use cond_access.
3325         (pthread_cond_wait): Use cond_access.
3326         (pthread_cond_timedwait): Use cond_access.
3327
3328 Sun May  6 11:55:40 2001  Christopher Faylor <cgf@cygnus.com>
3329
3330         * string.h (cygwin_strchr): Make 'static inline' so that things will
3331         still work when optimized.
3332
3333 Sat May  5 01:04:11 2001  Christopher Faylor <cgf@cygnus.com>
3334
3335         * exceptions.cc (handle_exceptions): Vastly increase test for exception
3336         loop guard variable.
3337
3338 Fri May  4 22:23:33 2001  Christopher Faylor <cgf@cygnus.com>
3339
3340         * exceptions.cc (stack_info): Add some controls.
3341         (stack_info::init): Add extra arguments to control method of
3342         initialization..  If we have a known good frame, set things up so that
3343         this frame is not skipped the first time through.  Record whether
3344         caller cares about arguments or not.
3345         (stack_info::walk): Don't store arguments if they're unwanted.
3346         (stackdump): Add isexception parameter for use when called by exception
3347         handler.
3348         (cygwin_stackdump): Accommodate extra argument to stackdump.
3349         (handle_exceptions): Ditto.
3350         (sig_handle): Ditto.
3351         (interrupt_on_return): Accommodate extra arguments to stack walk
3352         initialization.
3353
3354 Fri May  4 21:05:20 2001  Christopher Faylor <cgf@cygnus.com>
3355
3356         * localtime.c: Revert exclusion of windows.h.
3357
3358 Fri May  4 17:03:16 2001  Christopher Faylor <cgf@cygnus.com>
3359
3360         * string.h: Fix last-minute typo.
3361
3362 Fri May  4 16:49:34 2001  Christopher Faylor <cgf@cygnus.com>
3363
3364         * pinfo.h: Correctly set __SIGOFFSET.
3365
3366         * path.cc (hash_path_name): Avoid calling library functions for simple
3367         copying of characters.
3368
3369         * shortcut.c: Use WIN32_LEAN_AND_MEAN.
3370         * smallprint.c: Ditto.
3371
3372         * environ.cc (getwinenv): Minor clarity fix.
3373
3374         * localtime.c: No need to include windows.h
3375
3376         * string.h: New file.
3377
3378 Fri May  4 16:37:30 2001  Christopher Faylor <cgf@cygnus.com>
3379
3380         * exceptions.cc (ctrl_c_handler): Always send signal to process if it
3381         has no tty.
3382
3383 2001-05-04  Egor Duda  <deo@logos-m.ru>
3384
3385         * fhandler_socket.cc (set_connect_secret): Use /dev/urandom to
3386         generate secret cookie.
3387
3388 Thu May  3 16:37:55 2001  Christopher Faylor <cgf@cygnus.com>
3389
3390         * include/pthread.h (pthread_cleanup_push): Eliminate space preceding
3391         arguments.
3392         (pthread_cleanup_pop): Ditto.
3393
3394 Thu May  3 18:16:00 2001  Corinna Vinschen <corinna@vinschen.de>
3395
3396         * net.cc (wsock_init): Rename `was_in_progress' to `wsock_started'
3397         for clearness.
3398
3399 Thu May  3 10:44:16 2001  Christopher Faylor <cgf@cygnus.com>
3400
3401         * exceptions.cc (handle_exceptions): Break out of "loop" if the
3402         debugger doesn't seem to be attaching to our process.
3403
3404 Wed May  2 20:18:00 2001  Corinna Vinschen <corinna@vinschen.de>
3405
3406         * autoload.cc: Use new definition of LoadDLLinitfunc throughout.
3407         Redefine wrapper for wsock32.dll and ws2_32.dll.
3408         (std_dll_init): New function.
3409         * autoload.h: Rename LoadDLLinitfunc to LoadDLLinitfuncdef.
3410         Add new defines LoadDLLinitfunc and LoadDLLstdfunc.
3411         * net.cc (wsock_init): Add guard variable handling. Take care
3412         to call WSAStartup only once. Load WSAStartup without using
3413         autoload wrapper to eliminate recursion.  Eliminate FIONBIO
3414         and srandom stuff.
3415
3416 Tue May  1 01:26:15 2001  Christopher Faylor <cgf@cygnus.com>
3417
3418         * path.cc (mount_info::conv_to_win32_path): More path tweaking.
3419
3420 Tue May  1 00:34:46 2001  Christopher Faylor <cgf@cygnus.com>
3421
3422         * path.cc (mount_info::conv_to_win32_path): Fix debugging output to
3423         avoid a SIGSEGV.  Avoid double backslashes in middle of filename.
3424
3425 Mon Apr 30 21:51:14 2001  Christopher Faylor <cgf@cygnus.com>
3426
3427         * path.cc (mkrelpath): New function.
3428         (mount_info::conv_to_win32_path): Eliminate now-unneeded relative path
3429         name arg and processing.
3430         (path_conv::check): Accommodate relative path names again.  Accommodate
3431         one extra argument in mount_info::conv_to_win32_path.  Tack trailing
3432         slash on end of relative path as a side effect, like before.
3433         * shared_info.h (mount_info::conv_to_win32_path): Reflect new argument
3434         ordering.
3435
3436 Mon Apr 30 22:09:00 2001  Corinna Vinschen <corinna@vinschen.de>
3437
3438         * autoload.cc: Add LoadDLLinitfunc for secur32.dll.
3439         Add LoadDLLfuncEx statements for AllocateLocallyUniqueId@4,
3440         DuplicateTokenEx@24, LsaNtStatusToWinError@4,
3441         LsaDeregisterLogonProcess@4, LsaFreeReturnBuffer@4,
3442         LsaLogonUser@56, LsaLookupAuthenticationPackage@12,
3443         LsaRegisterLogonProcess@12,
3444         * environ.cc: Add extern declaration for `subauth_id'.
3445         (subauth_id_init): New function for setting `subauth_id'.
3446         (struct parse_thing): Add entry for `subauth_id'.
3447         * fork.cc (fork_parent): Call `RevertToSelf' and
3448         `ImpersonateLoggedOnUser' instead of `seteuid'.
3449         * security.cc: Define global variable `subauth_id'.
3450         (extract_nt_dom_user): New function.
3451         (cygwin_logon_user): Call `extract_nt_dom_user' now.
3452         (str2lsa): New static function.
3453         (str2buf2lsa): Ditto.
3454         (str2buf2uni): Ditto.
3455         (subauth): Ditto.
3456         * security.h: Add prototype for `subauth'.
3457         * spawn.cc (spawn_guts): Use cygheap->user.token only if impersonated.
3458         Use `cygsid' type. Remove impersonation before allowing access to
3459         workstation/desktop to everyone. Call `RevertToSelf' and
3460         `ImpersonateLoggedOnUser' instead of `seteuid'.
3461         * syscalls.cc (seteuid): Rearranged to allow using subauthentication
3462         to retrieve user tokens when needed.
3463
3464 Mon Apr 30 20:26:00 2001  Corinna Vinschen <corinna@vinschen.de>
3465
3466         * uinfo.cc (internal_getlogin): Formatting change.
3467
3468 Mon Apr 30 19:58:00 2001  Corinna Vinschen <corinna@vinschen.de>
3469
3470         * grp.cc: Eliminate MAX_DOMAIN_NAME define.
3471         (read_etc_group): Substitute MAX_DOMAIN_NAME by
3472         INTERNET_MAX_HOST_NAME_LENGTH.
3473         * passwd.cc (parse_pwd): Don't force pw_name to be lower case.
3474         * sec_helper.cc: Substitute MAX_USER_NAME by UNLEN,
3475         MAX_COMPUTERNAME_LENGTH by INTERNET_MAX_HOST_NAME_LENGTH throughout.
3476         (lookup_name): Slight cleanup.
3477         * security.cc (alloc_sd): Substitute MAX_USER_NAME by UNLEN.
3478         * security.h: Define DEFAULT_UID as DOMAIN_USER_RID_ADMIN and
3479         DEFAULT_GID as DOMAIN_ALIAS_RID_ADMINS.
3480         * shared.cc (memory_init): Substitute MAX_USER_NAME by UNLEN.
3481         * thread.h: Ditto.
3482         * uinfo.cc (internal_getlogin): Substitute MAX_USER_NAME by UNLEN.
3483         Substitute MAX_COMPUTERNAME_LENGTH and MAX_HOST_NAME by
3484         INTERNET_MAX_HOST_NAME_LENGTH.
3485         * winsup.h: Include lmcons.h. Eliminate MAX_USER_NAME and
3486         MAX_HOST_NAME. Move DEFAULT_UID and DEFAULT_GID to security.h.
3487
3488 Mon Apr 30 12:35:40 2001  Christopher Faylor <cgf@cygnus.com>
3489
3490         * path.cc (path_conv::check): Don't use path_flags when converting to
3491         MS-DOS syntax unless parsing tail of path component.  Stop parsing path
3492         when we reach the 'root' of the path.  Correctly copy tail to path
3493         component.
3494
3495 Sun Apr 29 22:28:06 2001  Christopher Faylor <cgf@cygnus.com>
3496
3497         * exceptions.cc (INIT_EXCEPTION_HANDLER): Eliminate.
3498         (init_exceptions): Just use init_exception_handler.
3499         (open_stackdumpfile): New function.
3500         (stack_info::first_time): Eliminate.
3501         (stack_info::init): Set up fields to avoid "first_time" consideration.
3502         (stack_info::walk): Remove "first_time" consideration.
3503         (stackdump): Change arguments to accept initial frame pointer and open
3504         stack file flag.
3505         (stack): Eliminate.
3506         (cygwin_stackdump): Use stackdump() rather than stack().
3507         (try_to_debug): Remove all synchronization logic.  Just keep looping in
3508         exception handler until debugger notices us.  Return 1 if successfully
3509         started debugger.
3510         (handle_exceptions): Just return if we know that we're debugging.
3511         Reorganize to avoid creating a stackdump file if we are starting a
3512         debugger.  Return from exception handler if debugger started
3513         successfully.
3514         (sig_handle): Create a stackdump only if debugger wasn't started.
3515         * winsup.h (try_to_debug): Add an argument.
3516
3517 Sun Apr 29 21:41:25 2001  Christopher Faylor <cgf@cygnus.com>
3518
3519         * path.cc (symlink_info::check): Remove extra arguments, move
3520         functionality back to path_conv::check.  Clear symlink bit from pflags
3521         argument before detecting if this is a symlink.
3522         (path_conv::check): Convert posix path here instead of
3523         symlink_info::check.  Only grab volflags when using ntsec.
3524         (symlink_info::check_case): Just replace appropriate part of input
3525         path.
3526
3527 Sat Apr 28 19:36:13 2001  Christopher Faylor <cgf@cygnus.com>
3528
3529         Throughout, change 'tty_attached' to 'real_tty_attached', for clarity.
3530         Throughout, change 'OutputStopped' to 'output_stopped', for
3531         consistency.
3532         * dtable.cc (stdio_init): Set controlling tty if not set by stdio
3533         opens.
3534         * exceptions.cc (ctrl_c_handler): Avoid special pgid checking if no tty
3535         is associated with the process.
3536         (Suggested by Tim Baker <dbaker@direct.ca>)
3537         * external.cc (fillout_pinfo): Return actual tty number for ctty.
3538         * fhandler_console.cc (get_tty_stuff): Set ctty when shared memory is
3539         allocated.  Accept flags input from open().
3540         (set_console_ctty): New function.
3541         (fhandler_console::open): Pass flags to get_tty_stuff and rely on this
3542         function to set the ctty, if appropriate.
3543         * fhandler_termios.cc (fhandler_termios::set_ctty): Move to tty_min
3544         class.
3545         * fhandler_tty.cc (fhandler_tty_slave::open): Use tc field to access
3546         set_ctty().
3547         * tty.h (TTY_CONSOLE): Move to include/sys/cygwin.h.
3548         (tty_min): Add set_ctty class here.
3549         * include/sys/cygwin.h (TTY_CONSOLE): New home here.
3550
3551         * path.cc (symlink_info): Make contents an actual buffer.  Pass more
3552         flags to case_check.
3553         (path_conv::check): Reorganize to do parsing based on posix path rather
3554         than native path.
3555         (symlink_info::check): Expect posix path as input.  Translate to native
3556         path here.  Accept path_conv flags.  Stop parsing if not a symlink
3557         regardless of whether previous path was a symlink.
3558
3559 2001-04-27  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
3560
3561         * thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the
3562         reent structure of newlib.
3563
3564 Fri Apr 27 14:02:24 2001  Christopher Faylor <cgf@cygnus.com>
3565
3566         * sigproc.h (sig_send): Add exception parameter to sig_send.
3567         * sigproc.cc (sig_send): Ditto.  Use it when setting frame info.
3568         * exceptions.cc (handle_exceptions): Use exception flag when calling
3569         sig_send.
3570
3571 2001-04-27  Egor Duda  <deo@logos-m.ru>
3572
3573         * tty.cc (tty::make_pipes): Set to_slave pipe mode to nonblocking.
3574         * fhandler_tty.cc (fhandler_pty_master::accept_input): If pipe buffer
3575         is full, give slave a chance to read data.
3576
3577 2001-04-26  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
3578
3579         * security.cc (alloc_sd): Add unrelated ACCESS_ALLOWED_ACE behind
3580         the `everyone' ACE.
3581
3582 Wed Apr 25 15:07:37 2001  Christopher Faylor <cgf@cygnus.com>
3583
3584         * sigproc.h [sigthread]: Add exception field.
3585         [sigframe::~sigframe]: Clear exception field.
3586         [sigframe::set]: Set exception field from caller.
3587         * sigproc.cc (sig_send): Set exception field when frame pointer is
3588         passed in.
3589         * exceptions.cc (interrupt_on_return): Always treat exception as
3590         interruptible.
3591
3592 2001-04-25  Egor Duda  <deo@logos-m.ru>
3593
3594         * cygwin.din: Export asctime_r, ctime_r, gmtime_r, localtime_r
3595         * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 39
3596
3597 Wed Apr 25 10:57:36 2001  Christopher Faylor <cgf@cygnus.com>
3598
3599         * include/cygwin/version.h: Bump minor version number.
3600         * childinfo.h: Bump child structure magic number.
3601
3602 2001-04-25  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
3603
3604         * uinfo.cc (internal_getlogin): Return pointer to struct passwd.
3605         (uinfo_init): Accommodate the above change.
3606         * syscalls.cc (seteuid): Ditto.
3607
3608 Tue Apr 25 11:08:00 2001  Corinna Vinschen <corinna@vinschen.de>
3609
3610         * autoload.cc: Add LoadDLLfunc statements for SetTokenInformation@16.
3611         * cygheap.cc: Include security.h.
3612         * grp.cc (internal_getgrent): New function.
3613         (getgroups): Rearranged using `internal_getgrent' and the new
3614         `cygsid' class.
3615         * passwd.cc (internal_getpwent): New function.
3616         * sec_acl.cc: Use new `cygsid' class throughout.
3617         (acl_access): Use `internal_getgrent' instead of `getgrent'.
3618         * sec_helper.cc: Use new `cygsid' class throughout.
3619         (get_id_from_sid): Use `internal_getgrent' instead of `getgrent'.
3620         Use `internal_getpwent' instead of `getpwent'.
3621         * security.cc: Use new `cygsid' class throughout.
3622         * security.h: Move `MAX_SID_LEN' from winsup.h to here.
3623         Add extern declarations for `internal_getgrent' and `internal_getpwent'.
3624         (class cygsid): New class.
3625         * shared.cc (sec_user): Use new `cygsid' class.
3626         * syscalls.cc (seteuid): Try to set owner to user and primary group to
3627         current group in impersonation token before performing impersonation.
3628         (setegid): Try to set primary group in process token to the new group
3629         if ntsec is on.
3630         * uinfo.cc (internal_getlogin): Use new `cygsid' class.
3631         Try to set owner to user and primary group to current group in process
3632         token if the process has been started from a non cygwin process.
3633         (uinfo_init): Set primary group only if the process has been started
3634         from a non cygwin process.
3635         * winsup.h: Move define for `MAX_SID_LEN' to security.h.
3636
3637 Mon Apr 16 23:20:00 2001  Andy Younger <andylyounger@hotmail.com>
3638
3639         * fhandler_dsp.cc: Improved handling of 8 bit playback modes.
3640         Put in mock support for SNDCTL_DSP_SETFRAGMENT.
3641
3642 Tue Apr 24 23:51:00 2001  Corinna Vinschen <corinna@vinschen.de>
3643
3644         * passwd.cc (getpwnam_r): Add pw_passwd handling as well.
3645         (getpwuid_r): Ditto.
3646
3647 Tue Apr 24 23:43:00 2001  Corinna Vinschen <corinna@vinschen.de>
3648
3649         * passwd.cc (getpwnam_r): Use correct offsets into buffer.
3650         Copy pw_gecos field as well.
3651         (getpwuid_r): Ditto.
3652
3653 2001-04-24  Egor Duda  <deo@logos-m.ru>
3654
3655         * dlmalloc.c: New file. Port of Doug Lea's malloc
3656         * dlmalloc.h: Ditto.
3657         * Makefile.in: Add support for MALLOC_DEBUG
3658         * config.h.in: Ditto.
3659         * winsup.h: Ditto.
3660         * configure.in: Add --enable-malloc-debugging option.
3661         * configure: Regenerate.
3662         * debug.h: Include declarations for debugging malloc.
3663         * tty.cc (grantpt): Fix definition.
3664         (unlockpt): Ditto.
3665
3666 Mon Apr 23 22:00:29 2001  Christopher Faylor <cgf@cygnus.com>
3667
3668         Remove trailing underscore from fhandler_base and friends, throughout.
3669         * fhandler.h (fhandler_base::set_open_status): New method.  Stores
3670         original open status.
3671         (fhandler_base::get_open_status): New method.  Retrieves original open
3672         status.
3673         (fhandler_base::reset_to_open_binmode): New method.
3674         * fhandler.cc (fhandler_base::open): Save open status.
3675         (fhandler_base::init): Ditto.
3676         * fhandler_clipboard.cc (fhandler_clipboard::open): Ditto.
3677         * fhandler_console.cc (fhandler_console::open): Ditto.
3678         * fhandler_dsp.cc (fhandler_dsp::open): Ditto.
3679         * fhandler_dev_mem.cc (fhandler_dev_mem::open): Ditto.
3680         * fhandler_dev_random.cc (fhandler_dev_random::open): Ditto.
3681         * fhandler_serial.cc (fhandler_serial::open): Ditto.
3682         * fhandler_tty_slave.cc (fhandler_tty_slave::open): Ditto.
3683         * fhandler_tty_master.cc (fhandler_tty_master::open): Ditto.
3684         * fhandler_dev_zero.cc (fhandler_dev_zero::open): Ditto.
3685         * syscalls.cc (setmode): Rework so that 0 mode value causes reversion
3686         to open state.
3687
3688         * fhandler_tty_slave.cc (fhandler_tty_slave::read): Use correct
3689         multiplier when converting from deciseconds to milliseconds.
3690
3691 Mon Apr 23 13:28:35 2001  Christopher Faylor <cgf@cygnus.com>
3692
3693         * fhandler.h (fhandler_base::clear_r_binary): New method.
3694         (fhandler_base::clear_w_binary): New method.
3695         * syscalls.cc (setmode): Accept 0 as mode value.  Resets text/binary
3696         behavior for fd to default.
3697
3698 Mon Apr 23 12:46:07 2001  Christopher Faylor <cgf@cygnus.com>
3699
3700         * net.cc [errmap]: Add '0' condition.
3701         (find_winsock_errno): Don't translate no error to EPERM.
3702
3703 Sun Apr 22 20:48:24 2001  Christopher Faylor <cgf@cygnus.com>
3704
3705         * include/cygwin/version.h: Bump Cygwin version and API version.
3706
3707 Mon Apr 23  9:27:00 2001  Robert Collins <rbtcollins@hotmail.com>
3708
3709         * thread.cc (MTinterface::Init): Always initialise per process variables.
3710
3711 Sun Apr 22 19:18:18 2001  Christopher Faylor <cgf@cygnus.com>
3712
3713         * features.h: Reinstate as wrapper for sys/features.h.
3714
3715 Mon Apr 23  0:10:00 2001  Corinna Vinschen <corinna@vinschen.de>
3716
3717         * security.cc (alloc_sd): Reformat comment.
3718         * shared.cc: Drop function declarations already in security.h.
3719
3720 Sun Apr 22 12:17:57 2001  Christopher Faylor <cgf@cygnus.com>
3721
3722         * shortcut.c (check_shortcut): Close input file handle before
3723         returning.
3724         * path.cc (check_sysfile): Ditto.
3725         (symlink_info::check): Rely on opened file handle being closed by
3726         symlink checking routines.  Set ext_tacked_on when .lnk is detected.
3727
3728 Sat Apr 21 19:26:05 2001  Christopher Faylor <cgf@cygnus.com>
3729
3730         * thread.cc (MTinterface::Init): Remove accidentally checked in code.
3731
3732 Sun Apr 22 00:22:00 2001  Robert Collins <rbtcollins@hotmail.com>
3733
3734         * passwd.cc (getpwuid): Check for thread cancellation.
3735         (getpwuid_r): Ditto.
3736         (getpwname): Ditto.
3737         (getpwnam_r): Ditto.
3738         * thread.h (pthread_mutex): New constructors for pshared operation.
3739         (MTinterface): Associative array for pshared mutex's.
3740         * thread.cc (MTinterface::Init): Initailize pshared mutex array.
3741         (pthread_cond::BroadCast): Implementation notes.
3742         (pthread_cond::TimedWait): Remove use of SignalObjectAndWait on non-NT systems.
3743         (pthread_mutex::pthread_mutex(unsigned short)): New function.
3744         (pthread_mutex::pthread_mutex (pthread_mutex_t *, pthread_mutexattr *)):New function.
3745         (pthread_mutex::pthread_mutex(pthread_mutexattr *)): Fail on pshared mutex's.
3746         (__pthread_mutex_getpshared): New function.
3747         (__pthread_join): Check for thread cancellation.
3748         (__pthread_cond_timedwait): Support pshared mutex's.
3749         (__pthread_cond_wait): Ditto.
3750         (__pthread_condattr_setpshared): Error on PROCESS_SHARED requests.
3751         (__pthread_mutex_init): Support pshared mutex's.
3752         (__pthread_mutex_getprioceiling): Ditto.
3753         (__pthread_mutex_lock): Ditto.
3754         (__pthread_mutex_trylock): Ditto.
3755         (__pthread_mutex_unlock): Ditto.
3756         (__pthread_mutex_destroy): Ditto.
3757         (__pthread_mutex_setprioceiling): Ditto.
3758         (__pthread_mutexattr_setpshared): Support PTHREAD_PROCESS_PSHARED requests.
3759
3760 Fri Apr 20 19:38:29 2001  Christopher Faylor <cgf@cygnus.com>
3761
3762         * cygwin.din: Add *scanf and *scan_r functions.
3763
3764 Fri Apr 20 22:25:00 2001  Corinna Vinschen <corinna@vinschen.de>
3765
3766         * security.cc (set_process_privileges): Swap out.
3767         * sec_helper.cc (set_process_privilege): Rename from
3768         `set_process_privileges'. Takes the privilege to enable or disable
3769         as parameter now.
3770         * security.h: Add prototype for `set_process_privileges'.
3771
3772 2001-04-19  Egor Duda  <deo@logos-m.ru>
3773
3774         * path.cc (path_conv::check): Always initialize member variables.
3775
3776 Fri Apr 20 12:27:49 2001  Christopher Faylor <cgf@cygnus.com>
3777
3778         * include/sys/file.h: More cleanup for X_OK.
3779
3780 Fri Apr 20 11:48:45 2001  Christopher Faylor <cgf@cygnus.com>
3781
3782         * include/sys/file.h: Move X_OK protection earlier.
3783
3784         * dtable.cc (dtable::vfork_child_fixup): Avoid closing already closed
3785         handles.
3786
3787 Fri Apr 20 16:29:00 2001  Corinna Vinschen <corinna@vinschen.de>
3788
3789         * grp.cc (getgroups): Change so that SIDs get compared instead
3790         of strings to SIDs.
3791
3792 Fri Apr 20 14:50:00 2001  Corinna Vinschen <corinna@vinschen.de>
3793
3794         * Makefile.in: Add object files `sec_helper.cc' and `sec_acl.cc'.
3795         * security.cc: Swap out several functions.
3796         * sec_acl.cc: New file. Move Sun compatibel ACL functions from
3797         `security.cc' to here.
3798         * sec_helper.cc: New file. Move security helper functions from
3799         `security.cc' to here.
3800         * security.h: Changed to accommodate the above changes.
3801
3802 Fri Apr 20 14:12:00 2001  Corinna Vinschen <corinna@vinschen.de>
3803
3804         * grp.cc: Replace `group_in_memory_p' by `group_state'.
3805         Eliminate group_sem throughout.
3806         (enum grp_state): New enumeration type.
3807         (read_etc_group): Make race safe.
3808         * security.cc: Eliminate group_sem throughout.
3809
3810 Thu Apr 19  9:40:00 2001  Corinna Vinschen <corinna@vinschen.de>
3811
3812         * mmap.cc (mmap): Drop usage of the same memory area if the same
3813         region of the same file is mapped twice.
3814
3815 Wed Apr 18 16:53:54 2001  Christopher Faylor <cgf@cygnus.com>
3816
3817         Throughout, change fdtab references to cygheap->fdtab.
3818         * child_info.h (cygheap_exec_info): Eliminate special fdtab stuff.
3819         * spawn.cc (spawn_guts): Ditto.
3820         * cygheap.cc (cygheap_init): Initialize fdtab, if appropriate.
3821         * cygheap.h (CYGHEAPSIZE): Include size of init_cygheap.
3822         (_cmalloc_entry): Include fdtab here.
3823         * dtable.h (dtable): Declare/define new methods.
3824         * dtable.cc (dtable::vfork_child_fixup): New method.
3825         (dtable::fixup_after_exec): Remove unneeded extra arguments.
3826         * dcrt0.cc (dll_crt0_1): Ditto.
3827
3828         * environ.cc (getwinenv): Use case sensitive comparison.
3829         (winenv): Make a copy of environment cache to avoid realloc problems
3830         when duplicate environment variables exist in the environment.  (From
3831         Egor Duda)
3832
3833         * net.cc (cygwin_socket): Revert Apr 14 change.
3834
3835         * include/sys/file.h: Protect against previous X_OK definition.
3836
3837 Tue Apr 17 12:18:28 2001  Christopher Faylor <cgf@cygnus.com>
3838
3839         * passwd.cc: Eliminate passwd_sem throughout.
3840         * security.cc: Ditto.
3841
3842 Tue Apr 17 12:18:28 2001  Robert Collins <rbtcollins@hotmail.com>
3843
3844         * cygwin.din: Export New functions.
3845         * passwd.cc (read_etc_passwd): Make race safe.
3846         (getpwuid_r): New function.
3847         (getpwnam_r): New function.
3848
3849 2001-04-18  Egor Duda  <deo@logos-m.ru>
3850
3851         * grp.cc (getgroups): Avoid crash if passwd field if /etc/group is
3852         empty.
3853
3854 Tue Apr 17 19:05:44 2001  Christopher Faylor <cgf@cygnus.com>
3855
3856         * path.h (path_conv::add_ext_from_sym): Declare.
3857         * path.cc (path_conv::add_ext_from_sym): Convert to pure inline method.
3858
3859 Tue Apr 17 18:50:00 2001  Corinna Vinschen <corinna@vinschen.de>
3860
3861         * path.cc (windows_device_names): Add missing NULL element.
3862
3863 Tue Apr 17 12:14:54 2001  Christopher Faylor <cgf@cygnus.com>
3864
3865         * path.cc (windows_device_names): Move dsp to proper location.
3866
3867 Tue Apr 17 13:44:00 2001  Corinna Vinschen <corinna@vinschen.de>
3868
3869         * path.cc (path_conv::check): Set case_clash even if pcheck_case
3870         is set to PCHECK_ADJUST when a case clash is given for the last
3871         component in path.
3872         (symlink_info::case_check): Ditto.
3873         * syscalls.cc (_rename): Avoid overwriting an already existing file
3874         if a case clash is given even if pcheck_case is set to PCHECK_ADJUST.
3875
3876 Tue Apr 17  2:07:07 2001  Christopher Faylor <cgf@cygnus.com>
3877
3878         * config.h.in: Turn off VFORK again.
3879
3880 Mon Apr 16 23:45:24 2001  Christopher Faylor <cgf@cygnus.com>
3881
3882         * path.h (cwdstuff): Move class.
3883         * cygheap.h (cwdstuff): To here.
3884         (init_cygheap): Add cwd field.
3885         * child_info.h (cygheap_exec_info): Eliminate cwd stuff.
3886         (child_info_spawn): Ditto.
3887         * dcrt0.cc (dll_crt0_1): Remove cygcwd.fixup_after_exec call.  Convert
3888         cygcwd reference to cygheap->cwd.
3889         * path.cc: Ditto, throughout.
3890         (cwdstuff::copy): Eliminate.
3891         (cwdstuff::fixup_after_exec): Ditto.
3892         * spawn.cc (spawn_guts): Eliminate call to cygcwd.copy.
3893
3894         * fhandler.h (FH_OSS_DSP): Move into "fast" device category.
3895
3896 Mon Apr 16 19:19:00 2001  Corinna Vinschen <corinna@vinschen.de>
3897
3898         * mmap.cc: Move fh_paging_file from some functions to be
3899         a global static variable.
3900         (class mmap_record): Add `devtype_' member to remember
3901         the device type of the file. Add declaration for methods
3902         `get_device', `alloc_fh' and `free_fh'.
3903         (mmap_record::mmap_record): Initialize `devtype_' correctly.
3904         (mmap_record::alloc_fh): New method.
3905         (mmap_record::free_fh): Ditto.
3906         (munmap): Use new mmap_record::alloc_fh and mmap_record::free_fh
3907         methods to create a correct fhandler.
3908         (msync): Ditto.
3909         (fixup_mmaps_after_fork): Ditto.
3910
3911 Mon Apr 16 16:01:00 2001  Corinna Vinschen <corinna@vinschen.de>
3912
3913         * grp.cc (getgroups): If `allow_ntsec' is set, use the process token
3914         information to evaluate the groups list.
3915
3916 Mon Apr 16 00:08:02 2001  Christopher Faylor <cgf@cygnus.com>
3917
3918         * features.h: Remove this file as it is now being supplied by newlib.
3919
3920 Sun Apr 15 23:23:29 2001  Christopher Faylor <cgf@cygnus.com>
3921
3922         * autoload.cc: Add winmm functions needed by fhandler_dsp.cc.
3923
3924 Sun Apr 15 22:53:52 2001  Andy Younger <andylyounger@hotmail.com>
3925
3926         * fhandler_dsp.cc: New file.  Implements OSS like /dev/dsp.
3927         * include/sys/soundcard.h: New file.  User land includes for OSS
3928         /dev/dsp.
3929         * fhandler.h: Add new class fhandler_dev_dsp and a FH_OSS_DSP
3930         definition.
3931         * dtable.cc (dtable::build_fhandler): Allow creation of the /dev/dsp
3932         device.
3933         * path.cc (windows_device_names): Add /dev/dsp into list of device
3934         names.
3935         * Makefile.in (DLL_OFILES): Add fhandler_dsp.o.
3936
3937 Sun Apr 15 16:36:27 2001  Christopher Faylor <cgf@cygnus.com>
3938
3939         * uname.c (uname): Default n in in86 to 6 if Windows returns > 6.
3940
3941 Sun Apr 15 15:56:00 2001  Corinna Vinschen <corinna@vinschen.de>
3942
3943         * path.cc (add_ext_from_sym): Redefine to call `add_ext_from_sym_'.
3944         (add_ext_from_sym_): New inline function.
3945
3946 Sat Apr 14 19:23:52 2001  Christopher Faylor <cgf@cygnus.com>
3947
3948         * config.h.in: Turn on VFORK by default.
3949
3950 Sat Apr 14 18:04:35 2001  Christopher Faylor <cgf@cygnus.com>
3951
3952         * net.cc (cygwin_socket): Set SO_LINGER to small value so closed UNIX
3953         domain sockets will not stay around.
3954
3955 Sat Apr 14 18:01:43 2001  Pierre A. Humblet  <Pierre.Humblet@ieee.org>
3956
3957         * select.cc (socket_cleanup): Set SO_LINGER to small value so closed
3958         dummy sockets do not stay around.  Use correct value for second argument
3959         to shutdown.
3960
3961 Sat Apr 14 17:04:00 2001  Robert Collins <rbtcollins@hotmail.com>
3962
3963         * thread.h (MTinterface): Add threadcount.
3964         * thread.cc (MTinterface::Init): Set threadcount to 1.
3965         (__pthread_create): Increment threadcount.
3966         (__pthread_exit): Decrement threadcount and call exit() from the last thread.
3967
3968 Fri Apr 13 11:34:24 2001  Robert Collins <rbtcollins@hotmail.com>
3969
3970         * fork.cc (fork_child): Call the __pthread_atforkchild function.
3971         (fork_parent): Call the __pthread_atforkparent function.
3972         * cygwin.din: Export pthread_atfork.
3973         * thread.h (callback): New class.
3974         (MTinterface): Use it.
3975         * thread.cc (__pthread_atforkprepare): New function.
3976         (__pthread_atforkparent): New function.
3977         (__pthread_atforkchild): New function.
3978         (__pthread_atfork): New function.
3979         * pthread.cc (pthread_atfork): New function.
3980
3981 Fri Apr 13  9:52:00 2001  Corinna Vinschen <corinna@vinschen.de>
3982
3983         * path.cc (add_ext_from_sym): New define evaluating `known'suffix'.
3984         (path_conv::check): Use add_ext_from_sym throughout.
3985
3986 Thu Apr 12 23:19:00 2001  Corinna Vinschen <corinna@vinschen.de>
3987
3988         * dir.cc (mkdir): Check for case clash.
3989         * environ.cc: Add extern declaration for `pcheck_case'.
3990         (check_case_init): New function.
3991         (struct parse_thing): Add "check_case" option.
3992         * errno.cc (_sys_nerrlist): Add text for ECASECLASH.
3993         (strerror): Add case branch for ECASECLASH.
3994         * fhandler.cc (fhandler_disk_file::open): Check for case clash.
3995         * path.cc: Add global variable `pcheck_case'.
3996         (struct symlink_info): Add member `case_clash' and method `case_check'.
3997         (path_prefix_p_): Call `pathnmatch' instead of `strncasematch'.
3998         (pathnmatch): New funtion.
3999         (pathmatch): Ditto.
4000         (path_conv::check): Add handling for case checking.
4001         (symlink): Check for case clash.
4002         (symlink_info::check): Add parameter for case checking.
4003         Handle case checking.
4004         (symlink_info::case_check): New method.
4005         (chdir): Don't use unconverted path if pcheck_case==PCHECK_STRICT.
4006         * path.h: Add extern declarations for `pathmatch' and
4007         `pathnmatch'.
4008         (enum case_checking): New enumeration type describing
4009         the case checking behaviour of path conversion routines.
4010         (class path_conv): Add member `case_clash'.
4011         * syscalls.cc (_link): Check for case clash.
4012
4013 Thu Apr 12 12:49:53 2001  Christopher Faylor <cgf@cygnus.com>
4014
4015         * syscalls.cc (mkfifo): New function stub.
4016
4017 2001-04-12   Robert Collins <rbtcollins@hotmail.com>
4018
4019         * configure.in: Remove PTH_ALLOW.
4020         * cygwin.din: Remove @PTH_ALLOW@ prefixes to pthread functions.  Add
4021         new pthread exports.
4022         * pthread.cc: New wrapper functions for the above new exports.
4023         * sched.cc (valid_sched_parameters): New function.
4024         (sched_setparam): Use it.
4025         (sched_set_thread_priority): New function.  Used by pthread_sched*.
4026         * thread.cc (pthread_key_destructor::InsertAfter): New function.
4027         (pthread_key_destructor::UnlinkNext): New function.
4028         (pthread_key_destructor::Next): New function.
4029         (pthread_key_destructor_list::Insert): New function.
4030         (pthread_key_destructor_list::Remove): New function.
4031         (pthread_key_destructor_list::Pop): New function.
4032         (pthread_key_destructor::pthread_key_destructor): New function.
4033         (pthread_key_destructor_list::IterateNull): New function.
4034         (MTinterface::Init): Initialise new member.
4035         (pthread::pthread): Initialise new members.
4036         (pthread::create): Copy new attributes.  Set the new thread priority.
4037         (pthread_attr::pthread_attr): Initialise new members.
4038         (pthread_key::pthread_key): Setup destructor function.
4039         (pthread_key::~pthread_key): Remove destructor function.
4040         (pthread_mutexattr::pthread_mutexattr): New function.
4041         (pthread_mutexattr::~pthread_mutexattr): New function.
4042         (__pthread_once): New function.
4043         (__pthread_cleanup): New function.
4044         (__pthread_cancel): New function.
4045         (__pthread_setcancelstate): New function.
4046         (__pthread_setcanceltype): New function.
4047         (__pthread_testcancel): New function.
4048         (__pthread_attr_getinheritsched): New function.
4049         (__pthread_attr_getschedparam): New function.
4050         (__pthread_attr_getschedpolicy): New function.
4051         (__pthread_attr_getscope): New function.
4052         (__pthread_attr_setinheritsched): New function.
4053         (__pthread_attr_setschedparam): New function.
4054         (__pthread_attr_setschedpolicy): New function.
4055         (__pthread_attr_setscope): New function.
4056         (__pthread_exit): Call any key destructors on thread exit.
4057         (__pthread_join): Use the embedded attr values.
4058         (__pthread_detach): Use the embedded attr values.
4059         (__pthread_getconcurrency): New function.
4060         (__pthread_getschedparam): New function.
4061         (__pthread_key_create): Pass the destructor on object creation.
4062         (__pthread_key_delete): Correct incorrect prototype.
4063         (__pthread_setconcurrency): New function.
4064         (__pthread_setschedparam): New function.
4065         (__pthread_cond_timedwait): Support static mutex initialisers.
4066         (__pthread_cond_wait): Ditto.
4067         (__pthread_mutex_getprioceiling): New function.
4068         (__pthread_mutex_lock): Support static mutex initialisers.
4069         (__pthread_mutex_trylock): Ditto.
4070         (__pthread_mutex_unlock): Ditto.
4071         (__pthread_mutex_destroy): Ditto.
4072         (__pthread_mutex_setprioceiling): New function.
4073         (__pthread_mutexattr_getprotocol): New function.
4074         (__pthread_mutexattr_getpshared): New function.
4075         (__pthread_mutexattr_gettype): New function.
4076         (__pthread_mutexattr_init): New function.
4077         (__pthread_mutexattr_destroy): New function.
4078         (__pthread_mutexattr_setprotocol): New function.
4079         (__pthread_mutexattr_setprioceiling): New function.
4080         (__pthread_mutexattr_getprioceiling): New function.
4081         (__pthread_mutexattr_setpshared): New function.
4082         (__pthread_mutexattr_settype): New function.  Remove stubs for non
4083         MT_SAFE compilation.
4084         * thread.h: Remove duplicate #defines.  Add prototypes for new
4085         functions in thread.cc.
4086         (pthread_key_destructor): New class.
4087         (pthread_key_destructor_list): New class.
4088         (pthread_attr): Add new members.
4089         (pthread): Remove members that are duplicated in the pthread_attr
4090         class.
4091         (pthread_mutex_attr): Add new members.
4092         (pthread_once): New class.
4093         * include/pthread.h: Add prototypes for new functions exported from
4094         cygwin1.dll.  Remove typedefs.
4095         * include/sched.h: Add prototypes for new functions in sched.cc.
4096         * include/cygwin/types.h: Add typedefs from pthread.h
4097
4098 Tue Apr 10 22:02:53 2001  Christopher Faylor <cgf@cygnus.com>
4099
4100         * path.cc (struct symlink_info): Add extn and ext_tacked_on fields.
4101         (path_conv::check): Only tack on extension if a known one didn't
4102         already exist.
4103         (suffix_scan::has): Return pointer to known extension.
4104         (symlink_info::check): Record location of extension, if any.
4105
4106 2001-04-09  Egor Duda  <deo@logos-m.ru>
4107
4108         * fhandler.h (class fhandler_socket): Add members and methods to
4109         support secure connections on AF_UNIX sockets.
4110         * fhandler_socket.cc (fhandler_socket::set_connect_secret): New method.
4111         (fhandler_socket::get_connect_secret): Ditto.
4112         (fhandler_socket::create_secret_event): Ditto.
4113         (fhandler_socket::close_secret_event): Ditto.
4114         (fhandler_socket::check_peer_secret_event): Ditto.
4115         (fhandler_socket::fixup_after_fork): Duplicate secret event to child.
4116         (fhandler_socket::dup): Copy address family.
4117         (fhandler_socket::close): Close secret event.
4118         * net.cc (get_inet_addr): Read secret cookie.
4119         (cygwin_connect): Check if peer knows secret cookie value.
4120         (cygwin_accept): Ditto. Copy address family to newly created socket.
4121         (cygwin_bind): Generate and write secret cookie.
4122         (wsock_init): Initialize random number generator.
4123
4124 Sun Apr  8 20:40:58 2001  Christopher Faylor <cgf@cygnus.com>
4125
4126         * Makefile.in: Put -lgcc last in list of libraries, since stdc++
4127         library needs it.
4128         * cygwin.din: Remove obsolete "__empty" export.
4129         * exceptions.cc (call_signal_handler_now): Force inclusion of function
4130         even when -finline-functions is specified.
4131         * sigproc.h: Remove obsolete call_signal_handler declaration.
4132
4133 Sun Apr  8 20:36:55 2001  Benjamin Riefenstahl  <Benjamin.Riefenstahl@epost.de>
4134
4135         * fhandler_console.cc (cp_get_internal): New function.
4136         (cp_convert): New function.
4137         (con_to_str): New function.
4138         (str_to_con): New function.
4139         (fhandler_console::read): Replace OemToCharBuff with con_to_str.
4140         (fhandler_console::write_normal): Replace CharToOemBuff with str_to_con.
4141
4142 Thu Apr  5 22:41:00 2001  Corinna Vinschen <corinna@vinschen.de>
4143
4144         * syscalls.cc (stat_worker): Fix conditional which still allowed
4145         successful stat'ing of non-existant files.
4146
4147 Wed Apr  4 10:37:44 2001  Christopher Faylor <cgf@cygnus.com>
4148
4149         * child_info.h: Bump magic number for fork/exec/spawn.
4150
4151 Tue Apr  3 20:06:00 2001  Corinna Vinschen <corinna@vinschen.de>
4152
4153         * errno.cc (errmap): Map ERROR_FILE_INVALID to ENXIO.
4154
4155 Mon Apr  2 22:48:58 2001  Christopher Faylor <cgf@cygnus.com>
4156
4157         * cygrun.c (main): Fix compiler warning.
4158         * gmon.c (_mcleanup): Ditto.
4159         * profil.c (profile_off): Ditto.
4160
4161         * net.cc (find_winsock_errno): New function.
4162         (__set_winsock_errno): Use find_winsock_errno.
4163         (cygwin_setsockopt): Detect SO_ERROR for debugging.
4164         (cygwin_getsockopt): Ditto.  Translate error when getsockopt returns
4165         SO_ERROR.
4166         * winsup.h: regparmize __set_winsock_errno.
4167         * include/sys/strace.h: Document that strace functions can't use
4168         regparm.
4169
4170 2001-04-02  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
4171
4172         * fhandler.cc (fhandler_disk_file::open): Avoid checking a magic
4173         number of a directory.
4174
4175 Mon Apr  2 00:24:08 2001  Christopher Faylor <cgf@cygnus.com>
4176
4177         * shared_info.h (mount_info): Remove mnt_ elements.
4178         * thread.h (struct _winsup_t): Add mnt_ elements.
4179         * path.cc (fillout_mntent): Use mnt_ elements from reent_winsup ().
4180
4181 Sun Apr  1 20:10:34 2001  Christopher Faylor <cgf@cygnus.com>
4182
4183         * exceptions.cc (sigframe::call_signal_handler): Return value of
4184         call_signal_handler_now.
4185         * sigproc.h (sigframe): Use constructor.
4186         * syscalls.cc (_read): Correct errno test prior to calling signal
4187         handler.
4188
4189 Sun Apr  1 00:38:06 2001  Christopher Faylor <cgf@cygnus.com>
4190
4191         * exceptions.cc (sigframe::call_signal_handler): Move outside of "C"
4192         block or some compilers will complain.
4193
4194 Sun Apr  1 00:24:14 2001  Christopher Faylor <cgf@cygnus.com>
4195
4196         * exceptions.cc (call_signal_handler_now): Rename from
4197         call_signal_handler to avoid C++ confusion.
4198
4199 Sun Apr  1 00:08:15 2001  Christopher Faylor <cgf@cygnus.com>
4200
4201         * path.cc (fillout_mntent): Always remove drive root directories from
4202         future consideration by "/cygdrive" reporting.
4203         (cygdrive_getmnt): Avoid reporting removable drives or drives with no
4204         media mounted.
4205
4206 Sat Mar 31 21:56:19 2001  Christopher Faylor <cgf@cygnus.com>
4207
4208         * thread.h (struct _winsup_t): Remove obsolete elements.  Add
4209         available_drives element.
4210         * path.cc (mount_info::getmntent): Report "/cygdrive" drives when
4211         mounted drives are exhausted.
4212         (fillout_mntent): New function.
4213         (mount_item::getmntent): Use fillout_mntent.
4214         (cygdrives_mntent): New function.  Returns next available "/cygdrive".
4215         (setmntent): Initialize available "/cygdrives".
4216         * syscalls.cc: Remove some if 0'ed code.
4217         * times.cc (timezone): Use more descriptive variable name.
4218
4219 Sat Mar 31 18:59:52 2001  Christopher Faylor <cgf@cygnus.com>
4220
4221         * sigproc.h (class sigframe): Implement 'unregister()' method.
4222         (sigframe::~sigframe): Use unregister method.
4223         (sigframe::call_signal_handler): Declare new method.
4224         * exceptions.cc (sigframe::call_signal_handler): New method.
4225         Unregisters current sigframe before calling signal handler.
4226         (setup_handler): Clear waiting threads prior to arming signal_arrived.
4227         * syscalls.cc (_read): Change goto to loop.  Recalculate sigframe
4228         inside of loop so that constructor is called when appropriate.
4229         * wait.cc (wait4): Ditto.
4230
4231         * signal.cc: Change "sig" to "signal" in debugging messages throughout.
4232         * sigproc.cc: Ditto.
4233
4234 Sat Mar 31 17:12:08 2001  Christopher Faylor <cgf@cygnus.com>
4235
4236         * fhandler_serial.cc (fhandler_serial::raw_write): Close protected
4237         handles with ForceCloseHandle or suffer spurious warnings.
4238
4239 Sat Mar 31 16:23:32 2001  Christopher Faylor <cgf@cygnus.com>
4240
4241         * fhandler.cc (fhandler_base::read): Remove special handling of CTRL-Z.
4242
4243 Sat Mar 31 11:09:00 2001  Corinna Vinschen <corinna@vinschen.de>
4244
4245         * fhandler.h (class fhandler_console): Add members `insert_mode'.
4246         * fhandler_console.cc (fhandler_console::dup): Duplicate `insert_mode'.
4247         (fhandler_console::fhandler_console): Initialize `insert_mode'.
4248         (fhandler_console::char_command): Add terminal capabilities
4249         "enter insert mode" = \E[4h and "exit insert mode" = \E[4l.
4250         Care for insert mode on terminal capability "repeat char" = \E[x;yb.
4251         (fhandler_console::write_normal): Care for insert mode before writing
4252         to the console.
4253         (array keytable): Add keymapping for modified cursor and control
4254         block keys (xterm like).
4255
4256 Fri Mar 30 13:02:00 2001  Corinna Vinschen <corinna@vinschen.de>
4257
4258         * fhandler.h (class fhandler_console): Add members `savebufsiz' and
4259         `savebuf' to allow save/restore of screen.
4260         * fhandler_console.cc (fhandler_console::dup): Duplicate `savebufsiz'
4261         and `savebuf'.
4262         (fhandler_console::fhandler_console): Initialize `savebufsiz' and
4263         `savebuf'.
4264         (fhandler_console::char_command): Add terminal capabilities
4265         "save screen content" = \E[?47h and "restore screen content" = \E[?47l.
4266
4267 Wed Mar 28 19:28:50 2001  Christopher Faylor <cgf@cygnus.com>
4268
4269         * path.cc (chdir): Eat trailing whitespace on input path.
4270
4271 Tue Mar 27 22:38:42 2001  Christopher Faylor <cgf@cygnus.com>
4272
4273         * lib/_cygwin_S_IEXEC.c: Remove "const" from globals or they never seem
4274         to be defined.  Wrap definitions in extern "C".  Include winsup.h to
4275         assure proper definitions.
4276
4277         * dcrt0.cc (dll_crt0_1): Call stdio_init after premain run so that
4278         binmode.o, etc., will control default stdio settings.
4279         * dtable.cc (dtable::init_std_file_from_handle): Allow __fmode to force
4280         binmode/textmode settings.  Default pipes to binmode.
4281
4282 Tue Mar 27 11:31:00 2001  Corinna Vinschen <corinna@vinschen.de>
4283
4284         * mmap.cc (mmap): Fix conditional for previous patch.
4285
4286 Mon Mar 26 18:48:00 2001  Corinna Vinschen <corinna@vinschen.de>
4287
4288         * mmap.cc (mmap): Outflank copy-on-write problem on 9x by
4289         setting access mode to FILE_MAP_READ when read access is requested.
4290
4291 Sun Mar 25 20:12:21 2001  Christopher Faylor <cgf@cygnus.com>
4292
4293         * dlfcn.cc (check_access): Eliminate.
4294         (check_path_access): Use passed in path_conv buf.
4295         (get_full_path_of_dll): Use passed in name buf to avoid a static.  Rip
4296         out most of the path checking since LoadLibrary will do all of this
4297         automatically.
4298         (dlopen): Set errno when appropriate (may not be compliant?).
4299         * environ.cc (posify): Don't pass in "native" path if it seems to
4300         actually be posix.
4301
4302 Thursday Mar 22 2001  Robert Collins <rbtcollins@hotmail.com>
4303
4304         * fhandler.h (fhandler_dev_clipboard): Extend to support writing.
4305         * fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard):
4306         Initialize new fields.  Open clipboard here.
4307         (fhandler_dev_clipboard::dup): New method.
4308         (fhandler_dev_clipboard::open): Accommodate new fields.  Register
4309         clipboard here, if appropriate.
4310         (set_clipboard): New function.  Moves buffer to clipboard.
4311         (fhandler_dev_clipboard::write): Truly implement clipboard writing.
4312         (fhandler_dev_clipboard::read): Reimplement to allow successive reads.
4313         (fhandler_dev_clipboard::lseek): Truly implement seeks in clipboard.
4314         (fhandler_dev_clipboard::close): Clear out new fields.  Support
4315         sequential reads and sequential writes.  Support for binary data via a
4316         native clipboard format.
4317
4318 2001-03-22  Egor Duda  <deo@logos-m.ru>
4319
4320         * fhandler_console.cc (fhandler_console::set_default_attr): Update
4321         console color attributes on tty reset.
4322
4323 Wed Mar 21 22:12:36 2001  Christopher Faylor <cgf@cygnus.com>
4324
4325         * autoload.cc (kernel32_init): New function for kernel32 autoload
4326         initialization.
4327         (SignalObjectAndWait): Add conditional load of this function when it is
4328         available.
4329
4330 2001-03-21 Robert Collins <rbtcollins@hotmail.com>
4331
4332         * sched.cc: New file.  Implement sched*.
4333         * include/sched.h: New file.  User land includes for sched*.
4334         * Makefile.in: Add sched.o
4335         * cygwin.din: Add exports for sched*.
4336
4337 Tue Mar 20 14:48:46 2001  Christopher Faylor <cgf@cygnus.com>
4338
4339         * dtable.cc: Guard against new winsock.h/winsock2.h warnings when
4340         mixing winsock*.h and sys/types.h.
4341         * fhandler_socket.cc: Ditto.
4342         * net.cc: Ditto.
4343         * select.cc: Ditto.
4344         * exceptions.cc: Remove unneeded define.
4345
4346 Mon Mar 19 17:43:29 2001  Christopher Faylor <cgf@cygnus.com>
4347
4348         * exceptions.cc (interruptible): Update debugging output.
4349         (setup_handler): Ensure that wait_sig loop wakes up when we punt on
4350         sending a signal.
4351         * poll.cc (poll): Add signal guard here.
4352
4353 2001-03-19  Egor Duda  <deo@logos-m.ru>
4354
4355         * tty.h (tty::create_inuse): Add new parameter to allow non-
4356         inheritable 'inuse' events.
4357         * tty.cc (tty::create_inuse): Use new parameter.
4358         * fhandler_tty.cc (fhandler_tty_master::init): Ditto.
4359         * fhandler_tty.cc (fhandler_pty_master::open): Ditto.
4360         * fhandler_tty.cc (fhandler_tty_master::init): Create master_alive
4361         event.
4362         * tty.cc (tty_list::terminate): Close master_alive event.
4363         * fhandler_tty.cc (fhandler_tty_common::close): Send EOF to slaves
4364         when master side is closed.
4365
4366 Mon Mar 19 14:32:00 2001  Corinna Vinschen <corinna@vinschen.de>
4367
4368         * mmap.cc (map::get_list_by_fd): Avoid calling `get_namehash' when
4369         file descriptor is -1.
4370
4371 Sat Mar 17 18:30:00 2001  Corinna Vinschen <corinna@vinschen.de>
4372
4373         * syscalls.cc (check_posix_perm): New static function.
4374         (fpathconf): Add _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY
4375         support.
4376         (pathconf): Ditto.
4377         * include/cygwin/version.h: Bump API minor number to 37.
4378
4379 2001-03-18  Egor Duda <deo@logos-m.ru>
4380
4381         * fhandler.h (fhandler_tty_slave): Declare new methods.
4382         * select.cc (fhandler_tty_slave::select_read): New method.
4383         * select.cc (fhandler_tty_slave::ready_for_read): Ditto.
4384         * select.cc (verify_tty_slave): New function.
4385         * fhandler_termios.cc (fhandler_termios::line_edit): Empty input
4386         buffer on signal.
4387         * fhandler_tty.cc (fhandler_tty_slave::read): Check for input data
4388         after reading from pipe. Reset event if input pipe is empty.
4389         * tty.h (class tty): Allow creating events with manual reset.
4390         * tty.cc (tty::get_event): Use manual_reset flag.
4391         * tty.cc (tty::common_init): Create input_available_event with
4392         manual reset.
4393
4394 Sat Mar 17 21:48:03 2001  Christopher Faylor <cgf@cygnus.com>
4395
4396         * external.cc (fillout_pinfo): Match windows pid, as well as cygwin pid
4397         when passed in pid.  Don't prematurely break when searching for a pid.
4398
4399         * thread.h (_winsup_t): Eliminate unneeded field.
4400
4401 Sat Mar 17 20:46:00 2001  Corinna Vinschen <corinna@vinschen.de>
4402
4403         * net.cc (get_95_ifconf): Use strcasematch instead of strcasecmp.
4404         * syscalls.cc (_unlink): Ditto.
4405         (_rename): Ditto.
4406
4407 Sat Mar 17 12:43:15 2001  Christopher Faylor <cgf@cygnus.com>
4408
4409         * path.cc (suffix_scan::next): Avoid searching for foo.lnk twice when
4410         input is "foo".
4411
4412 Sat Mar 17 18:10:00 2001  Corinna Vinschen <corinna@vinschen.de>
4413
4414         * net.cc (cygwin_socket): Set protocol to 0 when address family is
4415         AF_UNIX to avoid WSAEPROTONOSUPPORT error.
4416
4417 Sat Mar 17 09:51:32 2001  Mathew Brozowski <brozow@tavve.com>
4418
4419         * net.cc (cygwin_socket): Pass protocol parameter to socket call.
4420
4421 Sat Mar 17 02:05:38 2001  Christopher Faylor <cgf@cygnus.com>
4422
4423         * dir.cc (readdir): Use strcasematch for consistency.
4424         * path.cc (symlink_info): Eliminate known_suffix.
4425         (path_conv::check): Always copy ext_here to end of buffer, if found.
4426         (suffix_scan): Eliminate ext_here, add suffixes_start.
4427         (suffix_scan::has): Eliminate an argument.  Reorganize.  Always return
4428         pointer to end of input path.
4429         (suffix_scan::next): Take a second pass through the suffix list looking
4430         for .lnk.
4431         (symlink_info::check): Eliminate known_suffix usage.
4432
4433 Sat Mar 17 00:10:52 2001  Christopher Faylor <cgf@cygnus.com>
4434
4435         * syscalls.cc (stat_dev): Give devices full read/write by default.
4436
4437 Saturday Mar 17 3:45 2001 Robert Collins <rbtcollins@hotmail.com>
4438
4439         * thread.cc (MTinterface::CreateCond): Check for null attr pointer.
4440
4441 Fri Mar 16 21:13:23 2001  Christopher Faylor <cgf@cygnus.com>
4442
4443         * fhandler_termios.cc (fhandler_termios::line_edit): Don't accept input
4444         when a signal is sent or we'll end up in an EOF/signal race.
4445
4446 Fri Mar 16 20:25:40 2001  Christopher Faylor <cgf@cygnus.com>
4447
4448         * path.cc: Translate scan states from defines to enums.
4449         (suffix_scan): Rename state to nextstate for clarity.
4450         (lnk_match): Change to allow multiple states to indicate that a .lnk
4451         has been matched.
4452         (suffix_scan::has): Eliminate a goto.  Handle .lnk as a special case,
4453         since a .lnk may also need to be tacked on the end of a .lnk.
4454         (suffix_scan::next): Don't increment next state.  Set it specifically.
4455         Recognize new .lnk states.
4456
4457 Saturday Mar 17 01:19 2001 Robert Collins rbtcollins@hotmail.com
4458
4459         * cygwin.din: Export the new functions.
4460         * pthread.cc (pthread_cond_*): Add wrapper functions that call
4461         __pthread_cond* functions.
4462         * thread.cc (__pthread_cond_*): Implement the pthread_cond* functions.
4463         * thread.h: Add new class entries and prototypes for __pthread_cond*
4464         functions.
4465         * include/pthread.h: user land header prototypes for pthread_cond*
4466         functions and related defines.
4467
4468 Wed Mar 14 16:30:00 2001  Corinna Vinschen <corinna@vinschen.de>
4469
4470         * environ.cc (parse_options): Use strtok_r instead of strtok.
4471         * security.cc (convert_string_sid_to_sid): Ditto.
4472         (aclfromtext): Ditto. Fix buffer usage.
4473
4474 Wed Mar 14 10:11:00 2001  Corinna Vinschen <corinna@vinschen.de>
4475
4476         * path.cc (lnk_suffixes): Remove.
4477         (class suffix_scan): Add `lnk_state' flag.
4478         (suffix_scan::lnk_match): Return state of `lnk_state' now.
4479         (suffix_scan::has): Changed behaviour if file has `.lnk' suffix.
4480         (suffix_scan::next): Set `lnk_state' where appropriate.
4481         (symlink_info::check): Fix a wrong `break'.
4482         * syscalls.cc (chown_worker): Change debug statement to reflect
4483         lchown fix.
4484         (lchown): Call chown_worker with `PC_SYM_NOFOLLOW' instead of
4485         `PC_SYM_IGNORE'.
4486
4487 Tue Mar 13 13:52:00 2001  Corinna Vinschen <corinna@vinschen.de>
4488
4489         * fhandler.cc (fhandler_disk_file::fstat): Add correct modes to
4490         symlinks when stat'ing on FAT or FAT32 file systems.
4491
4492 2001-03-12  Egor Duda  <deo@logos-m.ru>
4493
4494         * fhandler.h (fhandler_termios::fixup_after_exec): New function.
4495         * fhandler_termios.cc (fhandler_termios::fixup_after_fork): New
4496         function. Fixup output handle.
4497         * fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Output
4498         handle is now fixed up in fhandler_termios::fixup_after_fork().
4499
4500 2001-03-12  Egor Duda  <deo@logos-m.ru>
4501
4502         * fhandler.h (fhandler_termios::fhandler_termios): Enable fixup
4503         after fork.
4504         * fhandler_console.cc (fhandler_console::fhandler_console): Fixup
4505         after fork is now enabled in the base class constructor.
4506
4507 Mon Mar 12 11:19:41 2001  Christopher Faylor <cgf@cygnus.com>
4508
4509         * mkvers.sh: Include config.h so that DEBUGGING is correctly defined.
4510
4511 Mon Mar 12 09:47:55 2001  Christopher Faylor <cgf@cygnus.com>
4512
4513         * spawn.cc (spawn_guts): Don't set EXIT_REPARENTING if parent process
4514         is not a cygwin process (suggested by Jason Gouger
4515         <cygwin@jason-gouger.com>).
4516
4517 Sun Mar 11 16:00:58 2001  Christopher Faylor <cgf@cygnus.com>
4518
4519         * child_info.h: Bump magic number for fork/exec/spawn.
4520
4521 Sat Mar 10 20:54:47 2001  Christopher Faylor <cgf@cygnus.com>
4522
4523         * autoload.cc (noload): Use proper method for multiline strings or
4524         newer gcc's complain.
4525         * exceptions.cc (unused_sig_wrapper): Ditto.
4526         * fhandler.h (fhandler_base): Make get_io_handle and friends return
4527         self.
4528         * fhandler_tty.cc (fhandler_pty_common::close_on_exec): Accommodate
4529         DEBUGGING flag to avoid spurious warnings when inheritance is set.
4530
4531 Sat Mar 10 16:52:12 2001  Christopher Faylor <cgf@cygnus.com>
4532
4533         * shortcut.c (PATH_ALL_EXEC): Add parentheses to avoid a compiler
4534         warning.
4535
4536         * exceptions.cc (setup_handler): Clarify debugging message.
4537         * sigproc.cc (proc_subproc): Remove PROC_CHILDSTOPPED test.  It is
4538         handled by normal PROC_CLEARWAIT case.
4539         (wait_sig): Eliminate "dispatched" tracking.  Remove __SIGCHILDSTOPPED
4540         test.  Decrement counter again before jumping out of
4541         InterlockedDecrement loop so that subsequent InterlockedIncrement will
4542         keep the counter at the correctly decremented value and also detect
4543         when there are pending signals.
4544         * sigproc.h: Remove __SIGCHILDSTOPPED element.
4545         (procstuff): Remove PROC_CHILDSTOPPED element.
4546
4547 Sat Mar 10 15:22:44 2001  Christopher Faylor <cgf@cygnus.com>
4548
4549         * syscalls.cc (_rename): Set errno to ENOENT when an old path doesn't
4550         exist (from Kazuhiro Fujieda <fujieda@jaist.ac.jp>).  Also set EACCES
4551         when directory is not writable.
4552
4553 Wed Mar  7 15:49:47 2001  Christopher Faylor <cgf@cygnus.com>
4554
4555         * syscalls.cc (_read): Change definition to return ssize_t to be
4556         consistent with read.
4557         (_write): Change definition to return ssize_t to be consistent with
4558         write.
4559
4560 Wed Mar  7 01:08:21 2001  Christopher Faylor <cgf@cygnus.com>
4561
4562         * sigproc.h (sigthread): Declare new methods.  Create new winapi_lock
4563         field.
4564         (sigframe:;set): Call get_winapi_lock after frame is set so that signal
4565         handler thread knows not to call SuspendThread.
4566         (sigframe::~sigframe): Release winapi_lock.
4567         * exceptions.cc (sigthread::get_winapi_lock): New method.
4568         (sigthread::release_winapi_lock): New method.
4569         (setup_handler): Use get_winapi_lock to ensure that signalled thread is
4570         not blocked in a Windows API.
4571
4572         * path.h (path_types): Avoid broken GCC warning.
4573
4574 Tue Mar  6 14:02:00 2001  Corinna Vinschen <corinna@vinschen.de>
4575
4576         * path.cc (suffix_scan::has): Change order of conditionals
4577         to allow checking for .lnk suffixes even if in_suffixes is empty.
4578
4579 Tue Mar  6 13:02:00 2001  Corinna Vinschen <corinna@vinschen.de>
4580
4581         * autoload.c (cygwin_premain0): Add missing parameter.
4582         * binmode.c (cygwin_premain0): Ditto.
4583         * textmode.c (cygwin_premain0): Ditto.
4584
4585 Tue Mar  6 12:04:00 2001  Jason Tiller <jtiller@sjm.com>
4586
4587         * auto_load.cc: Add "GetKeyboardLayout" entry in the list of
4588         Win32 User32.DLL exports to provide.
4589         * fhandler.h (class fhandler_console): Add meta_mask private
4590         member to remember which keystroke modifiers should generate
4591         META.
4592         * fhandler_console.cc (fhandler_console::read): Modify code that
4593         tests a keystroke for a META-escaped key to use the 'meta_mask'
4594         variable.
4595         (fhandler_console::fhandler_console): Add definition for
4596         variable "meta_mask" used to determine if a keystroke should be
4597         preceded by META in the client console stream.  Set meta_mask
4598         based on whether or not user's keyboard language is English -
4599         non-English keyboards pass AltGr (right <ALT>) unmolested,
4600         whereas English keyboards now interpret left- and right-<ALT>
4601         as META.
4602
4603 Mon Mar  5 20:15:00 2001  Corinna Vinschen <corinna@vinschen.de>
4604
4605         * include/a.out.h: Add copyright hint.
4606         * include/fcntl.h: Ditto.
4607         * include/lastlog.h: Ditto.
4608         * include/memory.h: Ditto.
4609         * include/mntent.h: Ditto.
4610         * include/paths.h: Ditto.
4611         * include/poll.h: Ditto.
4612         * include/syslog.h: Ditto.
4613         * include/termio.h: Ditto.
4614         * include/tzfile.h: Ditto.
4615         * include/arpa/inet.h: Ditto.
4616         * include/asm/byteorder.h: Ditto.
4617         * include/asm/socket.h: Ditto.
4618         * include/asm/types.h: Ditto.
4619         * include/cygwin/if.h: Ditto.
4620         * include/cygwin/mtio.h: Ditto.
4621         * include/cygwin/rdevio.h: Ditto.
4622         * include/cygwin/socket.h: Ditto.
4623         * include/net/if.h: Ditto.
4624         * include/netinet/in.h: Ditto.
4625         * include/netinet/in_systm.h: Ditto.
4626         * include/netinet/ip.h: Ditto.
4627         * include/netinet/ip_icmp.h: Ditto.
4628         * include/netinet/tcp.h: Ditto.
4629         * include/sys/cdefs.h: Ditto.
4630         * include/sys/cygwin.h: Ditto.
4631         * include/sys/ioctl.h: Ditto.
4632         * include/sys/mman.h: Ditto.
4633         * include/sys/mount.h: Ditto.
4634         * include/sys/mtio.h: Ditto.
4635         * include/sys/procfs.h: Ditto.
4636         * include/sys/resource.h: Ditto.
4637         * include/sys/smallprint.h: Ditto.
4638         * include/sys/socket.h: Ditto.
4639         * include/sys/strace.h: Ditto.
4640         * include/sys/syslog.h: Ditto.
4641         * include/sys/sysmacros.h: Ditto.
4642         * include/sys/termio.h: Ditto.
4643         * include/sys/termios.h: Ditto.
4644         * include/sys/uio.h: Ditto.
4645         * include/sys/un.h: Ditto.
4646         * include/sys/utsname.h: Ditto.
4647         * include/sys/vfs.h: Ditto.
4648         * include/sys/wait.h: Ditto.
4649         * regexp/regerror.c: Ditto.
4650         * regexp/regexp.h: Ditto.
4651         * regexp/regmagic.h: Ditto.
4652
4653 Mon Mar  5 01:25:03 2001  Christopher Faylor <cgf@cygnus.com>
4654
4655         * dlopen.c (dlopen): Return NULL when name is NULL (suggested by
4656         chrisiasci@aol.com).
4657
4658         * cygwin.din: Add a new, internally used export -
4659         _check_for_executable.
4660         * dcrt0.cc (dll_crt0_1): Set _check_for_executable for older binaries.
4661         Pass user_data to premain functions.
4662         * fhandler.cc (fhandler_disk_file::open): Only check for executable if
4663         the linked program is interested in the executable bit.
4664         (fhandler_disk_file::check_execable_p): Delete.
4665         * fhandler.h (executable_states): New enumeration of various states of
4666         executable bit caring.
4667         (fhandler_base::set_execable_p): New method.
4668
4669         * fhandler_termios.cc (fhandler_termios::line_edit): Flag when a signal
4670         has been sent to the tty.  Return -1 when this is so.
4671         * fhandler_console.cc (fhandler_console::read): Return -1 when signal
4672         sending character encountered.
4673
4674         * path.cc (path_conv::check): Record when path refers to a disk device.
4675         Move executable extension check here.
4676         (check_sysfile): Accommodate new EXEC path states.
4677         (has_suffix): Remove.
4678         (next_suffix): Remove.
4679         (class suffix_scan): New clas.
4680         (suffix_scan::has): New method.
4681         (suffix_scan:next): New method.
4682         (symlink_info::check): Use suffix_scan method to control for scanning
4683         for suffixes.
4684         * path.h (path_conv::exec_state): New method.
4685         * perprocess.h: Make "C" friendly.
4686         * include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_S_IEXEC.
4687         Bump CYGWIN_VERSION_API_MINOR.
4688         * include/sys/cygwin.h: Change premain declarations.
4689
4690         * winsup.h: Move __cplusplus test to after builtin defines.
4691
4692 2001-03-04  Egor Duda  <deo@logos-m.ru>
4693
4694         * fhandler.h (class fhandler_tty_common): New mutex and event to
4695         syncronize input on master tty with slave tty.
4696         * fhandler_tty.cc (fhandler_pty_master::accept_input): Use them to
4697         syncronize with slave.
4698         * fhandler_tty.cc (fhandler_tty_slave::read): Use input mutex and
4699         event to syncronize with master. Do not limit amount of data read
4700         from master to vmin value. Interrupt on signal and return already
4701         read data, if any.
4702         * fhandler_tty.cc (fhandler_tty_slave::open): Handle input mutex and
4703         event.
4704         * fhandler_tty.cc (fhandler_tty_common::close): Ditto.
4705         * fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Ditto.
4706         * fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Ditto.
4707         * fhandler_tty.cc (fhandler_tty_common::dup): Ditto.
4708         * tty.h (tty::open_input_mutex): New function.
4709         * tty.cc (tty::common_init): Create input mutex and event.
4710
4711 Fri Mar  2 13:32:00 2001  Corinna Vinschen <corinna@vinschen.de>
4712
4713         * dir.cc (readdir): Fix creating path in symlink check.
4714
4715 Fri Mar  2 12:33:00 2001  Corinna Vinschen <corinna@vinschen.de>
4716
4717         * dir.cc (readdir): Fix shortcut==symlink condition.
4718         * environ.cc: Add extern decl for `allow_winsymlinks'.
4719         (struct parse_thing): Add entry for `[no]winsymlinks'.
4720         * path.cc (symlink): Change to be able to create both,
4721         symlink==shortcut and symlink==systemfile, dependent of
4722         the setting of `allow_winsymlinks'.
4723         * security.cc (cygwin_logon_user): Add debug output.
4724         * shortcut.c: Add defines from path.h.
4725         (has_exec_chars): Copy from path.h.
4726         (check_shortcut): Check for executable file condition if not a
4727         shortcut.
4728
4729 Thu Mar  1 21:06:07 2001  Christopher Faylor <cgf@cygnus.com>
4730
4731         * exceptions.cc (sig_handle_tty_stop): Ignore attempts to suspend a
4732         process if started by non-cygwin parent.
4733
4734 Thu Mar  1 20:48:11 2001  Christopher Faylor <cgf@cygnus.com>
4735
4736         * select.cc (peek_console): Don't report read_ready on mouse events
4737         unless we are looking for mouse events.
4738         * fhandler.h (fhandler_console::mouse_aware): New method.
4739
4740 Wed Feb 28 15:10:00 2001  Corinna Vinschen <corinna@vinschen.de>
4741
4742         * uinfo.cc: Eliminate `#include <wchar.h>'.
4743
4744 2001-02-28  Egor Duda  <deo@logos-m.ru>
4745
4746         * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Determine
4747         drive geometry or partition size to allow seeking from the end of
4748         raw floppy device. Don't allow positioning past the end of media or
4749         to offsets bigger then max off_t.
4750
4751 2001-02-27  Egor Duda  <deo@logos-m.ru>
4752
4753         * fhandler.h (class fhandler_console): Make all variables that
4754         describe "state" of console to be members of fhandler_console.
4755         default_color is now the color which is set when console recieves
4756         reset command.
4757         * fhandler_console.cc (fhandler_console::fhandler_console): Turn
4758         mouse handling and raw keyboard mode off by default. Initialize
4759         state information.
4760         * fhandler.cc (fhandler_console::set_raw_win32_keyboard_mode): New
4761         function.
4762         * fhandler_console.cc (fhandler_console::set_default_attr): New
4763         function. Reset console attributes to default values.
4764         * fhandler_console.cc (fhandler_console::open): Reset attributes.
4765         * fhandler_console.cc (fhandler_console::get_win32_attr): New function.
4766         Calculate win32-style console attribute based on terminal attributes.
4767         * fhandler_console.cc (fhandler_console::set_cursor_maybe): Use
4768         member variable.
4769         * fhandler_console.cc (fhandler_console::read): If in raw-win32
4770         keyboard mode, encode win32 keyboard events in \033{x;y;z;t;u;wK
4771         sequences.
4772         * fhandler_console.cc (fhandler_console::dup): Copy all state
4773         information to the dup()ed handle.
4774         * fhandler_console.cc (fhandler_console::scroll_screen): Use current
4775         fill-in attribute.
4776         * fhandler_console.cc (fhandler_console::clear_screen): Ditto.
4777         * fhandler_console.cc (fhandler_console::char_command): Check if we
4778         saw '?' symbol by member variable. Set terminal attributes on \033[Xm
4779         commands. \033[24m - turn off underline mode, \033[27m - turn off
4780         reverse mode, \033[39m - restore default foreground color.
4781         \033[49m - restore default background color. \033[2000h - turn on raw
4782         keyboard mode, \033[2000l - turn off raw keyboard mode.
4783         * fhandler_console.cc (fhandler_console::write): Set attribues to
4784         default values on reset command.
4785
4786 2001-02-26  Mike Simons  <msimons@moria.simons-clan.com>
4787
4788         * times.cc (settimeofday): Replace function stub with working code.
4789
4790 Mon Feb 26 10:42:00 2001  Corinna Vinschen <corinna@vinschen.de>
4791
4792         * strace.cc (strace::vprntf): Move prntf functionality to this function
4793         adding an va_list interface to strace.
4794         (strace::printf): Calls strace::vprntf now.
4795         (strace_printf): New function providing an extern "C" interface to
4796         trace output.
4797         * include/sys/strace.h: Make plain C clean.
4798         (class strace): Add `vprntf' method.
4799
4800 Mon Feb 26  0:10:00 2001  Corinna Vinschen <corinna@vinschen.de>
4801
4802         * shortcut.c: Remove #include <sys/strace.h>.
4803
4804 Sun Feb 25 10:32:00 2001  Corinna Vinschen <corinna@vinschen.de>
4805
4806         * path.cc (symlink): Add a ".lnk" suffix regardless. Add a comment.
4807
4808 Sun Feb 25 10:18:00 2001  Corinna Vinschen <corinna@vinschen.de>
4809
4810         * shortcut.c (check_shortcut): Change symlink condition.
4811
4812 Fri Feb 23 10:42:00 2001  Corinna Vinschen <corinna@vinschen.de>
4813
4814         * mmap.cc (fhandler_disk_file::mmap): Use `addr' correctly.
4815         * fhandler_mem.cc (fhandler_dev_mem::mmap): Ditto.
4816
4817 Thu Feb 22 17:09:00 2001  Corinna Vinschen <corinna@vinschen.de>
4818
4819         * path.cc (symlink): Keep relative paths relative in the DOS
4820         path inside of a shortcut. If that's impossible or the target
4821         path is already absolute save an absolute path.
4822
4823 Thu Feb 22 15:33:00 2001  Corinna Vinschen <corinna@vinschen.de>
4824
4825         * cygerrno.h: Revert previous patch.
4826         * errno.cc: Ditto.
4827         * dir.cc: Eliminate `dir_suffixes'.
4828         (opendir): Remove usage of `dir_suffixes'.
4829         (rmdir): Ditto.
4830         * fhandler.cc (fhandler_disk_file::open): Remove usage of
4831         `inner_suffixes'.
4832         * path.cc: Rename `inner_suffixes' to `lnk_suffixes'.
4833         (path_conv::check): Remove usage of `inner_suffixes'.
4834         (symlink): Ditto.
4835         (symlink_info::check): Handle checking for `.lnk' in path_conv
4836         exclusively here.
4837         (chdir): Remove usage of `dir_suffixes'.
4838         * shortcut.c: Eliminate debug_printf lines.
4839         (check_shortcut): Don't set error except on failing ReadFile.
4840         * spawn.cc: Remove ".lnk" from `std_suffixes'.
4841         * syscalls.cc (_unlink): Remove usage of `inner_suffixes'.
4842         Remove ".lnk" from `stat_suffixes'.
4843         (_rename): Add check for renaming a symlink to keep the ".lnk"
4844         suffix after renaming.
4845
4846 Thu Feb 22 13:38:00 2001  Corinna Vinschen <corinna@vinschen.de>
4847
4848         * shortcut.c: New file. Provides a C interface to reading of
4849         Windows shortcuts to avoid compiler flag `-fvtable-thunks'.
4850         * shortcut.h: Ditto.
4851         * Makefile.in: Add shortcut.o to DLL_OFILES.
4852         * cygerrno.h: Provide a C interface to `geterrno_from_win_error' for
4853         using in shortcut.c.
4854         * errno.cc (geterrno_from_win_error): Define as extern "C".
4855         * path.cc (struct symlink_info): Remove methods `check_shortcut' and
4856         `check_sysfile'.
4857         (shortcut_header): Move to shortcut.c.
4858         (shortcut_initalized): Ditto.
4859         (create_shortcut_header): Ditto.
4860         (cmp_shortcut_header): Ditto.
4861         (symlink_info::check_shortcut): Ditto. Reorganize as a plain C function.
4862         (symlink_info::check_sysfile): Redefine as a global function using the
4863         same parameter list as `check_shortcut' for clearness.
4864         (symlink_info::check): Change parameter list for calls to
4865         `check_shortcut' and `check_sysfile'.
4866
4867 Thu Feb 22 12:04:00 2001  Corinna Vinschen <corinna@vinschen.de>
4868
4869         * fhandler.cc (fhandler_disk_file::open): Use `inner_suffixes' when
4870         resolving real_path.
4871         * path.cc (symlink): Ditto for win32_topath.
4872
4873 Wed Feb 21 22:41:00 2001  Corinna Vinschen <corinna@vinschen.de>
4874
4875         * Makefile.in: Add `-lshell32 -luuid' to link pass for new-cygwin1.dll.
4876         * autoload.cc: Add LoadDLLinitfunc for ole32.dll.
4877         Add LoadDLLfuncEx statements for CoInitialize@4, CoUninitialize@0
4878         and CoCreateInstance@20.
4879         * dir.cc (dir_suffixes): New datastructure.
4880         (readdir): Check for R/O *.lnk files to hide the suffix.
4881         (opendir): Use `dir_suffixes' in path conversion.
4882         (rmdir): Ditto.
4883         * fhandler.cc (fhandler_disk_file::fstat): Add S_IFLNK flag
4884         before calling `get_file_attribute'. Take FILE_ATTRIBUTE_READONLY
4885         into account only if the file is no symlink.
4886         * path.cc (inner_suffixes): New datastructure.
4887         (SYMLINKATTR): Eliminated.
4888         (path_conv::check): Use `inner_suffixes' on inner path components.
4889         (shortcut_header): New global static variable.
4890         (shortcut_initalized): Ditto.
4891         (create_shortcut_header): New function.
4892         (cmp_shortcut_header): Ditto.
4893         (symlink): Create symlinks by creating windows shortcuts. Preserve
4894         the old code.
4895         (symlink_info::check_shortcut): New method.
4896         (symlink_info::check_sysfile): Ditto.
4897         (symlink_info::check): Check for shortcuts. Move code reading
4898         old system attribute symlinks into symlink_info::check_sysfile().
4899         (chdir): Use `dir_suffixes' in path conversion.
4900         * security.cc (get_file_attribute): Check for S_IFLNK flag.
4901         Force 0777 permissions then.
4902         * spawn.cc (std_suffixes): Add ".lnk" suffix.
4903         * syscalls.cc (_unlink): Use `inner_suffixes' in path conversion.
4904         Check for shortcut symlinks to eliminate R/O attribute before
4905         calling DeleteFile().
4906         (stat_suffixes): Add ".lnk" suffix.
4907         (stat_worker): Force 0777 permissions if file is a symlink.
4908
4909 2001-02-21  Egor Duda  <deo@logos-m.ru>
4910
4911         * sigproc.cc (getsem): Make semaphore always non-inheritable.
4912
4913 Mon Feb 19 22:25:53 2001  Christopher Faylor <cgf@cygnus.com>
4914
4915         * dcrt0.cc (locale_init): Remove.
4916
4917 2001-02-15  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
4918
4919         * cygwin.din: Export rand48 functions.
4920         * thread.cc (MTinterface::Init): Remove the initialization of
4921         `reent_data'.
4922         * dcrt0.cc: Add the initalizer to the declaration of `reent_data'.
4923         * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 35.
4924
4925 2001-02-16  Egor Duda  <deo@logos-m.ru>
4926
4927         * signal.cc (signal): Prohibit setting handlers for SIGKILL and
4928         SIGSTOP
4929         * signal.cc (sigaction): Ditto
4930         * syscalls.cc (_lseek): Return EINVAL on invalid input
4931
4932 Wed Feb 14 14:54:40 2001 Christophe Iasci <chrisiasci@aol.com>
4933
4934         * dlfcn.cc (dlopen): Do not call LoadLibrary with a NULL pointer, when
4935         the library is not found
4936
4937 2001-02-14  Egor Duda  <deo@logos-m.ru>
4938
4939         * fhandler_console.cc (fhandler_console::char_command): Ignore unknown
4940         rendition codes in \033[xx;yym control sequences
4941
4942 Fri Feb  9 23:19:01 2001  Christopher Faylor <cgf@cygnus.com>
4943
4944         * fork.cc (fork_parent): Return EAGAIN when can't record pid.
4945         * pinfo.h (pinfo::remember): Return value of call to proc_subproc.
4946         * sigproc.cc (proc_subproc): Return error if can't record pid.
4947
4948 Fri Feb  9 12:17:27 2001  Christopher Faylor <cgf@cygnus.com>
4949
4950         * syscalls.cc (mknod): Add valid parameters.
4951
4952 Thu Feb  8 22:09:00 2001  Corinna Vinschen <corinna@vinschen.de>
4953
4954         * mmap.cc (mmap): Check for reusing a mapping only on MAP_SHARED
4955         and on MAP_PRIVATE|MAP_ANON in the special case of offset 0.
4956
4957 Thu Feb  8 21:57:00 2001  Corinna Vinschen <corinna@vinschen.de>
4958
4959         * mmap.cc (class list): Add member `hash'.
4960         (list::list): Initialize `hash'.
4961         (list::get_list_by_fd): Use filepath hash value to get the correct
4962         mapping list if it's not an anonymous mapping.
4963         (map::add_list): Initialize `hash' with filepath hash value.
4964         (mmap): Check for reusing a mapping only on MAP_SHARED.
4965
4966 Wed Feb  7 18:47:36 2001  Christopher Faylor <cgf@cygnus.com>
4967
4968         * signal.cc (killpg): Correct first argument.
4969
4970 Wed Feb  7 22:22:00 2001  Corinna Vinschen <corinna@vinschen.de>
4971
4972         * autoload.cc: Add LoadDLLinitfunc for iphlpapi.dll.
4973         Add LoadDLLfuncEx statements for GetIfTable@12 and GetIpAddrTable@12.
4974         * fhandler_socket.cc (fhandler_socket::ioctl): Move variable
4975         definitions to the beginning of the function to allow better debugging.
4976         Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU.
4977         * net.cc: Include iphlpapi.h.
4978         (get_2k_ifconf): Rewritten. Uses IP Helper API now.
4979         (get_nt_ifconf): Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC
4980         and SIOCGIFMTU.
4981         (get_95_ifconf): Ditto. Renamed from `get_9x_ifconf'.
4982         (get_ifconf): Name loopback `lo' instead of `lo0' as in Linux.
4983         Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU.
4984         Call `get_95_ifconf' only on Windows 95, `get_nt_ifconf' only
4985         on Windows NT < Service Pack 3, `get_2k_ifconf otherwise.
4986         * include/asm/socket.h: Add defines for SIOCGIFHWADDR, SIOCGIFMETRIC
4987         and SIOCGIFMTU.
4988         * include/cygwin/if.h: Add `ifr_hwaddr', `ifr_metric' and `ifr_mtu'.
4989         (struct ifreq): Add `ifru_hwaddr'.
4990
4991 Tue Feb  6 15:04:00 2001  Corinna Vinschen <corinna@vinschen.de>
4992
4993         * syscalls.cc (stat_worker): Add a check for the special case when
4994         a process creates a file using mode 000 using ntsec.
4995
4996 Mon Feb  5 17:00:00 2001  Corinna Vinschen <corinna@vinschen.de>
4997
4998         * fhandler.cc (fhandler_base::open): Always add GENERIC_READ access
4999         when opening raw disk devices.
5000         * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Implement bytewise
5001         access.
5002         * fhandler_raw.cc (fhandler_dev_raw::open): Always open raw disk device
5003         binary.
5004         (fhandler_dev_raw::raw_write): Don't drop read buffer content when
5005         writing after read.
5006
5007 Mon Feb  5 13:30:00 2001  Corinna Vinschen <corinna@vinschen.de>
5008
5009         * mmap.cc (mmap_record::fixup_map): New method to duplicate
5010         the memory protection in a just forked child.
5011         (mmap): Realign gran_len to page boundary only on anonymous
5012         mapping before saving in the mmap_record.
5013         (munmap): Cleanup code.
5014         (msync): Ditto.
5015         (fixup_mmaps_after_fork): Ditto. Call mmap_record::fixup_map now.
5016
5017 Thu Feb  1 23:08:29 2001  Christopher Faylor <cgf@cygnus.com>
5018
5019         * cygheap.cc (creturn): Correctly calculate cygheap_max.
5020
5021 Wed Jan 31 10:04:58 2001  Christopher Faylor <cgf@cygnus.com>
5022
5023         * shared.cc (shared_info::initialize): Reduce size of heap.
5024
5025 Wed Jan 31 13:22:00 2001  Corinna Vinschen <corinna@vinschen.de>
5026
5027         * include/sys/resource.h: Fix typo.
5028
5029 Wed Jan 31 13:20:00 2001  Corinna Vinschen <corinna@vinschen.de>
5030
5031         * include/sys/resource.h: Add RLIMIT_NLIMITS and RLIM_NLIMITS.
5032
5033 Tue Jan 30 18:15:23 2001  Christopher Faylor <cgf@cygnus.com>
5034
5035         * include/cygwin/version.h: Bump version to 1.3.0.
5036
5037 Tue Jan 30  8:55:00 2001  Corinna Vinschen <corinna@vinschen.de>
5038
5039         * pinfo.cc (pinfo::init): Use INVALID_HANDLE_VALUE instead of
5040         explicit cast (HANDLE) 0xffffffff.
5041         * shared.cc (open_shared): Ditto.
5042
5043 Mon Jan 29 17:15:22 2001  Bill Hegardt <bill@troyxcd.com>
5044
5045         * fhandler_serial.cc (raw_write): Use local copy of OVERLAPPED
5046         structure instead of shared structure to fix a race condition between
5047         read/write.
5048
5049 Mon Jan 29 14:30:00 2001  Corinna Vinschen <corinna@vinschen.de>
5050
5051         * mmap.cc (mmap): Remove obsolete check for MAP_SHARED|MAP_ANON as
5052         being invalid.
5053
5054 Mon Jan 29 10:23:00 2001  Corinna Vinschen <corinna@vinschen.de>
5055
5056         * mmap.cc (mmap_record::find_empty): Fix loop condition.
5057
5058 Sun Jan 28 19:40:40 2001  Christopher Faylor <cgf@cygnus.com>
5059
5060         * syscalls.cc (_link): Make sure that newpath does not exist.  Set
5061         errno if it does.
5062
5063 Sun Jan 28 19:29:08 2001  Christopher Faylor <cgf@cygnus.com>
5064
5065         * cygheap.cc (init_cheap): Don't specify a load address for the heap.
5066         It doesn't work on #!*& Windows 9x.
5067         (cygheap_init): Move GetUserName to memory_init.
5068         * dcrt0.cc (dll_crt0_1): Call new memory_init functin, eliminate call
5069         to heap_init.
5070         * heap.cc (heap_init): Improve error output.
5071         * heap.h: Correct some declarations.
5072         * shared.cc (mount_table_init): Remove.
5073         (memory_init): Renamed from shared_init.  Reorganize to accommodate
5074         strange Windows 9x problems with cygheap/heap interaction.
5075         * shared_info.h: Rename shared_init to memory_init.
5076
5077 Sun Jan 28 01:25:33 2001  Christopher Faylor <cgf@cygnus.com>
5078
5079         * include/cygwin/version.h: Bump API version.
5080
5081 Sun Jan 28 01:18:22 2001  Christopher Faylor <cgf@cygnus.com>
5082
5083         * cygheap.cc (init_cheap): Move username initialization.
5084         (cygheap_init): Here.
5085         * shared_info.h (mount_info): Add a sys_mount_table_counter field.
5086         (shared_info): Ditto.
5087         * path.cc (mount_info::conv_to_win32_path): Check that our mount table
5088         is in sync with the system mount table and reinitialize it if not.
5089         (mount_info::add_reg_mount): Bump sys_mount_table counters if the
5090         system mount table changes.
5091         (mount_info::del_reg_mount): Ditto.
5092         (mount_info::write_cygdrive_info_to_registry): Ditto.
5093         (mount_info::remove_cygdrive_info_from_registry): Ditto.
5094
5095 Sun Jan 28 00:28:30 2001  Christopher Faylor <cgf@cygnus.com>
5096
5097         Throughout, change 'cygwin_shared.mount' to 'mount_table'.
5098         * child_info.h (child_info): Move shared_h, console_h to cygheap.  Add
5099         mount_h.
5100         * cygheap.h (init_cygheap): Add shared_h, console_h.
5101         * cygheap.cc (init_cheap): Initialize heap at a fixed location after
5102         the shared memory regions.  Initialize cygheap->user name here.
5103         * dcrt0.cc (dll_crt0_1): Call getpagesize () to initialize constants.
5104         Remove cygheap_init since it is done in shared_init now.
5105         (_dll_crt0): Initialize mount_h, remove shared_h and console_h
5106         initialization.
5107         * fhandler_console.cc (console_shared_h): Eliminate.
5108         (get_tty_stuff): Use cygheap->console_h rather than console_shared_h.
5109         * heap.cc (heap_init): Use page size constant calculated earlier in
5110         initialization.
5111         * shared.cc: Eliminate cygwin_shared_h.  Add cygwin_mount_h.
5112         (mount_table_init): New function for initializing a user mount table.
5113         (open_shared_file_map): Use constant for shared memory region.
5114         Initialize cygheap and mount table here.
5115         (open_shared): Improve debugging output.
5116         (shared_info::initialize): Eliminate call to mount.init.
5117         (shared_terminate): Use cygheap->shared_h.  Close cygwin_mount_h.
5118         (open_shared_file_map): Eliminate.
5119         * shared_info.h (mount_info): Add a version field.
5120         (shared_align_past): New macro for calculating location for shared
5121         memory regions.
5122         * sigproc.cc (init_child_info): Eliminate shared_h, console_h.
5123         * spawn.cc (spawn_guts): Pass on cygwin_mount_h iff not a different
5124         user.
5125         * syscalls.cc (system_info): New global holding system memory defaults.
5126         (getpagesize): Use system_info.
5127         * uinfo.cc (internal_getlogin): Only fill in user name if nonexistent.
5128         * winsup.h: Declare system_info.
5129
5130         * passwd.cc (read_etc_passwd): Use cygheap->user.name () rather than
5131         retrieving the name again.
5132
5133 Sat Jan 27 10:18:02 2001  Christopher Faylor <cgf@cygnus.com>
5134
5135         * path.cc (path_conv::check): Detect when path has symlinks.
5136         (symlink_info::check): Remove debugging stuff.
5137         (chdir): Use posix'ized win32 path if cd'ed to a path using symlinks.
5138
5139 Fri Jan 26 21:20:28 2001  Christopher Faylor <cgf@cygnus.com>
5140
5141         * exceptions.cc (sigreturn): Call any pending signals prior to
5142         resetting the signal mask so that stacked signals behave correctly.
5143         (sigdelayed): Avoid a race where a signal could end up calling an
5144         incorrect signal handler if two signals come in close together.
5145
5146 Tue Jan 23 21:56:00 2001  Corinna Vinschen <corinna@vinschen.de>
5147
5148         * mmap.cc (fhandler_disk_file::mmap): Call CreateFileMapping with
5149         len != 0 only when performing an anonymous mapping.
5150
5151 Mon Jan 22 15:35:28 2001  Christopher Faylor <cgf@cygnus.com>
5152
5153         * path.h: Add a new constant.
5154         * syscalls.cc (_read): Oscillate errno check.
5155
5156 Mon Jan 22 15:27:12 2001  Christopher Faylor <cgf@cygnus.com>
5157
5158         * include/cygwin/version.h: Bump API to reflect setlogmask.
5159
5160 Sun Jan 21 22:40:25 2001  Jason Tishler <jt@dothill.com>
5161
5162         * cygwin.din: Add export for setlogmask().
5163         * syslog.cc (setlogmask): New function.
5164
5165 Thu Jan 18 10:27:00 2001  Corinna Vinschen <corinna@vinschen.de>
5166
5167         * resource.cc (setrlimit): Support RLIMIT_NOFILE.
5168
5169 Wed Jan 17 23:23:12 2001  Christopher Faylor <cgf@cygnus.com>
5170
5171         * syscalls.cc (setdtablesize): Call with amount to increment not total
5172         amount.  Return success or failure error code.
5173
5174 Wed Jan 17 09:47:13 2001  Christopher Faylor <cgf@cygnus.com>
5175
5176         * autoload.cc (LoadDLLinitfunc): Remove debugging statement.
5177
5178         * exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to
5179         earlier in interrupt.
5180         (interrupt_setup): i.e., here.
5181         (sig_handle): Don't queue multiple SIGSTOPS.
5182         * fhandler.h (bg_check_types): Enumerate return value of bg_check for
5183         clarity.
5184         * signal.cc (kill_pgrp): Minor cleanup.
5185         * fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type
5186         for function return.  Don't raise signal if a signal is already queued.
5187         * fhandler_console.cc (fhandler_console::read): Use enumerated return
5188         type for bg_check.
5189         * select.cc: Ditto, throughout.
5190         * read.cc: Ditto, throughout.
5191         * termios.cc: Ditto, throughout.
5192         (_read): YA interrupt detect simplification.
5193         * wait.cc (wait4): Ditto.
5194
5195 Wed Jan 17 10:56:00 2001  Corinna Vinschen <corinna@vinschen.de>
5196
5197         * cygheap.cc (cygheap_user::~cygheap_user): Temporarily
5198         disable free'ing memory.
5199
5200 Tue Jan 16 18:01:00 2001  Corinna Vinschen <corinna@vinschen.de>
5201
5202         * mmap.cc (mmap): Initialize fh to avoid compiler warnings.
5203
5204 Mon Jan 15 21:07:00 2001  Christopher Faylor <cgf@cygnus.com>
5205
5206         * wait.cc (wait4): Rename variable for consistency.  Allow restartable
5207         signal behavior.
5208
5209 Mon Jan 15 23:15:00 2001  Corinna Vinschen <corinna@vinschen.de>
5210
5211         * mmap.cc (mmap): Add more parameter checking. Change error output
5212         in case of EINVAL. Treat mmapping /dev/zero like MAP_ANONYMOUS.
5213
5214 Mon Jan 15 20:34:00 2001  Corinna Vinschen <corinna@vinschen.de>
5215
5216         * mmap.cc: include <unistd.h>. Define some bit operations for
5217         the new page map.
5218         (mmap_record): Change type of base_address_ to caddr_t.
5219         Add map_map_ member. Add several methods to manipulate map_map_.
5220         (mmap_record::alloc_map): New method.
5221         (mmap_record::free_map): Ditto.
5222         (mmap_record::find_empty): Ditto.
5223         (mmap_record::map_map): Ditto.
5224         (mmap_record::unmap_map): Ditto.
5225         (list::add_record): Change return type to `mmap_record *'.
5226         Allocate page map.
5227         (list::match): New method.
5228         (mmap): Partly rewritten to take care for the new page map. Add some
5229         parameter checking.
5230         (munmap): Ditto.
5231
5232 Mon Jan 15 13:50:00 2001  Corinna Vinschen <corinna@vinschen.de>
5233
5234         * heap.cc (heap_init): Fix extern declaration of getpagesize.
5235         * syscalls.cc (getpagesize): Fix another typo.
5236
5237 Mon Jan 15 12:48:00 2001  Corinna Vinschen <corinna@vinschen.de>
5238
5239         * syscalls.cc (getpagesize): Save pagesize in global variable to
5240         avoid calling GetSystemInfo too often.
5241         * heap.cc (getpagesize): Eliminate.
5242         (heap_init): Use getpagesize function from syscalls.cc.
5243
5244 Mon Jan 15 11:56:00 2001  Corinna Vinschen <corinna@vinschen.de>
5245
5246         * sysconf.cc (sysconf): return `getpagesize ()' on _SC_PAGESIZE
5247         request to avoid implementing the same twice.
5248
5249 Sun Jan 14 14:07:50 2001  Christopher Faylor <cgf@cygnus.com>
5250
5251         * syscalls.cc (_read): Use more lightweight method for determining if
5252         read has been interrupted by a signal.
5253
5254 Fri Jan 12 00:35:15 2001  Christopher Faylor <cgf@cygnus.com>
5255
5256         * debug.h: Add regparm attributes to some functions.
5257
5258         * signal.cc (sigaction): Don't treat SIGCONT specially.
5259
5260         * exceptions.cc (interrupt_setup): Save sa_flags of interrupted signal
5261         for later use.
5262         (sig_handler): Default any stopping signal to SIGSTOP.
5263         (call_signal_handler): New function.
5264         (sigdelayed0): New function.
5265         * sigproc.cc (sigproc_init): Initialize SIGSTOP sigaction for special
5266         behavior.
5267         * sigproc.h: Define call_signal_handler.
5268         * syscalls.cc (_read): Allow restartable signal behavior.
5269
5270 Thu Jan 11 13:17:00 2001  Corinna Vinschen <corinna@vinschen.de>
5271
5272         * fhandler.h (fhandler_base): New method `fixup_mmap_after_fork'.
5273         (fhandler_disk_file: Ditto.
5274         (fhandler_dev_mem): Ditto.
5275         * fhandler_mem.cc (fhandler_dev_mem::open): Set OBJ_INHERIT attribute
5276         for device\physicalmemory handle.
5277         (fhandler_dev_mem::mmap): Ditto.
5278         * fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork): New
5279         method.
5280         * mmap.cc (mmap_record): Add private `fdesc_' member.  Change
5281         constructor accordingly.
5282         (get_fd): New method.
5283         (mmap): Use new mmap_record constructor.
5284         (fhandler_base::fixup_mmap_after_fork): New method.
5285         (fhandler_disk_file::fixup_mmap_after_fork): Ditto.
5286         (fixup_mmaps_after_fork): Call `fixup_mmap_after_fork' of appropriate
5287         fhandler class.
5288
5289 Wed Jan 10 22:08:30 2001  Kazuhiro Fujieda  <fujieda@jaist.ac.jp>
5290
5291         * sigproc.cc (wait_sig): Allow SIGCONT when stopped.
5292
5293 Tue Jan  9 16:55:00 2001  Corinna Vinschen <corinna@vinschen.de>
5294
5295         Patch suggested by René Møller Fonseca <fonseca@mip.sdu.dk>
5296         * include/sys/socket.h: Change prototype to have 2nd parameter `const'.
5297         * net.cc (cygwin_bind): Change 2nd parameter to `const'.
5298
5299 Sun Jan  7 22:59:37 2001  Christopher Faylor <cgf@cygnus.com>
5300
5301         * pinfo.cc (codepage_init): Move function.
5302         * environ.cc (codepage_init): To here.
5303         * exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration
5304         since it is supposed to be maskable.
5305         * signal.cc (sigaction): Ditto.
5306         * sigproc.cc (wait_sig): Ditto.
5307         * winsup.h: Eliminate global declaration of codepage_init.
5308
5309 Thu Jan  5  9:33:00 2001  Corinna Vinschen <corinna@vinschen.de>
5310
5311         * resource.cc (getrlimit): Set errno on EFAULT instead of returning
5312         it.
5313         (setrlimit): Ditto.
5314
5315 Thu Jan  5  3:38:00  2001  David Sainty <David.Sainty@optimation.co.nz>
5316
5317         * resource.cc (setrlimit): Prevent failing with an error when the
5318         operation would not have changed anything.
5319
5320 Thu Jan  4 10:29:54  2001  Earnie Boyd  <earnie_boyd@yahoo.com>
5321
5322         * thread.cc: Need LONG_MAX definition.
5323
5324 Wed Jan  3 13:47:23 2001  Christopher Faylor <cgf@cygnus.com>
5325
5326         * thread.cc (MTinterface::CreateSemaphore): Correctly set semaphore
5327         max.
5328
5329 Wed Jan  3 09:44:51 2001  Christopher Faylor <cgf@cygnus.com>
5330
5331         * fhandler_console.cc (fhandler_console::read): Restore missing test
5332         for code page before doing OemToCharBuff.
5333
5334 Wed Jan  3 09:20:20 2001  Jason Tishler <jt@dothill.com>
5335
5336         * include/cygwin/version.h: Fix typo in CYGWIN_VERSION_DLL_COMBINED
5337         macro.