1 2007-03-07 Christopher Faylor <me@cgf.cx>
3 * signal.cc (handle_sigprocmask): Remove extraneous
6 2007-03-07 Corinna Vinschen <corinna@vinschen.de>
8 * fhandler_proc.cc: Fix formatting. Drop setting errno when creating
10 (format_proc_uptime): Simplify.
11 (format_proc_cpuinfo): Align more closely to output of Linux 2.6 kernel.
12 Evaluate more data, especially for AMD CPUs.
14 2007-03-06 Corinna Vinschen <corinna@vinschen.de>
16 * fhandler.h (fhandler_base::fstat_helper): Add creation time parameter.
17 * glob.cc (stat32_to_stat64): Set st_birthtim to st_mtim.
19 2007-03-06 Corinna Vinschen <corinna@vinschen.de>
21 * include/cygwin/stat.h (S_TYPEISMQ): Define.
25 2007-03-06 Corinna Vinschen <corinna@vinschen.de>
27 * fhandler_mailslot.cc (fhandler_mailslot::fstat): Set new stat member
28 st_birthtim to useful value.
29 * fhandler_process.cc (fhandler_process::fstat): Ditto.
30 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Take
31 additional parameter for creation time. Fill st_birthtim with it.
32 Accomodate additional creation time parameter throughout.
33 * fhandler_raw.cc (fhandler_dev_raw::fstat): Set new stat member
34 st_birthtim to useful value.
35 * fhandler.cc (fhandler_base::fstat): Ditto.
36 * fhandler_registry.cc (fhandler_registry::fstat): Ditto.
37 * include/cygwin/version.h: Bump API minor number.
38 * include/cygwin/stat.h (struct __stat64): Replace st_spare4 with
39 timestruc_t st_birthtim.
40 (struct stat): Ditto if __CYGWIN_USE_BIG_TYPES__ is defined.
41 (st_birthtime): Define if __CYGWIN_USE_BIG_TYPES__ is defined.
43 2007-03-02 Corinna Vinschen <corinna@vinschen.de>
45 * ntdll.h (struct _FILE_NAMES_INFORMATION): Define.
46 * syscalls.cc (unlink_nt): Check shared directory for being empty
47 before trying to move and mark for deletion.
49 2007-03-02 Corinna Vinschen <corinna@vinschen.de>
51 * security.cc (get_file_attribute): Avoid compiler warning.
53 2007-03-01 Christopher Faylor <me@cgf.cx>
55 * fork.cc (fork): Reset child to true after fork since it may have been
56 reset by fork memory copies.
58 2007-03-01 Christopher Faylor <me@cgf.cx>
60 * Makefile (DLL_OFILES): Remove ntea.o
61 * environ.cc (set_ntea): Delete.
62 (parse_thing): Delete "ntea" setting.
63 * fhandler.cc (fhandler_base::open): Remove allow_ntea considerations.
64 (check_posix_perm): Ditto.
65 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Ditto.
66 (fhandler_base::open_fs): Ditto.
67 (fhandler_disk_file::mkdir): Ditto.
68 * path.cc (symlink_worker): Ditto.
69 * security.cc (get_file_attribute): Ditto.
70 (set_file_attribute): Ditto.
71 * security.h: Remove allow_ntea declaration.
73 2007-02-27 Corinna Vinschen <corinna@vinschen.de>
75 * path.cc (close_user_proc_parms_cwd_handle): Remove.
76 (cwdstuff::init): Don't call close_user_proc_parms_cwd_handle.
77 Call set to set cwd with all-sharing handle.
78 (cwdstuff::set): Fix comment. Don't close cwd handle. Set in
79 user parameter block instead and close old cwd handle.
80 * syscalls.cc (rename): Call unlink_nt instead of RemoveDirectory or
81 DeleteFile to allow deleting shared files/directories.
83 2007-02-27 Corinna Vinschen <corinna@vinschen.de>
85 * fhandler.cc(fhandler_base::open): Open with READ_CONTROL only in
86 case of query_open flag set to query_read_control. Add case for
87 new query_read_attributes flag.
88 (fhandler_base::fstatvfs): New method.
89 * fhandler.h (enum query_state): Add query_read_attributes flag.
90 (class fhandler_base): Declare new virtual fstatvfs method.
91 (class fhandler_socket): Ditto.
92 (class fhandler_pipe): Ditto.
93 (class fhandler_fifo): Ditto.
94 (class fhandler_disk_file): Ditto.
95 (class fhandler_virtual): Ditto.
96 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Open with
97 query_read_attributes instead of query_read_control.
98 (fhandler_disk_file::fstatvfs): New method.
99 (fhandler_disk_file::facl): Open with query_read_attributes instead of
101 * fhandler_fifo.cc (fhandler_fifo::fstatvfs): New method.
102 * fhandler_socket.cc (fhandler_socket::fstatvfs): New method.
103 (fhandler_socket::fchmod): Return with EBADF in the default case.
104 (fhandler_socket::fchown): Ditto.
105 (fhandler_socket::facl): Ditto.
106 * fhandler_virtual.cc (fhandler_virtual::fstatvfs): Ditto.
107 * ntdll.h (struct _FILE_FS_ATTRIBUTE_INFORMATION): Define.
108 (struct _FILE_FS_FULL_SIZE_INFORMATION): Define.
109 * pipe.cc (fhandler_pipe::fstatvfs): New method.
110 * syscalls.cc (fstatvfs): Just call the fhandler's fstatvfs.
112 (fstatfs): Call fstatvfs.
113 (statfs): Drop EFAULT handling.
115 2007-02-26 Corinna Vinschen <corinna@vinschen.de>
117 * fhandler.cc (fhandler_base::fstat): Set all file times to arbitrary
120 2007-02-26 Corinna Vinschen <corinna@vinschen.de>
122 * fhandler_registry.cc (registry_listing): Drop name of HKEY_DYN_DATA.
123 (registry_keys): Drop HKEY_DYN_DATA.
124 * net.cc: Fix comment.
127 2007-02-26 Corinna Vinschen <corinna@vinschen.de>
129 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop comment.
130 * mmap.cc (gen_access): Remove.
131 (mmap_record::gen_access): Remove.
132 (mmap64): Don't mention 9x any longer.
133 * syscalls.cc (statvfs): Drop status code consideration for 9x.
134 * libc/minires-os-if.c (get_registry_dns_items): Don't mention 9x any
136 (get_registry_dns): Drop getting registry key on 9x. Drop is9x
139 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
141 Throughout remove all usage of wincap.has_security.
142 * environ.cc (environ_init): Drop setting allow_ntsec here.
143 * grp.cc (initgroups32): Drop usage of label "out".
144 * security.cc (allow_ntsec): Set to true by default.
145 * syscalls.cc (seteuid32): Remove label success_9x.
146 * wincap.cc: Remove has_security throughout.
149 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
151 * fhandler.h (class fhandler_pipe): Remove members writepipe_exists,
152 orig_pid and id. Make hit_eof inline.
153 * fhandler_fifo.cc (fhandler_fifo::open): Drop handling of
154 writepipe_exists, orig_pid and id.
155 * pipe.cc: Ditto throughout.
157 (pipeid_fmt): Remove.
158 (fhandler_pipe::hit_eof): Simplify. Move to fhandler.h.
159 (fhandler_pipe::dup): Drop leave label.
160 (fhandler_pipe::create): Drop has_unreliable_pipes case.
161 * wincap.cc: Remove has_unreliable_pipes throughout.
164 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
166 * devices.in: Change native device name to native NT device name for
167 /dev/null, /dev/comX and /dev/ttySx.
168 * devices.cc: Regenerate.
169 * fhandler.cc (fhandler_base::open_9x): Remove.
170 (fhandler_base::open): Don't test for DOS device name, don't call
172 (fhandler_dev_null::open): Remove.
173 * fhandler.h (class fhandler_base): Drop open_9x declaration.
174 (class fhandler_dev_null): Drop open declaration.
176 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
178 * fhandler_console.cc (fhandler_console::need_invisible): Drop
179 pty_needs_alloc_console check.
180 * spawn.cc (spawn_guts): Ditto.
181 (av::fixup): Remove setting iscui.
182 * syscalls.cc (rename): Drop has_move_file_ex checks. Remove 9x
184 * wincap.cc: Remove has_move_file_ex and pty_needs_alloc_console
188 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
190 * exceptions.cc (dummy_ctrl_c_handler): Remove.
191 (init_console_handler): Drop has_null_console_handler_routine checks.
192 * fhandler_raw.cc (fhandler_dev_raw::open): Drop has_raw_devices check.
193 * fhandler_serial.cc (fhandler_serial::open): Drop
194 .supports_reading_modem_output_lines check.
195 * miscfuncs.cc (low_priority_sleep): Drop has_switch_to_thread check.
196 * shared.cc (open_shared): Drop needs_memory_protection checks.
197 * spawn.cc (spawn_guts): Drop start_proc_suspended check.
198 * uname.cc (uname): Drop has_valid_processorlevel check.
199 * wincap.cc: Remove has_raw_devices, has_valid_processorlevel,
200 supports_reading_modem_output_lines, needs_memory_protection,
201 has_switch_to_thread, start_proc_suspended and
202 has_null_console_handler_routine throughout.
205 2007-02-23 Corinna Vinschen <corinna@vinschen.de>
207 * fhandler.cc (fhandler_base::lseek): Drop 9x considerations.
208 * fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto.
209 * wincap.cc: Remove lock_file_highword and has_64bit_file_access
213 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
215 * cygheap.h (struct cwdstuff): Remove sync member and keep_in_sync
217 * external.cc (cygwin_internal): Drop call to cygheap->cwd.keep_in_sync.
218 * fhandler_disk_file.cc (fhandler_disk_file::link): Always presume
219 ability to create hard links.
220 * path.cc (cwdstuff::init): Drop 9x considerations.
221 (cwdstuff::keep_in_sync): Remove.
222 (cwdstuff::set): Take NT for granted.
223 * pinfo.h (cygwin_pid): Just return pid.
224 * wincap.cc: Remove has_hard_links, can_open_directories,
225 has_negative_pids, has_named_pipes, has_try_enter_critical_section,
226 cant_debug_dll_entry and detect_win16_exe throughout.
229 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
231 * fhandler_console.cc (fhandler_console::read): Drop 9x specific
232 handling of AltGr key.
233 * mmap.cc: Take NT for granted throughout.
234 * wincap.cc: Remove map_view_of_file_ex_sucks, altgr_is_ctrl_alt,
235 has_working_copy_on_write, share_mmaps_only_by_name,
236 virtual_protect_works_on_shared_pages, has_mmap_alignment_bug and
237 has_working_virtual_lock throughout.
240 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
242 * fhandler.cc (fhandler_base::set_no_inheritance): Always use
243 SetHandleInformation.
244 * fhandler_disk_file.cc (fhandler_disk_file::lock): Always use
245 UnlockFileEx/LockFileEx functions.
246 * net.cc (fdsock): Don't bother to duplicate socket for inheritance.
247 * sysconf.cc (get_nproc_values): Take NT for granted.
249 * syslog.cc (WIN95_EVENT_LOG_PATH): Remove define.
250 (get_win95_event_log_path): Remove.
251 (vsyslog): Fix formatting. Take NT for granted.
252 * wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait,
253 has_eventlog, has_set_handle_information,
254 has_set_handle_information_on_console_handles and supports_smp
258 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
260 * dir.cc (rmdir): Move existance check in front of
261 has_dot_last_component check. Simplify setting errno in latter case.
263 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
265 * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case.
266 Simplify seek beyond EOF case.
267 * times.cc (times): Remove wincap.has_get_process_times case.
268 * wincap.cc: Remove has_delete_on_close, has_page_guard,
269 has_get_process_times and has_lseek_bug throughout.
272 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
274 Throughout remove all usage of wincap.access_denied_on_delete.
275 * dir.cc (rmdir): Add existance check to be errno-compatible with Linux.
276 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop test for
277 non-existent dir on 9x share.
278 * syscalls.cc (unlink): Add comment.
279 * wincap.cc: Remove access_denied_on_delete flag throughout.
282 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
284 * fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug
285 introduced by switching to NtClose.
287 2007-02-22 Christopher Faylor <me@cgf.cx>
289 * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of
290 guard test. Increase size of stack reserved and increase size before
291 the current stack pointer. Use pointers when doing arithmetic.
292 (dll_crt0_1): Initialize exception handler when we notice we're the
293 child of a fork from non-main thread.
294 * fork.cc (frok::parent): Make argument volatile.
295 (frok::child): Ditto.
296 (lock_signals): New class.
297 (lock_pthread): Ditto.
298 (hold_everhthing): Ditto.
299 (frok::parent): Move atforkprepare and atforkparent to lock_pthread
301 (fork): Make ischild boolean. Use hold_everything variable within
302 limited scope to set various mutexes in such a way as to avoid
304 * thread.h (pthread_mutex::tid): New variable, active when debugging
305 for tracking thread id of owner.
306 (pthread_mutex::set_owner): Set tid when debugging.
307 * thread.cc (pthread_mutex::pthread_mutex): Clear tid.
308 (pthread_mutex::_unlock): Ditto when unlocking.
309 (pthread_mutex::fixup_after_fork): Set tid to special value after
310 forking since owner is unknown.
312 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
314 Throughout replace all usage of wincap.shared with the constant
315 FILE_SHARE_VALID_FLAGS.
316 * fhandler.cc (fhandler_base::open_9x): Drop local variable shared.
317 * wincap.cc: Remove shared member throughout.
320 2007-02-22 Corinna Vinschen <corinna@vinschen.de>
322 * Makefile.in (DLL_IMPORTS): Add libntdll.a.
323 * autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and
324 ntdll.dll available on all platforms since NT4.
326 Throughout remove all usage of wincap.is_winnt.
327 * dcrt0.cc (dll_crt0_0): Remove call to mmap_init.
328 * fhandler.h (class fhandler_base): Remove has_changed flag.
329 (fhandler_disk_file::touch_ctime): Remove declaration.
330 (fhandler_disk_file::readdir_9x): Ditto.
331 (fhandler_disk_file::touch_ctime): Remove.
332 (fhandler_disk_file::readdir_9x): Remove.
333 (fhandler_disk_file::closedir): Call NtClose instead of CloseHandle.
334 * mmap.cc: Throughout call CreateMapping and MapView directly.
335 (VirtualProt9x): Remove.
336 (VirtualProtNT): Remove.
337 (VirtualProtEx9x): Remove.
338 (VirtualProtExNT): Remove.
339 (VirtualProtect): Remove define.
340 (VirtualProtectEx): Remove define.
341 (CreateMapping9x): Remove.
342 (CreateMappingNT): Rename to CreateMapping.
344 (MapViewNT): Rename to MapView.
345 (struct mmap_func_t): Remove definition.
346 (mmap_funcs_9x): Remove.
347 (mmap_funcs_nt): Remove.
350 * net.cc (getdomainname): Drop comment. Use NT4 registry key only.
351 (get_95_ifconf): Remove.
352 * pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes.
353 (winpids::enum9x): Remove.
354 (winpids::set): Just call enum_processes directly.
355 (winpids::enum_init): Ditto.
356 * pinfo.h (class winpids): Drop enum_processes pointer. Rename
357 enumNT to enum_processes. Drop enum9x declaration. Drop initialization
358 of enum_processes throughout.
359 * registry.cc (get_registry_hive_path): Just create NT key.
360 (load_registry_hive): Only load NT specific file.
361 * syscalls.cc (unlink_9x): Remove.
362 (unlink): Just call unlink_nt.
363 * wincap.cc: Remove is_winnt flag throughout.
365 * winsup.h: Remove mmap_init declaration.
367 2007-02-21 Corinna Vinschen <corinna@vinschen.de>
369 * wincap.cc (wincap_unknown): Change settings for unknown to reflect
370 the capabilities of NT4.
372 (wincap_95osr2): Remove.
374 (wincap_98se): Remove.
376 (wincap_nt3): Remove.
377 (wincapc::init): Temporarily bail out on any 9x system.
379 2007-02-20 Corinna Vinschen <corinna@vinschen.de>
381 * cygwin.din (sem_unlink): Export.
382 * posix_ipc.cc: Include thread.h and semaphore.h. Remove TODO
384 (ipc_names): Add max_len member. Set to maximum length of the path
385 before tacking on the prefix path. Set prefix path for named semaphors
386 to /dev/shm, as on Linux.
387 (enum ipc_type_t): Change sem to semaphore to avoid name conflicts.
388 (check_path): Detect empty paths. Use ipc_names's max_len member.
389 Use __small_sprintf to create full object path name. Special case
391 (ipc_cond_init): Drop superfluous strcpy.
392 (class ipc_flock): New class to simplify file locking in subsequent
394 (struct mq_hdr): Raise size of mqh_uname to allow adding a unique
396 (mq_open): Fix formatting. Create unique synchronization object names
397 using AllocateLocallyUniqueId.
398 (struct sem_finfo): New structure defining named semaphore file content.
399 (sem_open): Move here. Rework implementation to allow kernel
400 persistent implementation of POSIX named semaphores.
401 (_sem_close): Implement sem_close.
402 (sem_close): Move here. Just call _sem_close with do_close parameter
404 (sem_unlink): New function.
405 * pthread.cc (mangle_sem_name): Remove.
406 (sem_open): Move to posix_ipc.cc.
408 * syscalls.cc (close_all_files): Call semaphore::terminate here.
409 * thread.cc: Fix formatting. Rearrange semaphore functions so that
410 they are close together.
411 (semaphore::semaphore): Rework to play nicely with new named semaphore
413 (semaphore::_terminate): Call _sem_close if semaphore is a named
415 (semaphore::destroy): Don't destroy named semaphores. Return EINVAL
417 (semaphore::close): Only destroy named semaphores. Return EINVAL
419 (semaphore::open): Rework to play nicely with new named semaphore
420 implementation. Loop through existing semaphores to be able to
421 return same sem_t pointer as a former call on the same named semaphore.
422 (semaphore::getinternal): New function called from _sem_close.
423 * thread.h (class List): Make mx and head public.
424 (class semaphore): Fix formatting. Align method declarations with
425 implementation in thread.cc. Add members used for named semaphores.
426 (semaphore::terminate): New static method.
427 * include/semaphore.h: Redefine SEM_FAILED. Fix formatting.
428 (sem_unlink): Add declaration.
429 * include/cygwin/version.h: Bump API minor number.
431 2007-02-20 Christopher Faylor <me@cgf.cx>
433 * exceptions.cc (_cygtls::signal_exit): Only call myself.exit when when
434 exit_state indicates that we've visited do_exit.
435 * sync.h (lock_process::lock_process): Use renamed exit_state -
437 * winsup.h: Rename ES_MUTO_SET to ES_PROCESS_LOCKED.
439 2007-02-20 Corinna Vinschen <corinna@vinschen.de>
441 * fhandler_socket.cc (fhandler_socket::bind): Remove printing wrong
442 errno in debug output.
444 2007-02-19 Christopher Faylor <me@cgf.cx>
446 Remove extraneous whitespace.
447 * pinfo.cc (commune_process): Use default argument to lock_process.
448 * sigproc.cc: Update copyright.
451 2007-02-15 Corinna Vinschen <corinna@vinschen.de>
453 * posix_ipc.cc (mq_open): Avoid compiler warning. Initialize mqhdr
454 before using it in file exists case.
455 * include/mqueue.h (mqd_t): Make non-pointer type.
457 2007-02-15 Corinna Vinschen <corinna@vinschen.de>
459 * posix_ipc.cc (ipc_mutex_init): Create global object name.
460 (ipc_cond_init): Ditto.
461 (struct mq_hdr): Add mqh_uname member to store synchronization object
463 (mq_open): Create unique synchronization object name and store in
464 mq_hdr->mqh_uname. Use this name in calls to ipc_mutex_init and
467 2007-02-14 Corinna Vinschen <corinna@vinschen.de>
469 * Makefile.in (DLL_OFILES): Add posix_ipc.o.
470 * cygwin.din (mq_close): Export.
471 (mq_getattr): Export.
474 (mq_receive): Export.
476 (mq_setattr): Export.
477 (mq_timedreceive): Export.
478 (mq_timedsend): Export.
480 * posix_ipc.cc: New file implementing the above functions. Move
481 shm_open and shm_unlink from syscalls.cc here.
482 * sysconf.cc (sca): Set value of _SC_MQ_OPEN_MAX to MQ_OPEN_MAX,
483 _SC_MQ_PRIO_MAX to MQ_PRIO_MAX, _SC_MESSAGE_PASSING to
484 _POSIX_MESSAGE_PASSING.
485 * include/limits.h (MQ_OPEN_MAX): Define.
486 (MQ_PRIO_MAX): Define.
487 * include/mqueue.h: New file.
488 * include/cygwin/version.h: Bump API minor number.
490 2007-02-13 Corinna Vinschen <corinna@vinschen.de>
492 * include/cygwin/stdlib.h (valloc): Declare.
495 2007-02-09 Pierre A. Humblet <Pierre.Humblet@ieee.org>
497 * libc/minires-os-if.c (write_record): Handle DNS_TYPE_SRV and
500 2007-02-08 Corinna Vinschen <corinna@vinschen.de>
502 * syscalls.cc (check_shm): New static function to do path checking
503 common to shm_open and shm_unlink. Check for /dev/shm existance.
504 (shm_open): Call check_shm.
507 2007-02-08 Corinna Vinschen <corinna@vinschen.de>
509 * cygwin.din (shm_open): Export.
510 (shm_unlink): Export.
511 * syscalls.cc (shm_open): New function.
512 (shm_unlink): New function.
513 * sysconf.cc (sca): Set value of _SC_SHARED_MEMORY_OBJECTS to
514 _POSIX_SHARED_MEMORY_OBJECTS.
515 * include/cygwin/version.h: Bump API minor number.
516 * include/sys/mman.h (shm_open): Add prototype.
519 2007-02-08 Christopher Faylor <me@cgf.cx>
520 Corinna Vinschen <corinna@vinschen.de>
522 * cygmalloc.h (__set_ENOMEM): Declare.
523 (MALLOC_FAILURE_ACTION): Call __set_ENOMEM.
524 * malloc_wrapper.cc (malloc) Remove setting errno here.
529 (posix_memalign): Save and restore errno.
531 2007-02-07 Corinna Vinschen <corinna@vinschen.de>
533 * cygmalloc.h (MALLOC_FAILURE_ACTION): Move to correct #if branch.
535 2007-02-07 Corinna Vinschen <corinna@vinschen.de>
537 * cygmalloc.h (MALLOC_FAILURE_ACTION): Define empty.
538 * cygwin.din (posix_madvise): Export.
539 (posix_memalign): Export.
540 * fhandler.cc (fhandler_base::fpathconf): Return useful values in
541 _PC_VDISABLE, _PC_SYNC_IO and _PC_SYMLINK_MAX cases.
542 * malloc_wrapper.cc (malloc): Set errno here since it's not set in
548 (posix_memalign): New function.
549 * mmap.cc (posix_madvise): New function.
550 * sysconf.cc (get_open_max): New function.
551 (get_page_size): Ditto.
552 (get_nproc_values): Ditto.
555 (sca): New array to map _SC_xxx options to sysconf return values.
556 (sysconf): Reimplement using sca array.
557 * include/limits.h: Add all missing values as defined by SUSv3.
558 * include/pthread.h (PTHREAD_DESTRUCTOR_ITERATIONS): Move definition
560 (PTHREAD_KEYS_MAX): Ditto.
561 * include/semaphore.h (SEM_VALUE_MAX): Ditto.
562 * include/cygwin/stdlib.h (posix_memalign): Declare.
563 * include/cygwin/version.h: Bump API minor number.
564 * include/sys/mman.h: Add posix_madvise flags.
565 (posix_madvise): Declare.
566 * include/sys/termios.h (_POSIX_VDISABLE): Move definition to
569 2007-02-05 Corinna Vinschen <corinna@vinschen.de>
571 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support for
572 baud rates up to 3000000 baud. Add missing 128K and 256K cases.
573 (fhandler_serial::tcgetattr): Ditto.
574 * include/sys/termios.h: Add baud rate definitions from B460800 up to
577 2007-02-02 Corinna Vinschen <corinna@vinschen.de>
579 * syscalls.cc (unlink_nt): Add missing assignment in case NtClose fails.
581 2007-02-01 Corinna Vinschen <corinna@vinschen.de>
583 * net.cc (ga_dup): New function, taken from ga_clone with v4-in-v6
585 (ga_clone): Just call ga_dup from here.
586 (ga_duplist): New function to duplicate list of struct addrinfo.
587 (ga_echeck): Don't check ai_flags, it already happened in
589 (cygwin_freeaddrinfo): Always call ipv4_freeaddrinfo.
590 (cygwin_getaddrinfo): Use new wincap.supports_all_posix_ai_flags
591 flag rather than wincap.has_gaa_on_link_prefix. Always duplicate
592 WinSock's addrinfo list to a self-allocated list. Handle AI_V4MAPPED
593 for pre-Vista platforms supporting getaddrinfo.
594 * wincap.h (wincapc::supports_all_posix_ai_flags): New element.
595 * wincap.cc: Implement above element throughout.
596 * include/netdb.h: Note how AI_ADDRCONFIG is not supported pre-Vista.
597 Remove superfluous comment.
599 2007-02-01 Corinna Vinschen <corinna@vinschen.de>
601 * include/cygwin/socket.h: Add IPv6 socket options.
603 2007-01-31 Corinna Vinschen <corinna@vinschen.de>
605 * net.cc (cygwin_getaddrinfo): Fix thinko in AI_ADDRCONFIG handling.
607 2007-01-31 Corinna Vinschen <corinna@vinschen.de>
609 * net.cc (cygwin_getaddrinfo): Check ai_flags for valid values.
610 Handle AI_NUMERICSERV. Handle AI_ADDRCONFIG behaviour on Vista.
611 * include/netdb.h (AI_NUMERICSERV): Add missing flag.
613 2007-01-30 Corinna Vinschen <corinna@vinschen.de>
615 * fhandler_disk_file.cc (fhandler_disk_file::closedir): Add dir name
617 * syscalls.cc (try_to_bin): Enable code to move file to user specific
618 recycler dir to eliminate Vista problem.
619 (unlink_nt): Add comment that rename after opening for delete on close
622 2007-01-30 Corinna Vinschen <corinna@vinschen.de>
624 * sigproc.cc (child_info::child_info): Set msv_count to non-zero
625 value only on systems requiring it.
627 2007-01-28 Corinna Vinschen <corinna@vinschen.de>
629 * include/ftw.h: Include sys/cdefs.h.
631 2007-01-26 Corinna Vinschen <corinna@vinschen.de>
633 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Implement rmdir
634 on NT by calling unlink_nt. Check for directory here.
635 * syscalls.cc (try_to_bin): Fix buggy debug_printf statement.
636 (unlink_nt): Make non-static. Don't use delete-on-close semantics on
637 directories. Explain why.
639 2007-01-24 Corinna Vinschen <corinna@vinschen.de>
641 * net.cc (if_nametoindex): This time, really free IP_ADAPTER_ADDRESSES
643 (if_indextoname): Ditto.
645 2007-01-24 Corinna Vinschen <corinna@vinschen.de>
647 * security.h (pop_thread_privilege): Revert to previous state, not
648 to token used for impersonation.
650 2007-01-24 Corinna Vinschen <corinna@vinschen.de>
652 * cygheap.h (cygheap_user::deimpersonate): Always RevertToSelf.
654 2007-01-23 Corinna Vinschen <corinna@vinschen.de>
656 * net.cc (gai_errmap): Add EAI_OVERFLOW entry. Fix formatting.
657 (cygwin_gai_strerror): Drop using EAI_MAX.
658 (w32_to_gai_err): Ditto.
659 * include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX.
661 2007-01-23 Corinna Vinschen <corinna@vinschen.de>
663 * include/netdb.h: Add AI_xxx flags available since Vista.
665 2007-01-23 Corinna Vinschen <corinna@vinschen.de>
667 * net.cc (if_nametoindex): Free IP_ADAPTER_ADDRESSES memory.
668 (if_indextoname): Ditto.
669 (if_nameindex): Ditto. Remove duplicate indexed entries in result.
671 2007-01-21 Corinna Vinschen <corinna@vinschen.de>
673 * autoload.cc (WSAIoctl): Define.
675 * cygwin.din: Export if_freenameindex, if_indextoname, if_nameindex and
677 * fhandler_procnet.cc: Drop including wchar.h. Drop definitions of
678 GAA_FLAG_INCLUDE_ALL_INTERFACES, IP_ADAPTER_UNICAST_ADDRESS_VISTA.
679 (fhandler_procnet::exists): Check for has_gaa_prefixes. Call
680 get_adapters_addresses here.
681 (fhandler_procnet::readdir): Ditto.
682 (prefix): Move to net.cc.
683 (fhandler_procnet::fill_filebuf): Call get_adapters_addresses here.
684 Simplify allocation. Use AdapterName rather than FriendlyName as
685 interface name. Use IfIndex if available, Ipv6IfIndex otherwise.
686 (in6_are_prefix_equal): Move to net.cc.
687 * fhandler_socket.cc: Define old SIOCGxxx values.
688 (CONV_OLD_TO_NEW_SIO): Convert old SIOCGxxx value to new one.
689 (struct __old_ifreq): Define old struct ifreq.
690 (fhandler_socket::ioctl): Handle old SIOCGxxx values. Handle new
691 SIOCGIFFRNDLYNAM command. Simplify copying ifreq data to user space.
692 Call get_ifconf with additional SOCKET parameter.
693 * net.cc (IP_ADAPTER_UNICAST_ADDRESS_LH): Define.
694 (IP_ADAPTER_ADDRESSES_LH): Define.
695 (SIO_GET_INTERFACE_LIST): Define.
696 (sockaddr_in6_old): Define.
697 (sockaddr_gen): Define.
698 (INTERFACE_INFO): Define.
699 (IN_LOOPBACK): Define.
700 (in_are_prefix_equal): New static function.
701 (ip_addr_prefix): New function, replaces prefix function, add AF_INET
703 (GAA_FLAG_INCLUDE_ALL_INTERFACES): Define.
704 (get_adapters_addresses): New function.
705 (WS_IFF_xxx): Define Winsock interface flag values.
706 (convert_ifr_flags): New function to convert Winsock interface flag
707 values to Cygwin interface flag values.
708 (get_xp_ifconf): New get_ifconf implementation for XP SP1 and above.
709 (get_2k_ifconf): Fix interface index. Fix formatting.
710 (get_nt_ifconf): Fix formatting.
711 (get_95_ifconf): Ditto.
712 (get_ifconf): Take additional SOCKET parameter. Call get_xp_ifconf
714 (if_nametoindex): New function.
715 (if_indextoname): New function.
716 (if_nameindex): New function.
717 (if_freenameindex): New function.
718 (in6_are_prefix_equal): Moved here from fhandler_procnet.cc.
719 * wincap.cc (wincap_xp): Define has_gaa_prefixes as true by default.
720 (wincapc::init): Assume has_osversioninfoex by default. Call
721 GetVersionEx with OSVERSIONINFOEX first. Call with OSVERSIONINFO only
722 if that fails. Simplify NT4 case and try to avoid strcmp. Check XP
723 Service Pack using version.wServicePackMajor to avoid strcmp.
724 * include/asm/socket.h (SIOCGIFFRNDLYNAM): Define.
725 * include/cygwin/if.h: Fix formatting.
726 (IFF_POINTTOPOINT): Define.
728 (IFF_LOWER_UP): Define.
729 (IFF_DORMANT): Define.
730 (struct if_nameindex): Define.
731 (IFRF_FRIENDLYNAMESIZ): Define.
732 (struct ifreq_frndlyname): Define.
733 (IFNAMSIZ): Redefine as 44.
734 (IF_NAMESIZE): Define.
735 (struct ifreq): Redefine ifru_flags as int. Define ifru_data. Pad size
736 to sizeof sockaddr_in6 for further extensions.
738 (ifr_frndlyname): Define.
739 (if_nametoindex): Declare.
740 (if_indextoname): Declare.
741 (if_nameindex): Declare.
742 (if_freenameindex): Declare.
743 * include/cygwin/version.h: Bump API minor number.
744 (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ): Define check for old vs. new
747 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
749 * spawn.cc (spawn_guts): Don't set cwd for non-Cygwin child processes
750 on NT to allow starting them in virtual directories.
752 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
754 * mmap.cc (list::hash): Fix type to __ino64_t.
755 (list::get_hash): Ditto.
756 (list::set): Add struct stat parameter. Use that instead of calling
758 (map::get_list_by_fd): Ditto.
759 (map::add_list): Ditto.
760 (mmap_is_attached_or_noreserve): Call get_list_by_fd appropriately.
761 (mmap_worker): Add pameters for map list and file stat information.
762 Propagate to called functions.
763 (mmap64): Use fstat on files early. Replace call to GetFileSize.
764 Call get_list_by_fd and mmap_worker appropriately.
766 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
768 * fhandler_procnet.cc: Drop declaration of htonl and ntohs. Include
769 asm/byteorder.h instead.
771 2007-01-18 Corinna Vinschen <corinna@vinschen.de>
773 * include/cygwin/in6.h: Drop inclusion of asm/byteorder.h.
774 * fhandler_procnet.cc: Declare htonl and ntohs here.
776 2007-01-17 Corinna Vinschen <corinna@vinschen.de>
778 * Makefile.in (DLL_OFILES): Add fhandler_procnet.o.
779 * autoload.cc (GetAdaptersAddresses): Define.
780 * devices.h (FH_PROCNET): Define new device.
781 * devices.in (dev_procnet_storage): Add "/proc/net" entry.
782 * devices.cc: Regenerate.
783 * dir.cc (readdir_worker): Use isproc_dev macro.
784 * dtable.cc (build_fh_pc): Add FH_PROCNET.
785 * fhandler.h (class fhandler_procnet): New class.
786 * fhandler_proc.cc: Add "net" subdirectory handling.
787 * fhandler_procnet.cc: New file handling "/proc/net" directory.
788 * path.cc (isvirtual_dev): Move to path.h.
789 * path.h (isproc_dev): New macro to identify /proc files by device.
790 (isvirtual_dev): Moved here. Define using isproc_dev.
791 * syscalls.cc (unlink): Use isproc_dev macro.
792 * wincap.h (wincapc::has_gaa_prefixes): New element.
793 (wincapc::has_gaa_on_link_prefix): New element.
794 * wincap.cc: Implement above elements throughout.
795 (wincapc::init): Check XP for service pack and set has_gaa_prefixes
797 * include/cygwin/in6.h: Include asm/byteorder.h.
799 2007-01-17 Corinna Vinschen <corinna@vinschen.de>
801 * include/asm/socket.h (SIOGIFINDEX): Define.
803 2007-01-17 Corinna Vinschen <corinna@vinschen.de>
805 * mmap.cc (MapView9x): Note possible uselessness of retrying.
807 (mmap64): Fix pre-reservation to work for non NULL, non MAP_FIXED.
809 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
811 * autoload.cc (RtlAnsiStringToUnicodeString): Define.
812 (RtlOemStringToUnicodeString): Define.
813 * ntdll.h (struct _RTL_USER_PROCESS_PARAMETERS): Define.
814 (struct _PEB): Redefine with a bit of content.
815 (RtlAnsiStringToUnicodeString): Declare.
816 (RtlOemStringToUnicodeString): Declare.
817 * path.cc: Include ntdll.h.
818 (_upp): New global variable pointing to user process parameter block.
819 (get_user_proc_parms): New static function to retrieve user process
821 (close_user_proc_parms_cwd_handle): New function to close handle to
822 current working directory in user process parameter block.
823 (cwdstuff::init): Drop redundant declaration of dynamically_loaded.
824 Set current dir only on 9x. Call close_user_proc_parms_cwd_handle
826 (cwdstuff::keep_in_sync): Only on 9x.
827 (cwdstuff::set): Keep behaviour on 9x. On NT write cwd path into user
828 process parameter block and set cwd handle to NULL. Fix comments to
829 reflect new behaviour.
831 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
833 * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX.
834 * net.cc (get_2k_ifconf): Ditto.
835 (get_nt_ifconf): Fake SIOCGIFINDEX.
836 (get_95_ifconf): Ditto.
837 (get_ifconf): Handle SIOCGIFINDEX. Fake it for loopback on systems
838 not supporting IP Helper Lib.
839 * include/asm/socket.h (SIOCGIFINDEX): Define.
840 * include/cygwin/if.h (struct ifreq): Add member for interface index.
841 (ifr_ifindex): Define.
843 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
845 * include/cygwin/in6.h (struct ipv6_mreq): Change type of interface
847 (struct in6_pktinfo): Ditto.
849 2007-01-16 Corinna Vinschen <corinna@vinschen.de>
851 * include/cygwin/in.h (struct ip_mreq_source): Define.
852 (struct ip_msfilter): Define.
853 (IP_MSFILTER_SIZE): Define.
854 (struct in_pktinfo): Define.
855 (struct group_req): Define.
856 (struct group_source_req): Define.
857 (struct group_filter): Define.
858 (GROUP_FILTER_SIZE): Define.
859 (INADDR_ALLRTRS_GROUP): Define.
860 * include/cygwin/socket.h: Define protocol agnostic multicast options.
862 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
864 * CYGWIN_LICENSE: Fix web pages and contact information.
866 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
868 * ntdll.h: Adjust status definitions.
870 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
872 * cygheap.cc (cygheap_init): Add TODO comment.
874 2007-01-15 Corinna Vinschen <corinna@vinschen.de>
876 * ntdll.h (STATUS_SHARING_VIOLATION): Define.
878 2007-01-13 Corinna Vinschen <corinna@vinschen.de>
880 * syscalls.cc (unlink_nt): Don't move files to recycle bin which are
883 2007-01-13 Christopher Faylor <me@cgf.cx>
885 * glob.cc: Update copyright notice with latest from FreeBSD.
886 (glob0): Use correct type for c variable to propagate previously
889 2007-01-12 Corinna Vinschen <corinna@vinschen.de>
891 * cygheap.cc (_csbrk): Fix off-by-one error.
892 * cygwin.sc: Give .cygheap a minimum size of 512K.
894 2007-01-12 Christopher Faylor <me@cgf.cx>
896 * external.cc (sync_winenv): Use cur_environ () rather than
899 2007-01-12 Corinna Vinschen <corinna@vinschen.de>
901 * fork.cc (child_copy): Add missing Windows PID in debug output.
903 2007-01-12 Corinna Vinschen <corinna@vinschen.de>
905 * syscalls.cc: Update copyright.
907 2007-01-10 Corinna Vinschen <corinna@vinschen.de>
909 * mmap.cc (mmap64): Pre-Reserve space for the whole mapping to get a
910 useful, valid address before the actual mappings take place.
913 2007-01-10 Corinna Vinschen <corinna@vinschen.de>
915 * syscalls.cc (sync): Use b_drive for B: drive (Thanks to Howard Chu).
917 2007-01-09 Corinna Vinschen <corinna@vinschen.de>
919 * syscalls.cc (getpagesize): Change condition for clarity.
920 (getsystempagesize): Ditto.
922 2007-01-09 Corinna Vinschen <corinna@vinschen.de>
924 * mmap.cc: Do bookkeeping in 4K pages, rather than in 64K chunks.
926 2007-01-07 Corinna Vinschen <corinna@vinschen.de>
928 * security.h (setacl): Add parameter for writability flag.
929 * sec_acl.cc (setacl): Ditto. Set to true if any ACE with write
930 permissions is created.
931 * fhandler_disk_file.cc (fhandler_disk_file::facl): Reset
932 FILE_ATTRIBUTE_READONLY if ACL contains an ACE with write permissions.
934 2007-01-05 Corinna Vinschen <corinna@vinschen.de>
936 * include/strings.h: Don't include string.h. Only declare functions
939 2007-01-04 Corinna Vinschen <corinna@vinschen.de>
941 (get_ifconf): Set MTU for loopback to more correct value.
943 2007-01-04 Corinna Vinschen <corinna@vinschen.de>
945 * fhandler_socket.cc (fhandler_socket::ioctl): Don't fake results
946 for SIOCGIFFLAGS here. Call get_ifconf instead.
947 * net.cc (get_2k_ifconf): Clean up code to generate interface name.
948 Handle SIOCGIFFLAGS here.
949 (get_nt_ifconf): Fake SIOCGIFFLAGS here.
950 (get_95_ifconf): Ditto.
951 (get_ifconf): Don't fake loopback on systems with IP Helper Lib.
952 Set MTU for loopback to a more "modern" value.
954 2007-01-04 Brian Ford <Brian.Ford@FlightSafety.com>
955 Corinna Vinschen <corinna@vinschen.de>
957 * fhandler.h (PREFERRED_IO_BLKSIZE): Define as 64K.
958 * fhandler.cc (fhandler_base::fstat): Set st_blksize to
959 PREFERRED_IO_BLKSIZE.
960 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Ditto.
961 * fhandler_mailslot.cc (fhandler_mailslot::fstat): Ditto.
962 * fhandler_raw.cc (fhandler_dev_raw::fstat): Ditto.
964 2007-01-01 Christopher Faylor <me@cgf.cx>
966 * spawn.cc (spawn_guts): Don't expect synchronization from a non-cygwin