]> sourceware.org Git - newlib-cygwin.git/blob - winsup/cygwin/ChangeLog
1d4c7fea32b089f6d44d47d643daa7cf980ac9f3
[newlib-cygwin.git] / winsup / cygwin / ChangeLog
1 2008-04-18 Corinna Vinschen <corinna@vinschen.de>
2
3 Revert thinko in previous patch.
4 * fhandler.h (struct wsa_event): Move back from wsa_event.h to here.
5 * fhandler_socket.cc (NUM_SOCKS): Ditto.
6 (wsa_events): Move back from cygwin_shared to here. Accommodate
7 throughout.
8 (socket_serial_number): Ditto.
9 * shared_info.h: Accommodate above changes.
10 * wsa_event.h: Remove.
11
12 2008-04-18 Corinna Vinschen <corinna@vinschen.de>
13
14 * fhandler.h (struct wsa_event): Move to wsa_event.h. Include
15 wsa_event.h instead.
16 * fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h.
17 (wsa_events): Move from DLL shared area to cygwin_shared shared
18 memory. Accommodate throughout.
19 (socket_serial_number): Ditto.
20 * fhandler_tape.cc (mt): Ditto.
21 (mtinfo_init): Remove.
22 (mt): Define as cygwin_shared->mt.
23 * flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove.
24 (FLOCK_INODE_DIR_ACCESS): Move up in file.
25 (FLOCK_MUTANT_ACCESS): Ditto.
26 (FLOCK_EVENT_ACCESS): Ditto.
27 (get_lock_parent_dir): Remove.
28 (inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle.
29 Add a "flock-" prefix to file's lock directory name for clarity.
30 * mtinfo.h (mtinfo_init): Drop declaration.
31 * net.cc (last_used_bindresvport): Move from DLL shared area to
32 cygwin_shared shared memory.
33 (cygwin_bindresvport_sa): Accommodate above change.
34 * sec_helper.cc (_everyone_sd): Move here from flock.cc.
35 * security.h (SD_MIN_SIZE): Ditto.
36 (everyone_sd): Ditto.
37 * shared.cc (cygwin_shared_area): Remove.
38 (cygwin_shared_h): New handle.
39 (get_shared_parent_dir): New static function.
40 (shared_name): Drop session_local argument. Call get_shared_parent_dir
41 here. Add cygwin-shared subdir to object name.
42 (offsets): Reinstantiate SH_CYGWIN_SHARED member.
43 (open_shared): Revert change from 2007-03-29 for systems supporting
44 SeCreateGlobalPrivilege.
45 (shared_info::initialize): Call mtinfo's initialize here.
46 (memory_init): Drop call to mtinfo_init.
47 * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
48 (CURR_SHARED_MAGIC): Ditto.
49 (class shared_info): Add members for global socket and tape info
50 sharing.
51 (enum shared_locations): Reinstantiate SH_CYGWIN_SHARED.
52 (get_shared_parent_dir): Declare.
53 (shared_name): Drop session_local argument from declaration.
54 * wsa_event.h: New file. Move definitions of NUM_SOCKS and
55 struct wsa_event here.
56
57 2008-04-18 Christopher Faylor <me+cygwin@cgf.cx>
58
59 * autoload.cc (noload): Make sure this and succeeding functions are
60 located in the text segment.
61
62 2008-04-16 Corinna Vinschen <corinna@vinschen.de>
63
64 * fhandler_socket.cc (fhandler_socket::close): Disable enforced
65 lingering since the original problem can no longer be reproduced.
66
67 2008-04-16 Corinna Vinschen <corinna@vinschen.de>
68
69 * grp.cc (internal_getgroups): Drop local buf. Allocate groups
70 directly using alloca.
71
72 2008-04-14 Corinna Vinschen <corinna@vinschen.de>
73
74 * postinstall: Fix copy/paste bug.
75
76 2008-04-14 Corinna Vinschen <corinna@vinschen.de>
77
78 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Fix
79 thinko in UNC path handling.
80 * path.cc (symlink_worker): Fix typo in comment. Fix UNC path handling.
81
82 2008-04-13 Corinna Vinschen <corinna@vinschen.de>
83
84 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Simplify
85 code which checks for symlinks. Fix problem with UNC paths.
86
87 * environ.cc (struct parse_thing): Remove transparent_exe option.
88 * syscalls.cc (transparent_exe): Remove.
89 (unlink): Always add stat_suffixes, drop transparent_exe check.
90 (open): Ditto.
91 (link): Ditto.
92 (pathconf): Ditto.
93 * fhandler_disk_file.cc (fhandler_disk_file::link): Ditto.
94 * fhandler_process.cc (fhandler_process::fill_filebuf): Always remove
95 .exe suffix.
96 * path.cc (realpath): Never attach known_suffix.
97
98 2008-04-10 Corinna Vinschen <corinna@vinschen.de>
99
100 * cygwin.din (wprintf): Remove.
101 (_wprintf): Ditto.
102 * syscalls.cc (wprintf): Ditto.
103 * include/cygwin/version.h: Add FIXME comment.
104
105 2008-04-08 Corinna Vinschen <corinna@vinschen.de>
106
107 * mount.cc (mount_info::from_fstab): Read user fstab files from
108 /etc/fstab.d/$USER to avoid user write access to /etc.
109 * postinstall: Use variables for filenames. Create /etc/fstab.d dir
110 with 01777 permissions.
111
112 2008-04-08 Corinna Vinschen <corinna@vinschen.de>
113
114 * postinstall: Disable adding registry mounts to /etc/fstab for now.
115
116 2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
117
118 Remove unneeded header files from source files throughout.
119
120 2008-04-07 Corinna Vinschen <corinna@vinschen.de>
121
122 * postinstall: Add function print_flags and call where appropriate.
123 Omit system and cygdrive flag when testing cygdrive flags.
124
125 2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
126
127 Add miscfuncs.h to files as needed throughout.
128 * mount.cc: New file.
129 * path.cc: Move mount-specific stuff into mount.cc. Move common stuff
130 into miscfuncs.cc. Remove unneeded includes.
131 * miscfuncs.cc: Move some common path functions here.
132 * miscfuncs.h: New file.
133 * winsup.h: Move miscelleneous functions to miscfuncs.h.
134 * dcrt0.cc: Remove unneeded includes.
135 * Makefile.in (DLL_OFILES): Add mount.o.
136
137 * include/cygwin/config.h: Fix a minor typo.
138
139 2008-04-07 Corinna Vinschen <corinna@vinschen.de>
140
141 * postinstall: Set IFS to LF only. Change while loop in subshell to
142 for loop in parent shell. Add code to read system mount points and
143 system cygdrive prefix from registry and append them to /etc/fstab.
144
145 2008-04-06 Corinna Vinschen <corinna@vinschen.de>
146
147 * path.cc (struct opt): Rename "system" to "nouser".
148 * postinsatll: Ditto.
149
150 2008-04-05 Corinna Vinschen <corinna@vinschen.de>
151
152 * postinstall: New script.
153 * Makefile.in (sysconfdir): Define.
154 (install): Create $(sysconfdir)/postinstall dir. Install postinstall
155 script into it.
156
157 * path.cc: Add temorary comments to note later function removal.
158 (conv_fstab_spaces): New inline function to handle \040 to space
159 conversion.
160 (struct opt): Add "system" and "user" mount options.
161 (mount_info::from_fstab_line): Only allow # to start a comment at
162 the beginning of the line. Call conv_fstab_spaces on native_path and
163 posix_path fields. Don't enforce system mounts in /etc/fstab.
164 Drop last argument in call to add_item.
165 (mount_info::from_fstab): Create a default cygdrive entry. Load
166 user mount points from fstab.<username> instead of fstab.<sid>.
167 (mount_info::read_mounts): Drop last argument in call to add_item.
168 (mount_info::add_reg_mount): Remove.
169 (mount_info::del_reg_mount): Remove.
170 (mount_info::write_cygdrive_info): Rename from
171 mount_info::write_cygdrive_info_to_registry. Don't write to registry.
172 Disallow to overwrite a system cygdrive prefix.
173 (mount_info::remove_cygdrive_info_from_registry): Remove.
174 (mount_info::get_cygdrive_info): Just fetch current cygdrive prefix and
175 flags.
176 (mount_info::add_item): Drop last argument. Don't write to registry.
177 Disallow to overwrite a system mount point.
178 (mount_info::del_item): Drop last argument. Don't write to registry.
179 Disallow to remove a system mount point.
180 (mount): Enforce user mount.
181 (cygwin_umount): Ditto.
182 * shared_info.h (mount_info::add_item): Drop last argument.
183 (mount_info::del_item): Ditto.
184 (mount_info::add_reg_mount): Remove.
185 (mount_info::del_reg_mount): Remove.
186 (mount_info::write_cygdrive_info): Rename from
187 mount_info::write_cygdrive_info_to_registry.
188 (mount_info::remove_cygdrive_info_from_registry): Remove.
189
190 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
191
192 * path.cc (mount_info::from_fstab_line): Simplify. Recognize special
193 "cygdrive" entry from FS type field.
194 (mount_info::from_fstab): Create a default root dir.
195
196 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
197
198 * dcrt0.cc (insert_file): Fix potential buffer overflow.
199
200 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
201
202 * path.cc (mount_info::from_fstab): Get module path name of the Cygwin
203 DLL, not the path of the application.
204
205 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
206
207 Cleanup.
208 * exceptions.cc (windows_system_directory): Make static. Convert to
209 WCHAR.
210 (_cygtls::inside_kernel): Accommodate above change. Check module
211 path name for leading \\?\ and skip, if so.
212 (try_to_debug): Call GetEnvironmentStringsW and convert evaluation to
213 WCHAR to avoid truncated environment problem.
214 (has_visible_window_station): Call GetUserObjectInformationW.
215 (events_init): Accommodate above conversion of windows_system_directory.
216 * init.cc (respawn_wow64_process): Use WCHAR functions to start new
217 process.
218 * net.cc (__dup_ent): Drop Windows 9x consideration.
219 (load_ipv6_funcs): Use WCHAR functions to load IPv6 libs.
220 * syscalls.cc (syscalls.cc): Remove call to GetDiskFreeSpace.
221
222 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
223
224 * path.cc (mount_info::init): First try to fetch mount points from
225 fstab files. Fallback to registry if none exists.
226 (skip_ws): New inline function.
227 (find_ws): Ditto.
228 (struct opt): New structure for mount options.
229 (read_flags): New static function to convert a mount flags string into
230 a flag value.
231 (mount_info::from_fstab_line): New method to create a mount table
232 entry from a fstab line.
233 (mount_info::from_fstab): New method to read fstab file.
234 * shared_info.h (mount_info::from_fstab_line): Declare.
235 (mount_info::from_fstab): Declare.
236
237 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
238
239 * path.cc (enum symlink_t): Rename from shortcut_t.
240
241 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
242
243 * path.cc (symlink_info::check_reparse_point): Use NtFsControlFile
244 to read reparse points.
245 (enum shortcut_t): New type.
246 (symlink_info::check): Convert sym_check to shortcut_t. Use shortcut_t
247 enum values throughout. Check reparse point before checking for
248 sysfile shortcut. Open reparse points with READ_CONTROL only to
249 accommodate special Vista reparse points. Add comments.
250
251 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
252
253 * flock.cc (get_lock_parent_dir): Drop call to NtOpenDirectoryObject
254 and utilize OBJ_OPENIF flag in call to NtCreateDirectoryObject.
255 (inode_t::inode_t): Ditto. Same for NtOpenMutant/NtCreateMutant.
256
257 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
258
259 * posix.sgml: Change lockf to being implemented.
260
261 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
262
263 * dcrt0.cc (insert_file): Convert filename to WCHAR and call
264 CreateFileW to allow UTF-8 filenames.
265
266 2008-04-01 Corinna Vinschen <corinna@vinschen.de>
267
268 * Fix copyright dates.
269
270 2008-04-01 Corinna Vinschen <corinna@vinschen.de>
271
272 Throughout, call fcntl64 instead of fcntl or fcntl_worker.
273 * fcntl.cc (fcntl_worker): Remove.
274 (fcntl64): Add fault handler. Move fcntl_worker stuff here. Add case
275 for locking and call fhandler's lock method directly. Make sure that
276 F_FLOCK flag isn't set in lock call.
277 (_fcntl): Add fault handler.
278 * fhandler.cc (fhandler_base::fcntl): Drop lock cases.
279 * flock.cc (flock): Add fault handler. Simplify code. Call fhandlers
280 lock method directly instead of fcntl_worker. Add debug output.
281 (lockf): Add fault handler. Call fhandlers lock method directly
282 instead of fcntl_worker. Add debug output.
283 * winsup.h (fcntl_worker): Drop declaration.
284 (fcntl64): Declare.
285
286 2008-03-31 Corinna Vinschen <corinna@vinschen.de>
287
288 * smallprint.cc (__small_vswprintf): Fix uninitialized usage of `w'.
289
290 Revamp advisory file locking to avoid cross reference pointers as well
291 as to allow BSD flock semantics. More agressively delete unused nodes
292 and sync objects.
293 * fhandler.h (fhandler_base::ino): Rename from namehash. Fix comment.
294 (fhandler_base::node): Remove.
295 (fhandler_base::unique_id): Add.
296 (fhandler_base::del_my_locks): New method.
297 (get_ino): Rename from get_namehash. Change usage throughout Cygwin.
298 (get_unique_id): New method.
299 * fhandler.cc (fhandler_base::close): Call own del_my_locks method.
300 Fix comment.
301 (fhandler_base::fhandler_base): Accommodate new and changed members.
302 (fhandler_base::fixup_after_fork): Call del_my_locks.
303 (fhandler_base::fixup_after_exec): Ditto for files with close-on-exec
304 flag set.
305 * fhandler_disk_file.cc (get_ino_by_handle): Rename from
306 readdir_get_ino_by_handle. Accommodate throughout.
307 (fhandler_base::open_fs): Fill ino with inode number if FS has good
308 inodes. Allocate a LUID and store in unique_id to recognize file
309 descriptors referencing the same file object.
310 * flock.cc: Drop flock TODO comments. Use explicit types __dev32_t
311 and __ino64_t instead of dev_t and ino_t.
312 (LOCK_OBJ_NAME_LEN): Change to reflect longer lf_id length.
313 (get_obj_handle_count): New method.
314 (lockf_t::lf_id): Change type to long long.
315 (inode_t::get_lock_obj_handle_count): Drop in favor of static function
316 get_obj_handle_count.
317 (inode_t::del_locks): Remove.
318 (inode_t::get): Add create_if_missing flag argument.
319 (inode_t::del_my_locks): Reimplement to handle POSIX and BSD flock
320 locks. Return if node can be deleted or not.
321 (inode_t::~inode_t): Ditto. Close handles to i_dir and i_mtx.
322 (fixup_lockf_after_fork): Remove.
323 (fhandler_base::del_my_locks): New method.
324 (fixup_lockf_after_exec): Check if node can be deleted.
325 (inode_t::get): Only create node if create_if_missing is set. Lock
326 the returned node here before unlocking the node list.
327 (inode_t::get_all_locks_list): Accommodate new lf_id length.
328 (inode_t::create_lock_obj): Ditto.
329 (lockf_t::open_lock_obj): Ditto. Change return type to bool. De-const.
330 Set lf_obj instead of returning a handle.
331 (lockf_t::del_lock_obj): Call SetEvent only if new incoming parameters
332 allow it. Explain how it's supposed to work.
333 (fhandler_disk_file::lock): Only fetch file length in SEEK_END case.
334 Use NtQueryInformationFile(FileStandardInformation) instead of
335 calling fstat_by_handle. Always unlock node before returning.
336 Use fhandler's unique id to create lf_id for BSD flock locks.
337 Rely on node lock from inode_t::get. Call del_lock_obj on removed
338 locks here to allow explicit unlocking. Delete node if no lock exists
339 on the file anymore.
340 (lf_setlock): Get file handle as additional parameter. Handle the fact
341 that lf_getblock now always opens the attached event object. Reactivate
342 erroneously applied patch which deactivates setting thread priority.
343 Additionally handle blocking on BSD flock locks.
344 (lf_clearlock): Get file handle as additional parameter.
345 (lf_getlock): Close event handle opened by lf_getblock.
346 (lf_getblock): Open potentially blocking event object here and check
347 its signal state if it's a BSD flock lock.
348 (lf_wakelock): Get file handle as additional parameter.
349 * fork.cc (frok::child): Drop call to fixup_lockf_after_fork.
350 * ntdll.h (struct _EVENT_BASIC_INFORMATION): Define.
351 (enum _EVENT_INFORMATION_CLASS): Define.
352 (NtQueryEvent): Declare.
353
354 * fhandler.h (fhandler_base::fs_flags): Remove.
355 (fhandler_base::set_fs_flags): Remove.
356 (fhandler_base::get_fs_flags): Remove.
357 * fhandler.cc (fhandler_base::write): Check for sparse file using
358 pc.fs_flags().
359 * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto.
360
361 The return of the volume serial number in fs_info.
362 * fhandler.h (get_dev): New method.
363 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call to
364 NtQueryVolumeInformationFile(FileFsVolumeInformation). Just use
365 get_dev() method.
366 * fhandler_fifo.cc (fhandler_fifo::open) Use device ID and inode number
367 to generate fifo name.
368 * path.h (fs_info::sernum): New member.
369 (fs_info::serial_number): New method.
370 (path_conv::fs_serial_number): New method.
371 * path.cc (fs_info::update): Fetch volume serial number and store in
372 sernum.
373
374 2008-03-28 Corinna Vinschen <corinna@vinschen.de>
375
376 * flock.cc (lockf_t::operator new): Add operator taking a pointer. Call
377 cmalloc instead of ccalloc in the default operator. Add comments.
378 (inode_t::operator new): Call cmalloc instead of ccalloc.
379 (inode_t::get_all_locks_list): Return lockf_t pointer.
380 (inode_t::del_all_locks_list): Delete. Remove calls throughout.
381 (inode_t::get): Handle failing new gracefully.
382 (MAX_LOCKF_CNT): Define.
383 (inode_t::get_all_locks_list): Use pre-allocated buffer in i_all_lf
384 instead of allocating every lock. Return pointer to start of linked
385 list of locks.
386 (lockf_t::open_lock_obj): Create event object non-inheritable.
387 (fhandler_disk_file::lock): Handle failing new gracefully.
388 (lf_setlock): Allocate temporary buffer for node->i_all_lf from TLS.
389 Remove erroneous NtClose call.
390 (lf_getlock): Allocate temporary buffer for node->i_all_lf from TLS.
391 (lf_getblock): Set lf to return value of get_all_locks_list.
392
393 2008-03-27 Corinna Vinschen <corinna@vinschen.de>
394
395 * flock.cc (FLOCK_PARENT_DIR_ACCESS): Define.
396 (FLOCK_INODE_DIR_ACCESS): Define.
397 (FLOCK_MUTANT_ACCESS): Define.
398 (FLOCK_EVENT_ACCESS): Define.
399 (SD_MIN_SIZE): Define.
400 (everyone_sd): Define to simplify calling _everyone_sd.
401 (_everyone_sd): Replace everyone_sync_sd. Take SECURITY_DESCRIPTOR as
402 argument and allow to specify access mask.
403 (get_lock_parent_dir): Open/Create parent dir with
404 FLOCK_PARENT_DIR_ACCESS. Add text to api_fatal message.
405 (inode_t::inode_t): Open/Create dir with FLOCK_INODE_DIR_ACCESS.
406 Open/Create mutant with FLOCK_MUTANT_ACCESS. Add text to api_fatal
407 message.
408 (lockf_t::create_lock_obj): Create event with FLOCK_EVENT_ACCESS.
409 Add text to api_fatal message.
410 (lockf_t::open_lock_obj): Open event with FLOCK_EVENT_ACCESS.
411 On failure, just return NULL pointer instead of calling api_fatal.
412 (lockf_t::get_lock_obj_handle_count): Replace call to small_printf
413 with call to debug_printf.
414 (lf_setlock): Handle a failure to open the lock event object as
415 EDEADLK. Call system_printf if opening sync objects fail.
416 * ntdll.h (DIRECTORY_TRAVERSE): Define.
417 (DIRECTORY_CREATE_OBJECT): Define.
418 (DIRECTORY_CREATE_SUBDIRECTORY): Define.
419 (EVENT_QUERY_STATE): Define.
420
421 2008-03-27 Corinna Vinschen <corinna@vinschen.de>
422
423 * syscalls.cc (rename): Fix setting errno in case of trailing "/."
424
425 2008-03-27 Corinna Vinschen <corinna@vinschen.de>
426
427 * fhandler_socket.cc: Create shared objects session local throughout.
428 * shared.cc (shared_name): Add argument to allow opening session
429 local shared memory.
430 * shared_info.h (shared_name): Change declaration accordingly.
431
432 2008-03-26 Christopher Faylor <me+cygwin@cgf.cx>
433
434 Implement method of detecting a missing dll as suggested by Brian
435 Dessent.
436 * hookapi.cc (find_first_notloaded_dll): New function.
437 * pinfo.cc (status_exit): New function. Issue message when dll not
438 found. Use find_first_notloaded_dll to find a nonexistent dll.
439 (pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit
440 code >= 0xc0000000UL.
441 * sigproc.cc (child_info::proc_retry): Return exit code when
442 STATUS_DLL_NOT_FOUND.
443 * spawn.cc (spawn_guts): Minor cleanup.
444 * syscalls.cc (close_all_files): Don't actually close stderr
445 filehandle. Just make it noninheritable.
446 * winsup.h (find_first_notloaded_dll): Declare new function.
447
448 2008-03-26 Brian Dessent <brian@dessent.net>
449
450 * ntdll.h: Add several missing NTSTATUS defines.
451
452 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
453
454 * flock.cc (inode_t::get_all_locks_list): Don't allow F_WAIT flag
455 in lock event object name.
456 (lockf_t::create_lock_obj): Ditto.
457 (lockf_t::open_lock_obj): Ditto.
458 (lf_setlock): Only check POSIX locks for deadlock condition.
459 (lf_findoverlap): Don't let POSIX and flock locks interact.
460
461 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
462
463 * flock.cc: Clarify a couple of comments.
464 (lf_setlock): Treat not being able to sync on a process as a potential
465 deadlock situation. Close process handle using CloseHandle.
466
467 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
468
469 * flock.cc: Fix typo in comment.
470
471 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
472
473 * fhandler.cc (fhandler_base::dup): Drop setting flags in the parent.
474
475 Implement advisory file locking.
476 * cygheap.h (struct init_cygheap): Add inode_list member.
477 * cygwin.din (lockf): Export.
478 * dcrt0.cc (child_info_spawn::handle_spawn): Call
479 fixup_lockf_after_exec.
480 * dtable.h (class dtable): Add fhandler_disk_file as friend class.
481 * fhandler.cc (fhandler_base::close): Call del_my_locks if node is set.
482 (fhandler_base::fhandler_base): Initialize node to NULL.
483 (fhandler_base::fixup_after_fork): Ditto.
484 * fhandler.h (class fhandler_base): Add member node.
485 * fhandler_disk_file.cc (fhandler_disk_file::lock): Delete.
486 * flock.cc: Implement all advisory file locking here.
487 (fhandler_disk_file::lock): Implement here.
488 (flock): Call fcntl with F_FLOCK bit set. Remove test main function.
489 (lockf): New function.
490 * fork.cc (frok::child): Call fixup_lockf_after_fork.
491 * ntdll.h (DIRECTORY_ALL_ACCESS): Define.
492 (struct _OBJECT_BASIC_INFORMATION): Define.
493 (enum _EVENT_TYPE): Define.
494 (NtCreateDirectoryObject): Declare.
495 (NtCreateEvent): Declare.
496 (NtCreateMutant): Declare.
497 (NtOpenEvent): Declare.
498 (NtOpenMutant): Declare.
499 * include/cygwin/version.h: Bump API minor number.
500
501 2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
502
503 * dtable.cc (handle_to_fn): Modify to return true if handle represents
504 a cygwin tty.
505 (dtable::init_std_file_from_handle): Detect when we've seen a cygwin
506 pipe and use it in overlapped mode by default.
507 (decode_tty): Make static.
508
509 2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
510
511 * dtable.cc: Define various device-related string constants as wide
512 character constants.
513 (dtable::init_std_file_from_handle): Reorganize pipe handling to try to
514 catch special tty case.
515 (build_fh_name_worker): Declare for common use.
516 (build_fh_name): Define char version.
517 (build_fh_name): Define (currently unused) UNICODE_STRING version.
518 (decode_tty): Detect if pipe is actually a cygwin tty, returning the
519 tty name in the buffer.
520 (handle_to_fn): Reorganize to use wide characters.
521 * dtable.h (build_fh_name): Declare (currently unused) UNICODE_STRING
522 version.
523 * fhandler_tty.cc (fhandler_pty_master::setup): Use
524 fhandler_pipe::create_selectable to create a pipe with a given name.
525 * pipe.cc (pipe_handler): Make returned handle inheritable.
526 (fhandler_pipe::create_selectable): Take an optional name. Use a
527 standard cygwin introducer for the name.
528
529 * path.cc (path_conv::check): Make first argument const.
530 * path.h (path_conv::check): Ditto for declaration.
531 (path_conv::path_conv): Ditto for UNICODE_STRING version.
532
533 2008-03-18 Corinna Vinschen <corinna@vinschen.de>
534
535 * include/sys/cygwin.h: Revert erroneous move of `#ifdef WINVER' to
536 another location.
537
538 2008-03-14 Corinna Vinschen <corinna@vinschen.de>
539
540 * fcntl.cc (fcntl_worker): Protect with a 'myfault'.
541
542 * path.cc (normalize_posix_path): Treat X:/ as Win32 path, too.
543
544 * smallprint.cc (__wrn): New static function.
545 (__small_vswprintf): New function to generate WCHAR strings.
546 (__small_swprintf): Ditto.
547 * winsup.h (__small_swprintf): Declare.
548 (__small_vswprintf): Declare.
549
550 2008-03-13 Corinna Vinschen <corinna@vinschen.de>
551
552 * path.sgml: Remove documentation for old path API. Add documentation
553 for new path API.
554 * security.sgml: New file to document cygwin_set_impersonation_token
555 and cygwin_logon_user with only eight years of delay.
556 * shared.sgml: Remove file.
557 * include/sys/cygwin.h (cygwin32_attach_handle_to_fd): Move declaration
558 into fully deprecated function block.
559 (cygwin_logon_user): Move declaration down to declaration of
560 cygwin_set_impersonation_token.
561
562 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
563
564 * syscalls.cc (rename): Just return with 0 if filenames are identical,
565 per POSIX. Drop comment added in previous patch.
566
567 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
568
569 * syscalls.cc (rename): Handle a special case of trying to rename a
570 mount point.
571
572 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
573
574 * environ.h: Fix comment.
575 * winsup.h: Ditto. Reflect the fact that CYG_MAX_PATH is deprecated.
576
577 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
578
579 * pipe.cc (fhandler_pipe::create_selectable): Use MAX_PATH instead of
580 CYG_MAX_PATH.
581 * tty.cc (tty_list::init_session): Ditto.
582 (tty::alive): Ditto.
583 (tty::open_mutex): Ditto.
584 (tty::create_inuse): Ditto.
585 (tty::get_event): Ditto.
586
587 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
588
589 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Disable
590 munging. Convert all chars in the 0xf0xx area to it's ascii equivalent.
591 * path.cc (normalize_posix_path): Don't treat "X:foo" as windows path,
592 only "X:\foo".
593 (tfx_chars): New transformation table for special DOS chars.
594 (tfx_chars_managed): Ditto, plus transformation of uppercase ASCII
595 chars.
596 (transform_chars): New function.
597 (get_nt_native_path): Make static. Call transform_chars for all valid
598 FS paths. Get additional flag if file is managed or not. Accommodate
599 throughout.
600 (getfileattr): Get additional flag if file is managed or not.
601 Accommodate throughout.
602 (path_conv::check): Disable special handling for trailing dots and
603 spaces.
604 (mount_item::build_win32): Disable code for managed paths.
605 (mount_info::conv_to_posix_path): Ditto.
606 * path.h (get_nt_native_path): Remove declaration.
607
608 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
609
610 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
611 copy filename twice in the non-managed case.
612
613 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
614
615 * winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767.
616 Accommodate change throughout.
617
618 * cygwin.din (cygwin_conv_path): Export.
619 (cygwin_conv_path_list): Export.
620 (cygwin_create_path): Export.
621 * dcrt0.cc (dll_crt0_1): Use cygwin_conv_path.
622 * dtable.cc (handle_to_fn): Ditto. Don't expect UNICODE_STRING being
623 0-terminated.
624 * environ.cc (env_plist_to_posix): New helper function.
625 (env_plist_to_win32): Ditto.
626 (env_path_to_posix): Ditto.
627 (env_path_to_win32): Ditto.
628 (return_MAX_PATH): Remove.
629 (conv_envvars): Use new helper functions. Drop removed members.
630 (win_env::operator =): Accommodate removal of path length functions.
631 (win_env::add_cache): Accommodate new env helper function API.
632 (posify): Ditto.
633 * environ.h (struct win_env): Ditto. Remove path length function
634 pointers since they are unused.
635 * path.cc (warn_msdos): Use cygwin_conv_path.
636 (getfileattr): Use new tmp_pathbuf::u_get method.
637 (fillout_mntent): Ditto.
638 (symlink_info::check): Ditto.
639 (path_conv::check): Use sizeof (WCHAR) instead of constant 2.
640 (symlink_info::check_reparse_point): Ditto.
641 (conv_path_list): Get max size of target string as argument. Call
642 cygwin_conv_path as helper function.
643 (cygwin_conv_path): New function.
644 (cygwin_create_path): New function.
645 (cygwin_conv_to_win32_path): Just call cygwin_conv_path with size set
646 to MAX_PATH.
647 (cygwin_conv_to_full_win32_path): Ditto.
648 (cygwin_conv_to_posix_path): Ditto.
649 (cygwin_conv_to_full_posix_path): Ditto.
650 (conv_path_list_buf_size): Add FIXME comment.
651 (env_PATH_to_posix): Rename from env_win32_to_posix_path_list.
652 Add size argument as required for env helper functions.
653 (cygwin_win32_to_posix_path_list): Call conv_path_list with size set to
654 MAX_PATH.
655 (cygwin_posix_to_win32_path_list): Ditto.
656 (cygwin_conv_path_list): New function.
657 (cwdstuff::get): Fix length argument in call to sys_wcstombs.
658 * spawn.cc (find_exec): Use cygwin_conv_path_list.
659 * tls_pbuf.h (tmp_pathbuf::u_get: New method.
660 * uinfo.cc (cygheap_user::ontherange): Allocate temporary path buffers
661 using tmp_pathbuf. Use cygwin_conv_path.
662 * winf.cc (av::unshift): Use cygwin_conv_path.
663 * include/cygwin/version.h: Bump API minor number.
664 * include/sys/cygwin.h: Comment out old cygwin32_XXX API.
665 Mark old path handling API as deprecated.
666 (cygwin_conv_path_t): Typedef. Define values.
667 (cygwin_conv_path): Declare.
668 (cygwin_create_path): Declare.
669 (cygwin_conv_path_list): Declare.
670
671 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
672
673 * dlfcn.cc (get_full_path_of_dll): Allow paths up to PATH_MAX.
674 (dlopen): Call get_full_path_of_dll with path buffer allocate by
675 tmp_pathbuf.
676
677 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
678
679 * spawn.cc (find_exec): Use tmp_pathbuf to allocate path buffer.
680
681 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
682
683 * dtable.cc (dtable::init_std_file_from_handle): Use tmp_pathbuf to
684 allocate path buffer.
685 (handle_to_fn): Ditto. Allocate fnbuf big enough to get long path
686 names.
687
688 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
689
690 * path.cc (cwdstuff::set): Make sure drive_length is 0 for virtual
691 paths. Add comments.
692 * spawn.cc (spawn_guts): Don't allow to start a native Win32 application
693 from a long path or a virtual path. Print an error message to stderr.
694
695 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
696
697 * environ.cc (parse_options): Use tmp_pathbuf to allocate buffer.
698 (regopt): Take tmp buffer as additional argument.
699 (environ_init): Alllcate tmpbuf earlier. Use as temporary buffer in
700 call to regopt.
701 * tls_pbuf.cc (tmp_pathbuf::c_get): Allocate one additional char.
702 (tmp_pathbuf::w_get): Allocate one additional WCHAR.
703 * winf.cc (av::unshift): Use tmp_pathbuf to allocate buffer.
704
705 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
706
707 * syscalls.cc (sync): Use MAX_PATH rather than CYG_MAX_PATH.
708
709 2008-03-10 Corinna Vinschen <corinna@vinschen.de>
710
711 * fhandler.h (class fhandler_console): Add write_buf as pointer to
712 temporary buffer space.
713 * fhandler_console.cc (CONVERT_LIMIT): Define as NT_MAX_PATH. Add
714 comment.
715 (fhandler_console::write_normal): Use write_buf throughout.
716 (fhandler_console::write): Use tmp_pathbuf to allocate write_buf.
717
718 2008-03-10 Corinna Vinschen <corinna@vinschen.de>
719
720 * fhandler_console.cc (fhandler_console::write_normal): Don't print
721 chars marked as ERR chars.
722
723 2008-03-10 Corinna Vinschen <corinna@vinschen.de>
724
725 * fhandler.h (dev_console::con_to_str): Declare returning DWORD.
726 * fhandler_console.cc (dev_console::con_to_str): Return number of
727 multibyte char bytes.
728 (fhandler_console::read): Set nread to number of multibyte char bytes
729 returned from con_to_str.
730 (fhandler_console::write_normal): Reorder trunc buffer preocessing.
731 Return after writing valid multibyte sequence out of trunc buffer.
732 Change comments slightly.
733
734 2008-03-08 Corinna Vinschen <corinna@vinschen.de>
735
736 * fhandler_disk_file.cc (DIR_BUF_SIZE): Define required space for file
737 name in terms of sizeof(WCHAR).
738 (fhandler_disk_file::readdir_helper): Convert *all* of fname.
739 * path.cc (fillout_mntent): Use tmp_pathbuf for path buffer.
740 (symlink_worker): Ditto.
741 (SCAN_JUSTCHECKTHIS): New state for suffix_scan to define
742 that only the actual name gets cheked and a suffix is never attached.
743 (suffix_scan::has): If filename + suffix would be > NAME_MAX, start
744 in SCAN_JUSTCHECKTHIS state.
745 (suffix_scan::next): Add case for SCAN_JUSTCHECKTHIS.
746 (symlink_info::check): Use tmp_pathbuf for path buffer. Goto
747 file_not_symlink in case of invalid file name.
748 (realpath): Use tmp_pathbuf for path buffer.
749
750 2008-03-07 Brian Dessent <brian@dessent.net>
751
752 * dtable.cc (handle_to_fn): Null-terminate posix_fn in the case
753 of justslash = true.
754
755 2008-03-07 Brian Dessent <brian@dessent.net>
756
757 * fhandler.cc (fhandler_base::open): Use %S for PUNICODE_STRING.
758 * syscalls.cc (setmode): Ditto.
759
760 2008-03-07 Corinna Vinschen <corinna@vinschen.de>
761
762 * fhandler_socket.cc (fhandler_socket::sendto): Never send more than
763 64K. Add comment to explain why.
764 (fhandler_socket::sendmsg): Ditto.
765
766 2008-03-07 Corinna Vinschen <corinna@vinschen.de>
767
768 * Makefile.in (DLL_OFILES): Add tls_pbuf.o.
769 * autoload.cc (CreateDesktopW): Replace CreateDesktopA.
770 (CreateWindowStationW): Replace CreateWindowStationA.
771 (GetUserObjectInformationW): Replace GetUserObjectInformationA.
772 * cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH.
773 * cygtls.cc (_cygtls::remove): Free temporary TLS path buffers.
774 * cygtls.h (TP_NUM_C_BUFS): Define.
775 (TP_NUM_W_BUFS): Define.
776 (class tls_pathbuf): New class to store pointers to thread local
777 temporary path buffers.
778 (_local_storage::pathbufs): New member.
779 * environ.cc (win_env::add_cache): Use temporary TLS path buffer instead
780 of stack based buffer.
781 (posify): Get temporary outenv buffer from calling function.
782 (environ_init): Create temporary TLS path buffer for posify.
783 (build_env): Create Windows environment block as WCHAR buffer.
784 * environ.h (build_env): Change declaration accordingly.
785 * external.cc (sync_winenv): Accommodate build_env change.
786 * fhandler_console.cc (fhandler_console::need_invisible): Use
787 GetUserObjectInformationW and CreateWindowStationW.
788 * fhandler_process.cc (format_process_maps): Use temporary TLS path
789 buffer instead of stack based buffer.
790 * fork.cc (frok::parent): Convert to use CreateProcessW.
791 * path.cc: Throughout use temporary TLS path buffers instead of stack
792 based buffer. Replace checks for CYG_MAX_PATH by checks for
793 NT_MAX_PATH.
794 (getfileattr): New function to replace GetFileAttributesA.
795 (normalize_win32_path): Remove Win32 and NT long path prefixes.
796 (getwd): Assume PATH_MAX + 1 buffer per SUSv3.
797 * path.h (class path_conv): Set path buffer to size NT_MAX_PATH.
798 (iswdrive): Define.
799 * pinfo.cc (commune_process): Use temporary TLS path buffer instead of
800 stack based buffer.
801 * registry.cc (get_registry_hive_path): Ditto.
802 (load_registry_hive): Ditto.
803 * spawn.cc (spawn_guts): Convert to use CreateProcessW and
804 CreateProcessAsUserW.
805 (av::fixup): Open/close file using NtOpenFile/NtClose.
806 * syscalls.cc (mknod_worker): Allow PATH_MAX file name.
807 (mknod32): Ditto.
808 (getusershell): Ditto.
809 * tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf
810 methods.
811 * tls_pbuf.h: New header for files using tmp_pathbuf.
812 * tlsoffsets.h: Regenerate.
813 * winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow.
814
815 2008-03-06 Corinna Vinschen <corinna@vinschen.de>
816
817 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
818
819 2008-03-06 Corinna Vinschen <corinna@vinschen.de>
820
821 * fhandler.cc (fhandler_base::open_): Add missing test for O_CREAT.
822 Fix comment.
823
824 2008-03-05 Corinna Vinschen <corinna@vinschen.de>
825
826 * child_info.h (~child_info_spawn): Check moreinfo->myself_pinfo for
827 NULL before closing.
828 * spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely
829 in case of failing CloseProcess.
830
831 * fhandler.cc (fhandler_base::open_): Return EISDIR when trying to
832 create a directory.
833 * path.cc (path_conv::check): If input path had a trailing dir
834 separator, tack it on to the native path if directory doesn't exist.
835
836 2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
837
838 * cygtls.cc (_cygtls::init_exception_handler): Semi-revert to making
839 only ourselves the exception handler and nothing else.
840 * exceptions.cc (open_stackdumpfile): Use correct format specifiers for
841 unicode when printing the name of the stackdump file.
842 (stack_info::walk): Stop walking if ebp points into cygwin itself.
843 (_cygtls::handle_exceptions): Detect when signal is masked and treat as
844 if it was not caught. Reinitialize exception handler to known state to
845 avoid subsequent attempts to call Windows exception handlers if an
846 exception occurs in a signal handler. Revert to a 'return 0' rather
847 than using a goto.
848
849 * strfuncs.cc (sys_wcstombs_alloc): Minor formatting tweak.
850 * winsup.h: Fix comment typo.
851
852 2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
853
854 * smallprint.cc (__small_vsprintf): Free allocated buffer rather than
855 pointer into the buffer.
856
857 2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
858
859 * cygtls.h (_cygtls::handle_threadlist_exception): Eliminate.
860 (_cygtls::init_threadlist_exceptions): Ditto.
861 * cygtls.cc (_cygtls::handle_threadlist_exception): Eliminate.
862 (_cygtls::init_threadlist_exceptions): Ditto.
863 (_cygtls::find_tls): Use myfault handling to deal with errors caused by
864 nonexistent threads.
865 * sigproc.cc (wait_sig): Eliminate call to init_threadlist_exceptions.
866
867 2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
868
869 * cygtls.cc (_cygtls::init_exception_handler): Just return.
870
871 2008-03-01 Corinna Vinschen <corinna@vinschen.de>
872
873 * exceptions.cc (_cygtls::handle_exceptions): Only call rtl_unwind when
874 exiting. Just return, don't set thread context.
875 * gendef (_setjmp): Store %fs:0 in jmp_buf.
876 (_sjfault): Ditto.
877 (_ljfault): Restore %fs:0 from jmp_buf.
878 (_longjmp): Ditto.
879
880 2008-02-29 Corinna Vinschen <corinna@vinschen.de>
881
882 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call close_fs
883 instead of close to avoid calling close from wrong class when changing
884 a file system based device node.
885 (fhandler_disk_file::fchown): Ditto.
886 (fhandler_disk_file::facl): Ditto.
887
888 2008-02-28 Corinna Vinschen <corinna@vinschen.de>
889
890 * exceptions.cc (_cygtls::handle_exceptions): When being debugged,
891 leave through SetThreadContext, too, to keep exception handler stack
892 intact.
893
894 2008-02-28 Corinna Vinschen <corinna@vinschen.de>
895
896 * exceptions.cc (open_stackdumpfile): Add comments.
897
898 2008-02-28 Corinna Vinschen <corinna@vinschen.de>
899
900 * exceptions.cc (open_stackdumpfile): Use NtCreateFile to create
901 stackdump file.
902
903 2008-02-27 Corinna Vinschen <corinna@vinschen.de>
904
905 * exceptions.cc (stack_info::walk): Fix typo.
906
907 2008-02-27 Corinna Vinschen <corinna@vinschen.de>
908
909 * cygtls.cc (_cygtls::init_exception_handler): Fix comment.
910
911 2008-02-27 Corinna Vinschen <corinna@vinschen.de>
912
913 * (struct __DIR_cache): Switch order of members so that the buffer
914 given to NtQueryDirectoryFile is 8 byte aligned.
915
916 2008-02-27 Christopher Faylor <me+cygwin@cgf.cx>
917
918 * cygtls.cc (_cygtls::handle_threadlist_exception): Make it clear that
919 the function never actually returns.
920 * exceptions.cc (_cygtls::handle_exceptions): Jump out of function
921 rather than returning to avoid meddling by previously installed
922 exception handlers.
923
924 2008-02-25 Corinna Vinschen <corinna@vinschen.de>
925
926 * dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is
927 enabled. Replace calls to GetEnvironmentVariable by calls to
928 GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA
929 with NULL buffer.
930 (cygbench): Ditto, drop local buffer.
931 * environ.cc (getearly): Call GetEnvironmentVariableA.
932 (environ_init): Retrieve unicode environment and convert to current
933 codepage locally.
934 (getwinenveq): Ditto.
935 * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling
936 convention.
937 * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve
938 required buffer length.
939 * fork.cc (frok::child): Call GetEnvironmentVariableA.
940 * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs.
941 * sec_auth.cc: Ditto.
942 * strfuncs.cc (sys_wcstombs_alloc): Fix formatting.
943 (sys_mbstowcs): Change arguments to allow specifying a source string
944 length.
945 (sys_mbstowcs_alloc): Ditto.
946 * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in
947 calls to sys_mbstowcs.
948 * winsup.h (sys_mbstowcs): Adjust declaration.
949 (sys_mbstowcs_alloc): Ditto.
950
951 2008-02-20 Corinna Vinschen <corinna@vinschen.de>
952
953 * path.cc (cwdstuff::set): Revert error handling change in case
954 DuplicateHandle fails, because it breaks Vista/Longhorn workaround.
955
956 2008-02-19 Christopher Faylor <me+cygwin@cgf.cx>
957
958 * sigproc.cc (sig_send): Use sigmask of target thread if it is
959 specified otherwise default to main sigmask.
960
961 2008-02-16 Corinna Vinschen <corinna@vinschen.de>
962
963 * fhandler.cc (fhandler_base::fpathconf): Fix _PC_NAME_MAX and
964 _PC_PATH_MAX cases.
965
966 2008-02-15 Corinna Vinschen <corinna@vinschen.de>
967
968 * include/sys/cygwin.h (__INT_MAX_PATH): Remove.
969 (external_pinfo): Convert program_long to pointer.
970 * external.cc (fillout_pinfo): Add buffer for program_long value.
971
972 2008-02-15 Corinna Vinschen <corinna@vinschen.de>
973
974 * include/sys/cygwin.h (__INT_MAX_PATH): Define to 32K.
975 (external_pinfo): Set size of program_long to __INT_MAX_PATH.
976
977 2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
978
979 * include/sys/cygwin.h (external_pinfo): Define program_long size using
980 external buffer size rather than cygwin-internal buffer size.
981
982 2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
983
984 Perform whitespace cleanup throughout.
985
986 * dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards
987 compatibility.
988 (check_sanity_and_sync): Ditto.
989 * winsup.h (SIGTOMASK): Ditto. Just use constant in signal
990 calculation.
991 * include/cygwin/version: Remove backwards signal mask compatibility
992 define.
993
994 * path.cc (symlink_info::check_sysfile): Cosmetic change.
995
996 * registry.cc (get_registry_hive_path): Remove unneeded variable.
997
998 * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and
999 use either main sigmask or current thread sigmask.
1000 (set_process_mask): Ditto.
1001 (sighold): Ditto.
1002 (sigrelse): Ditto.
1003 (sigset): Ditto.
1004 (set_process_mask_delta): Ditto.
1005 (_cygtls::call_signal_handler): Ditto.
1006 * fhandler_process.cc (format_process_status): Ditto.
1007 * fhandler_termios.cc (fhandler_termios::bg_check): Ditto.
1008 * pinfo.h (class pinfo): Ditto.
1009 * select.cc (pselect): Ditto.
1010 * signal.cc (sigprocmask): Ditto.
1011 (abort): Ditto.
1012 (sigpause): Ditto.
1013 (sigsend): Ditto.
1014 (wait_sig): Ditto.
1015 * thread.h (pthread::parent_tls): New member.
1016 * thread.cc (pthread::pthread): Record parent_tls here.
1017 (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
1018
1019 2008-02-14 Corinna Vinschen <corinna@vinschen.de>
1020
1021 * cygheap.cc (cwcsdup): New function.
1022 (cwcsdup1): New function.
1023 * cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR.
1024 (cwcsdup): Declare.
1025 (cwcsdup1): Declare.
1026 * registry.cc (get_registry_hive_path): Use WCHAR instead of char
1027 throughout.
1028 (load_registry_hive): Ditto.
1029 * registry.h (get_registry_hive_path): Change declaration accordingly.
1030 (load_registry_hive): Ditto.
1031 * sec_helper.cc (cygpsid::string): New method returning PWCHAR.
1032 * security.h (cygpsid::string): Declare.
1033 * syscalls.cc (seteuid32): Convert local name var to WCHAR.
1034 * uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers
1035 to WCHAR. Call sys_wcstombs_alloc to generate puserprof buffer.
1036
1037 * winsup.h: Fix comment.
1038 (NT_MAX_PATH): New definition for maximum internal path length.
1039 Use throughout where appropriate.
1040 * include/limits.h (PATH_MAX): Set to 4096 as on Linux.
1041
1042 2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
1043
1044 * configure.in: Remove non-working options.
1045 * configure: Regenerate.
1046
1047 2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
1048
1049 * syscalls.cc (_isatty): Define as an alias to isatty to override
1050 newlib version.
1051
1052 * thread.cc (pthread_kill): Deal with signal 0 as per POSIX and also
1053 avoid manipulating an invalid thread.
1054
1055 2008-02-13 Corinna Vinschen <corinna@vinschen.de>
1056
1057 * posix.sgml: Move llrint, llrintf, llrintl, lrintl, rintl, wcstol,
1058 wcstoll, wcstoul, wcstoull, wcsxfrm from unimplemented to implemented
1059 POSIX interfaces.
1060 Change headline of "GNU extensions" to "GNU and Linux extensions".
1061 Add fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, lgetxattr,
1062 listxattr, llistxattr, lremovexattr, lsetxattr, removexattr, setxattr,
1063 wcpcpy and wcpncpy to list of implemented GNU functions.
1064
1065 2008-02-13 Corinna Vinschen <corinna@vinschen.de>
1066
1067 * cygtls.cc (_cygtls::init_exception_handler): Revert patch
1068 from 2005-12-02.
1069 * exceptions.cc (stack_info::walk): Add workaround for NT 5.2
1070 64 bit OSes.
1071 * wincap.h (wincaps::has_restricted_stack_args): New element.
1072 * wincap.cc: Implement above element throughout.
1073 (wincapc::init): Reset has_restricted_stack_args if not running
1074 under WOW64.
1075
1076 2008-02-11 Corinna Vinschen <corinna@vinschen.de>
1077
1078 * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): Remove unused
1079 attr.
1080 (fhandler_disk_file::fsetxattr): Ditto.
1081 * include/attr/xattr.h: New file.
1082
1083 2008-02-11 Corinna Vinschen <corinna@vinschen.de>
1084
1085 * dcrt0.cc (dll_crt0_1): Fix typo in call to sys_wcstombs.
1086 * miscfuncs.cc (next_char): Initialize ret to keep gcc happy.
1087
1088 2008-02-10 Corinna Vinschen <corinna@vinschen.de>
1089
1090 * Makefile.in (DLL_OFILES): Add ntea.o.
1091 * cygwin.din (getxattr, listxattr, removexattr, setxattr, lgetxattr,
1092 llistxattr, lremovexattr, lsetxattr, fgetxattr, flistxattr,
1093 fremovexattr, fsetxattr): Export Linux extended attribute functions.
1094 Sort.
1095 * errno.cc (errmap): Add mappings for ERROR_EAS_DIDNT_FIT,
1096 ERROR_EAS_NOT_SUPPORTED, ERROR_EA_LIST_INCONSISTENT,
1097 ERROR_EA_TABLE_FULL, ERROR_FILE_CORRUPT, ERROR_INVALID_EA_NAME.
1098 * fhandler.h (class fhandler_base): Declare new fgetxattr and
1099 fsetxattr methods.
1100 (class fhandler_disk_file): Ditto.
1101 * fhandler.cc (fhandler_base::fgetxattr): New method.
1102 (fhandler_base::fsetxattr): New method.
1103 * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): New method.
1104 (fhandler_disk_file::fsetxattr): New method.
1105 * ntdll.h (STATUS_EA_TOO_LARGE): Define.
1106 (STATUS_NONEXISTENT_EA_ENTRY): Define.
1107 (STATUS_NO_EAS_ON_FILE): Define.
1108 * ntea.cc (read_ea): Rewrite for long pathnames and for using with
1109 Linux extended attribute functions.
1110 (write_ea): Ditto.
1111 (getxattr_worker): New static function.
1112 (getxattr): New function.
1113 (lgetxattr): New function.
1114 (fgetxattr): New function.
1115 (listxattr): New function.
1116 (llistxattr): New function.
1117 (flistxattr): New function.
1118 (setxattr_worker): New static function.
1119 (setxattr): New function.
1120 (lsetxattr): New function.
1121 (fsetxattr): New function.
1122 (removexattr): New function.
1123 (lsetxattr): New function.
1124 (fsetxattr): New function.
1125 * security.h (read_ea): Change declaration according to above changes.
1126 (write_ea): Ditto.
1127 * include/cygwin/version.h: Bump API minor version.
1128
1129 2008-02-10 Corinna Vinschen <corinna@vinschen.de>
1130
1131 * libc/ftw.cc (ftw): Allow nfds <= 0 for glibc compatibility.
1132 * libc/nftw.c (nftw): Ditto.
1133
1134 2008-02-07 Corinna Vinschen <corinna@vinschen.de>
1135
1136 * dtable.cc (dtable::init_std_file_from_handle): Set access to
1137 read/write if handle is connected to a tty or console.
1138 * fhandler_dsp.cc (fhandler_dev_dsp::dup): Set open flags correctly
1139 after duplicating from archetype.
1140 * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
1141 (fhandler_pty_master::dup): Ditto.
1142
1143 2008-02-06 Corinna Vinschen <corinna@vinschen.de>
1144
1145 * miscfuncs.cc (next_char): Fix typos in comment.
1146 * strfuncs.cc: Remove cygserver guards.
1147
1148 2008-02-06 Corinna Vinschen <corinna@vinschen.de>
1149
1150 * fhandler.h (fhandler_console::trunc_buf): Add to use as cache for
1151 truncated multibyte characters on input.
1152 (fhandler_console::write_replacement_char): Declare new method.
1153 * fhandler_console.cc (CONVERT_LIMIT): Raise to 64K.
1154 (fhandler_console::fhandler_console): Initialize trunc_buf.
1155 (ERR): Define as independent value again.
1156 (fhandler_console::write_replacement_char): New method to print
1157 replacement chars.
1158 (fhandler_console::write_normal): Add handling for truncated multibyte
1159 sequences. Call next_char instead of pathetic CharNextExA function.
1160 Don't change src, rather just work with found later on.
1161 * miscfuncs.cc (is_cp_multibyte): Move here from strfuncs.cc.
1162 Don't call Windows function, restrict to well-known ANSI/OEM codepages
1163 and UTF-8.
1164 (next_char): Call CharNextExA only for doublebyte codepages.
1165 Implement for UTF-8 here.
1166 * strfuncs.cc (is_cp_multibyte): Move to miscfuncs.cc.
1167 * winsup.h (next_char): Declare.
1168 * include/limits.h (MB_LEN_MAX): Set to maximum value of MB_CUR_MAX
1169 as defined by newlib for now.
1170
1171 2008-02-05 Corinna Vinschen <corinna@vinschen.de>
1172
1173 * autoload.cc (CharToOemA): Remove.
1174 (CharNextExA): Define.
1175 * environ.cc (codepage_init): Un-static. Set active_codepage to
1176 active codepage. Default to ansi regardless of buf pointer.
1177 * fhandler.h (dev_console::get_console_cp): New method.
1178 (dev_console::con_to_str): Change declaration according to new
1179 implementation.
1180 (dev_console::str_to_con): Ditto.
1181 * fhandler_console.cc (cp_convert): Remove.
1182 (dev_console::con_to_str): Redefine to take WCHAR as incoming console
1183 char.
1184 (dev_console::get_console_cp): Return correct codepage according to
1185 alternate_charset_active setting.
1186 (dev_console::str_to_con): Redefine to create WCHAR buffer for console
1187 output.
1188 (fhandler_console::read): Read console input as WCHARs.
1189 (base_chars): Fix typo in comment.
1190 (fhandler_console::char_command): Save and restore console output
1191 buffer using UNICODE functions.
1192 (fhandler_console::write_normal): Convert to write output in UNICODE.
1193 Use CharNextExA to recognize multibyte characters in input. Workaround
1194 problem with UTF-8 and MultiByteToWideChar. Simplify the loop for
1195 printing "normal" characters.
1196 * strfuncs.cc (active_codepage): New variable to store active codepage.
1197 (get_cp): Call codepage_init() if active_codepage is uninitialized.
1198 Just return active_codepage.
1199 (is_cp_multibyte): New function.
1200 * winsup.h (active_codepage): Declare.
1201 (codepage_init): Declare.
1202 (is_cp_multibyte): Declare.
1203
1204 2008-02-03 Brian Dessent <brian@dessent.net>
1205
1206 * smallprint.cc (__small_vsprintf): Use HEAP_NOTHEAP for type.
1207 * strfuncs.cc (sys_wcstombs_alloc): Guard use of ccalloc
1208 to !__OUTSIDE_CYGWIN__ for use in cygserver.
1209 (sys_mbstowcs_alloc): Ditto.
1210
1211 2008-02-01 Corinna Vinschen <corinna@vinschen.de>
1212
1213 * miscfuncs.cc (cygwin_wcsncasecmp): Never access more than n
1214 characters.
1215 (cygwin_strncasecmp): Ditto. Fix for strings longer than n.
1216
1217 2008-02-01 Corinna Vinschen <corinna@vinschen.de>
1218
1219 * string.h: Re-enable inline strcasematch and strncasematch
1220 implementations and rename to ascii_strcasematch/ascii_strncasematch.
1221 * dcrt0.cc: Replace str[n]casematch with ascii_str[n]casematch where
1222 applicable.
1223 * environ.cc: Ditto.
1224 * fhandler_process.cc: Ditto.
1225 * hookapi.cc: Ditto.
1226 * path.cc: Ditto.
1227 * spawn.cc: Ditto.
1228 * strace.cc: Ditto.
1229 * syscalls.cc: Ditto.
1230 * uinfo.cc: Ditto.
1231 * winf.cc: Ditto.
1232
1233 2008-01-31 Corinna Vinschen <corinna@vinschen.de>
1234
1235 * dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to current
1236 codepage.
1237 * environ.cc (set_file_api_mode): Always set file api to ANSI if not
1238 using the OEM codepage.
1239 (codepage_init): Allow "utf8" codepage.
1240 * fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and
1241 cast as needed. Always convert input to wide char and write
1242 CF_UNICODETEXT to clipboard.
1243 (fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and
1244 convert to current codepage if CYGWIN_NATIVE format is not available.
1245 * fhandler_console.cc: Drop redundant undef.
1246 * smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING
1247 to current codepage for printing.
1248 * strfuncs.cc: Use PWCHAR throughout.
1249 (get_cp): Return CP_UTF8 for utf8_cp codepage setting.
1250 (sys_wcstombs): Allow NULL target buffer.
1251 (sys_wcstombs_alloc): New function.
1252 (sys_mbstowcs_alloc): Ditto.
1253 * winsup.h (codepage_type): Add utf8_cp.
1254 (HEAP_NOTHEAP): Define.
1255 (sys_wcstombs_alloc): Declare.
1256 (sys_mbstowcs_alloc): Declare.
1257
1258 2008-01-31 Corinna Vinschen <corinna@vinschen.de>
1259
1260 * cygheap.h (struct cwdstuff): Add dir member to store cwd handle.
1261 (cwdstuff::get_handle): New method.
1262 * path.cc (cwdstuff::set): When doit is true, always try to get
1263 directory handle. Fail if duplicating handle fails. Store handle
1264 in dir. Fix potential SEGV when setting drive_length.
1265
1266 2008-01-28 Corinna Vinschen <corinna@vinschen.de>
1267
1268 * path.cc: Fix Samba version in comment.
1269
1270 2008-01-24 Corinna Vinschen <corinna@vinschen.de>
1271
1272 * path.cc (fs_info::update): Fix old-style Samba test to support
1273 recent as well as upcoming Samba releases.
1274
1275 2008-01-22 Corinna Vinschen <corinna@vinschen.de>
1276
1277 * ntdll.h (struct _FILE_FS_OBJECTID_INFORMATION): Define.
1278 * path.cc (struct smb_extended_info): Define.
1279 (fs_info::update): Request object id info to get Samba information.
1280 Set flags according to new implementation.
1281 * path.h (struct fs_info): Add samba_version to status_flags.
1282 Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG.
1283
1284 2008-01-21 Corinna Vinschen <corinna@vinschen.de>
1285
1286 * fhandler_disk_file.cc (fhandler_disk_file::link): Open file with
1287 READ_CONTROL for Vista/Longhorn's sake.
1288
1289 2008-01-15 Corinna Vinschen <corinna@vinschen.de>
1290
1291 * Makefile.in (install-libs): Overwrite newlib's libg.a with symlink
1292 to libcygwin.a.
1293
1294 2008-01-15 Corinna Vinschen <corinna@vinschen.de>
1295
1296 * Makefile.in (DLL_OFILES): Remove memmem.o.
1297 * memmem.cc: Remove in favor of newlib implementation.
1298
1299 2008-01-07 Corinna Vinschen <corinna@vinschen.de>
1300
1301 * fhandler.h: Update copyright.
1302 * include/limits.h: Ditto.
1303
1304 2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
1305
1306 * fhandler.h (fhandler_base::is_tty): Make bool.
1307 (fhandler_serial::is_tty): Ditto.
1308 (fhandler_termios::is_tty): Ditto.
1309 (fhandler_base::is_slow): Return bool value.
1310 (fhandler_socket::is_slow): Ditto.
1311 (fhandler_serial::is_slow): Ditto.
1312 (fhandler_console::is_slow): Ditto.
1313 (fhandler_tty_common::is_slow): Ditto.
1314 (fhandler_tty_master::is_slow): Ditto.
1315 (fhandler_dev_null::is_slow): Ditto.
1316
1317 2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
1318
1319 * include/limits.h (TTY_NAME_MAX): Increase size to same as linux to
1320 allow for (at least) null terminating byte for "/dev/console".
1321
1322 2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
1323
1324 * tty.cc: Update copyright.
1325 * pipe.cc: Ditto.
1326
1327 2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
1328
1329 * newsym: First stab at understanding data as well as functions.
1330
1331 * pipe.cc (fhandler_pipe::init): Move more intelligence here.
1332 (fhandler_pipe::create): Simplify based on above change.
1333
1334 * tty.cc (tty_list::allocate): Remove non-NT code.
1335
This page took 0.089316 seconds and 4 git commands to generate.