OSDN Git Service

* new-features.sgml (ov-new1.7.8): Document new C99 complex API.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / doc / faq-using.xml
1 <!-- faq-problems.xml -->
2 <qandaentry id="faq.using.missing-dlls">
3 <question><para>Why can't my application locate cygncurses-8.dll?  or cygintl-3.dll?  or cygreadline6.dll?  or ...?</para></question>
4 <answer>
5
6 <para>Well, something has gone wrong somehow...
7 </para>
8 <para>To repair the damage, you must run Cygwin Setup again, and re-install the
9 package which provides the missing DLL package.
10 </para>
11 <para>If you already installed the package at one point, Cygwin Setup won't
12 show the option to install the package by default.  In the
13 ``Select packages to install'' dialog, click on the <literal>Full/Part</literal>
14 button.  This lists all packages, even those that are already
15 installed.  Scroll down to locate the missing package, for instance
16 <literal>libncurses8</literal>.  Click on the ``cycle'' glyph until it says
17 ``Reinstall''.  Continue with the installation.
18 </para>
19 <para>For a detailed explanation of the general problem, and how to extend
20 it to other missing DLLs and identify their containing packages, see
21 <ulink url="http://cygwin.com/ml/cygwin/2002-01/msg01619.html">http://cygwin.com/ml/cygwin/2002-01/msg01619.html</ulink>.
22 </para>
23 </answer></qandaentry>
24
25 <qandaentry id="faq.using.slow">
26 <question><para>Why is Cygwin suddenly <emphasis>so</emphasis> slow?</para></question>
27 <answer>
28
29 <para>If suddenly <emphasis>every</emphasis> command takes a
30 <emphasis>very</emphasis> long time, then something is probably attempting to 
31 access a network share.  You may have the obsolete <literal>//c</literal>
32 notation in your PATH or startup files.  Using <literal>//c</literal> means
33 to contact the <emphasis>network server</emphasis> <literal>c</literal>, which
34 will slow things down tremendously if it does not exist.  
35 </para>
36 </answer></qandaentry>
37
38 <qandaentry id="faq.using.shares">
39 <question><para>Why can't my services access network shares?</para></question>
40 <answer>
41
42 <para>If your service is one of those which switch the user context
43 (sshd, inetd, etc), then it depends on the method used to switch to
44 another user.  This problem as well as its solution is described in
45 detail in the Cygwin User's Guide, see
46 <ulink url="http://cygwin.com/cygwin-ug-net/ntsec.html" />.
47 </para>
48 <para>Workarounds include using public network share that does not require
49 authentication (for non-critical files), providing your password to a
50 <command>net use</command> command, or running the service as your own
51 user with <literal>cygrunsrv -u</literal> (see
52 <literal>/usr/share/doc/Cygwin/cygrunsrv.README</literal> for more
53 information).
54 </para>
55 </answer></qandaentry>
56
57 <qandaentry id="faq.using.path">
58 <question><para>How should I set my PATH?</para></question>
59 <answer>
60
61 <para>This is done for you in the file /etc/profile, which is sourced by bash
62 when you start it from the Desktop or Start Menu shortcut, created by
63 <literal>setup.exe</literal>.  The line is
64 </para>
65 <screen>
66         PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
67 </screen>
68
69 <para>Effectively, this <emphasis role='bold'>prepends</emphasis> /usr/local/bin and /usr/bin to your
70 Windows system path.  If you choose to reset your PATH, say in
71 $HOME/.bashrc, or by editing etc/profile directly, then you should
72 follow this rule.  You <emphasis role='bold'>must</emphasis> have <literal>/usr/bin</literal> in your PATH
73 <emphasis role='bold'>before</emphasis> any Windows system directories.  (And you must not omit
74 the Windows system directories!)  Otherwise you will likely encounter
75 all sorts of problems running Cygwin applications.
76 </para>
77 <para>If you're using another shell than bash (say, tcsh), the mechanism
78 is the same, just the names of the login scripts are different.
79 </para>
80 </answer></qandaentry>
81
82 <qandaentry id="faq.using.not-found">
83 <question><para>Bash (or another shell) says "command not found", but it's right there!</para></question>
84 <answer>
85
86 <para>If you compile a program, you might find that you can't run it:
87 </para>
88 <screen>
89         bash$ gcc -o hello hello.c
90         bash$ hello
91         bash: hello: command not found
92 </screen>
93
94 <para>Unlike the Windows default behaviour, Unix shells like bash do not look for programs in <literal>.</literal> (the current
95 directory) by default.  You can add <literal>.</literal> to your PATH (see above),
96 but this is not recommended (at least on UNIX) for security reasons.
97 Just tell bash where to find it, when you type it on the command line:
98 </para>
99 <screen>
100         bash$ gcc -o hello hello.c
101         bash$ ./hello
102         Hello World!
103 </screen>
104
105 </answer></qandaentry>
106
107 <qandaentry id="faq.using.converting-paths">
108 <question><para>How do I convert between Windows and UNIX paths?</para></question>
109 <answer>
110
111 <para>Use the 'cygpath' utility.  Type '<literal>cygpath --help</literal>' for
112 information.  For example (on my installation):
113 <screen>
114         bash$ cygpath --windows ~/.bashrc
115         D:\starksb\.bashrc
116         bash$ cygpath --unix C:/cygwin/bin/cygwin.bat
117         /usr/bin/cygwin.bat
118         bash$ cygpath --unix C:\\cygwin\\bin\\cygwin.bat
119         /usr/bin/cygwin.bat
120 </screen>
121 Note that bash interprets the backslash '\' as an escape character, so
122 you must type it twice in the bash shell if you want it to be recognized
123 as such.
124 </para>
125 </answer></qandaentry>
126
127 <qandaentry id="faq.using.bashrc">
128 <question><para>Why doesn't bash read my .bashrc file on startup?</para></question>
129 <answer>
130
131 <para>Your .bashrc is read from your home directory specified by the HOME
132 environment variable.  It uses /.bashrc if HOME is not set.  So you need
133 to set HOME (and the home dir in your /etc/passwd entry) correctly.
134 </para>
135 </answer></qandaentry>
136
137 <qandaentry id="faq.using.bash-insensitive">
138 <question><para>How can I get bash filename completion to be case insensitive?</para></question>
139 <answer>
140
141 <para>Add the following to your <literal>~/.bashrc</literal> file:
142 </para>
143 <screen>
144         shopt -s nocaseglob
145 </screen>
146
147 <para>and add the following to your <literal>~/.inputrc</literal> file:
148 </para>
149 <screen>
150         set completion-ignore-case on
151 </screen>
152
153 </answer></qandaentry>
154
155 <qandaentry id="faq.using.filename-spaces">
156 <question><para>Can I use paths/filenames containing spaces in them?</para></question>
157 <answer>
158
159 <para>Cygwin does support spaces in filenames and paths.  That said, some
160 utilities that use the library may not, since files don't typically
161 contain spaces in Unix.  If you stumble into problems with this, you
162 will need to either fix the utilities or stop using spaces in filenames
163 used by Cygwin tools.
164 </para>
165 <para>In particular, bash interprets space as a word separator.  You would have
166 to quote a filename containing spaces, or escape the space character.
167 For example:
168 <screen>
169         bash-2.03$ cd '/cygdrive/c/Program Files'
170 </screen>
171 or
172 <screen>
173         bash-2.03$ cd /cygdrive/c/Program\ Files
174 </screen>
175 </para>
176 </answer></qandaentry>
177
178 <qandaentry id="faq.using.shortcuts">
179 <question><para>Why can't I cd into a shortcut to a directory?</para></question>
180 <answer>
181
182 <para>Cygwin does not follow MS Windows Explorer Shortcuts
183 (*.lnk files).  It sees a shortcut as a regular file and this you
184 cannot "cd" into it.
185 </para>
186 <para>Cygwin is also capable to create POSIX symlinks as Windows shortcuts 
187 (see the CYGWIN environment variable option "winsymlinks"), but these
188 shortcuts are different from shortcuts created by native Windows
189 applications.  Windows applications can usually make use of Cygwin
190 shortcuts but not vice versa.  This is by choice.  The reason is that
191 Windows shortcuts may contain a bunch of extra information which would
192 get lost, if, for example, Cygwin tar archives and extracts them as
193 symlinks.
194 </para>
195 <para>Changing a Cygwin shortcut in Windows Explorer usually changes a Cygwin
196 shortcut into a Windows native shortcut.  Afterwards, Cygwin will not
197 recognize it as symlink anymore.
198 </para>
199 </answer></qandaentry>
200
201 <qandaentry id="faq.using.find">
202 <question><para>I'm having basic problems with find.  Why?</para></question>
203 <answer>
204
205 <para>Make sure you are using the find that came with Cygwin and that you
206 aren't picking up the Win32 find command instead.  You can verify that
207 you are getting the right one by doing a "type find" in bash.
208 </para>
209 <para>If the path argument to find, including current directory (default), is
210 itself a symbolic link, then find will not traverse it unless you
211 specify the <literal>-follow</literal> option.  This behavior is different than most
212 other UNIX implementations, but is not likely to change.
213 </para>
214 <para>If find does not seem to be producing enough results, or seems to be
215 missing out some directories, you may be experiencing a problem with one
216 of find's optimisations.  The absence of <literal>.</literal> and <literal>..</literal>
217 directories on some filesystems, such as DVD-R UDF, can confuse find.
218 See the documentation for the option <literal>-noleaf</literal> in the man page.
219 </para>
220 </answer></qandaentry>
221
222 <qandaentry id="faq.using.su">
223 <question><para>Why doesn't <literal>su</literal> work?</para></question>
224 <answer>
225
226 <para>The <literal>su</literal> command has been in and out of Cygwin distributions, but
227 it has not been ported to Cygwin and has never worked.  It is
228 currently installed as part of the sh-utils, but again, it does not work.
229 </para>
230 <para>You should rather install <literal>sshd</literal> and use
231 <literal>ssh username@localhost</literal> as a <literal>su</literal>
232 replacement.
233 </para>
234 <para>For some technical background into why <literal>su</literal> doesn't work, read
235 <ulink url="http://www.cygwin.com/ml/cygwin/2003-06/msg00897.html">http://www.cygwin.com/ml/cygwin/2003-06/msg00897.html</ulink> and
236 related messages.
237 </para>
238 </answer></qandaentry>
239
240 <qandaentry id="faq.using.man">
241 <question><para>Why doesn't man -k (or apropos) work?</para></question>
242 <answer>
243
244 <para>Before you can use <literal>man -k</literal> or <literal>apropos</literal>, you
245 must create the whatis database.  Just run the command
246 </para>
247 <screen>
248         /usr/sbin/makewhatis
249 </screen>
250
251 <para>(it may take a minute to complete).
252 </para>
253 </answer></qandaentry>
254
255 <qandaentry id="faq.using.chmod">
256 <question><para>Why doesn't <literal>chmod</literal> work?</para></question>
257 <answer>
258
259 <para>The most common case is that your <literal>/etc/passwd</literal>
260 or <literal>/etc/group</literal> files are not properly set up. If 
261 <literal>ls -l</literal> shows a group of <literal>mkpasswd</literal> 
262 or <literal>mkgroup</literal>, you need to run one or both of those
263 commands.
264 </para>
265 <para>If you're using FAT32 instead of NTFS, <literal>chmod</literal> 
266 will fail since FAT32 does not provide any permission information.
267 You should really consider converting the drive to NTFS with
268 <literal>CONVERT.EXE</literal>.  FAT and FAT32 are barely good enough
269 for memory cards or USB sticks to exchange pictures...
270 </para>
271 <para>For other cases, understand that Cygwin attempts to show UNIX 
272 permissions based on the security features of Windows, so the Windows 
273 ACLs are likely the source of your problem.  See the Cygwin User's 
274 Guide at <ulink url="http://cygwin.com/cygwin-ug-net/ntsec.html" />
275 for more information on how Cygwin maps Windows permissions.
276 </para>
277 </answer></qandaentry>
278
279 <qandaentry id="faq.using.shell-scripts">
280 <question><para>Why doesn't my shell script work?</para></question>
281 <answer>
282
283 <para>There are two basic problems you might run into.  One is the fact that
284 <command>/bin/sh</command> is really <command>bash</command>.
285 It could be missing some features you might expect in
286 <command>/bin/sh</command>, if you are used to <command>/bin/sh</command>
287 actually being <command>zsh</command> (MacOS X "Panther") or
288 <command>ksh</command> (Tru64).  
289 </para>
290
291 <para>Or, it could be a permission problem, and Cygwin doesn't understand
292 that your script is executable.  On NTFS or NFS just make the script
293 executable using <literal>chmod +x</literal>.  However,
294 <literal>chmod</literal> may not work due to restrictions of the
295 filesystem (see FAQ entry above).  In this case Cygwin must read the
296 contents of files to determine if they are executable.  If your script
297 does not start with
298 </para>
299 <screen>
300         #! /bin/sh
301 </screen>
302
303 <para>(or any path to a script interpreter, it does not have to be /bin/sh)
304 then Cygwin will not know it is an executable script.  The Bourne shell
305 idiom
306 </para>
307 <screen>
308         :
309         # This is the 2nd line, assume processing by /bin/sh
310 </screen>
311
312 <para>also works.
313 </para>
314 <para>Note that you can use the filesystem flag <literal>cygexec</literal> in
315 <filename>/etc/fstab</filename> to force Cygwin to treat all files
316 under the mount point as executable.  This can be used for individual
317 files as well as directories.  Then Cygwin will not bother to read files
318 to determine whether they are executable.
319 </para>
320 </answer></qandaentry>
321
322 <qandaentry id="faq.using.printing">
323 <question><para>How do I print under Cygwin?</para></question>
324 <answer>
325
326 <para>lpr is available in the <ulink url="http://cygwin.com/setup.exe">setup.exe</ulink> cygutils package.  Some <ulink url="http://cygwin.com/ml/cygwin/2008-05/msg00123.html">usage hints</ulink> are available courtesy of Rodrigo Medina.
327 </para>
328 <para>Jason Tishler has written a couple of messages that explain how to use
329 a2ps (for nicely formatted text in PostScript) and ghostscript (to print
330 PostScript files on non-PostScript Windows printers).  Start at
331 <ulink url="http://cygwin.com/ml/cygwin/2001-04/msg00657.html">http://cygwin.com/ml/cygwin/2001-04/msg00657.html</ulink>.  Note that the
332 <literal>file</literal> command is now available as part of Cygwin setup.
333 </para>
334 <para>Alternatively, you can use the Windows <literal>print</literal>
335 command.  (It does not seem to be available on Win9x.)  Type
336 </para>
337 <screen>
338         bash$ print /\?
339 </screen>
340
341 <para>for usage instructions (note the <literal>?</literal> must be escaped from the
342 shell).
343 </para>
344 <para>Finally, you can simply <literal>cat</literal> the file to the printer's share name:
345 </para>
346 <screen>
347         bash$ cat myfile &gt; //host/printer
348 </screen>
349
350 <para>You may need to press the formfeed button on your printer or append the
351 formfeed character to your file.
352 </para>
353 </answer></qandaentry>
354
355 <qandaentry id="faq.using.unicode">
356 <question><para>Why don't international (Unicode) characters work?</para></question>
357 <answer>
358
359 <para>Internationalization is a complex issue. The short answer is that
360 Cygwin relies on the setting of the setting of LANG/LC_xxx environment
361 variables. The long answer can be found in the User's Guide in the
362 section <ulink url="http://cygwin.com/cygwin-ug-net/setup-locale.html">Internationalization</ulink>
363 </para>
364
365 <para> Cygwin uses UTF-8 by default.  To use a different character set, you
366 need to set the LC_ALL, LC_CTYPE or LANG environment variables.</para>
367 </answer></qandaentry>
368
369 <qandaentry id="faq.using.weirdchars">
370 <question><para>My application prints international characters but I only
371 see gray boxes</para></question>
372 <answer>
373 <para>Very likely you didn't set your console character set to the preferred
374 character set before the first Cygwin application was started in the
375 console.  To make sure the console is using the desired character set,
376 make sure that one of the internationalization environment variables
377 LC_ALL, LC_CTYPE, or LANG is set before the first Cygwin process starts.
378 You can do that, for instance, by setting the variable in your
379 <literal>Cygwin.bat</literal> file from which you start your Cygwin shell.
380 </para>
381
382 <para>
383 For a more detailed explanation see the section
384 <ulink url="http://cygwin.com/cygwin-ug-net/setup-locale.html#setup-locale-console">The Windows Console character set</ulink> in the Cygwin User's Guide.</para>
385 </answer></qandaentry>
386
387 <qandaentry id="faq.using.multiple-copies">
388 <question><para>Is it OK to have multiple copies of the DLL?</para></question>
389 <answer>
390 <para>You should only have one copy of the Cygwin DLL on your system.  If you
391 have multiple versions, they will conflict and cause problems.
392 </para>
393 <para>If you get the error "shared region is corrupted" or "shared region
394 version mismatch" it means you have multiple versions of cygwin1.dll
395 running at the same time which conflict with each other.  This could happen,
396 for example, if you update cygwin1.dll without exiting
397 <emphasis>all</emphasis> Cygwin apps (including inetd) beforehand.
398 </para>
399 <para>The only DLL that is sanctioned by the Cygwin project is the one that
400 you get by running <ulink url="http://cygwin.com/setup.exe">setup.exe</ulink>,
401 installed in the directory controlled by this program.  If you have other
402 versions on your system and desire help from the cygwin project, you should
403 delete or rename all DLLs that are not installed by
404 <filename>setup.exe</filename>.
405 </para>
406 <para>If you're trying to find multiple versions of the DLL that are causing
407 this problem, reboot first, in case DLLs still loaded in memory are the
408 cause.  Then use the Windows System find utility to search your whole
409 machine, not just components in your PATH (as 'type' would do) or
410 cygwin-mounted filesystems (as Cygwin 'find' would do).
411 </para>
412 </answer></qandaentry>
413
414 <qandaentry id="faq.using.third-party.multiple-copies">
415 <question><para>
416 I read the above but I want to bundle Cygwin with a product, and ship it
417 to customer sites.  How can I do this without conflicting with any
418 Cygwin installed by the user?
419 </para></question>
420 <answer><para>
421 Third party developers who wish to use Cygwin should check if
422 there is a version of cygwin installed and use the installed
423 version if it is newer, or conditionally upgrade if it is not.
424 (If you write a tool to make this easy, consider contributing
425 it for others to use)
426 </para></answer></qandaentry>
427
428 <qandaentry id="faq.using.bundling-cygwin">
429 <question><para>
430 Can I bundle Cygwin with my product for free?
431 </para></question>
432 <answer><para>
433 Only if you comply with Cygwin's <ulink
434 url="http://cygwin.com/license.html">license</ulink> very carefully.  If you
435 choose to distribute cygwin1.dll, you must be willing to distribute the
436 exact source code used to build that copy of cygwin1.dll as per the
437 terms of the GPL.  If you ship applications that link with cygwin1.dll,
438 you must either provide those applications' source code under a
439 GPL-compatible license, *or* purchase a cygwin license from Red Hat.
440 </para></answer></qandaentry>
441
442 <qandaentry id="faq.using.private-cygwin">
443 <question><para>
444 So I can't install a private version of the Cygwin DLL without
445 conflicting with the system cygwin?
446 </para></question>
447 <answer><para>
448 Actually, if you are very careful, you can have two different versions
449 of the Cygwin DLL installed on your system at the same time but they
450 must be run serially.  The only exception from this rule is, if one of
451 the DLLs is a pre-1.7 DLL and the other is a 1.7.0 or later DLL.  These
452 DLLs can work concurrently without knowing about each other due to
453 massive changes using shared resources in Cygwin 1.7.  However,
454 processes using different DLLs will not interact with each other
455 correctly, so keep them separate except you really really know what
456 you're doing.
457 </para>
458 <para>This usage is not recommeded for novices.  Only limited support will be
459 provided in the <ulink url="http://cygwin.com/lists.html">mailing lists</ulink>
460 if you run into problems.
461 </para></answer></qandaentry>
462
463 <qandaentry id="faq.using.older-cygwin-conflict">
464 <question><para>
465 But doesn't that mean that if some application installs an older Cygwin
466 DLL on top of a newer DLL, my application will break?
467 </para></question>
468 <answer><para>
469 It depends on what you mean by "break".  If the application installs a
470 version of the Cygwin DLL in another location than Cygwin's /bin
471 directory then the rules in
472 <xref linkend="faq.using.third-party.multiple-copies"></xref> apply. 
473 If the application installs an older version of the DLL in /bin then you
474 should complain loudly to the application provider.
475 </para><para>
476 Remember that the Cygwin DLL strives to be backwards compatible so a
477 newer version of the DLL should always work with older executables.  So,
478 in general, it is always best to keep one version of the DLL on your
479 system and it should always be the latest version which matches your
480 installed distribution.
481 </para></answer></qandaentry>
482
483 <qandaentry id="faq.using.missing-packages">
484 <question><para>Why isn't package XYZ available in Cygwin?</para></question>
485 <answer>
486
487 <para>Probably because there is nobody willing or able to maintain it.  It
488 takes time, and the priority for the Cygwin Team is the Cygwin package.
489 The rest is a volunteer effort.  Want to contribute?  See
490 <ulink url="http://cygwin.com/setup.html">http://cygwin.com/setup.html</ulink>.
491 </para>
492 </answer></qandaentry>
493
494 <qandaentry id="faq.using.old-packages">
495 <question><para>Why is the Cygwin package of XYZ so out of date?</para></question>
496 <answer>
497
498 <para>(Also: Why is the version of package XYZ older than the version that I
499 can download from the XYZ web site?  Why is the version of package XYZ
500 older than the version that I installed on my linux system?  Is there
501 something special about Cygwin which requires that only an older version
502 of package XYZ will work on it?)
503 </para>
504 <para>Every package in the Cygwin distribution has a maintainer who is
505 responsible for sending out updates of the package.  This person is a
506 volunteer who is rarely the same person as the official developer of the
507 package.  If you notice that a version of a package seems to be out of
508 date, the reason is usually pretty simple -- the person who is
509 maintaining the package hasn't gotten around to updating it yet. Rarely,
510 the newer package actually requires complex changes that the maintainer
511 is working out. 
512 </para>
513 <para>If you urgently need an update, sending a polite message to the cygwin
514 mailing list pinging the maintainer is perfectly acceptable.  There are
515 no guarantees that the maintainer will have time to update the package
516 or that you'll receive a response to your request, however.
517 </para>
518 <para>Remember that the operative term here is "volunteer".
519 </para>
520 </answer></qandaentry>
521
522 <qandaentry id="faq.using.accessing-drives">
523 <question><para>How can I access other drives?</para></question>
524 <answer>
525
526 <para>You have some flexibility here.
527 </para>
528 <para>Cygwin has a builtin "cygdrive prefix" for drives that are not mounted.
529 You can access any drive, say Z:, as '/cygdrive/z/'.
530 </para>
531 <para>In some applications (notably bash), you can use the familiar windows
532 &lt;drive&gt;:/path/, using posix forward-slashes ('/') instead of Windows
533 backward-slashes ('\').  (But see the warning below!)  This maps in the
534 obvious way to the Windows path, but will be converted internally to use
535 the Cygwin path, following mounts (default or explicit).  For example:
536 <screen>
537         bash$ cd C:/Windows
538         bash$ pwd
539         /cygdrive/c/Windows
540 </screen>
541 and
542 <screen>
543         bash$ cd C:/cygwin
544         bash$ pwd
545         /
546 </screen>
547 for a default setup.  You could also use backward-slashes in the
548 Windows path, but these would have to be escaped from the shell.
549 </para>
550 <para><emphasis role='bold'>Warning:</emphasis> There is some ambiguity in going from a Windows path
551 to the posix path, because different posix paths, through different
552 mount points, could map to the same Windows directory.  This matters
553 because different mount points may be binmode or textmode, so the
554 behavior of Cygwin apps will vary depending on the posix path used to
555 get there.
556 </para>
557 <para>You can avoid the ambiguity of Windows paths, and avoid typing
558 "/cygdrive", by explicitly mounting drives to posix paths.  For example:
559 <screen>
560         bash$ mkdir /c
561         bash$ mount c:/ /c
562         bash$ ls /c
563 </screen>
564 Then <literal>/cygdrive/c/Windows</literal> becomes <literal>/c/Windows</literal> which is a
565 little less typing.
566 </para>
567 <para>Note that you have to enter the mount point into the
568 <filename>/etc/fstab</filename> file to keep it indefinitely. 
569 The mount command will only add the mount point for the lifetime
570 of your current Cygwin session.
571 </para>
572 <para>You can change the default <literal>cygdrive</literal> prefix and whether it is binmode or textmode using the <filename>/etc/fstab</filename> file
573 as well.  See the Cygwin User's Guide at
574 <ulink url="http://cygwin.com/cygwin-ug-net/using.html#mount-table">http://cygwin.com/cygwin-ug-net/using.html#mount-table</ulink>
575 for more details.
576 </para>
577 </answer></qandaentry>
578
579 <qandaentry id="faq.using.copy-and-paste">
580 <question><para>How can I copy and paste into Cygwin console windows?</para></question>
581 <answer>
582
583 <para>First, consider using mintty instead of the standard console
584 window.  In mintty, selecting with the left-mouse also copies,
585 and middle-mouse pastes.  It couldn't be easier!
586 </para>
587 <para>In Windows's console window, open the properties dialog.
588 The options contain a toggle button, named "Quick edit mode".  It must
589 be ON.  Save the properties.
590 </para>
591 <para>You can also bind the insert key to paste from the clipboard by adding 
592 the following line to your .inputrc file: 
593 <screen>
594         "\e[2~": paste-from-clipboard 
595 </screen>
596 </para>
597 </answer></qandaentry>
598
599 <qandaentry id="faq.using.firewall">
600 <question><para>What firewall should I use with Cygwin? </para></question>
601 <answer>
602
603 <para>We have had good reports about Kerio Personal Firewall, ZoneLabs
604 Integrity Desktop, and the built-in firewall in Windows XP. Other
605 well-known products including ZoneAlarm and Norton Internet Security have
606 caused problems for some users but work fine for others. At last report,
607 Agnitum Outpost did not work with Cygwin.  If you are having strange
608 connection-related problems, disabling the firewall is a good
609 troubleshooting step (as is closing or disabling all other running
610 applications, especially resource-intensive processes such as indexed
611 search).
612 </para>
613 <para>On the whole, Cygwin doesn't care which firewall is used.  The few rare
614 exceptions have to do with socket code.
615 Cygwin uses sockets to implement many of its functions, such as IPC.
616 Some overzealous firewalls install themselves deeply into the winsock
617 stack (with the 'layered service provider' API) and install hooks
618 throughout.  Sadly the mailing list archives are littered with examples
619 of poorly written firewall-type software that causes things to break.
620 Note that with many of these products, simply disabling the firewall
621 does not remove these changes; it must be completely uninstalled.
622 </para>
623 <para>See also <ulink url="http://cygwin.com/faq/faq.using.html#faq.using.bloda" />
624 for a list of applications that have been known, at one time or another, to 
625 interfere with the normal functioning of Cygwin.
626 </para>
627 </answer></qandaentry>
628
629 <qandaentry id="faq.using.sharing-files">
630 <question><para>How can I share files between Unix and Windows?</para></question>
631 <answer>
632
633 <para>During development, we have Linux boxes running Samba and NFS as well
634 as Windows machines.  We often build with cross-compilers under Linux and copy
635 binaries and source to the Windows system or just toy with them
636 directly off the Samba-mounted partition.  Or, we use the Microsoft NFS
637 client and just use NFS shares on Linux from Windows.  And then there are
638 tools like <literal>scp</literal>, <literal>ftp</literal>,
639 <literal>rsync</literal>, ...
640 </para>
641 </answer></qandaentry>
642
643 <qandaentry id="faq.using.case-sensitive">
644 <question><para>Is Cygwin case-sensitive??</para></question>
645 <answer>
646
647 <para>Several Unix programs expect to be able to use to filenames
648 spelled the same way, but with different case.  A prime example
649 of this is perl's configuration script, which wants
650 <literal>Makefile</literal> and <literal>makefile</literal>.  Windows can't
651 tell the difference between files with just different case, so the
652 configuration fails.
653 </para>
654 <para>To help with this problem, Cygwin supports casesensitivity
655 starting with Cygwin 1.7.0.  For a detailed description how to use that
656 feature see the Cygwin User's Guilde at
657 <ulink url="http://cygwin.com/cygwin-ug-net/using-specialnames.html">http://cygwin.com/cygwin-ug-net/using-specialnames.html</ulink>.
658 </para>
659
660 </answer></qandaentry>
661
662 <qandaentry id="faq.using.dos-filenames">
663 <question><para>What about DOS special filenames?</para></question>
664 <answer>
665
666 <para>In Windows, files cannot be named com1, lpt1, or aux (to name a few);
667 either as the root filename or as the extension part.  If you do, you'll have
668 trouble.  Unix programs don't avoid these names which can make things
669 interesting.  E.g., the perl distribution has a file called
670 <literal>aux.sh</literal>.  The perl configuration tries to make sure that
671 <literal>aux.sh</literal> is there, but an operation on a file with the magic
672 letters 'aux' in it will hang.
673 </para>
674 <para>At least that's what happens when using native Windows tools.  Cygwin
675 1.7.0 and later can deal with these filenames just fine.  Again, see the
676 User's Guide at
677 <ulink url="http://cygwin.com/cygwin-ug-net/using-specialnames.html">http://cygwin.com/cygwin-ug-net/using-specialnames.html</ulink>
678 for a detailed description of what's possible with filenames and what is not.
679 </para>
680 </answer></qandaentry>
681
682 <qandaentry id="faq.using.hangs">
683 <question><para>When it hangs, how do I get it back?</para></question>
684 <answer>
685
686 <para>If something goes wrong and the tools hang on you for some reason (easy
687 to do if you try and read a file called aux.sh), first try hitting ^C to
688 return to bash or the cmd prompt.
689 </para>
690 <para>If you start up another shell, and applications don't run, it's a good
691 bet that the hung process is still running somewhere.  Use the Task
692 Manager, pview, or a similar utility to kill the process.
693 </para>
694 <para>And, if all else fails, there's always the reset button/power switch.
695 In theory this should never be necessary, though.
696 </para>
697 </answer></qandaentry>
698
699 <qandaentry id="faq.using.directory-structure">
700 <question><para>Why the weird directory structure?</para></question>
701 <answer>
702
703 <para>Why do /lib and /usr/lib (and /bin, /usr/bin) point to the same thing?
704 </para>
705 <para>Why use mounts instead of symbolic links?
706 </para>
707 <para>Can I use a disk root (e.g., C:\) as Cygwin root?  Why is this discouraged?
708 </para>
709 <para>After a new installation in the default location, your mount points will
710 look something like this:
711 </para>
712 <screen>
713         bash$ mount
714         C:\cygwin\bin on /usr/bin type ntfs (binary,auto)
715         C:\cygwin\lib on /usr/lib type ntfs (binary,auto)
716         C:\cygwin on / type ntfs (binary,auto)
717         C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
718 </screen>
719
720 <para>Note that /bin and /usr/bin point to the same location, as do /lib and
721 /usr/lib.  This is intentional, and you should not undo these mounts
722 unless you <emphasis>really</emphasis> know what you are doing.
723 </para>
724 <para>Various applications and packages may expect to be installed in /lib or
725 /usr/lib (similarly /bin or /usr/bin).  Rather than distinguish between
726 them and try to keep track of them (possibly requiring the occasional
727 duplication or symbolic link), it was decided to maintain only one
728 actual directory, with equivalent ways to access it.
729 </para>
730 <para>Symbolic links had been considered for this purpose, but were dismissed
731 because they do not always work on Samba drives.  Also, mounts are
732 faster to process because no disk access is required to resolve them.
733 </para>
734 <para>Note that non-cygwin applications will not observe Cygwin mounts (or
735 symlinks for that matter).  For example, if you use WinZip to unpack the
736 tar distribution of a Cygwin package, it may not get installed to the
737 correct Cygwin path.  <emphasis>So don't do this!</emphasis>
738 </para>
739 <para>It is strongly recommended not to make the Cygwin root directory the
740 same as your drive's root directory, unless you know what you are doing
741 and are prepared to deal with the consequences.  It is generally easier
742 to maintain the Cygwin hierarchy if it is isolated from, say, C:\.  For
743 one thing, you avoid possible collisions with other (non-cygwin)
744 applications that may create (for example) \bin and \lib directories.
745 (Maybe you have nothing like that installed now, but who knows about
746 things you might add in the future?)
747 </para>
748 </answer></qandaentry>
749
750 <qandaentry id="faq.using.anti-virus">
751 <question><para>How do anti-virus programs like Cygwin?</para></question>
752 <answer>
753
754 <para>Users have reported that NAI (formerly McAfee) VirusScan for NT (and
755 others?) is incompatible with Cygwin.  This is because it tries to scan
756 the newly loaded shared memory in cygwin1.dll, which can cause fork() to
757 fail, wreaking havoc on many of the tools.  (It is not confirmed that
758 this is still a problem, however.)
759 </para>
760 <para>There have been several reports of NAI VirusScan causing the system to
761 hang when unpacking tar.gz archives.  This is surely a bug in VirusScan,
762 and should be reported to NAI.  The only workaround is to disable
763 VirusScan when accessing these files.  This can be an issue during
764 setup, and is discussed in that FAQ entry.
765 </para>
766 <para>Some users report a significant performance hit using Cygwin when their
767 anti-virus software is enabled.  Rather than disable the anti-virus
768 software completely, it may be possible to specify directories whose
769 contents are exempt from scanning.  In a default installation, this
770 would be <literal>C:\cygwin\bin</literal>.  Obviously, this could be
771 exploited by a hostile non-Cygwin program, so do this at your own risk.
772 </para>
773 <para>See also <ulink url="http://cygwin.com/faq/faq.using.html#faq.using.bloda" />
774 for a list of applications that have been known, at one time or another, to
775 interfere with the normal functioning of Cygwin.
776 </para>
777 </answer></qandaentry>
778
779 <qandaentry id="faq.using.emacs">
780 <question><para>Is there a Cygwin port of GNU Emacs?</para></question>
781 <answer>
782
783 <para>Yes.  Install the emacs package.  This provides everything you
784 need in order to run GNU emacs in a terminal window.  If you also want
785 to be able to use the X11
786 (<ulink url="http://cygwin.com/xfree/">http://cygwin.com/xfree/</ulink>)
787 GUI, install the emacs-X11 package.  In either case, you run emacs by
788 typing 'emacs' or '/usr/bin/emacs'.  If you run emacs in the cygwin
789 console, be sure that your CYGWIN environment variable contains tty.
790 See /usr/share/doc/Cygwin/emacs.README for further information.
791 </para>
792 </answer></qandaentry>
793
794 <qandaentry id="faq.using.xemacs">
795 <question><para>Is there a Cygwin port of XEmacs?</para></question>
796 <answer>
797
798 <para>Yes.  It can be used in three different modes:</para>
799 <para><itemizedlist>
800 <listitem><para>X11 (<ulink url="http://cygwin.com/xfree/">http://cygwin.com/xfree/</ulink>) GUI</para></listitem>
801 </itemizedlist></para>
802 <para>You have to <emphasis>set</emphasis> the DISPLAY environment variable
803 before starting xemacs.</para>
804 <screen>
805         bash$ DISPLAY=127.0.0.1:0 xemacs &amp;
806 </screen>
807 <para><itemizedlist>
808 <listitem><para>Windows native GUI</para></listitem>
809 </itemizedlist></para>
810 <para>You have to <emphasis>unset</emphasis> the DISPLAY environment variable
811 before starting xemacs.</para>
812 <screen>
813         bash$ DISPLAY= xemacs &amp;
814 </screen>
815 <para><itemizedlist>
816 <listitem><para>Console mode</para></listitem>
817 </itemizedlist></para>
818 <para>Start xemacs with -nw in a terminal (native or X11) window</para>
819 <screen>
820         bash$ xemacs -nw
821 </screen>
822 <para>The current stable Cygwin version of XEmacs is 21.4.x. But there is also a
823 Cygwin test release version (21.5.x) available for download via setup.exe.
824 </para>
825 <para>To use all the standard packages with XEmacs you should download the following
826 two packages:</para>
827 <para><itemizedlist>
828 <listitem><para>xemacs-sumo - XEmacs standard packages</para></listitem>
829 <listitem><para>xemacs-mule-sumo - XEmacs MULE (MUlti Lingual Emacs) packages</para></listitem>
830 </itemizedlist></para>
831 <para>An alternative <emphasis>native</emphasis> distribution of XEmacs for
832 Windows based systems can be downloaded from
833 <ulink url="http://xemacs.org/Download/win32/index.html">http://xemacs.org/Download/win32/index.html</ulink>.
834 It uses an <emphasis>InnoSetup Kit</emphasis> based installer.</para>
835 </answer></qandaentry>
836
837 <qandaentry id="faq.using.ntemacs">
838 <question><para>What about NT Emacs?</para></question>
839 <answer>
840
841 <para>If you want GNU Emacs with a native Microsoft GUI interface,
842 then you can either use XEmacs (see above), or native
843 NT Emacs: see section
844 <ulink url="http://www.gnu.org/software/emacs/windows/Getting-Emacs.html#Getting-Emacs">Where can I get pre-compiled versions?</ulink> in NT Emacs FAQ.
845
846 </para>
847 <para>NT Emacs uses the Windows command shell by default.  Since it is not a
848 Cygwin application, it has no knowledge of Cygwin mounts.  With those
849 points in mind, you need to add the following code to your ~/.emacs
850 (or ~/_emacs) file in order to use Cygwin bash.  This is particularly useful
851 for the JDEE package (<ulink url="http://jdee.sunsite.dk/">http://jdee.sunsite.dk/</ulink>).  The following
852 settings are for Emacs 21.1:
853 </para>
854 <screen>
855
856         ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
857         ;; Initial setup
858         ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
859
860         ;; This assumes that Cygwin is installed in C:\cygwin (the
861         ;; default) and that C:\cygwin\bin is not already in your
862         ;; Windows Path (it generally should not be).
863
864         (setq exec-path (cons "C:/cygwin/bin" exec-path))
865         (setenv "PATH" (concat "C:\\cygwin\\bin;" (getenv "PATH")))
866
867         ;;   LOGNAME and USER are expected in many Emacs packages
868         ;;   Check these environment variables.
869
870         (if (and (null (getenv "USER"))
871                  ;; Windows includes variable USERNAME, which is copied to
872                  ;; LOGNAME and USER respectively.
873                  (getenv "USERNAME"))
874             (setenv "USER" (getenv "USERNAME")))
875
876         (if (and (getenv "LOGNAME")
877                  ;;  Bash shell defines only LOGNAME
878                  (null (getenv "USER")))
879             (setenv "USER" (getenv "LOGNAME")))
880
881         (if (and (getenv "USER")
882                  (null (getenv "LOGNAME")))
883             (setenv "LOGNAME" (getenv "USER")))
884
885         ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
886         ;; (A) M-x shell: This change M-x shell permanently
887         ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
888
889         ;; Would call Windows command interpreter. Change it.
890
891         (setq shell-file-name "bash")
892         (setenv "SHELL" shell-file-name)
893         (setq explicit-shell-file-name shell-file-name)
894
895         ;; Remove C-m (^M) characters that appear in output
896
897         (add-hook 'comint-output-filter-functions
898                   'comint-strip-ctrl-m)
899
900         ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
901         ;; (B) *OR* call following function with M-x my-bash
902         ;; The M-x shell would continue to run standard Windows shell
903         ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
904
905         (defun my-bash (&amp;optional buffer)
906           "Run Cygwin Bash shell in optional BUFFER; default *shell-bash*."
907           (autoload 'comint-check-proc "comint")
908           (interactive
909            (let ((name "*shell-bash*"))
910              (if current-prefix-arg
911                  (setq name (read-string
912                              (format "Cygwin shell buffer (default %s): " name)
913                              (not 'initial-input)
914                              (not 'history)
915                              name)))
916              (list name)))
917           (or buffer
918               (setq buffer "*shell-bash*"))
919           (if (comint-check-proc buffer)
920               (pop-to-buffer buffer)
921             (let* ((shell-file-name            "bash")
922                    (explicit-shell-file-name   shell-file-name)
923                    (explicit-sh-args           '("--login" "-i"))
924                    (explicit-bash-args         explicit-sh-args)
925                    (w32-quote-process-args     ?\"));; Use Cygwin quoting rules.
926               (shell buffer)
927               ;;  By default Emacs sends "\r\n", but bash wants plain "\n"
928               (set-buffer-process-coding-system 'undecided-dos 'undecided-unix)
929               ;; With TAB completion, add slash path separator, none to filenames
930               (make-local-variable 'comint-completion-addsuffix)
931               (setq comint-completion-addsuffix '("/" . ""))
932               ;;  This variable is local to buffer
933               (setq comint-prompt-regexp "^[ \n\t]*[$] ?"))))
934
935 </screen>
936
937 <para>If you want NT Emacs to understand Cygwin paths, get
938 cygwin-mount.el from <ulink url="http://www.emacswiki.org/elisp/index.html">http://www.emacswiki.org/elisp/index.html</ulink>.
939 </para>
940 <para>Note that all of this ``just works'' if you use the Cygwin port of
941 Emacs or XEmacs from Cygwin Setup.
942 </para>
943 </answer></qandaentry>
944
945 <qandaentry id="faq.using.console-window">
946 <question><para>Is there a better alternative to the standard console window?</para></question>
947 <answer>
948
949 <para>Yes!  Use <command>mintty</command> instead.  <command>mintty</command> is an optional packages in
950 Cygwin Setup.  <command>mintty</command> is a Cygwin application providing a native GUI without
951 the need of X11.
952 </para>
953 </answer></qandaentry>
954
955 <qandaentry id="faq.using.symlinkstoppedworking">
956 <question><para>Why do some of my old symlinks don't work anymore?</para></question>
957 <answer>
958
959 <para>Beginning with Cygwin 1.7, Cygwin supports multiple character sets.
960 Symlinks created with Cygwin 1.7 are using the UTF-16 character set, which is
961 portable across all character sets.  Old symlinks were written using your
962 current Windows codepage, which is not portable across all character sets.
963 If the target of the symlink doesn't resolve anymore, it's very likely that
964 the symlink points to a target filename using native, non-ASCII characters,
965 and you're now using another character set than way back when you created
966 the symlink.</para>
967
968 <para>Solution: Delete the symlink and create it again under you new Cygwin.
969 The new symlink will be correctly point to the target no matter what character
970 set you're using in future.</para>
971 </answer></qandaentry>
972
973 <qandaentry id="faq.using.symlinks-samba">
974 <question><para>Why don't symlinks work on samba-mounted filesystems?</para></question>
975 <answer>
976
977 <para>Symlinks are marked with "system" file attribute.  Samba does not
978 enable this attribute by default.  To enable it, consult your Samba
979 documentation and then add these lines to your samba configuration
980 file:
981 </para>
982 <screen>
983         map system = yes
984         create mask = 0775
985 </screen>
986
987 <para>Note that the 0775 can be anything as long as the 0010 bit is set.
988 </para>
989 <para>Alternatively, use Windows shortcuts as symlinks.  See the CYGWIN
990 environment variable option "winsymlinks" 
991 <ulink url="http://cygwin.com/cygwin-ug-net/using-cygwinenv.html">http://cygwin.com/cygwin-ug-net/using-cygwinenv.html</ulink>
992 </para>
993 </answer></qandaentry>
994
995 <qandaentry id="faq.using.sshd-in-domain">
996 <question><para>How do I setup sshd in a domain?</para></question>
997 <answer>
998
999 <para>
1000 If you want to be able to logon with domain accounts to a domain member
1001 machine, you should make sure that the "cyg_server" account under which
1002 the sshd service is usually running, is a domain account as well.  Here's
1003 how you set this up.
1004 </para>
1005
1006 <para>
1007 First of all, create a new domain account called "cyg_server".  This
1008 account must be an administrative account, so make sure it's in the
1009 "Administrators" group.  Now create a domain policy which is propagated
1010 to all machines which are supposed to run an sshd service.  This domain
1011 policy should give the following user rights to the "cyg_server" account:
1012 </para>
1013
1014 <screen>
1015   Act as part of the operating system (SeTcbPrivilege)
1016   Create a token object               (SeCreateTokenPrivilege)
1017   Replace a process level token       (SeAssignPrimaryTokenPrivilege)
1018 </screen>
1019
1020 <para>
1021 Now to install sshd on the member machine, logon to that machine as
1022 an admin.  Make sure the aforementioend global policy has been propagated
1023 to this machine.  Examine the Local Security Policy settings and, if
1024 necessary, call gpupdate.
1025 </para>
1026
1027 <para>
1028 If everything looks ok, run bash.  Starting with Windows Vista, make
1029 sure you're running bash elevated.
1030 </para>
1031
1032 <para>
1033 If "cyg_server" is not already in <literal>/etc/passwd</literal>, add it
1034 using <literal>mkpasswd</literal>.  Make sure all domain accounts which are
1035 supposed to be able to logon via ssh are in <literal>/etc/passwd</literal>.
1036 Also make sure that all important domain groups are in
1037 <literal>/etc/group</literal>.  If in doubt, call
1038 </para>
1039
1040 <screen>
1041   $ mkpasswd -l -d your_domain > /etc/passwd
1042   $ mkgroup -l -d your_domain > /etc/group
1043 </screen>
1044
1045 <para>
1046 Then run ssh-host-config.  Answer all questions so that "cyg_server" is
1047 used to run the service.  When done, check ownership of
1048 <literal>/var/empty</literal> and all <literal>/etc/ssh*</literal>
1049 files.  All of them must be owned by "cyg_server".  If that's ok, you're
1050 usually all set and you can start the sshd service via
1051 </para>
1052
1053 <screen>
1054   $ cygrunsrv -S sshd
1055 </screen>
1056
1057 <para>or</para>
1058
1059 <screen>
1060   $ net start sshd
1061 </screen>
1062
1063 </answer></qandaentry>
1064
1065 <qandaentry id="faq.using.tcl-tk">
1066 <question><para>Why doesn't Cygwin tcl/tk understand Cygwin paths?</para></question>
1067 <answer>
1068
1069 <para>The versions of Tcl/Tk distributed with Cygwin (e.g. cygtclsh80.exe,
1070 cygwish80.exe) are not actually "Cygwin versions" of those tools.
1071 They are built as native libraries, which means they do not understand
1072 Cygwin mounts or symbolic links.
1073 </para>
1074 <para>See the entry "How do I convert between Windows and UNIX paths?"
1075 elsewhere in this FAQ.
1076 </para></answer></qandaentry>
1077
1078 <qandaentry id="faq.using.ipv6">
1079 <question><para>Why do I get "Address family not supported" errors when playing with IPv6?</para></question>
1080 <answer>
1081
1082 <para>IPv6 is only fully supported and available right from the start
1083 beginning with Windows Vista and Windows Server 2008.</para>
1084
1085 <para>The previous generation of Windows,
1086 Windows XP and Windows Server 2003, only support IPv6 on an "experimental"
1087 basis.  On these Windows versions, the IPv6 TCP/IP stack is not installed
1088 automatically, rather the system administrator has to install it manually.
1089 Unless this has already been done on your machine, your machine is not
1090 IPv6-capable and that's why you see the "Address family not supported"
1091 error message.  Note, however, that the IPv6 stack on these systems
1092 don't fully support all features of IPv6.</para>
1093
1094 <para>There's also a very experimental IPv6 stack for Windows 2000, and
1095 Cygwin will try its best to support it, but it's not recommended to install
1096 it.  Windows NT4 or older never saw IPv6 at all.</para>
1097
1098 <para>For more information about IPv6 on Windows and how to install the
1099 IPv6 stack, see the <ulink url="http://www.microsoft.com/technet/network/ipv6/ipv6faq.mspx">Microsoft TechNet IPv6 FAQ article</ulink>
1100 </para></answer></qandaentry>
1101
1102 <qandaentry id="faq.using.bloda">
1103 <question><para>What applications have been found to interfere with Cygwin?</para></question>
1104 <answer>
1105
1106 <para>From time to time, people have reported strange failures and problems in
1107 Cygwin and Cygwin packages that seem to have no rational explanation.  Among
1108 the most common symptoms they report are fork failures, memory leaks, and file
1109 access denied problems.  These problems, when they have been traced, often appear
1110 to be caused by interference from other software installed on the same PC.  Security
1111 software, in particular, such as anti-virus, anti-spyware, and firewall applications,
1112 often implements its functions by installing hooks into various parts of the system,
1113 including both the Explorer shell and the underlying kernel.  Sometimes these hooks
1114 are not implemented in an entirely transparent fashion, and cause changes in the
1115 behaviour which affect the operation of other programs, such as Cygwin.
1116 </para>
1117 <para>Among the software that has been found to cause difficulties are:</para>
1118 <para><itemizedlist>
1119 <listitem><para>Sonic Solutions burning software containing DLA component (when DLA disabled)</para></listitem>
1120 <listitem><para>Norton/McAfee/Symantec antivirus or antispyware</para></listitem>
1121 <listitem><para>Logitech webcam software with "Logitech process monitor" service</para></listitem>
1122 <listitem><para>Kerio, Agnitum or ZoneAlarm Personal Firewall</para></listitem>
1123 <listitem><para>Iolo System Mechanic/AntiVirus/Firewall</para></listitem>
1124 <listitem><para>LanDesk</para></listitem>
1125 <listitem><para>Windows Defender </para></listitem>
1126 <listitem><para>Various programs by Wave Systems Corp using wxvault.dll, including Embassy Trust Suite and Embassy Security Center</para></listitem>
1127 <listitem><para>NOD32 Antivirus</para></listitem>
1128 <listitem><para>ByteMobile laptop optimization client</para></listitem>
1129 <listitem><para>Earthlink Total-Access</para></listitem>
1130 <listitem><para>Spybot S&amp;D TeaTimer</para></listitem>
1131 <listitem><para>AR Soft RAM Disk</para></listitem>
1132 <listitem><para>ATI Catalyst drivers</para></listitem>
1133 <listitem><para>Windows LiveOneCare</para></listitem>
1134 <listitem><para>Webroot Spy Sweeper with Antivirus</para></listitem>
1135 <listitem><para>COMODO Firewall Pro</para></listitem>
1136 <listitem><para>PC Tools Spyware Doctor</para></listitem>
1137 <listitem><para>Avira AntiVir</para></listitem>
1138 <listitem><para>Panda Internet Security</para></listitem>
1139 <listitem><para>BitDefender</para></listitem>
1140 <listitem><para>Google Desktop</para></listitem>
1141 <listitem><para>Sophos Anti-Virus 7</para></listitem>
1142 <listitem><para>Bufferzone from Trustware</para></listitem>
1143 <listitem><para>Lenovo IPS Core Service (ipssvc)</para></listitem>
1144 <listitem><para>Credant Guardian Shield</para></listitem>
1145 </itemizedlist></para>
1146 <para>Sometimes these problems can be worked around, by temporarily or partially
1147 disabling the offending software.  For instance, it may be possible to disable
1148 on-access scanning in your antivirus, or configure it to ignore files under the
1149 Cygwin installation root.  Often, unfortunately, this is not possible; even disabling
1150 the software may not work, since many applications that hook the operating system
1151 leave their hooks installed when disabled, and simply set them into what is intended
1152 to be a completely transparent pass-through mode.  Sometimes this pass-through is not
1153 as transparent as all that, and the hooks still interfere with Cygwin; in these cases,
1154 it may be necessary to uninstall the software altogether to restore normal operation.
1155 </para>
1156 <para>Some of the symptoms you may experience are:</para>
1157 <para><itemizedlist>
1158 <listitem>
1159 <para>Random fork() failures.</para>
1160 <para>Caused by hook DLLs that load themselves into every process in the
1161 system.  POSIX fork() semantics require that the memory map of the child process
1162 must be an exact duplicate of the parent process' layout.  If one of these DLLs
1163 loads itself at a different base address in the child's memory space as compared
1164 to the address it was loaded at in the parent, it can end up taking the space that
1165 belonged to a different DLL in the parent.  When Cygwin can't load the original
1166 DLL at that same address in the child, the fork() call has to fail.
1167 </para>
1168 </listitem>
1169 <listitem>
1170 <para>File access problems.</para>
1171 <para>Some programs (e.g., virus scanners with on-access scanning) scan or
1172 otherwise operate on every file accessed by all the other software running on
1173 your computer.  In some cases they may retain an open handle on the file even
1174 after the software that is really using the file has closed it.  This has been
1175 known to cause operations such as deletes, renames and moves to fail with
1176 access denied errors.  In extreme cases it has been known for scanners to leak
1177 file handles, leading to kernel memory starvation.
1178 </para>
1179 </listitem>
1180 <listitem>
1181 <para>Networking issues</para>
1182 <para>Firewall software sometimes gets a bit funny about Cygwin.  It's not
1183 currently understood why; Cygwin only uses the standard Winsock2 API, but
1184 perhaps in some less-commonly used fashion that doesn't get as well tested
1185 by the publishers of firewalls.  Symptoms include mysterious failures to
1186 connect, or corruption of network data being sent or received.</para>
1187 </listitem>
1188 <listitem>
1189 <para>Memory and/or handle leaks</para>
1190 <para>Some applications that hook into the Windows operating system exhibit
1191 bugs when interacting with Cygwin that cause them to leak allocated memory
1192 or other system resources.  Symptoms include complaints about out-of-memory
1193 errors and even virtual memory exhaustion dialog boxes from the O/S; it is
1194 often possible to see the excess memory allocation using a tool such as
1195 Task Manager or Sysinternals' Process Explorer, although interpreting the
1196 statistics they present is not always straightforward owing to complications
1197 such as virtual memory paging and file caching.</para>
1198 </listitem>
1199 </itemizedlist></para>
1200 </answer></qandaentry>