1 2007-03-01 Christopher Faylor <me@cgf.cx>
3 * Makefile (DLL_OFILES): Remove ntea.o
4 * environ.cc (set_ntea): Delete.
5 (parse_thing): Delete "ntea" setting.
6 * fhandler.cc (fhandler_base::open): Remove allow_ntea considerations.
7 (check_posix_perm): Ditto.
8 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Ditto.
9 (fhandler_base::open_fs): Ditto.
10 (fhandler_disk_file::mkdir): Ditto.
11 * path.cc (symlink_worker): Ditto.
12 * security.cc (get_file_attribute): Ditto.
13 (set_file_attribute): Ditto.
14 * security.h: Remove allow_ntea declaration.
16 2007-02-27 Corinna Vinschen <corinna@vinschen.de>
18 * path.cc (close_user_proc_parms_cwd_handle): Remove.
19 (cwdstuff::init): Don't call close_user_proc_parms_cwd_handle.
20 Call set to set cwd with all-sharing handle.
21 (cwdstuff::set): Fix comment. Don't close cwd handle. Set in
22 user parameter block instead and close old cwd handle.
23 * syscalls.cc (rename): Call unlink_nt instead of RemoveDirectory or
24 DeleteFile to allow deleting shared files/directories.
26 2007-02-27 Corinna Vinschen <corinna@vinschen.de>
28 * fhandler.cc(fhandler_base::open): Open with READ_CONTROL only in
29 case of query_open flag set to query_read_control. Add case for
30 new query_read_attributes flag.
31 (fhandler_base::fstatvfs): New method.
32 * fhandler.h (enum query_state): Add query_read_attributes flag.
33 (class fhandler_base): Declare new virtual fstatvfs method.
34 (class fhandler_socket): Ditto.
35 (class fhandler_pipe): Ditto.
36 (class fhandler_fifo): Ditto.
37 (class fhandler_disk_file): Ditto.
38 (class fhandler_virtual): Ditto.
39 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Open with
40 query_read_attributes instead of query_read_control.
41 (fhandler_disk_file::fstatvfs): New method.
42 (fhandler_disk_file::facl): Open with query_read_attributes instead of
44 * fhandler_fifo.cc (fhandler_fifo::fstatvfs): New method.
45 * fhandler_socket.cc (fhandler_socket::fstatvfs): New method.
46 (fhandler_socket::fchmod): Return with EBADF in the default case.
47 (fhandler_socket::fchown): Ditto.
48 (fhandler_socket::facl): Ditto.
49 * fhandler_virtual.cc (fhandler_virtual::fstatvfs): Ditto.
50 * ntdll.h (struct _FILE_FS_ATTRIBUTE_INFORMATION): Define.
51 (struct _FILE_FS_FULL_SIZE_INFORMATION): Define.
52 * pipe.cc (fhandler_pipe::fstatvfs): New method.
53 * syscalls.cc (fstatvfs): Just call the fhandler's fstatvfs.
55 (fstatfs): Call fstatvfs.
56 (statfs): Drop EFAULT handling.
58 2007-02-26 Corinna Vinschen <corinna@vinschen.de>
60 * fhandler.cc (fhandler_base::fstat): Set all file times to arbitrary
63 2007-02-26 Corinna Vinschen <corinna@vinschen.de>
65 * fhandler_registry.cc (registry_listing): Drop name of HKEY_DYN_DATA.
66 (registry_keys): Drop HKEY_DYN_DATA.
67 * net.cc: Fix comment.
70 2007-02-26 Corinna Vinschen <corinna@vinschen.de>
72 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop comment.
73 * mmap.cc (gen_access): Remove.
74 (mmap_record::gen_access): Remove.
75 (mmap64): Don't mention 9x any longer.
76 * syscalls.cc (statvfs): Drop status code consideration for 9x.
77 * libc/minires-os-if.c (get_registry_dns_items): Don't mention 9x any
79 (get_registry_dns): Drop getting registry key on 9x. Drop is9x
82 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
84 Throughout remove all usage of wincap.has_security.
85 * environ.cc (environ_init): Drop setting allow_ntsec here.
86 * grp.cc (initgroups32): Drop usage of label "out".
87 * security.cc (allow_ntsec): Set to true by default.
88 * syscalls.cc (seteuid32): Remove label success_9x.
89 * wincap.cc: Remove has_security throughout.
92 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
94 * fhandler.h (class fhandler_pipe): Remove members writepipe_exists,
95 orig_pid and id. Make hit_eof inline.
96 * fhandler_fifo.cc (fhandler_fifo::open): Drop handling of
97 writepipe_exists, orig_pid and id.
98 * pipe.cc: Ditto throughout.
100 (pipeid_fmt): Remove.
101 (fhandler_pipe::hit_eof): Simplify. Move to fhandler.h.
102 (fhandler_pipe::dup): Drop leave label.
103 (fhandler_pipe::create): Drop has_unreliable_pipes case.
104 * wincap.cc: Remove has_unreliable_pipes throughout.
107 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
109 * devices.in: Change native device name to native NT device name for
110 /dev/null, /dev/comX and /dev/ttySx.
111 * devices.cc: Regenerate.
112 * fhandler.cc (fhandler_base::open_9x): Remove.
113 (fhandler_base::open): Don't test for DOS device name, don't call
115 (fhandler_dev_null::open): Remove.
116 * fhandler.h (class fhandler_base): Drop open_9x declaration.
117 (class fhandler_dev_null): Drop open declaration.
119 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
121 * fhandler_console.cc (fhandler_console::need_invisible): Drop
122 pty_needs_alloc_console check.
123 * spawn.cc (spawn_guts): Ditto.
124 (av::fixup): Remove setting iscui.
125 * syscalls.cc (rename): Drop has_move_file_ex checks. Remove 9x
127 * wincap.cc: Remove has_move_file_ex and pty_needs_alloc_console
131 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
133 * exceptions.cc (dummy_ctrl_c_handler): Remove.
134 (init_console_handler): Drop has_null_console_handler_routine checks.
135 * fhandler_raw.cc (fhandler_dev_raw::open): Drop has_raw_devices check.
136 * fhandler_serial.cc (fhandler_serial::open): Drop
137 .supports_reading_modem_output_lines check.
138 * miscfuncs.cc (low_priority_sleep): Drop has_switch_to_thread check.
139 * shared.cc (open_shared): Drop needs_memory_protection checks.
140 * spawn.cc (spawn_guts): Drop start_proc_suspended check.
141 * uname.cc (uname): Drop has_valid_processorlevel check.
142 * wincap.cc: Remove has_raw_devices, has_valid_processorlevel,
143 supports_reading_modem_output_lines, needs_memory_protection,
144 has_switch_to_thread, start_proc_suspended and
145 has_null_console_handler_routine throughout.
148 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
150 * fhandler.cc (fhandler_base::lseek): Drop 9x considerations.
151 * fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto.
152 * wincap.cc: Remove lock_file_highword and has_64bit_file_access
156 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
158 * cygheap.h (struct cwdstuff): Remove sync member and keep_in_sync
160 * external.cc (cygwin_internal): Drop call to cygheap->cwd.keep_in_sync.
161 * fhandler_disk_file.cc (fhandler_disk_file::link): Always presume
162 ability to create hard links.
163 * path.cc (cwdstuff::init): Drop 9x considerations.
164 (cwdstuff::keep_in_sync): Remove.
165 (cwdstuff::set): Take NT for granted.
166 * pinfo.h (cygwin_pid): Just return pid.
167 * wincap.cc: Remove has_hard_links, can_open_directories,
168 has_negative_pids, has_named_pipes, has_try_enter_critical_section,
169 cant_debug_dll_entry and detect_win16_exe throughout.
172 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
174 * fhandler_console.cc (fhandler_console::read): Drop 9x specific
175 handling of AltGr key.
176 * mmap.cc: Take NT for granted throughout.
177 * wincap.cc: Remove map_view_of_file_ex_sucks, altgr_is_ctrl_alt,
178 has_working_copy_on_write, share_mmaps_only_by_name,
179 virtual_protect_works_on_shared_pages, has_mmap_alignment_bug and
180 has_working_virtual_lock throughout.
183 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
185 * fhandler.cc (fhandler_base::set_no_inheritance): Always use
186 SetHandleInformation.
187 * fhandler_disk_file.cc (fhandler_disk_file::lock): Always use
188 UnlockFileEx/LockFileEx functions.
189 * net.cc (fdsock): Don't bother to duplicate socket for inheritance.
190 * sysconf.cc (get_nproc_values): Take NT for granted.
192 * syslog.cc (WIN95_EVENT_LOG_PATH): Remove define.
193 (get_win95_event_log_path): Remove.
194 (vsyslog): Fix formatting. Take NT for granted.
195 * wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait,
196 has_eventlog, has_set_handle_information,
197 has_set_handle_information_on_console_handles and supports_smp
201 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
203 * dir.cc (rmdir): Move existance check in front of
204 has_dot_last_component check. Simplify setting errno in latter case.
206 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
208 * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case.
209 Simplify seek beyond EOF case.
210 * times.cc (times): Remove wincap.has_get_process_times case.
211 * wincap.cc: Remove has_delete_on_close, has_page_guard,
212 has_get_process_times and has_lseek_bug throughout.
215 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
217 Throughout remove all usage of wincap.access_denied_on_delete.
218 * dir.cc (rmdir): Add existance check to be errno-compatible with Linux.
219 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop test for
220 non-existent dir on 9x share.
221 * syscalls.cc (unlink): Add comment.
222 * wincap.cc: Remove access_denied_on_delete flag throughout.
225 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
227 * fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug
228 introduced by switching to NtClose.
230 2007-02-22 Christopher Faylor <me@cgf.cx>
232 * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of
233 guard test. Increase size of stack reserved and increase size before
234 the current stack pointer. Use pointers when doing arithmetic.
235 (dll_crt0_1): Initialize exception handler when we notice we're the
236 child of a fork from non-main thread.
237 * fork.cc (frok::parent): Make argument volatile.
238 (frok::child): Ditto.
239 (lock_signals): New class.
240 (lock_pthread): Ditto.
241 (hold_everhthing): Ditto.
242 (frok::parent): Move atforkprepare and atforkparent to lock_pthread
244 (fork): Make ischild boolean. Use hold_everything variable within
245 limited scope to set various mutexes in such a way as to avoid
247 * thread.h (pthread_mutex::tid): New variable, active when debugging
248 for tracking thread id of owner.
249 (pthread_mutex::set_owner): Set tid when debugging.
250 * thread.cc (pthread_mutex::pthread_mutex): Clear tid.
251 (pthread_mutex::_unlock): Ditto when unlocking.
252 (pthread_mutex::fixup_after_fork): Set tid to special value after
253 forking since owner is unknown.
255 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
257 Throughout replace all usage of wincap.shared with the constant
258 FILE_SHARE_VALID_FLAGS.
259 * fhandler.cc (fhandler_base::open_9x): Drop local variable shared.
260 * wincap.cc: Remove shared member throughout.
263 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
265 * Makefile.in (DLL_IMPORTS): Add libntdll.a.
266 * autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and
267 ntdll.dll available on all platforms since NT4.
269 Throughout remove all usage of wincap.is_winnt.
270 * dcrt0.cc (dll_crt0_0): Remove call to mmap_init.
271 * fhandler.h (class fhandler_base): Remove has_changed flag.
272 (fhandler_disk_file::touch_ctime): Remove declaration.
273 (fhandler_disk_file::readdir_9x): Ditto.
274 (fhandler_disk_file::touch_ctime): Remove.
275 (fhandler_disk_file::readdir_9x): Remove.
276 (fhandler_disk_file::closedir): Call NtClose instead of CloseHandle.
277 * mmap.cc: Throughout call CreateMapping and MapView directly.
278 (VirtualProt9x): Remove.
279 (VirtualProtNT): Remove.
280 (VirtualProtEx9x): Remove.
281 (VirtualProtExNT): Remove.
282 (VirtualProtect): Remove define.
283 (VirtualProtectEx): Remove define.
284 (CreateMapping9x): Remove.
285 (CreateMappingNT): Rename to CreateMapping.
287 (MapViewNT): Rename to MapView.
288 (struct mmap_func_t): Remove definition.
289 (mmap_funcs_9x): Remove.
290 (mmap_funcs_nt): Remove.
293 * net.cc (getdomainname): Drop comment. Use NT4 registry key only.
294 (get_95_ifconf): Remove.
295 * pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes.
296 (winpids::enum9x): Remove.
297 (winpids::set): Just call enum_processes directly.
298 (winpids::enum_init): Ditto.
299 * pinfo.h (class winpids): Drop enum_processes pointer. Rename
300 enumNT to enum_processes. Drop enum9x declaration. Drop initialization
301 of enum_processes throughout.
302 * registry.cc (get_registry_hive_path): Just create NT key.
303 (load_registry_hive): Only load NT specific file.
304 * syscalls.cc (unlink_9x): Remove.
305 (unlink): Just call unlink_nt.
306 * wincap.cc: Remove is_winnt flag throughout.
308 * winsup.h: Remove mmap_init declaration.
310 2007-02-21 Corinna Vinschen <corinna@vinschen.de>
312 * wincap.cc (wincap_unknown): Change settings for unknown to reflect
313 the capabilities of NT4.
315 (wincap_95osr2): Remove.
317 (wincap_98se): Remove.
319 (wincap_nt3): Remove.
320 (wincapc::init): Temporarily bail out on any 9x system.
322 2007-02-20 Corinna Vinschen <corinna@vinschen.de>
324 * cygwin.din (sem_unlink): Export.
325 * posix_ipc.cc: Include thread.h and semaphore.h. Remove TODO
327 (ipc_names): Add max_len member. Set to maximum length of the path
328 before tacking on the prefix path. Set prefix path for named semaphors
329 to /dev/shm, as on Linux.
330 (enum ipc_type_t): Change sem to semaphore to avoid name conflicts.
331 (check_path): Detect empty paths. Use ipc_names's max_len member.
332 Use __small_sprintf to create full object path name. Special case
334 (ipc_cond_init): Drop superfluous strcpy.
335 (class ipc_flock): New class to simplify file locking in subsequent
337 (struct mq_hdr): Raise size of mqh_uname to allow adding a unique
339 (mq_open): Fix formatting. Create unique synchronization object names
340 using AllocateLocallyUniqueId.
341 (struct sem_finfo): New structure defining named semaphore file content.
342 (sem_open): Move here. Rework implementation to allow kernel
343 persistent implementation of POSIX named semaphores.
344 (_sem_close): Implement sem_close.
345 (sem_close): Move here. Just call _sem_close with do_close parameter
347 (sem_unlink): New function.
348 * pthread.cc (mangle_sem_name): Remove.
349 (sem_open): Move to posix_ipc.cc.
351 * syscalls.cc (close_all_files): Call semaphore::terminate here.
352 * thread.cc: Fix formatting. Rearrange semaphore functions so that
353 they are close together.
354 (semaphore::semaphore): Rework to play nicely with new named semaphore
356 (semaphore::_terminate): Call _sem_close if semaphore is a named
358 (semaphore::destroy): Don't destroy named semaphores. Return EINVAL
360 (semaphore::close): Only destroy named semaphores. Return EINVAL
362 (semaphore::open): Rework to play nicely with new named semaphore
363 implementation. Loop through existing semaphores to be able to
364 return same sem_t pointer as a former call on the same named semaphore.
365 (semaphore::getinternal): New function called from _sem_close.
366 * thread.h (class List): Make mx and head public.
367 (class semaphore): Fix formatting. Align method declarations with
368 implementation in thread.cc. Add members used for named semaphores.
369 (semaphore::terminate): New static method.
370 * include/semaphore.h: Redefine SEM_FAILED. Fix formatting.
371 (sem_unlink): Add declaration.
372 * include/cygwin/version.h: Bump API minor number.
374 2007-02-20 Christopher Faylor <me@cgf.cx>
376 * exceptions.cc (_cygtls::signal_exit): Only call myself.exit when when
377 exit_state indicates that we've visited do_exit.
378 * sync.h (lock_process::lock_process): Use renamed exit_state -
380 * winsup.h: Rename ES_MUTO_SET to ES_PROCESS_LOCKED.
382 2007-02-20 Corinna Vinschen <corinna@vinschen.de>
384 * fhandler_socket.cc (fhandler_socket::bind): Remove printing wrong
385 errno in debug output.
387 2007-02-19 Christopher Faylor <me@cgf.cx>
389 Remove extraneous whitespace.
390 * pinfo.cc (commune_process): Use default argument to lock_process.
391 * sigproc.cc: Update copyright.
394 2007-02-15 Corinna Vinschen <corinna@vinschen.de>
396 * posix_ipc.cc (mq_open): Avoid compiler warning. Initialize mqhdr
397 before using it in file exists case.
398 * include/mqueue.h (mqd_t): Make non-pointer type.
400 2007-02-15 Corinna Vinschen <corinna@vinschen.de>
402 * posix_ipc.cc (ipc_mutex_init): Create global object name.
403 (ipc_cond_init): Ditto.
404 (struct mq_hdr): Add mqh_uname member to store synchronization object
406 (mq_open): Create unique synchronization object name and store in
407 mq_hdr->mqh_uname. Use this name in calls to ipc_mutex_init and
410 2007-02-14 Corinna Vinschen <corinna@vinschen.de>
412 * Makefile.in (DLL_OFILES): Add posix_ipc.o.
413 * cygwin.din (mq_close): Export.
414 (mq_getattr): Export.
417 (mq_receive): Export.
419 (mq_setattr): Export.
420 (mq_timedreceive): Export.
421 (mq_timedsend): Export.
423 * posix_ipc.cc: New file implementing the above functions. Move
424 shm_open and shm_unlink from syscalls.cc here.
425 * sysconf.cc (sca): Set value of _SC_MQ_OPEN_MAX to MQ_OPEN_MAX,
426 _SC_MQ_PRIO_MAX to MQ_PRIO_MAX, _SC_MESSAGE_PASSING to
427 _POSIX_MESSAGE_PASSING.
428 * include/limits.h (MQ_OPEN_MAX): Define.
429 (MQ_PRIO_MAX): Define.
430 * include/mqueue.h: New file.
431 * include/cygwin/version.h: Bump API minor number.
433 2007-02-13 Corinna Vinschen <corinna@vinschen.de>
435 * include/cygwin/stdlib.h (valloc): Declare.
438 2007-02-09 Pierre A. Humblet <Pierre.Humblet@ieee.org>
440 * libc/minires-os-if.c (write_record): Handle DNS_TYPE_SRV and
443 2007-02-08 Corinna Vinschen <corinna@vinschen.de>
445 * syscalls.cc (check_shm): New static function to do path checking
446 common to shm_open and shm_unlink. Check for /dev/shm existance.
447 (shm_open): Call check_shm.
450 2007-02-08 Corinna Vinschen <corinna@vinschen.de>
452 * cygwin.din (shm_open): Export.
453 (shm_unlink): Export.
454 * syscalls.cc (shm_open): New function.
455 (shm_unlink): New function.
456 * sysconf.cc (sca): Set value of _SC_SHARED_MEMORY_OBJECTS to
457 _POSIX_SHARED_MEMORY_OBJECTS.
458 * include/cygwin/version.h: Bump API minor number.
459 * include/sys/mman.h (shm_open): Add prototype.
462 2007-02-08 Christopher Faylor <me@cgf.cx>
463 Corinna Vinschen <corinna@vinschen.de>
465 * cygmalloc.h (__set_ENOMEM): Declare.
466 (MALLOC_FAILURE_ACTION): Call __set_ENOMEM.
467 * malloc_wrapper.cc (malloc) Remove setting errno here.
472 (posix_memalign): Save and restore errno.
474 2007-02-07 Corinna Vinschen <corinna@vinschen.de>
476 * cygmalloc.h (MALLOC_FAILURE_ACTION): Move to correct #if branch.
478 2007-02-07 Corinna Vinschen <corinna@vinschen.de>
480 * cygmalloc.h (MALLOC_FAILURE_ACTION): Define empty.
481 * cygwin.din (posix_madvise): Export.
482 (posix_memalign): Export.
483 * fhandler.cc (fhandler_base::fpathconf): Return useful values in
484 _PC_VDISABLE, _PC_SYNC_IO and _PC_SYMLINK_MAX cases.
485 * malloc_wrapper.cc (malloc): Set errno here since it's not set in
491 (posix_memalign): New function.
492 * mmap.cc (posix_madvise): New function.
493 * sysconf.cc (get_open_max): New function.
494 (get_page_size): Ditto.
495 (get_nproc_values): Ditto.
498 (sca): New array to map _SC_xxx options to sysconf return values.
499 (sysconf): Reimplement using sca array.
500 * include/limits.h: Add all missing values as defined by SUSv3.
501 * include/pthread.h (PTHREAD_DESTRUCTOR_ITERATIONS): Move definition
503 (PTHREAD_KEYS_MAX): Ditto.
504 * include/semaphore.h (SEM_VALUE_MAX): Ditto.
505 * include/cygwin/stdlib.h (posix_memalign): Declare.
506 * include/cygwin/version.h: Bump API minor number.
507 * include/sys/mman.h: Add posix_madvise flags.
508 (posix_madvise): Declare.
509 * include/sys/termios.h (_POSIX_VDISABLE): Move definition to
512 2007-02-05 Corinna Vinschen <corinna@vinschen.de>
514 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support for
515 baud rates up to 3000000 baud. Add missing 128K and 256K cases.
516 (fhandler_serial::tcgetattr): Ditto.
517 * include/sys/termios.h: Add baud rate definitions from B460800 up to
520 2007-02-02 Corinna Vinschen <corinna@vinschen.de>
522 * syscalls.cc (unlink_nt): Add missing assignment in case NtClose fails.
524 2007-02-01 Corinna Vinschen <corinna@vinschen.de>
526 * net.cc (ga_dup): New function, taken from ga_clone with v4-in-v6
528 (ga_clone): Just call ga_dup from here.
529 (ga_duplist): New function to duplicate list of struct addrinfo.
530 (ga_echeck): Don't check ai_flags, it already happened in
532 (cygwin_freeaddrinfo): Always call ipv4_freeaddrinfo.
533 (cygwin_getaddrinfo): Use new wincap.supports_all_posix_ai_flags
534 flag rather than wincap.has_gaa_on_link_prefix. Always duplicate
535 WinSock's addrinfo list to a self-allocated list. Handle AI_V4MAPPED
536 for pre-Vista platforms supporting getaddrinfo.
537 * wincap.h (wincapc::supports_all_posix_ai_flags): New element.
538 * wincap.cc: Implement above element throughout.
539 * include/netdb.h: Note how AI_ADDRCONFIG is not supported pre-Vista.
540 Remove superfluous comment.
542 2007-02-01 Corinna Vinschen <corinna@vinschen.de>
544 * include/cygwin/socket.h: Add IPv6 socket options.
546 2007-01-31 Corinna Vinschen <corinna@vinschen.de>
548 * net.cc (cygwin_getaddrinfo): Fix thinko in AI_ADDRCONFIG handling.
550 2007-01-31 Corinna Vinschen <corinna@vinschen.de>
552 * net.cc (cygwin_getaddrinfo): Check ai_flags for valid values.
553 Handle AI_NUMERICSERV. Handle AI_ADDRCONFIG behaviour on Vista.
554 * include/netdb.h (AI_NUMERICSERV): Add missing flag.
556 2007-01-30 Corinna Vinschen <corinna@vinschen.de>
558 * fhandler_disk_file.cc (fhandler_disk_file::closedir): Add dir name
560 * syscalls.cc (try_to_bin): Enable code to move file to user specific
561 recycler dir to eliminate Vista problem.
562 (unlink_nt): Add comment that rename after opening for delete on close
565 2007-01-30 Corinna Vinschen <corinna@vinschen.de>
567 * sigproc.cc (child_info::child_info): Set msv_count to non-zero
568 value only on systems requiring it.
570 2007-01-28 Corinna Vinschen <corinna@vinschen.de>
572 * include/ftw.h: Include sys/cdefs.h.
574 2007-01-26 Corinna Vinschen <corinna@vinschen.de>
576 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Implement rmdir
577 on NT by calling unlink_nt. Check for directory here.
578 * syscalls.cc (try_to_bin): Fix buggy debug_printf statement.
579 (unlink_nt): Make non-static. Don't use delete-on-close semantics on
580 directories. Explain why.
582 2007-01-24 Corinna Vinschen <corinna@vinschen.de>
584 * net.cc (if_nametoindex): This time, really free IP_ADAPTER_ADDRESSES
586 (if_indextoname): Ditto.
588 2007-01-24 Corinna Vinschen <corinna@vinschen.de>
590 * security.h (pop_thread_privilege): Revert to previous state, not
591 to token used for impersonation.
593 2007-01-24 Corinna Vinschen <corinna@vinschen.de>
595 * cygheap.h (cygheap_user::deimpersonate): Always RevertToSelf.
597 2007-01-23 Corinna Vinschen <corinna@vinschen.de>
599 * net.cc (gai_errmap): Add EAI_OVERFLOW entry. Fix formatting.
600 (cygwin_gai_strerror): Drop using EAI_MAX.
601 (w32_to_gai_err): Ditto.
602 * include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX.
604 2007-01-23 Corinna Vinschen <corinna@vinschen.de>
606 * include/netdb.h: Add AI_xxx flags available since Vista.
608 2007-01-23 Corinna Vinschen <corinna@vinschen.de>
610 * net.cc (if_nametoindex): Free IP_ADAPTER_ADDRESSES memory.
611 (if_indextoname): Ditto.
612 (if_nameindex): Ditto. Remove duplicate indexed entries in result.
614 2007-01-21 Corinna Vinschen <corinna@vinschen.de>
616 * autoload.cc (WSAIoctl): Define.
618 * cygwin.din: Export if_freenameindex, if_indextoname, if_nameindex and
620 * fhandler_procnet.cc: Drop including wchar.h. Drop definitions of
621 GAA_FLAG_INCLUDE_ALL_INTERFACES, IP_ADAPTER_UNICAST_ADDRESS_VISTA.
622 (fhandler_procnet::exists): Check for has_gaa_prefixes. Call
623 get_adapters_addresses here.
624 (fhandler_procnet::readdir): Ditto.
625 (prefix): Move to net.cc.
626 (fhandler_procnet::fill_filebuf): Call get_adapters_addresses here.
627 Simplify allocation. Use AdapterName rather than FriendlyName as
628 interface name. Use IfIndex if available, Ipv6IfIndex otherwise.
629 (in6_are_prefix_equal): Move to net.cc.
630 * fhandler_socket.cc: Define old SIOCGxxx values.
631 (CONV_OLD_TO_NEW_SIO): Convert old SIOCGxxx value to new one.
632 (struct __old_ifreq): Define old struct ifreq.
633 (fhandler_socket::ioctl): Handle old SIOCGxxx values. Handle new
634 SIOCGIFFRNDLYNAM command. Simplify copying ifreq data to user space.
635 Call get_ifconf with additional SOCKET parameter.
636 * net.cc (IP_ADAPTER_UNICAST_ADDRESS_LH): Define.
637 (IP_ADAPTER_ADDRESSES_LH): Define.
638 (SIO_GET_INTERFACE_LIST): Define.
639 (sockaddr_in6_old): Define.
640 (sockaddr_gen): Define.
641 (INTERFACE_INFO): Define.
642 (IN_LOOPBACK): Define.
643 (in_are_prefix_equal): New static function.
644 (ip_addr_prefix): New function, replaces prefix function, add AF_INET
646 (GAA_FLAG_INCLUDE_ALL_INTERFACES): Define.
647 (get_adapters_addresses): New function.
648 (WS_IFF_xxx): Define Winsock interface flag values.
649 (convert_ifr_flags): New function to convert Winsock interface flag
650 values to Cygwin interface flag values.
651 (get_xp_ifconf): New get_ifconf implementation for XP SP1 and above.
652 (get_2k_ifconf): Fix interface index. Fix formatting.
653 (get_nt_ifconf): Fix formatting.
654 (get_95_ifconf): Ditto.
655 (get_ifconf): Take additional SOCKET parameter. Call get_xp_ifconf
657 (if_nametoindex): New function.
658 (if_indextoname): New function.
659 (if_nameindex): New function.
660 (if_freenameindex): New function.
661 (in6_are_prefix_equal): Moved here from fhandler_procnet.cc.
662 * wincap.cc (wincap_xp): Define has_gaa_prefixes as true by default.
663 (wincapc::init): Assume has_osversioninfoex by default. Call
664 GetVersionEx with OSVERSIONINFOEX first. Call with OSVERSIONINFO only
665 if that fails. Simplify NT4 case and try to avoid strcmp. Check XP
666 Service Pack using version.wServicePackMajor to avoid strcmp.
667 * include/asm/socket.h (SIOCGIFFRNDLYNAM): Define.
668 * include/cygwin/if.h: Fix formatting.
669 (IFF_POINTTOPOINT): Define.
671 (IFF_LOWER_UP): Define.
672 (IFF_DORMANT): Define.
673 (struct if_nameindex): Define.
674 (IFRF_FRIENDLYNAMESIZ): Define.
675 (struct ifreq_frndlyname): Define.
676 (IFNAMSIZ): Redefine as 44.
677 (IF_NAMESIZE): Define.
678 (struct ifreq): Redefine ifru_flags as int. Define ifru_data. Pad size
679 to sizeof sockaddr_in6 for further extensions.
681 (ifr_frndlyname): Define.
682 (if_nametoindex): Declare.
683 (if_indextoname): Declare.
684 (if_nameindex): Declare.
685 (if_freenameindex): Declare.
686 * include/cygwin/version.h: Bump API minor number.
687 (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ): Define check for old vs. new
690 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
692 * spawn.cc (spawn_guts): Don't set cwd for non-Cygwin child processes
693 on NT to allow starting them in virtual directories.
695 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
697 * mmap.cc (list::hash): Fix type to __ino64_t.
698 (list::get_hash): Ditto.
699 (list::set): Add struct stat parameter. Use that instead of calling
701 (map::get_list_by_fd): Ditto.
702 (map::add_list): Ditto.
703 (mmap_is_attached_or_noreserve): Call get_list_by_fd appropriately.
704 (mmap_worker): Add pameters for map list and file stat information.
705 Propagate to called functions.
706 (mmap64): Use fstat on files early. Replace call to GetFileSize.
707 Call get_list_by_fd and mmap_worker appropriately.
709 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
711 * fhandler_procnet.cc: Drop declaration of htonl and ntohs. Include
712 asm/byteorder.h instead.
714 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
716 * include/cygwin/in6.h: Drop inclusion of asm/byteorder.h.
717 * fhandler_procnet.cc: Declare htonl and ntohs here.
719 2007-01-17 Corinna Vinschen <corinna@vinschen.de>
721 * Makefile.in (DLL_OFILES): Add fhandler_procnet.o.
722 * autoload.cc (GetAdaptersAddresses): Define.
723 * devices.h (FH_PROCNET): Define new device.
724 * devices.in (dev_procnet_storage): Add "/proc/net" entry.
725 * devices.cc: Regenerate.
726 * dir.cc (readdir_worker): Use isproc_dev macro.
727 * dtable.cc (build_fh_pc): Add FH_PROCNET.
728 * fhandler.h (class fhandler_procnet): New class.
729 * fhandler_proc.cc: Add "net" subdirectory handling.
730 * fhandler_procnet.cc: New file handling "/proc/net" directory.
731 * path.cc (isvirtual_dev): Move to path.h.
732 * path.h (isproc_dev): New macro to identify /proc files by device.
733 (isvirtual_dev): Moved here. Define using isproc_dev.
734 * syscalls.cc (unlink): Use isproc_dev macro.
735 * wincap.h (wincapc::has_gaa_prefixes): New element.
736 (wincapc::has_gaa_on_link_prefix): New element.
737 * wincap.cc: Implement above elements throughout.
738 (wincapc::init): Check XP for service pack and set has_gaa_prefixes
740 * include/cygwin/in6.h: Include asm/byteorder.h.
742 2007-01-17 Corinna Vinschen <corinna@vinschen.de>
744 * include/asm/socket.h (SIOGIFINDEX): Define.
746 2007-01-17 Corinna Vinschen <corinna@vinschen.de>
748 * mmap.cc (MapView9x): Note possible uselessness of retrying.
750 (mmap64): Fix pre-reservation to work for non NULL, non MAP_FIXED.
752 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
754 * autoload.cc (RtlAnsiStringToUnicodeString): Define.
755 (RtlOemStringToUnicodeString): Define.
756 * ntdll.h (struct _RTL_USER_PROCESS_PARAMETERS): Define.
757 (struct _PEB): Redefine with a bit of content.
758 (RtlAnsiStringToUnicodeString): Declare.
759 (RtlOemStringToUnicodeString): Declare.
760 * path.cc: Include ntdll.h.
761 (_upp): New global variable pointing to user process parameter block.
762 (get_user_proc_parms): New static function to retrieve user process
764 (close_user_proc_parms_cwd_handle): New function to close handle to
765 current working directory in user process parameter block.
766 (cwdstuff::init): Drop redundant declaration of dynamically_loaded.
767 Set current dir only on 9x. Call close_user_proc_parms_cwd_handle
769 (cwdstuff::keep_in_sync): Only on 9x.
770 (cwdstuff::set): Keep behaviour on 9x. On NT write cwd path into user
771 process parameter block and set cwd handle to NULL. Fix comments to
772 reflect new behaviour.
774 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
776 * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX.
777 * net.cc (get_2k_ifconf): Ditto.
778 (get_nt_ifconf): Fake SIOCGIFINDEX.
779 (get_95_ifconf): Ditto.
780 (get_ifconf): Handle SIOCGIFINDEX. Fake it for loopback on systems
781 not supporting IP Helper Lib.
782 * include/asm/socket.h (SIOCGIFINDEX): Define.
783 * include/cygwin/if.h (struct ifreq): Add member for interface index.
784 (ifr_ifindex): Define.
786 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
788 * include/cygwin/in6.h (struct ipv6_mreq): Change type of interface
790 (struct in6_pktinfo): Ditto.
792 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
794 * include/cygwin/in.h (struct ip_mreq_source): Define.
795 (struct ip_msfilter): Define.
796 (IP_MSFILTER_SIZE): Define.
797 (struct in_pktinfo): Define.
798 (struct group_req): Define.
799 (struct group_source_req): Define.
800 (struct group_filter): Define.
801 (GROUP_FILTER_SIZE): Define.
802 (INADDR_ALLRTRS_GROUP): Define.
803 * include/cygwin/socket.h: Define protocol agnostic multicast options.
805 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
807 * CYGWIN_LICENSE: Fix web pages and contact information.
809 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
811 * ntdll.h: Adjust status definitions.
813 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
815 * cygheap.cc (cygheap_init): Add TODO comment.
817 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
819 * ntdll.h (STATUS_SHARING_VIOLATION): Define.
821 2007-01-13 Corinna Vinschen <corinna@vinschen.de>
823 * syscalls.cc (unlink_nt): Don't move files to recycle bin which are
826 2007-01-13 Christopher Faylor <me@cgf.cx>
828 * glob.cc: Update copyright notice with latest from FreeBSD.
829 (glob0): Use correct type for c variable to propagate previously
832 2007-01-12 Corinna Vinschen <corinna@vinschen.de>
834 * cygheap.cc (_csbrk): Fix off-by-one error.
835 * cygwin.sc: Give .cygheap a minimum size of 512K.
837 2007-01-12 Christopher Faylor <me@cgf.cx>
839 * external.cc (sync_winenv): Use cur_environ () rather than
842 2007-01-12 Corinna Vinschen <corinna@vinschen.de>
844 * fork.cc (child_copy): Add missing Windows PID in debug output.
846 2007-01-12 Corinna Vinschen <corinna@vinschen.de>
848 * syscalls.cc: Update copyright.
850 2007-01-10 Corinna Vinschen <corinna@vinschen.de>
852 * mmap.cc (mmap64): Pre-Reserve space for the whole mapping to get a
853 useful, valid address before the actual mappings take place.
856 2007-01-10 Corinna Vinschen <corinna@vinschen.de>
858 * syscalls.cc (sync): Use b_drive for B: drive (Thanks to Howard Chu).
860 2007-01-09 Corinna Vinschen <corinna@vinschen.de>
862 * syscalls.cc (getpagesize): Change condition for clarity.
863 (getsystempagesize): Ditto.
865 2007-01-09 Corinna Vinschen <corinna@vinschen.de>
867 * mmap.cc: Do bookkeeping in 4K pages, rather than in 64K chunks.
869 2007-01-07 Corinna Vinschen <corinna@vinschen.de>
871 * security.h (setacl): Add parameter for writability flag.
872 * sec_acl.cc (setacl): Ditto. Set to true if any ACE with write
873 permissions is created.
874 * fhandler_disk_file.cc (fhandler_disk_file::facl): Reset
875 FILE_ATTRIBUTE_READONLY if ACL contains an ACE with write permissions.
877 2007-01-05 Corinna Vinschen <corinna@vinschen.de>
879 * include/strings.h: Don't include string.h. Only declare functions
882 2007-01-04 Corinna Vinschen <corinna@vinschen.de>
884 (get_ifconf): Set MTU for loopback to more correct value.
886 2007-01-04 Corinna Vinschen <corinna@vinschen.de>
888 * fhandler_socket.cc (fhandler_socket::ioctl): Don't fake results
889 for SIOCGIFFLAGS here. Call get_ifconf instead.
890 * net.cc (get_2k_ifconf): Clean up code to generate interface name.
891 Handle SIOCGIFFLAGS here.
892 (get_nt_ifconf): Fake SIOCGIFFLAGS here.
893 (get_95_ifconf): Ditto.
894 (get_ifconf): Don't fake loopback on systems with IP Helper Lib.
895 Set MTU for loopback to a more "modern" value.
897 2007-01-04 Brian Ford <Brian.Ford@FlightSafety.com>
898 Corinna Vinschen <corinna@vinschen.de>
900 * fhandler.h (PREFERRED_IO_BLKSIZE): Define as 64K.
901 * fhandler.cc (fhandler_base::fstat): Set st_blksize to
902 PREFERRED_IO_BLKSIZE.
903 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Ditto.
904 * fhandler_mailslot.cc (fhandler_mailslot::fstat): Ditto.
905 * fhandler_raw.cc (fhandler_dev_raw::fstat): Ditto.
907 2007-01-01 Christopher Faylor <me@cgf.cx>
909 * spawn.cc (spawn_guts): Don't expect synchronization from a non-cygwin