OSDN Git Service

* fhandler.cc (fhandler_base::lseek): Drop 9x considerations.
[pf3gnuchains/pf3gnuchains3x.git] / winsup / cygwin / ChangeLog
1 2007-02-23  Corinna Vinschen  <corinna@vinschen.de>
2
3         * fhandler.cc (fhandler_base::lseek): Drop 9x considerations.
4         * fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto.
5         * wincap.cc: Remove lock_file_highword and has_64bit_file_access
6         throughout.
7         * wincap.h: Ditto.
8
9 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
10
11         * cygheap.h (struct cwdstuff): Remove sync member and keep_in_sync
12         accessors.
13         * external.cc (cygwin_internal): Drop call to cygheap->cwd.keep_in_sync.
14         * fhandler_disk_file.cc (fhandler_disk_file::link): Always presume
15         ability to create hard links.
16         * path.cc (cwdstuff::init): Drop 9x considerations.
17         (cwdstuff::keep_in_sync): Remove.
18         (cwdstuff::set): Take NT for granted.
19         * pinfo.h (cygwin_pid): Just return pid.
20         * wincap.cc: Remove has_hard_links, can_open_directories,
21         has_negative_pids, has_named_pipes, has_try_enter_critical_section,
22         cant_debug_dll_entry and detect_win16_exe throughout.
23         * wincap.h: Ditto.
24
25 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
26
27         * fhandler_console.cc (fhandler_console::read): Drop 9x specific
28         handling of AltGr key.
29         * mmap.cc: Take NT for granted throughout.
30         * wincap.cc: Remove map_view_of_file_ex_sucks, altgr_is_ctrl_alt,
31         has_working_copy_on_write, share_mmaps_only_by_name,
32         virtual_protect_works_on_shared_pages, has_mmap_alignment_bug and
33         has_working_virtual_lock throughout.
34         * wincap.h: Ditto.
35
36 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
37
38         * fhandler.cc (fhandler_base::set_no_inheritance): Always use
39         SetHandleInformation.
40         * fhandler_disk_file.cc (fhandler_disk_file::lock): Always use
41         UnlockFileEx/LockFileEx functions.
42         * net.cc (fdsock): Don't bother to duplicate socket for inheritance.
43         * sysconf.cc (get_nproc_values): Take NT for granted.
44         (get_avphys): Ditto.
45         * syslog.cc (WIN95_EVENT_LOG_PATH): Remove define.
46         (get_win95_event_log_path): Remove.
47         (vsyslog): Fix formatting.  Take NT for granted.
48         * wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait,
49         has_eventlog, has_set_handle_information,
50         has_set_handle_information_on_console_handles and supports_smp
51         throughout.
52         * wincap.h: Ditto.
53
54 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
55
56         * dir.cc (rmdir): Move existance check in front of
57         has_dot_last_component check.  Simplify setting errno in latter case.
58
59 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
60
61         * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case.
62         Simplify seek beyond EOF case.
63         * times.cc (times): Remove wincap.has_get_process_times case.
64         * wincap.cc: Remove has_delete_on_close, has_page_guard,
65         has_get_process_times and has_lseek_bug throughout.
66         * wincap.h: Ditto.
67
68 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
69
70         Throughout remove all usage of wincap.access_denied_on_delete.
71         * dir.cc (rmdir): Add existance check to be errno-compatible with Linux.
72         * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop test for
73         non-existent dir on 9x share.
74         * syscalls.cc (unlink): Add comment.
75         * wincap.cc: Remove access_denied_on_delete flag throughout.
76         * wincap.h: Ditto.
77
78 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
79
80         * fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug
81         introduced by switching to NtClose.
82
83 2007-02-22  Christopher Faylor  <me@cgf.cx>
84
85         * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of
86         guard test.  Increase size of stack reserved and increase size before
87         the current stack pointer.  Use pointers when doing arithmetic.
88         (dll_crt0_1): Initialize exception handler when we notice we're the
89         child of a fork from non-main thread.
90         * fork.cc (frok::parent): Make argument volatile.
91         (frok::child): Ditto.
92         (lock_signals): New class.
93         (lock_pthread): Ditto.
94         (hold_everhthing): Ditto.
95         (frok::parent): Move atforkprepare and atforkparent to lock_pthread
96         class.
97         (fork): Make ischild boolean.  Use hold_everything variable within
98         limited scope to set various mutexes in such a way as to avoid
99         deadlocks.
100         * thread.h (pthread_mutex::tid): New variable, active when debugging
101         for tracking thread id of owner.
102         (pthread_mutex::set_owner): Set tid when debugging.
103         * thread.cc (pthread_mutex::pthread_mutex): Clear tid.
104         (pthread_mutex::_unlock): Ditto when unlocking.
105         (pthread_mutex::fixup_after_fork): Set tid to special value after
106         forking since owner is unknown.
107
108 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
109
110         Throughout replace all usage of wincap.shared with the constant
111         FILE_SHARE_VALID_FLAGS.
112         * fhandler.cc (fhandler_base::open_9x): Drop local variable shared.
113         * wincap.cc: Remove shared member throughout.
114         * wincap.h: Ditto.
115
116 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
117
118         * Makefile.in (DLL_IMPORTS): Add libntdll.a.
119         * autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and
120         ntdll.dll available on all platforms since NT4.
121         
122         Throughout remove all usage of wincap.is_winnt.
123         * dcrt0.cc (dll_crt0_0): Remove call to mmap_init.
124         * fhandler.h (class fhandler_base): Remove has_changed flag.
125         (fhandler_disk_file::touch_ctime): Remove declaration.
126         (fhandler_disk_file::readdir_9x): Ditto.
127         (fhandler_disk_file::touch_ctime): Remove.
128         (fhandler_disk_file::readdir_9x): Remove.
129         (fhandler_disk_file::closedir): Call NtClose instead of CloseHandle.
130         * mmap.cc: Throughout call CreateMapping and MapView directly.
131         (VirtualProt9x): Remove.
132         (VirtualProtNT): Remove.
133         (VirtualProtEx9x): Remove.
134         (VirtualProtExNT): Remove.
135         (VirtualProtect): Remove define.
136         (VirtualProtectEx): Remove define.
137         (CreateMapping9x): Remove.
138         (CreateMappingNT): Rename to CreateMapping.
139         (MapView9x): Remove.
140         (MapViewNT): Rename to MapView.
141         (struct mmap_func_t): Remove definition.
142         (mmap_funcs_9x): Remove.
143         (mmap_funcs_nt): Remove.
144         (mmap_func): Remove.
145         (mmap_init): Remove.
146         * net.cc (getdomainname): Drop comment. Use NT4 registry key only.
147         (get_95_ifconf): Remove.
148         * pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes.
149         (winpids::enum9x): Remove.
150         (winpids::set): Just call enum_processes directly.
151         (winpids::enum_init): Ditto.
152         * pinfo.h (class winpids): Drop enum_processes pointer.  Rename
153         enumNT to enum_processes.  Drop enum9x declaration.  Drop initialization
154         of enum_processes throughout.
155         * registry.cc (get_registry_hive_path): Just create NT key.
156         (load_registry_hive): Only load NT specific file.
157         * syscalls.cc (unlink_9x): Remove.
158         (unlink): Just call unlink_nt.
159         * wincap.cc: Remove is_winnt flag throughout.
160         * wincap.h: Ditto.
161         * winsup.h: Remove mmap_init declaration.
162
163 2007-02-21  Corinna Vinschen  <corinna@vinschen.de>
164
165         * wincap.cc (wincap_unknown): Change settings for unknown to reflect
166         the capabilities of NT4.
167         (wincap_95): Remove.
168         (wincap_95osr2): Remove.
169         (wincap_98): Remove.
170         (wincap_98se): Remove.
171         (wincap_me): Remove.
172         (wincap_nt3): Remove.
173         (wincapc::init): Temporarily bail out on any 9x system.
174
175 2007-02-20  Corinna Vinschen  <corinna@vinschen.de>
176
177         * cygwin.din (sem_unlink): Export.
178         * posix_ipc.cc: Include thread.h and semaphore.h.  Remove TODO
179         comment.
180         (ipc_names): Add max_len member.  Set to maximum length of the path
181         before tacking on the prefix path.  Set prefix path for named semaphors
182         to /dev/shm, as on Linux.
183         (enum ipc_type_t): Change sem to semaphore to avoid name conflicts.
184         (check_path): Detect empty paths.  Use ipc_names's max_len member.
185         Use __small_sprintf to create full object path name.  Special case
186         semaphores.
187         (ipc_cond_init): Drop superfluous strcpy.
188         (class ipc_flock): New class to simplify file locking in subsequent
189         code.
190         (struct mq_hdr): Raise size of mqh_uname to allow adding a unique
191         LUID to the name.
192         (mq_open): Fix formatting.  Create unique synchronization object names
193         using AllocateLocallyUniqueId.
194         (struct sem_finfo): New structure defining named semaphore file content.
195         (sem_open): Move here.  Rework implementation to allow kernel
196         persistent implementation of POSIX named semaphores.
197         (_sem_close): Implement sem_close.
198         (sem_close): Move here.  Just call _sem_close with do_close parameter
199         set to true.
200         (sem_unlink): New function.
201         * pthread.cc (mangle_sem_name): Remove.
202         (sem_open): Move to posix_ipc.cc.
203         (sem_close): Ditto.
204         * syscalls.cc (close_all_files): Call semaphore::terminate here.
205         * thread.cc: Fix formatting.  Rearrange semaphore functions so that
206         they are close together.
207         (semaphore::semaphore): Rework to play nicely with new named semaphore
208         implementation.
209         (semaphore::_terminate): Call _sem_close if semaphore is a named
210         semaphore.
211         (semaphore::destroy): Don't destroy named semaphores.  Return EINVAL
212         instead.
213         (semaphore::close): Only destroy named semaphores.  Return EINVAL
214         otherwise.
215         (semaphore::open): Rework to play nicely with new named semaphore
216         implementation.  Loop through existing semaphores to be able to
217         return same sem_t pointer as a former call on the same named semaphore.
218         (semaphore::getinternal): New function called from _sem_close.
219         * thread.h (class List): Make mx and head public.
220         (class semaphore): Fix formatting.  Align method declarations with
221         implementation in thread.cc.  Add members used for named semaphores.
222         (semaphore::terminate): New static method.
223         * include/semaphore.h: Redefine SEM_FAILED.  Fix formatting.
224         (sem_unlink): Add declaration.
225         * include/cygwin/version.h: Bump API minor number.
226
227 2007-02-20  Christopher Faylor  <me@cgf.cx>
228
229         * exceptions.cc (_cygtls::signal_exit): Only call myself.exit when when
230         exit_state indicates that we've visited do_exit.
231         * sync.h (lock_process::lock_process): Use renamed exit_state -
232         ES_PROCESS_LOCKED.
233         * winsup.h: Rename ES_MUTO_SET to ES_PROCESS_LOCKED.
234
235 2007-02-20  Corinna Vinschen  <corinna@vinschen.de>
236
237         * fhandler_socket.cc (fhandler_socket::bind): Remove printing wrong
238         errno in debug output.
239
240 2007-02-19  Christopher Faylor  <me@cgf.cx>
241
242         Remove extraneous whitespace.
243         * pinfo.cc (commune_process): Use default argument to lock_process.
244         * sigproc.cc: Update copyright.
245         * select.cc: Ditto.
246
247 2007-02-15  Corinna Vinschen  <corinna@vinschen.de>
248
249         * posix_ipc.cc (mq_open): Avoid compiler warning.  Initialize mqhdr
250         before using it in file exists case.
251         * include/mqueue.h (mqd_t): Make non-pointer type.
252
253 2007-02-15  Corinna Vinschen  <corinna@vinschen.de>
254
255         * posix_ipc.cc (ipc_mutex_init): Create global object name.
256         (ipc_cond_init): Ditto.
257         (struct mq_hdr): Add mqh_uname member to store synchronization object
258         name.
259         (mq_open): Create unique synchronization object name and store in
260         mq_hdr->mqh_uname.  Use this name in calls to ipc_mutex_init and
261         ipc_cond_init.
262
263 2007-02-14  Corinna Vinschen  <corinna@vinschen.de>
264
265         * Makefile.in (DLL_OFILES): Add posix_ipc.o.
266         * cygwin.din (mq_close): Export.
267         (mq_getattr): Export.
268         (mq_notify): Export.
269         (mq_open): Export.
270         (mq_receive): Export.
271         (mq_send): Export.
272         (mq_setattr): Export.
273         (mq_timedreceive): Export.
274         (mq_timedsend): Export.
275         (mq_unlink): Export.
276         * posix_ipc.cc: New file implementing the above functions.  Move
277         shm_open and shm_unlink from syscalls.cc here.
278         * sysconf.cc (sca): Set value of _SC_MQ_OPEN_MAX to MQ_OPEN_MAX,
279         _SC_MQ_PRIO_MAX to MQ_PRIO_MAX, _SC_MESSAGE_PASSING to
280         _POSIX_MESSAGE_PASSING.
281         * include/limits.h (MQ_OPEN_MAX): Define.
282         (MQ_PRIO_MAX): Define.
283         * include/mqueue.h: New file.
284         * include/cygwin/version.h: Bump API minor number.
285
286 2007-02-13  Corinna Vinschen  <corinna@vinschen.de>
287
288         * include/cygwin/stdlib.h (valloc): Declare.
289         (memalign): Declare.
290
291 2007-02-09  Pierre A. Humblet  <Pierre.Humblet@ieee.org>
292
293         * libc/minires-os-if.c (write_record): Handle DNS_TYPE_SRV and
294         some obsolete types.
295
296 2007-02-08  Corinna Vinschen  <corinna@vinschen.de>
297
298         * syscalls.cc (check_shm): New static function to do path checking
299         common to shm_open and shm_unlink.  Check for /dev/shm existance.
300         (shm_open): Call check_shm.
301         (shm_unlink): Ditto.
302
303 2007-02-08  Corinna Vinschen  <corinna@vinschen.de>
304
305         * cygwin.din (shm_open): Export.
306         (shm_unlink): Export.
307         * syscalls.cc (shm_open): New function.
308         (shm_unlink): New function.
309         * sysconf.cc (sca): Set value of _SC_SHARED_MEMORY_OBJECTS to
310         _POSIX_SHARED_MEMORY_OBJECTS.
311         * include/cygwin/version.h: Bump API minor number.
312         * include/sys/mman.h (shm_open): Add prototype.
313         (shm_unlink): Ditto.
314
315 2007-02-08  Christopher Faylor <me@cgf.cx>
316             Corinna Vinschen  <corinna@vinschen.de>
317
318         * cygmalloc.h (__set_ENOMEM): Declare.
319         (MALLOC_FAILURE_ACTION): Call __set_ENOMEM.
320         * malloc_wrapper.cc (malloc) Remove setting errno here.
321         (realloc): Ditto.
322         (calloc): Ditto.
323         (memalign): Ditto.
324         (valloc): Ditto.
325         (posix_memalign): Save and restore errno.
326
327 2007-02-07  Corinna Vinschen  <corinna@vinschen.de>
328
329         * cygmalloc.h (MALLOC_FAILURE_ACTION): Move to correct #if branch.
330
331 2007-02-07  Corinna Vinschen  <corinna@vinschen.de>
332
333         * cygmalloc.h (MALLOC_FAILURE_ACTION): Define empty.
334         * cygwin.din (posix_madvise): Export.
335         (posix_memalign): Export.
336         * fhandler.cc (fhandler_base::fpathconf): Return useful values in
337         _PC_VDISABLE, _PC_SYNC_IO and _PC_SYMLINK_MAX cases.
338         * malloc_wrapper.cc (malloc): Set errno here since it's not set in
339         dlmalloc.c anymore.
340         (realloc): Ditto.
341         (calloc): Ditto.
342         (memalign): Ditto.
343         (valloc): Ditto.
344         (posix_memalign): New function.
345         * mmap.cc (posix_madvise): New function.
346         * sysconf.cc (get_open_max): New function.
347         (get_page_size): Ditto.
348         (get_nproc_values): Ditto.
349         (get_avphys): Ditto.
350         (sc_type): New type.
351         (sca): New array to map _SC_xxx options to sysconf return values.
352         (sysconf): Reimplement using sca array.
353         * include/limits.h: Add all missing values as defined by SUSv3.
354         * include/pthread.h (PTHREAD_DESTRUCTOR_ITERATIONS): Move definition
355         to sys/limits.h.
356         (PTHREAD_KEYS_MAX): Ditto.
357         * include/semaphore.h (SEM_VALUE_MAX): Ditto.
358         * include/cygwin/stdlib.h (posix_memalign): Declare.
359         * include/cygwin/version.h: Bump API minor number.
360         * include/sys/mman.h: Add posix_madvise flags.
361         (posix_madvise): Declare.
362         * include/sys/termios.h (_POSIX_VDISABLE): Move definition to
363         sys/limits.h.
364
365 2007-02-05  Corinna Vinschen  <corinna@vinschen.de>
366
367         * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support for
368         baud rates up to 3000000 baud.  Add missing 128K and 256K cases.
369         (fhandler_serial::tcgetattr): Ditto.
370         * include/sys/termios.h: Add baud rate definitions from B460800 up to
371         B3000000.
372
373 2007-02-02  Corinna Vinschen  <corinna@vinschen.de>
374
375         * syscalls.cc (unlink_nt): Add missing assignment in case NtClose fails.
376
377 2007-02-01  Corinna Vinschen  <corinna@vinschen.de>
378
379         * net.cc (ga_dup): New function, taken from ga_clone with v4-in-v6
380         mapping addition.
381         (ga_clone): Just call ga_dup from here.
382         (ga_duplist): New function to duplicate list of struct addrinfo.
383         (ga_echeck): Don't check ai_flags, it already happened in
384         cygwin_getaddrinfo.
385         (cygwin_freeaddrinfo): Always call ipv4_freeaddrinfo.
386         (cygwin_getaddrinfo): Use new wincap.supports_all_posix_ai_flags
387         flag rather than wincap.has_gaa_on_link_prefix.  Always duplicate
388         WinSock's addrinfo list to a self-allocated list.  Handle AI_V4MAPPED
389         for pre-Vista platforms supporting getaddrinfo.
390         * wincap.h (wincapc::supports_all_posix_ai_flags): New element.
391         * wincap.cc: Implement above element throughout.
392         * include/netdb.h: Note how AI_ADDRCONFIG is not supported pre-Vista.
393         Remove superfluous comment.
394
395 2007-02-01  Corinna Vinschen  <corinna@vinschen.de>
396
397         * include/cygwin/socket.h: Add IPv6 socket options.
398
399 2007-01-31  Corinna Vinschen  <corinna@vinschen.de>
400
401         * net.cc (cygwin_getaddrinfo): Fix thinko in AI_ADDRCONFIG handling.
402
403 2007-01-31  Corinna Vinschen  <corinna@vinschen.de>
404
405         * net.cc (cygwin_getaddrinfo): Check ai_flags for valid values.
406         Handle AI_NUMERICSERV.  Handle AI_ADDRCONFIG behaviour on Vista.
407         * include/netdb.h (AI_NUMERICSERV): Add missing flag.
408
409 2007-01-30  Corinna Vinschen  <corinna@vinschen.de>
410
411         * fhandler_disk_file.cc (fhandler_disk_file::closedir): Add dir name
412         to debug output.
413         * syscalls.cc (try_to_bin): Enable code to move file to user specific
414         recycler dir to eliminate Vista problem.
415         (unlink_nt): Add comment that rename after opening for delete on close
416         only fails on XP.
417
418 2007-01-30  Corinna Vinschen  <corinna@vinschen.de>
419
420         * sigproc.cc (child_info::child_info): Set msv_count to non-zero
421         value only on systems requiring it.
422
423 2007-01-28  Corinna Vinschen  <corinna@vinschen.de>
424
425         * include/ftw.h: Include sys/cdefs.h.
426
427 2007-01-26  Corinna Vinschen  <corinna@vinschen.de>
428
429         * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Implement rmdir
430         on NT by calling unlink_nt.  Check for directory here.
431         * syscalls.cc (try_to_bin): Fix buggy debug_printf statement.
432         (unlink_nt): Make non-static.  Don't use delete-on-close semantics on
433         directories.  Explain why.
434
435 2007-01-24  Corinna Vinschen  <corinna@vinschen.de>
436
437         * net.cc (if_nametoindex): This time, really free IP_ADAPTER_ADDRESSES
438         memory.
439         (if_indextoname): Ditto.
440
441 2007-01-24  Corinna Vinschen  <corinna@vinschen.de>
442
443         * security.h (pop_thread_privilege): Revert to previous state, not
444         to token used for impersonation.
445
446 2007-01-24  Corinna Vinschen  <corinna@vinschen.de>
447
448         * cygheap.h (cygheap_user::deimpersonate): Always RevertToSelf.
449
450 2007-01-23  Corinna Vinschen  <corinna@vinschen.de>
451
452         * net.cc (gai_errmap): Add EAI_OVERFLOW entry.  Fix formatting.
453         (cygwin_gai_strerror): Drop using EAI_MAX.
454         (w32_to_gai_err): Ditto.
455         * include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX.
456
457 2007-01-23  Corinna Vinschen  <corinna@vinschen.de>
458
459         * include/netdb.h: Add AI_xxx flags available since Vista.
460
461 2007-01-23  Corinna Vinschen  <corinna@vinschen.de>
462
463         * net.cc (if_nametoindex): Free IP_ADAPTER_ADDRESSES memory.
464         (if_indextoname): Ditto.
465         (if_nameindex): Ditto.  Remove duplicate indexed entries in result.
466
467 2007-01-21  Corinna Vinschen  <corinna@vinschen.de>
468
469         * autoload.cc (WSAIoctl): Define.
470         (SendARP): Define.
471         * cygwin.din: Export if_freenameindex, if_indextoname, if_nameindex and
472         if_nametoindex.
473         * fhandler_procnet.cc: Drop including wchar.h.  Drop definitions of
474         GAA_FLAG_INCLUDE_ALL_INTERFACES, IP_ADAPTER_UNICAST_ADDRESS_VISTA.
475         (fhandler_procnet::exists): Check for has_gaa_prefixes.  Call
476         get_adapters_addresses here.
477         (fhandler_procnet::readdir): Ditto.
478         (prefix): Move to net.cc.
479         (fhandler_procnet::fill_filebuf): Call get_adapters_addresses here.
480         Simplify allocation.  Use AdapterName rather than FriendlyName as
481         interface name.  Use IfIndex if available, Ipv6IfIndex otherwise.
482         (in6_are_prefix_equal): Move to net.cc.
483         * fhandler_socket.cc: Define old SIOCGxxx values.
484         (CONV_OLD_TO_NEW_SIO): Convert old SIOCGxxx value to new one.
485         (struct __old_ifreq): Define old struct ifreq.
486         (fhandler_socket::ioctl): Handle old SIOCGxxx values.  Handle new
487         SIOCGIFFRNDLYNAM command.  Simplify copying ifreq data to user space.
488         Call get_ifconf with additional SOCKET parameter.
489         * net.cc (IP_ADAPTER_UNICAST_ADDRESS_LH): Define.
490         (IP_ADAPTER_ADDRESSES_LH): Define.
491         (SIO_GET_INTERFACE_LIST): Define.
492         (sockaddr_in6_old): Define.
493         (sockaddr_gen): Define.
494         (INTERFACE_INFO): Define.
495         (IN_LOOPBACK): Define.
496         (in_are_prefix_equal): New static function.
497         (ip_addr_prefix): New function, replaces prefix function, add AF_INET
498         handling.
499         (GAA_FLAG_INCLUDE_ALL_INTERFACES): Define.
500         (get_adapters_addresses): New function.
501         (WS_IFF_xxx): Define Winsock interface flag values.
502         (convert_ifr_flags): New function to convert Winsock interface flag
503         values to Cygwin interface flag values.
504         (get_xp_ifconf): New get_ifconf implementation for XP SP1 and above.
505         (get_2k_ifconf): Fix interface index.  Fix formatting.
506         (get_nt_ifconf): Fix formatting.
507         (get_95_ifconf): Ditto.
508         (get_ifconf): Take additional SOCKET parameter.  Call get_xp_ifconf
509         on XP SP1 and above.
510         (if_nametoindex): New function.
511         (if_indextoname): New function.
512         (if_nameindex): New function.
513         (if_freenameindex): New function.
514         (in6_are_prefix_equal): Moved here from fhandler_procnet.cc.
515         * wincap.cc (wincap_xp): Define has_gaa_prefixes as true by default.
516         (wincapc::init): Assume has_osversioninfoex by default.  Call
517         GetVersionEx with OSVERSIONINFOEX first.  Call with OSVERSIONINFO only
518         if that fails.  Simplify NT4 case and try to avoid strcmp.  Check XP
519         Service Pack using version.wServicePackMajor to avoid strcmp.
520         * include/asm/socket.h (SIOCGIFFRNDLYNAM): Define.
521         * include/cygwin/if.h: Fix formatting.
522         (IFF_POINTTOPOINT): Define.
523         (IFF_NOARP): Define.
524         (IFF_LOWER_UP): Define.
525         (IFF_DORMANT): Define.
526         (struct if_nameindex): Define.
527         (IFRF_FRIENDLYNAMESIZ): Define.
528         (struct ifreq_frndlyname): Define.
529         (IFNAMSIZ): Redefine as 44.
530         (IF_NAMESIZE): Define.
531         (struct ifreq): Redefine ifru_flags as int.  Define ifru_data.  Pad size
532         to sizeof sockaddr_in6 for further extensions.
533         (ifr_data): Define.
534         (ifr_frndlyname): Define.
535         (if_nametoindex): Declare.
536         (if_indextoname): Declare.
537         (if_nameindex): Declare.
538         (if_freenameindex): Declare.
539         * include/cygwin/version.h: Bump API minor number.
540         (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ): Define check for old vs. new
541         ifreq structure.
542
543 2007-01-18  Corinna Vinschen  <corinna@vinschen.de>
544
545         * spawn.cc (spawn_guts): Don't set cwd for non-Cygwin child processes
546         on NT to allow starting them in virtual directories.
547
548 2007-01-18  Corinna Vinschen  <corinna@vinschen.de>
549
550         * mmap.cc (list::hash): Fix type to __ino64_t.
551         (list::get_hash): Ditto.
552         (list::set): Add struct stat parameter.  Use that instead of calling
553         fstat.
554         (map::get_list_by_fd): Ditto.
555         (map::add_list): Ditto.
556         (mmap_is_attached_or_noreserve): Call get_list_by_fd appropriately.
557         (mmap_worker): Add pameters for map list and file stat information.
558         Propagate to called functions.
559         (mmap64): Use fstat on files early.  Replace call to GetFileSize.
560         Call get_list_by_fd and mmap_worker appropriately.
561
562 2007-01-18  Corinna Vinschen  <corinna@vinschen.de>
563
564         * fhandler_procnet.cc: Drop declaration of htonl and ntohs.  Include
565         asm/byteorder.h instead.
566
567 2007-01-18  Corinna Vinschen  <corinna@vinschen.de>
568
569         * include/cygwin/in6.h: Drop inclusion of asm/byteorder.h.
570         * fhandler_procnet.cc: Declare htonl and ntohs here.
571
572 2007-01-17  Corinna Vinschen  <corinna@vinschen.de>
573
574         * Makefile.in (DLL_OFILES): Add fhandler_procnet.o.
575         * autoload.cc (GetAdaptersAddresses): Define.
576         * devices.h (FH_PROCNET): Define new device.
577         * devices.in (dev_procnet_storage): Add "/proc/net" entry.
578         * devices.cc: Regenerate.
579         * dir.cc (readdir_worker): Use isproc_dev macro.
580         * dtable.cc (build_fh_pc): Add FH_PROCNET.
581         * fhandler.h (class fhandler_procnet): New class.
582         * fhandler_proc.cc: Add "net" subdirectory handling.
583         * fhandler_procnet.cc: New file handling "/proc/net" directory.
584         * path.cc (isvirtual_dev): Move to path.h.
585         * path.h (isproc_dev): New macro to identify /proc files by device.
586         (isvirtual_dev): Moved here.  Define using isproc_dev.
587         * syscalls.cc (unlink): Use isproc_dev macro.
588         * wincap.h (wincapc::has_gaa_prefixes): New element.
589         (wincapc::has_gaa_on_link_prefix): New element.
590         * wincap.cc: Implement above elements throughout.
591         (wincapc::init): Check XP for service pack and set has_gaa_prefixes
592         appropriately.
593         * include/cygwin/in6.h: Include asm/byteorder.h.
594
595 2007-01-17  Corinna Vinschen  <corinna@vinschen.de>
596
597         * include/asm/socket.h (SIOGIFINDEX): Define.
598
599 2007-01-17  Corinna Vinschen  <corinna@vinschen.de>
600
601         * mmap.cc (MapView9x): Note possible uselessness of retrying.
602         (MapViewNT): Ditto.
603         (mmap64): Fix pre-reservation to work for non NULL, non MAP_FIXED.
604
605 2007-01-16  Corinna Vinschen  <corinna@vinschen.de>
606
607         * autoload.cc (RtlAnsiStringToUnicodeString): Define.
608         (RtlOemStringToUnicodeString): Define.
609         * ntdll.h (struct _RTL_USER_PROCESS_PARAMETERS): Define.
610         (struct _PEB): Redefine with a bit of content.
611         (RtlAnsiStringToUnicodeString): Declare.
612         (RtlOemStringToUnicodeString): Declare.
613         * path.cc: Include ntdll.h.
614         (_upp): New global variable pointing to user process parameter block.
615         (get_user_proc_parms): New static function to retrieve user process
616         parameter block.
617         (close_user_proc_parms_cwd_handle): New function to close handle to
618         current working directory in user process parameter block.
619         (cwdstuff::init): Drop redundant declaration of dynamically_loaded.
620         Set current dir only on 9x.  Call close_user_proc_parms_cwd_handle
621         on NT instead.
622         (cwdstuff::keep_in_sync): Only on 9x.
623         (cwdstuff::set): Keep behaviour on 9x.  On NT write cwd path into user
624         process parameter block and set cwd handle to NULL.  Fix comments to
625         reflect new behaviour.
626
627 2007-01-16  Corinna Vinschen  <corinna@vinschen.de>
628
629         * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX.
630         * net.cc (get_2k_ifconf): Ditto.
631         (get_nt_ifconf): Fake SIOCGIFINDEX.
632         (get_95_ifconf): Ditto.
633         (get_ifconf): Handle SIOCGIFINDEX.  Fake it for loopback on systems
634         not supporting IP Helper Lib.
635         * include/asm/socket.h (SIOCGIFINDEX): Define.
636         * include/cygwin/if.h (struct ifreq): Add member for interface index.
637         (ifr_ifindex): Define.
638
639 2007-01-16  Corinna Vinschen  <corinna@vinschen.de>
640
641         * include/cygwin/in6.h (struct ipv6_mreq): Change type of interface
642         member to uint32_t.
643         (struct in6_pktinfo): Ditto.
644
645 2007-01-16  Corinna Vinschen  <corinna@vinschen.de>
646
647         * include/cygwin/in.h (struct ip_mreq_source): Define.
648         (struct ip_msfilter): Define.
649         (IP_MSFILTER_SIZE): Define.
650         (struct in_pktinfo): Define.
651         (struct group_req): Define.
652         (struct group_source_req): Define.
653         (struct group_filter): Define.
654         (GROUP_FILTER_SIZE): Define.
655         (INADDR_ALLRTRS_GROUP): Define.
656         * include/cygwin/socket.h: Define protocol agnostic multicast options.
657
658 2007-01-15  Corinna Vinschen  <corinna@vinschen.de>
659
660         * CYGWIN_LICENSE: Fix web pages and contact information.
661
662 2007-01-15  Corinna Vinschen  <corinna@vinschen.de>
663
664         * ntdll.h: Adjust status definitions.
665
666 2007-01-15  Corinna Vinschen  <corinna@vinschen.de>
667
668         * cygheap.cc (cygheap_init): Add TODO comment.
669
670 2007-01-15  Corinna Vinschen  <corinna@vinschen.de>
671
672         * ntdll.h (STATUS_SHARING_VIOLATION): Define.
673
674 2007-01-13  Corinna Vinschen  <corinna@vinschen.de>
675
676         * syscalls.cc (unlink_nt): Don't move files to recycle bin which are
677         not in use.
678
679 2007-01-13  Christopher Faylor  <me@cgf.cx>
680
681         * glob.cc: Update copyright notice with latest from FreeBSD.
682         (glob0): Use correct type for c variable to propagate previously
683         detected protection.
684
685 2007-01-12  Corinna Vinschen  <corinna@vinschen.de>
686
687         * cygheap.cc (_csbrk): Fix off-by-one error.
688         * cygwin.sc: Give .cygheap a minimum size of 512K.
689
690 2007-01-12  Christopher Faylor  <me@cgf.cx>
691
692         * external.cc (sync_winenv): Use cur_environ () rather than
693         __cygwin_environ.
694
695 2007-01-12  Corinna Vinschen  <corinna@vinschen.de>
696
697         * fork.cc (child_copy): Add missing Windows PID in debug output.
698
699 2007-01-12  Corinna Vinschen  <corinna@vinschen.de>
700
701         * syscalls.cc: Update copyright.
702
703 2007-01-10  Corinna Vinschen  <corinna@vinschen.de>
704
705         * mmap.cc (mmap64): Pre-Reserve space for the whole mapping to get a
706         useful, valid address before the actual mappings take place.
707         Fix typo in comment.
708
709 2007-01-10  Corinna Vinschen  <corinna@vinschen.de>
710
711         * syscalls.cc (sync): Use b_drive for B: drive (Thanks to Howard Chu).
712
713 2007-01-09  Corinna Vinschen  <corinna@vinschen.de>
714
715         * syscalls.cc (getpagesize): Change condition for clarity.
716         (getsystempagesize): Ditto.
717
718 2007-01-09  Corinna Vinschen  <corinna@vinschen.de>
719
720         * mmap.cc: Do bookkeeping in 4K pages, rather than in 64K chunks.
721
722 2007-01-07  Corinna Vinschen  <corinna@vinschen.de>
723
724         * security.h (setacl): Add parameter for writability flag.
725         * sec_acl.cc (setacl): Ditto.  Set to true if any ACE with write
726         permissions is created.
727         * fhandler_disk_file.cc (fhandler_disk_file::facl): Reset
728         FILE_ATTRIBUTE_READONLY if ACL contains an ACE with write permissions.
729
730 2007-01-05  Corinna Vinschen  <corinna@vinschen.de>
731
732         * include/strings.h: Don't include string.h.  Only declare functions
733         according to SUSv3.
734
735 2007-01-04  Corinna Vinschen  <corinna@vinschen.de>
736
737         (get_ifconf): Set MTU for loopback to more correct value.
738
739 2007-01-04  Corinna Vinschen  <corinna@vinschen.de>
740
741         * fhandler_socket.cc (fhandler_socket::ioctl): Don't fake results
742         for SIOCGIFFLAGS here.  Call get_ifconf instead.
743         * net.cc (get_2k_ifconf): Clean up code to generate interface name.
744         Handle SIOCGIFFLAGS here.
745         (get_nt_ifconf): Fake SIOCGIFFLAGS here.
746         (get_95_ifconf): Ditto.
747         (get_ifconf): Don't fake loopback on systems with IP Helper Lib.
748         Set MTU for loopback to a more "modern" value.
749
750 2007-01-04  Brian Ford  <Brian.Ford@FlightSafety.com>
751             Corinna Vinschen  <corinna@vinschen.de>
752
753         * fhandler.h (PREFERRED_IO_BLKSIZE): Define as 64K.
754         * fhandler.cc (fhandler_base::fstat): Set st_blksize to
755         PREFERRED_IO_BLKSIZE.
756         * fhandler_disk_file.cc (fhandler_base::fstat_helper): Ditto.
757         * fhandler_mailslot.cc (fhandler_mailslot::fstat): Ditto.
758         * fhandler_raw.cc (fhandler_dev_raw::fstat): Ditto.
759
760 2007-01-01  Christopher Faylor  <me@cgf.cx>
761
762         * spawn.cc (spawn_guts): Don't expect synchronization from a non-cygwin
763         _P_NOWAIT process.