This is faq.txt, produced by makeinfo version 4.2 from
../../../../src/winsup/doc/faq.texinfo.

What is it?
***********

   The Cygwin tools are ports of the popular GNU development tools for
Microsoft Windows.  They run thanks to the Cygwin library which
provides the UNIX system calls and environment these programs expect.

   With these tools installed, it is possible to write Win32 console or
GUI applications that make use of the standard Microsoft Win32 API
and/or the Cygwin API.  As a result, it is possible to easily port many
significant Unix programs without the need for extensive changes to the
source code.  This includes configuring and building most of the
available GNU software (including the packages included with the Cygwin
development tools themselves).  Even if the development tools are of
little to no use to you, you may have interest in the many standard
Unix utilities provided with the package.  They can be used both from
the bash shell (provided) or from the standard Windows command shell.

What versions of Windows are supported?
=======================================

   Wait a minute... Cygwin is only _supported_ if you are paying for
it, such as through a support contract with Red Hat.  For information
about getting a Red Hat support contract, see
`http://www.redhat.com/software/tools/cygwin/'.

   That said, Cygwin can be expected to run on all modern 32 bit
versions of Windows, except Windows CE.  This includes Windows
95/98/ME/NT/2000/XP.

   Keep in mind that Cygwin can only do as much as the underlying OS
supports.  Because of this, Cygwin will behave differently, and exhibit
different limitations, on the various versions of Windows.

Where can I get it?
===================

   The home page for the Cygwin project is `http://cygwin.com/'.  There
you should find everything you need for Cygwin, including links for
download and setup, a current list of mirror sites, a User's Guide, an
API Reference, mailing lists and archives, and additional ported
software.

   You can find documentation for the individual GNU tools at
`http://www.fsf.org/manual/'.  (You should read GNU manuals from a
local mirror.  Check `http://www.fsf.org/server/list-mirrors.html' for
a list of them.)

Is it free software?
====================

   Yes.  Parts are GNU software (gcc, gas, ld, etc...), parts are
covered by the standard X11 license, some of it is public domain, some
of it was written by Cygnus and placed under the GPL.  None of it is
shareware.  You don't have to pay anyone to use it but you should be
sure to read the copyright section of the FAQ more more information on
how the GNU General Public License may affect your use of these tools.

   In particular, if you intend to port a proprietary (non-GPL'd)
application using Cygwin, you will need the proprietary-use license for
the Cygwin library.  This is available for purchase; please visit
`http://www.redhat.com/software/tools/cygwin/' for more information.
All other questions should be sent to the project mailing list
cygwin@cygwin.com.

   Note that when we say "free" we mean freedom, not price.  The goal of
such freedom is that the people who use a given piece of software
should be able to change it to fit their needs, learn from it, share it
with their friends, etc.  The Cygwin license allows you those freedoms,
so it is free software.

   The Cygwin 1.0 product was a "commercial" distribution of cygwin.  As
such, it included such non-software things as printed manuals, support,
and aggregation of useful utilities.  There was nothing (software-wise)
in there that you couldn't get off the net already, if you took the
time to find and download everything (and usually, build it yourself),
although the _versions_ available for download may have been different
than those distributed with the commercial product.  We tested it all
to make sure it worked together, and packaged it in a convenient form.
We considered such testing and packaging to be a valuable service and
thus charged a fee for it.  Plus, it provided income for the Cygwin
project so we could continue working on it.  However, Red Hat is no
longer offering Cygwin 1.0 on CD, and there are no plans to do so
again.  The latest news about this can be found at
`http://cygwin.com/cygwin-cd.html'.

Recent history of the project: What version _is_ this, anyway?
==============================================================

   Starting on April 17, 2000, the Cygwin team changed the procedure for
doing net releases.

   Previously, net releases entailed downloading one or two large files
(called something like `FULL.EXE' or `USER.EXE').  These files unpacked
a "Cygwin Distribution" to a static (and arcane) directory structure.
This distribution contained lots of .exe, .a, .h, and other files.

   These distributions were named after the version of the Cygwin DLL
which they contained.  The last version released with this method was
Cygwin B20.1.

   This distribution method has the advantage that everything was "all
in one place".  You could copy the huge FULL.EXE file around and know
that you were getting the complete "Cygwin Distribution".

   The method had several disadvantages, however.  1) it was huge, 2) it
was hard to download in one error-free piece, and 3) it was hard to
update.

   Why was it hard to update?  Because any change to any package in
FULL.EXE meant re-generating all of FULL.EXE.  This process was not easy
to automate since FULL.EXE was an InstallShield executable.  As a
result, until recently, Cygwin development was relatively static.

   To rectify these problems, the Cygwin team decided, early in January
2000, to break up the packages in the release and make a small program
(`setup.exe') available to use in downloading packages.  After much
development and internal discussion on the cygwin-developers mailing
list, the new, improved version of a Cygwin release was made available
on April 17, 2000.

   This new release also had a new version of the Cygwin DLL - 1.1.0.
Most of the other packages were updated and some packages from the
Cygwin CD were included.  Meanwhile, the Cygwin DLL continues to be
updated, and since release 1.3.1, is more generically referred to as
"1.3.x".

   Users obtain this package by first downloading a version of Cygwin
Setup.  This program started as a simple command line tool, has
metamorphosed into a GUI, and is in the process of continual
improvement.  However, its purpose is simple - it is designed to
install packages from the cygwin web site at `http://cygwin.com/'.  In
effect, it is a smaller, more intelligent replacement for FULL.EXE.  It
does not require the downloading a huge executable but rather downloads
individual small packages.

   Does this mean that the new net release of the Cygwin package is
1.3.x?  No.  We no longer label the releases with the Cygwin version
number.  Each package in the cygwin release has its own version now.

   Does this mean that Cygwin 1.3.x is newer than B20.1?  Yes!  The
cygwin 1.3.x versions all represent continual improvement in the Cygwin
DLL.  Although the 1.3.x code is still considered "beta quality", the
Cygwin team felt comfortable enough with the cygwin technology to bump
the version number to "1".

   The other packages in the latest directory are also continually
improving, thanks to the efforts of net volunteers who maintain the
cygwin binary ports.  Each package has its own version numbers and its
own release process.

   So, how do you get the most up-to-date version of cygwin?  Easy.
Just download the Cygwin Setup program from
`http://cygwin.com/setup.exe'.  This program will handle the task of
updating the packages on your system to the latest version.  The Cygwin
team frequently updates and adds new packages to the sourceware web
site.  The Cygwin Setup program is the easiest way to determine what
you need on your system.

   For some "ancient" history of the project (rather, just woefully out
of date), visit the Project History page at
`http://cygwin.com/history.html'.

Installation Instructions
*************************

Contents
========

   Unlike previous net releases such as B20.1 and earlier, there is no
monolithic "full" or "usertools" installation.  Rather, you can pick and
choose the packages you wish to install, and update them individually.

   For a searchable list of packages that can be installed with Cygwin,
see `http://cygwin.com/packages/'.

   Full source code is available for all packages and tools.

   There is only one recommended way to install Cygwin, which is to use
the GUI installer "Cygwin Setup".  It is flexible and easy to use.

   Do it any other way, and you're on your own!  That said, keep in mind
that the GUI installer is a "work in progress", so there might be a few
difficulties, especially if you are behind a firewall or have other
specific requirements.  If something doesn't work right for you, and
it's not covered here or elsewhere, then by all means report it to the
mailing list.

Installation using "Cygwin Setup"
=================================

   The Cygwin Setup program is the _only_ recommended way to install
Cygwin.

Why not install in C:\?
-----------------------

   The Cygwin Setup program will prompt you for a "root" directory.
The default is `C:\cygwin', but you can change it.  You are urged not to
choose something like 'C:\' (the root directory on the system drive) for
your Cygwin root.  If you do, then critical Cygwin system directories
like 'etc', 'lib' and 'bin' could easily be corrupted by other
(non-Cygwin) applications or packages that use \etc, \lib or \bin.
Perhaps there is no conflict now, but who knows what you might install
in the future?  It's also just good common sense to segregate your
Cygwin "filesystems" from the rest of your Windows system disk.

   (In the past, there had been genuine bugs that would cause problems
for people who installed in C:\, but we believe those are gone now.)

Can I use Cygwin Setup to update a B18, B19, B20, B20.1 or CD-ROM (1.0) installation of Cygwin?
-----------------------------------------------------------------------------------------------

   No, you must start from scratch with the new Cygwin Setup.  The
overall structure has changed so much that it would be pointless to try
to accomodate old installations of Cygwin.  You will probably be much
better off with a whole new installation anyway.  You may backup or
rename your old installation first, or just install the new one
somewhere else.  Be sure to make note of your current mount table,
because this will be overwritten during the new setup.  Make sure you
don't end up with two different versions of `cygwin1.dll' on your
system.

   Once you've installed the latest net release, Cygwin Setup will
update just the individual packages that need it.

Is Cygwin Setup, or one of the packages, infected with a virus?
---------------------------------------------------------------

   Unlikely.  Unless you can confirm it, please don't report it to the
mailing list.  Anti-virus products have been known to detect false
positives when extracting compressed tar archives.  If this causes
problems for you, consider disabling your anti-virus software when
running `setup'.  Read the next entry for a fairly safe way to do this.

My computer hangs when I run Cygwin Setup!
------------------------------------------

   Both Network Associates (formerly McAfee) and Norton anti-virus
products have been reported to "hang" when extracting Cygwin tar
archives.  If this happens to you, consider disabling your anti-virus
software when running Cygwin Setup.  The following procedure should be
a fairly safe way to do that:

  1. Download `setup.exe' and scan it explicitly.

  2. Turn off the anti-virus software.

  3. Run setup to download and extract all the tar files.

  4. Re-activate your anti-virus software and scan everything in
     C:\cygwin (or wherever you chose to install), or your entire hard
     disk if you are paranoid.


   This should be safe, but only if Cygwin Setup is not substituted by
something malicious, and no mirror has been compromised.

What packages should I download?
--------------------------------

   When using Cygwin Setup for the first time, the default is to install
a minimal subset of packages.  If you want anything beyond that, you
will have to select it explicitly.  See `http://cygwin.com/packages/'
for a searchable list of available packages.

   If you want to build programs, of course you'll need `gcc',
`binutils', `make' and probably other packages from the "Devel"
category.

How do I just get everything?
-----------------------------

   Long ago, the default was to install everything, much to the
irritation of most users.  Now the default is to install only a basic
core of packages.  Cygwin Setup is designed to make it easy to browse
categories and select what you want to install or omit from those
categories.  It's also easy to install everything:

  1. At the "Select Packages" screen, in "Categories" view, at the line
     marked "All", click on the word "default" so that it changes to
     "install".  (Be patient, there is some computing to do at this
     step.  It may take a second or two to register the change.)  This
     tells Setup to install _everything_, not just what it thinks you
     should have by default.

  2. Now click on the "View" button (twice) until you get the "Partial"
     view.  This shows exactly which packages are about to be
     downloaded and installed.


   This procedure only works for packages that are currently available.
There is no way to tell Cygwin Setup to install all packages by default
from now on.  As new packages become available that would not be
installed by default, you have to repeat the above procedure to get
them.

   In general, a better method (in my opinion), is to:

  1. First download & install all packages that would normally be
     installed by default.  This includes fundamental packages and any
     updates to what you have already installed.  Then...

  2. Run Cygwin Setup again, and apply the above technique to get all
     new packages that would not be installed by default.  You can check
     the list in the Partial View before proceeding, in case there's
     something you really _don't_ want.

  3. In the latest version of Cygwin Setup, if you click the "View"
     button (twice) more, it shows packages not currently installed.
     You ought to check whether you _really_ want to install everything!


How much disk space does Cygwin require?
----------------------------------------

   That depends, obviously, on what you've chosen to download and
install.  A full installation today is probably larger than 800MB
installed, not including the package archives themselves nor the source
code.

   After installation, the package archives remain in your "Local
Package Directory", by default the location of `setup.exe'.  You may
conserve disk space by deleting the subdirectories there.  These
directories will have very wierd looking names, being encoded with
their URLs.

What if setup fails?
--------------------

   First, make sure that you are using the latest version of Cygwin
Setup.  The latest version is always available from the 'Install Cygwin
now' link on the Cygwin Home Page at `http://cygwin.com/'.

   If you are downloading from the internet, setup will fail if it
cannot download the list of mirrors at
`http://cygwin.com/mirrors.html'.  It could be that the network is too
busy.  Similarly for an ftp download site that isn't working.  Try
another mirror, or try again later.

   If setup refuses to download a package that you know needs to be
upgraded, try deleting that package's entry from /etc/setup.  If you are
reacting quickly to an announcement on the mailing list, it could be
that the mirror you are using doesn't have the latest copy yet.  Try
another mirror, or try again tomorrow.

   If setup has otherwise behaved strangely, check the files
`setup.log' and `setup.log.full' in `/var/log' (`C:\cygwin\var\log' by
default).  It may provide some clues as to what went wrong and why.

   If you're still baffled, search the Cygwin mailing list for clues.
Others may have the same problem, and a solution may be posted there.
If that search proves fruitless, send a query to the Cygwin mailing
list.  You must provide complete details in your query: version of
setup, options you selected, contents of setup.log and setup.log.full,
what happened that wasn't supposed to happen, etc.

My Windows logon name has a space in it, will this cause problems?
------------------------------------------------------------------

   Most definitely yes!  UNIX shells (and thus Cygwin) use the space
character as a word delimiter.  Under certain circumstances, it is
possible to get around this with various shell quoting mechanisms, but
you are much better off if you can avoid the problem entirely.

   In particular, the environment variables `USER' and `HOME' are set
for you in /etc/profile.  By default these derive from your Windows
logon name.  You may edit this file and set them explicitly to something
without spaces.

   (If you use the `login' package or anything else that reads
/etc/passwd, you may need to make corresponding changes there.  See the
README file for that package.)

How do I uninstall individual packages?
---------------------------------------

   Run Cygwin Setup as you would to install packages.  In the list of
packages to install, browse the relevant category or click on the
"View" button to get a full listing.  Click on the cycle glyph until
the action reads "Uninstall".  Proceed by clicking "Next".

How do I uninstall *all* of Cygwin?
-----------------------------------

   Setup has no automatic uninstall facility.  Just delete everything
manually:

   * Cygwin shortcuts on the Desktop and Start Menu

   * The registry tree `Software\Cygnus Solutions' under
     `HKEY_LOCAL_MACHINE' and/or `HKEY_CURRENT_USER'.

   * Anything under the Cygwin root folder, `C:\cygwin' by default.

   * Anything created by setup in its temporary working directory.


   It's up to you to deal with other changes you made to your system,
such as installing the inetd service, altering system paths, etc.  Setup
would not have done any of these things for you.

How do I install snapshots?
---------------------------

   First, are you sure you want to do this?  Snapshots are risky.  They
have not been tested.  Use them *only* if there is a feature or bugfix
that you need to try, and you are willing to deal with any problems.

   Before installing a snapshot, you must first Close *all* Cygwin
applications, including shells and services (e.g. inetd, sshd), before
updating `cygwin1.dll'.  You may have to restart Windows to clear the
DLL from memory.

   You cannot use Setup to install a snapshot.

   You should generally install the full `cygwin-inst-YYYYMMDD.tar.bz2'
update, rather than just the DLL, otherwise some components may be out
of sync.  Cygwin tar won't be able to update `/usr/bin/cygwin1.dll',
but it should succeed with everything else.

  1. Download the snapshot, and run:
          	cd /
                  tar jxvf /posix/path/to/cygwin-inst-YYYYMMDD.tar.bz2 --exclude=usr/bin/cygwin1.dll
                  cd /tmp
                  tar jxvf /posix/path/to/cygwin-inst-YYYYMMDD.tar.bz2 usr/bin/cygwin1.dll

  2. After closing all Cygwin apps (see above), use Explorer or the
     Windows command shell to move `C:\cygwin\tmp\usr\bin\cygwin1.dll'
     to `C:\cygwin\bin\cygwin1.dll'.


Can Cygwin Setup maintain a "mirror"?
-------------------------------------

   NO.  Cygwin Setup cannot do this for you.  Use a tool designed for
this purpose.  See `http://rsync.samba.org/',
`http://sunsite.org.uk/packages/mirror/', `http://wget.sunsite.dk/' for
utilities that can do this for you.

What Unix API calls are supported by Cygwin?
********************************************

   This is the beginning of documentation listing the calls supported
by the Cygwin library.

   All POSIX.1/1996 and ANSI C calls are listed in this file.  Note that
while almost all POSIX.1/1990 calls are included in Cygwin, most
POSIX.1/1996 calls are not (yet at least!).  Additional Unix
compatibility calls and extended libc/libm calls are provided by Cygwin
but may or may not be listed yet.

   To see if a function is implemented but not listed here, check for
the presence of the call in the file winsup/cygwin.din in the sources.
In addition, you may want to read the source code corresponding to the
call to verify that it is not a stub.  Finally, libc/libm functions
(including extended calls not listed here) may be documented in the
newlib texinfo documentation.

   Calls are implemented on both Windows 95 and NT unless otherwise
noted.  Included are references to relevant standards, if any.  Calls
starting with "cygwin_" are Cygwin-specific calls.

ANSI C Library Functions
========================

   *(Please note: This section has not yet been updated for the latest
net release.)*

   `' libc stdio (newlib/libc/stdio)
        `' clearerr: C 4.9.10.1

        `' fclose: C 4.9.5.1, P 8.2.3.2

        `' feof: C 4.9.10.2

        `' ferror: C 4.9.10.3

        `' fflush: C 4.9.5.2, P 8.2.3.4

        `' fgetc: C 4.9.7.1, P 8.2.3.5

        `' fgetpos: C 4.9.9.1

        `' fgets: C 4.9.7.2, P 8.2.3.5

        `' fopen: C 4.9.5.3, P 8.2.3.1

        `' fprintf: C 4.9.7.3, P 8.2.3.6

        `' fputc: C 4.9.7.3, P 8.2.3.6

        `' fputs: C 4.9.7.4, P 8.2.3.6

        `' fread: C 4.9.8.1, P 8.2.3.5

        `' freopen: C 4.9.5.4, P 8.2.3.3

        `' fscanf: C 4.9.6.2, P 8.2.3.7

        `' fseek: C 4.9.9.2, P 8.2.3.7

        `' fsetpos: C 4.9.9.3

        `' ftell: C 4.9.9.4, P 8.2.3.10

        `' fwrite: C 4.9.8.2, P 8.2.3.6

        `' getc: C 4.9.7.5, P 8.2.3.5

        `' getchar: C 4.9.7.6, P 8.2.3.5

        `' gets: C 4.9.7.7, P 8.2.3.5

        `' perror: C 4.9.10.4, P 8.2.3.8

        `' printf: C 4.9.6.3, P 8.2.3.6

        `' putc: C 4.9.7.8, P 8.2.3.6

        `' putchar: C 4.9.7.9, P 8.2.3.6

        `' puts: C 4.9.7.10, P 8.2.3.6

        `' remove: C 4.9.4.1, P 8.2.4

        `' rename: C 4.9.4.2, P 5.5.3.1

        `' rewind: C 4.9.9.5, P 8.2.3.7

        `' scanf: C 4.9.6.4, P 8.2.3.5

        `' setbuf: C 4.9.5.5

        `' setvbuf: C 4.9.5.6

        `' sprintf: C 4.9.6.5

        `' sscanf: C 4.9.6.6

        `' tmpfile: C 4.9.4.3, P 8.2.3.9

        `' tmpnam: C 4.9.4.4, P 8.2.5

        `' vfprintf: C 4.9.6.7

        `' ungetc: C 4.9.7.11

        `' vprintf: C 4.9.6.8

        `' vsprintf: C 4.9.6.9

   `' libc string (newlib/libc/string)
        `' memchr: C 4.11.5.1

        `' memcmp: C 4.11.4.1

        `' memcpy: C 4.11.2.1

        `' memmove: C 4.11.2.2

        `' memset: C 4.11.6.1

        `' strcat: C 4.11.3.1

        `' strchr: C 4.11.5.2

        `' strcmp: C 4.11.4.2

        `' strcoll: C 4.11.4.3

        `' strcpy: C 4.11.2.3

        `' strcspn: C 4.11.5.3

        `' strerror: C 4.11.6.2

        `' strlen: C 4.11.6.3

        `' strncat: C 4.11.3.2

        `' strncmp: C 4.11.3.2

        `' strncpy: C 4.11.2.4

        `' strpbrk: C 4.11.5.4

        `' strrchr: C 4.11.5.5

        `' strspn: C 4.11.5.6

        `' strstr: C 4.11.5.7

        `' strtok: C 4.11.5.8

        `' strxfrm: C 4.11.4.5

   `' libc stdlib (newlib/libc/stdlib, environ.cc,
     newlib/libc/include/machine/setjmp.h newlib/libc/include/assert.h)
        `' abort: C 4.10.4.1, P 8.2.3.12

        `' abs: C 4.10.6.1

        `' assert: C 4.2.1.1

        `' atexit: C 4.10.4.2

        `' atof: C 4.10.1.1

        `' atoi: C 4.10.1.2

        `' atol: C 4.10.1.3

        `' bsearch: C 4.10.5.1

        `' calloc: C 4.10.3.1

        `' div: C 4.10.6.2

        `' exit: C 4.10.4.3, P 8.2.3.12

        `' free: C 4.10.3.2

        `' getenv: C 4.10.4.4, P 4.6.1.1

        `' labs: C 4.10.6.3

        `' ldiv: C 4.10.6.2

        `' longjmp: C 4.6.2.1

        `' malloc: C 4.10.3.3

        `' mblen: C 4.10.7.1

        `' mbstowcs: C 4.10.8.1

        `' mbtowc: C 4.10.7.2

        `' qsort: 4.10.5.2

        `' rand: C 4.10.2.1

        `' realloc: C 4.10.3.4

        `' setjmp: C 4.6.1.1

        `' srand: C 4.10.2.2

        `' strtod: C 4.10.1.4

        `' strtol: C 4.10.1.5

        `' strtoul: C 4.10.1.6

        `' system: C 4.10.4.5

        `' wcstombs: C 4.10.8.2

        `' wctomb: C 4.10.7.3

   `' libc time (times.cc, newlib/libc/time)
        `' asctime: C 4.12.3.1

        `' gmtime: C 4.12.3.3

        `' localtime: C 4.12.3.4, P 8.1.1

        `' time: C 4.12.2.4, P 4.5.1.1

        `' clock: C 4.12.2.1

        `' ctime: C 4.12.3.2

        `' difftime: C 4.12.2.2

        `' mktime: C 4.12.2.3, P 8.1.1

        `' strftime: C 4.11.6.2

   `' libc signals (signal.cc, newlib/libc/signal)
        `' raise: C 4.7.2.1

        `' signal: C 4.7.1.1

   `' libc ctype (newlib/libc/ctype)
        `' isalnum: C 4.3.1.1

        `' isalpha: C 4.3.1.2

        `' iscntrl: C 4.3.1.3

        `' isdigit: C 4.3.1.4

        `' isgraph: C 4.3.1.5

        `' islower: C 4.3.1.6

        `' isprint: C 4.3.1.7

        `' ispunct: C 4.3.1.8

        `' isspace: C 4.3.1.9

        `' isupper: C 4.3.1.10

        `' isxdigit: C 4.3.1.11

        `' tolower: C 4.3.2.1

        `' toupper: C 4.3.2.2

   `' libm math (newlib/libm/math)
        `' acos: C 4.5.2.1

        `' asin: C 4.5.2.2

        `' atan: C 4.5.2.3

        `' atan2: C 4.5.2.4

        `' ceil: C 4.5.6.1

        `' cos: C 4.5.2.5

        `' cosh: C 4.5.3.2

        `' exp: C 4.5.4.1

        `' fabs: C 4.5.6.2

        `' floor: C 4.5.6.3

        `' fmod: C 4.5.6.4

        `' frexp: C 4.5.4.2

        `' ldexp: C 4.5.4.3

        `' log: C 4.5.4.4

        `' log10: C 4.5.4.5

        `' modf: C 4.5.4.6

        `' pow: C 4.5.5.1

        `' sin: C 4.5.2.6

        `' sinh: C 4.5.3.2

        `' sqrt: C 4.5.5.2

        `' tan: C 4.5.2.7

        `' tanh: C 4.5.3.3

   `' libc misc (newlib/libc/locale, gcc/ginclude/stdarg.h)
        `' localeconv: C 4.4.2.1

        `' setlocale: C 4.4.1.1, P 8.1.2.1

        `' va_arg: C 4.8.1.2

        `' va_end: C 4.8.1.3

        `' va_start: C 4.8.1.1

POSIX.1/96 Functions
====================

     *(Please note: This section has not yet been updated for the latest
net release.)*

   `' Process Primitives (Section 3)
        `' fork: P 3.1.1.1

        `' execl: P 3.1.2.1

        `' execle: P 3.1.2.1

        `' execlp: P 3.1.2.1

        `' execv: P 3.1.2.1

        `' execve: P 3.1.2.1

        `' execvp: P 3.1.2.1

        `' pthread_atfork: P96 3.1.3.1 - unimplemented

        `' wait: P 3.2.1.1

        `' waitpid: P 3.2.1.1

        `' _exit: P 3.2.2.1

        `' kill: P 3.3.2.1

        `' sigemptyset: P 3.3.3.1

        `' sigfillset: P 3.3.3.1

        `' sigaddset: P 3.3.3.1

        `' sigdelset: P 3.3.3.1

        `' sigismember: P 3.3.3.1

        `' sigaction: P 3.3.4.1

        `' pthread_sigmask: P96 3.3.5.1

        `' sigprocmask: P 3.3.5.1

        `' sigpending: P 3.3.6.1

        `' sigsuspend: P 3.3.7.1

        `' sigwait: P96 3.3.8.1 - unimplemented

        `' sigwaitinfo: P96 3.3.8.1 - unimplemented

        `' sigtimedwait: P96 3.3.8.1 - unimplemented

        `' sigqueue: P96 3.3.9.1 - unimplemented

        `' pthread_kill: P96 3.3.10.1

        `' alarm: P 3.4.1.1

        `' pause: P 3.4.2.1

        `' sleep: P 3.4.3.1

   `' Process Environment (Section 4)
        `' getpid: P 4.1.1.1

        `' getppid: P 4.1.1.1

        `' getuid: P 4.2.1.1

        `' geteuid: P 4.2.1.1

        `' getgid: P 4.2.1.1

        `' getegid: P 4.2.1.1

        `' setuid: P 4.2.2.1 (stub on 9X, sets ENOSYS, returns zero)

        `' setgid: P 4.2.2.1 (stub on 9X, sets ENOSYS, returns zero)

        `' getgroups: P 4.2.3.1

        `' getlogin: P 4.2.4.1

        `' getlogin_r: P 4.2.4.1 - unimplemented

        `' getpgrp: P 4.3.1.1

        `' setsid: P 4.3.2.1

        `' setpgid: P 4.3.3.1

        `' uname: P 4.4.1.1

        `' time: C 4.12.2.4, P 4.5.1.1

        `' times: P 4.5.2.1

        `' getenv: C 4.10.4.4, P 4.6.1.1

        `' ctermid: P 4.7.1.1

        `' ttyname: P 4.7.2.1

        `' ttyname_r: P 4.7.2.1 - unimplemented

        `' isatty: P 4.7.2.1

        `' sysconf: P 4.8.1.1

   `' Files and Directories (Section 5)
        `' opendir: P 5.1.2.1

        `' readdir: P 5.1.2.1

        `' readdir_r: P96 5.1.2.1 - unimplemented

        `' rewinddir: P 5.1.2.1

        `' closedir: P 5.1.2.1

        `' chdir: P 5.2.1.1

        `' getcwd: P 5.2.2.1

        `' open: P 5.3.1.1

        `' creat: P 5.3.2.1

        `' umask: P 5.3.3.1

        `' link: P 5.3.4.1 (copy file in Win 95, and when link fails in
          NT)

        `' mkdir: P 5.4.1.1

        `' mkfifo: P 5.4.2.1 - unimplemented!!!

        `' unlink: P 5.5.1.1

        `' rmdir: P 5.5.2.1

        `' rename: C 4.9.4.2, P 5.5.3.1

        `' stat: P 5.6.2.1

        `' fstat: P 5.6.2.1

        `' access: P 5.6.3.1

        `' chmod: P 5.6.4.1

        `' fchmod: P96 5.6.4.1

        `' chown: P 5.6.5.1 (stub in Win 95; always returns zero)

        `' utime: P 5.6.6.1

        `' ftruncate: P96 5.6.7.1

        `' pathconf: P 5.7.1.1

        `' fpathconf: P 5.7.1.1

   `' Input and Output Primitives (Section 6)
        `' pipe: P 6.1.1.1

        `' dup: P 6.2.1.1

        `' dup2: P 6.2.1.1

        `' close: P 6.3.1.1

        `' read: P 6.4.1.1

        `' write: P 6.4.2.1

        `' fcntl: P 6.5.2.1 (note: fcntl(fd, F_GETLK,...) is not
          implemented (returns -1 with errno set to ENOSYS)).

        `' lseek: P 6.5.3.1 (note: only works correctly on binary files)

        `' fsync: P96 6.6.1.1

        `' fdatasync: P96 6.6.2.1 - unimplemented

        `' aio_read: P96 6.7.2.1 - unimplemented

        `' aio_write: P96 6.7.3.1 - unimplemented

        `' lio_listio: P96 6.7.4.1 - unimplemented

        `' aio_error: P96 6.7.5.1 - unimplemented

        `' aio_return: P96 6.7.6.1 - unimplemented

        `' aio_cancel: P96 6.7.7.1 - unimplemented

        `' aio_suspend: P96 6.7.8.1 - unimplemented

        `' aio_fsync: P96 6.7.9.1 - unimplemented

   `' Device- and Class-Specific Functions (Section 7)
        `' cfgetispeed: P96 7.1.3.1

        `' cfgetospeed: P96 7.1.3.1

        `' cfsetispeed: P96 7.1.3.1

        `' cfsetospeed: P96 7.1.3.1

        `' tcdrain: P 7.2.2.1

        `' tcflow: P 7.2.2.1

        `' tcflush: P 7.2.2.1

        `' tcgetattr: P96 7.2.1.1

        `' tcgetpgrp: P 7.2.3.1

        `' tcsendbreak: P 7.2.2.1

        `' tcsetattr: P96 7.2.1.1

        `' tcsetpgrp: P 7.2.4.1

   `' Language-Specific Services for the C Programming Language
     (Section 8)
        `' abort: C 4.10.4.1, P 8.2.3.12

        `' asctime_r: P96 8.3.4.1 - unimplemented

        `' ctime_r: P96 8.3.5.1 - unimplemented

        `' exit: C 4.10.4.3, P 8.2.3.12

        `' fclose: C 4.9.5.1, P 8.2.3.2

        `' fdopen: P 8.2.2.1

        `' fflush: C 4.9.5.2, P 8.2.3.4

        `' fgetc: C 4.9.7.1, P 8.2.3.5

        `' fgets: C 4.9.7.2, P 8.2.3.5

        `' fileno: P 8.2.1.1

        `' flockfile: P96 8.2.6.1 - unimplemented

        `' fopen: C 4.9.5.3, P 8.2.3.1

        `' fprintf: C 4.9.7.3, P 8.2.3.6

        `' fputc: C 4.9.7.3, P 8.2.3.6

        `' fputs: C 4.9.7.4, P 8.2.3.6

        `' fread: C 4.9.8.1, P 8.2.3.5

        `' freopen: C 4.9.5.4, P 8.2.3.3

        `' fscanf: C 4.9.6.2, P 8.2.3.7

        `' fseek: C 4.9.9.2, P 8.2.3.7

        `' ftell: C 4.9.9.4, P 8.2.3.10

        `' ftrylockfile: P96 8.2.6.1 - unimplemented

        `' funlockfile: P96 8.2.6.1 - unimplemented

        `' fwrite: C 4.9.8.2, P 8.2.3.6

        `' getc: C 4.9.7.5, P 8.2.3.5

        `' getc_unlocked: P96 8.2.7.1

        `' getchar: C 4.9.7.6, P 8.2.3.5

        `' getchar_unlocked: P96 8.2.7.1

        `' gets: C 4.9.7.7, P 8.2.3.5

        `' gmtime_r: P96 8.3.6.1 - unimplemented

        `' localtime_r: P96 8.3.7.1 - unimplemented

        `' perror: C 4.9.10.4, P 8.2.3.8

        `' printf: C 4.9.6.3, P 8.2.3.6

        `' putc: C 4.9.7.8, P 8.2.3.6

        `' putc_unlocked: P96 8.2.7.1

        `' putchar: C 4.9.7.9, P 8.2.3.6

        `' putchar_unlocked: P96 8.2.7.1

        `' puts: C 4.9.7.10, P 8.2.3.6

        `' rand_r: P96 8.3.8.1 - unimplemented

        `' remove: C 4.9.4.1, P 8.2.4

        `' rewind: C 4.9.9.5, P 8.2.3.7

        `' scanf: C 4.9.6.4, P 8.2.3.5

        `' setlocale: C 4.4.1.1, P 8.1.2.1

        `' siglongjmp: P 8.3.1.1

        `' sigsetjmp: P 8.3.1.1

        `' strtok_r: P96 8.3.3.1 - unimplemented

        `' tmpfile: C 4.9.4.3, P 8.2.3.9

        `' tmpnam: C 4.9.4.4, P 8.2.5

        `' tzset: P 8.3.2.1

   `' System Databases (Section 9)
        `' getgrgid: P 9.2.1.1

        `' getgrgid_r: P96 9.2.1.1 - unimplemented

        `' getgrnam: P 9.2.1.1

        `' getgrnam_r: P96 9.2.1.1 - unimplemented

        `' getpwnam: P 9.2.2.1

        `' getpwnam_r: P96 9.2.2.1 - unimplemented

        `' getpwuid: P 9.2.2.1

        `' getpwuid_r: P96 9.2.2.1 - unimplemented

   `' Synchronization (Section 11)
        `' pthread_cond_broadcast: P96 11.4.3.1

        `' pthread_cond_destroy: P96 11.4.2.1

        `' pthread_cond_init: P96 11.4.2.1

        `' pthread_cond_signal: P96 11.4.3.1

        `' pthread_cond_timedwait: P96 11.4.4.1

        `' pthread_cond_wait: P96 11.4.4.1

        `' pthread_condattr_destroy: P96 11.4.1.1 - unimplemented

        `' pthread_condattr_getpshared: P96 11.4.1.1 - unimplemented

        `' pthread_condattr_init: P96 11.4.1.1 - unimplemented

        `' pthread_condattr_setpshared: P96 11.4.1.1 - unimplemented

        `' pthread_mutex_destroy: P96 11.3.2.1

        `' pthread_mutex_init: P96 11.3.2.1

        `' pthread_mutex_lock: P96 11.3.3.1

        `' pthread_mutex_trylock: P96 11.3.3.1

        `' pthread_mutex_unlock: P96 11.3.3.1

        `' sem_close: P96 11.2.4.1 - unimplemented

        `' sem_destroy: P96 11.2.2.1

        `' sem_getvalue: P96 11.2.8.1 - unimplemented

        `' sem_init: P96 11.2.1.1

        `' sem_open: P96 11.2.3.1 - unimplemented

        `' sem_post: P96 11.2.7.1

        `' sem_trywait: P96 11.2.6.1

        `' sem_unlink: P96 11.2.5.1 - unimplemented

        `' sem_wait: P96 11.2.6.1

   `' Memory Management (Section 12)
        `' mlock: P96 12.1.2.1 - unimplemented

        `' mlockall: P96 12.1.1.1 - unimplemented

        `' mmap: P96 12.2.1.1

        `' mprotect: P96 12.2.3.1

        `' msync: P96 12.2.4.1

        `' munlock: P96 12.1.2.1 - unimplemented

        `' munlockall: P96 12.1.1.1 - unimplemented

        `' munmap: P96 12.2.2.1

        `' shm_open: P96 12.3.1.1 - unimplemented

        `' shm_unlink: P96 12.3.2.1 - unimplemented

   `' Execution Scheduling (Section 13)
        `' pthread_attr_getinheritsched: P96 13.5.1.1 - unimplemented

        `' pthread_attr_getschedparam: P96 13.5.1.1 - unimplemented

        `' pthread_attr_getschedpolicy: P96 13.5.1.1 - unimplemented

        `' pthread_attr_getscope: P96 13.5.1.1 - unimplemented

        `' pthread_attr_setinheritsched: P96 13.5.1.1

        `' pthread_attr_setschedparam: P96 13.5.1.1 - unimplemented

        `' pthread_attr_setschedpolicy: P96 13.5.1.1 - unimplemented

        `' pthread_attr_setscope: P96 13.5.1.1 - unimplemented

        `' pthread_getschedparam: P96 13.5.2.1

        `' pthread_mutex_getprioceiling: P96 13.6.2.1 - unimplemented

        `' pthread_mutex_setprioceiling: P96 13.6.2.1 - unimplemented

        `' pthread_mutexattr_getprioceiling: P96 13.6.1.1 -
          unimplemented

        `' pthread_mutexattr_getprotocol: P96 13.6.1.1 - unimplemented

        `' pthread_mutexattr_setprioceiling: P96 13.6.1.1 -
          unimplemented

        `' pthread_mutexattr_setprotocol: P96 13.6.1.1 - unimplemented

        `' pthread_setschedparam: P96 13.5.2.1

        `' sched_get_priority_max: P96 13.3.6.1 - unimplemented

        `' sched_get_priority_min: P96 13.3.6.1 - unimplemented

        `' sched_getparam: P96 13.3.2.1 - unimplemented

        `' sched_getscheduler: P96 13.3.4.1 - unimplemented

        `' sched_rr_get_interval: P96 13.3.6.1 - unimplemented

        `' sched_setparam: P96 13.3.1.1 - unimplemented

        `' sched_setscheduler: P96 13.3.3.1 - unimplemented

        `' sched_yield: P96 13.3.5.1 - unimplemented

   `' Clocks and Timers (Section 14)
        `' clock_getres: P96 14.2.1.1 - unimplemented

        `' clock_gettime: P96 14.2.1.1 - unimplemented

        `' clock_settime: P96 14.2.1.1 - unimplemented

        `' nanosleep: P96 14.2.5.1 - unimplemented

        `' timer_create: P96 14.2.2.1 - unimplemented

        `' timer_delete: P96 14.2.3.1 - unimplemented

        `' timer_getoverrun: P96 14.2.4.1 - unimplemented

        `' timer_gettime: P96 14.2.4.1 - unimplemented

        `' timer_settime: P96 14.2.4.1 - unimplemented

   `' Message Passing (Section 15)
        `' mq_close: P96 15.2.2.1 - unimplemented

        `' mq_getattr: P96 15.2.8.1 - unimplemented

        `' mq_notify: P96 15.2.6.1 - unimplemented

        `' mq_open: P96 15.2.1.1 - unimplemented

        `' mq_receive: P96 15.2.5.1 - unimplemented

        `' mq_send: P96 15.2.4.1 - unimplemented

        `' mq_setattr: P96 15.2.7.1 - unimplemented

        `' mq_unlink: P96 15.2.3.1 - unimplemented

   `' Thread Management (Section 16)
        `' pthread_attr_destroy: P96 16.2.1.1

        `' pthread_attr_getdetachstate: P96 16.2.1.1 - unimplemented

        `' pthread_attr_getstackaddr: P96 16.2.1.1 - unimplemented

        `' pthread_attr_getstacksize: P96 16.2.1.1

        `' pthread_attr_init: P96 16.2.1.1

        `' pthread_attr_setdetachstate: P96 16.2.1.1 - unimplemented

        `' pthread_attr_setstackaddr: P96 16.2.1.1 - unimplemented

        `' pthread_attr_setstacksize: P96 16.2.1.1

        `' pthread_create: P96 16.2.2.1

        `' pthread_detach: P96 16.2.4.1 - unimplemented

        `' pthread_equal: P96 16.2.7.1

        `' pthread_exit: P96 16.2.5.1

        `' pthread_join: P96 16.2.3.1 - unimplemented

        `' pthread_once: P96 16.2.8.1 - unimplemented

        `' pthread_self: P96 16.2.6.1

   `' Thread-Specific Data (Section 17)
        `' pthread_getspecific: P96 17.1.2.1

        `' pthread_key_create: P96 17.1.1.1

        `' pthread_key_delete: P96 17.1.3.1

        `' pthread_setspecific: P96 17.1.2.1

   `' Thread Cancellation (Section 18)
        `' pthread_cancel: P96 18.2.1.1 - unimplemented

        `' pthread_cleanup_pop: P96 18.2.3.1 - unimplemented

        `' pthread_cleanup_push: P96 18.2.3.1 - unimplemented

        `' pthread_setcancelstate: P96 18.2.2.1 - unimplemented

        `' pthread_setcanceltype: P96 18.2.2.1 - unimplemented

        `' pthread_testcancel: P96 18.2.2.1 - unimplemented

Misc Functions
==============

     *(Please note: This section has not yet been updated for the latest
net release.)*

   `' Networking (net.cc) (Standardized by POSIX 1.g, which is probably
     still in draft?)
        `' accept

        `' bind

        `' connect

        `' getdomainname

        `' gethostbyaddr

        `' gethostbyname

        `' getpeername

        `' getprotobyname

        `' getprotobynumber

        `' getservbyname

        `' getservbyport

        `' getsockname

        `' getsockopt

        `' herror

        `' htonl

        `' htons

        `' inet_addr

        `' inet_makeaddr

        `' inet_netof

        `' inet_ntoa

        `' listen

        `' ntohl

        `' ntohs

        `' rcmd

        `' recv

        `' recvfrom

        `' rexec

        `' rresvport

        `' send

        `' sendto

        `' setsockopt

        `' shutdown

        `' socket

        `' socketpair

     Of these networking calls, rexec, rcmd and rresvport are
     implemented in MS IP stack but may not be implemented in other
     vendors' stacks.

   `' Other
        `' acl

        `' aclcheck

        `' aclfrommode

        `' aclfrompbits

        `' aclfromtext

        `' aclsort

        `' acltomode

        `' acltopbits

        `' acltotext

        `' chroot (with restrictions)

        `' closelog

        `' cwait

        `' cygwin_conv_to_full_posix_path

        `' cygwin_conv_to_full_win32_path

        `' cygwin_conv_to_posix_path

        `' cygwin_conv_to_win32_path

        `' cygwin_logon_user

        `' cygwin_posix_path_list_p

        `' cygwin_posix_to_win32_path_list

        `' cygwin_posix_to_win32_path_list_buf_size

        `' cygwin_set_impersonation_token

        `' cygwin_split_path

        `' cygwin_win32_to_posix_path_list

        `' cygwin_win32_to_posix_path_list_buf_size

        `' cygwin_winpid_to_pid

        `' dlclose

        `' dlerror

        `' dlfork

        `' dlopen

        `' dlsym

        `' endgrent

        `' endhostent

        `' facl

        `' fcloseall

        `' fcloseall_r

        `' ffs

        `' fstatfs

        `' ftime

        `' get_osfhandle

        `' getdtablesize

        `' getgrent

        `' gethostname

        `' getitimer

        `' getmntent

        `' getpagesize

        `' getpgid

        `' getpwent

        `' gettimeofday: BSD

        `' grantpt

        `' initgroups (stub)

        `' ioctl

        `' killpg

        `' login

        `' logout

        `' lstat

        `' mknod (stub, sets ENOSYS, returns -1)

        `' memccpy

        `' nice

        `' openlog

        `' pclose

        `' popen

        `' ptsname

        `' putenv

        `' random

        `' readv

        `' realpath

        `' regfree

        `' rexec

        `' select

        `' setegid: SVR4 (stub on 9X, sets ENOSYS, returns zero)

        `' endpwent

        `' setenv

        `' seterrno

        `' seteuid (stub on 9X, sets ENOSYS, returns zero)

        `' sethostent

        `' setitimer

        `' setmntent

        `' setmode

        `' setpassent

        `' setpgrp

        `' setpwent

        `' settimeofday: BSD (stub, set ENOSYS, return -1)

        `' sexecl

        `' sexecle

        `' sexeclp

        `' sexeclpe

        `' sexeclpe

        `' sexecp

        `' sexecv

        `' sexecve

        `' sexecvpe

        `' sigpause

        `' spawnl (spawn calls are from Windows C library)

        `' spawnle

        `' spawnlp

        `' spawnlpe

        `' spawnv

        `' spawnve

        `' spawnvp

        `' spawnvpe

        `' srandom

        `' statfs

        `' strsignal

        `' strtosigno

        `' swab

        `' syslog

        `' timezone

        `' truncate (SVR4/4.3+BSD)

        `' ttyslot

        `' unlockpt

        `' unsetenv

        `' usleep

        `' utimes

        `' vfork: stub that calls fork

        `' vhangup (stub, sets ENOSYS, returns -1)

        `' wait3

        `' wait4

        `' wcscmp

        `' wcslen

        `' wprintf

        `' writev


Question and Answers
********************

Where can I get more information?
=================================

Where's the documentation?
--------------------------

   If you have installed Cygwin, you can find lots of documentation in
`/usr/doc/'.  Many packages ship with standard documentation, you can
find this in a directory `/usr/doc/_package_name_'.  In addition, some
packages have Cygwin specific instructions in a file
`/usr/doc/Cygwin/_package_name_.README'.

   There are links to quite a lot of it on the main Cygwin project web
page: `http://cygwin.com/'.  Be sure to at least read any 'Release
Notes' or 'Readme' or 'read this' links on the main web page, if there
are any.

   There is a comprehensive Cygwin User's Guide at
`http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html' and an API
Reference at `http://cygwin.com/cygwin-api/cygwin-api.html'.

   You can find documentation for the individual GNU tools at
`http://www.fsf.org/manual/'.  (You should read GNU manuals from a
local mirror, check `http://www.fsf.org/server/list-mirrors.html' for a
list of them.)

What Cygwin mailing lists can I join?
-------------------------------------

   Comprehensive information about the Cygwin mailing lists can be
found at `http://cygwin.com/lists.html'.

   To subscribe to the main list, send a message to
cygwin-subscribe@cygwin.com.  To unsubscribe from the main list, send a
message to cygwin-unsubscribe@cygwin.com.  In both cases, the subject
and body of the message are ignored.

   Similarly, to subscribe to the Cygwin annoucements list, send a
message to cygwin-announce-subscribe@cygwin.com.  To unsubscribe, send
a message to cygwin-announce-unsubscribe@cygwin.com.

   If you are going to help develop the Cygwin library by volunteering
for the project, you will want to subscribe to the Cygwin developers
list, called cygwin-developers.  If you are contributing to Cygwin
tools & applications, rather than the library itself, then you should
subscribe to cygwin-apps.  The same mechanism as described for the
first two lists works for these as well.  Both cygwin-developers and
cygwin-apps are by-approval lists.

   There is a searchable archive of the main mailing list at
`http://cygwin.com/ml/cygwin/'.  There is an alternate archive, also
searchable, at `http://www.delorie.com/archives/'.  You can also search
at `http://www.google.com/' and include "cygwin" in the list of search
terms.

   Cygwin mailing lists are not gatewayed to USENET, so anti-spam
measures in your email address are neither required nor appreciated.
Also, avoid sending HTML content to Cygwin mailing lists.

Posting Guidelines (Or: Why won't you/the mailing list answer my questions?)
----------------------------------------------------------------------------

   If you follow these guidelines, you are much more likely to get a
helpful response from the Cygwin developers and/or the Cygwin community
at large:

   * Read the User's Guide and the FAQ first.

   * Check the mailing list archives.  Your topic may have come up
     before.  (It may even have been answered!)  Use the search
     facilities at the links above.  Try the alternate site if the main
     archive is not producing search results.

   * Explain your problem carefully and completely.  "I installed Blah
     and it doesn't work!" wastes everybody's time.  It provides no
     information for anyone to help you with your problem.  You should
     provide:

        * A problem statement:  How does it behave, how do you think it
          should behave, and what makes you think it's broken?  (Oh
          yeah, and what is _"it"_?)

        * Information about your Windows OS ("Win95 OSR2" or "NT4/SP3"
          or "Win2K" or "Win98 SE" or ...).

        * Details about your installation process, or attempts at same.
          (Internet or Directory install?  If the former, exactly when
          and from what mirror?  If the latter, which packages did you
          download?  Which version of setup.exe?  Any subsequent
          updates?)

        * Details about your Cygwin setup, accomplished by _attaching_
          the output of 'cygcheck -s -v -r' to your message.  (Do not
          paste the output into your message.)

        * A valid return address, so that a reply doesn't require
          manual editing of the 'To:' header.

   * Your message must be relevant to the list.  Messages that are
     _not_ directly related to Cygwin are considered off-topic and are
     unwelcome.  For example, the following are off-topic:

        * General programming language questions

        * General Windows programming questions

        * General UNIX shell programming questions

        * General application usage questions

        * How to make millions by working at home

        * Announcements from LaserJet toner cartridge suppliers

   * Read and obey "How To Ask Questions The Smart Way" by Eric S.
     Raymond, at `http://www.catb.org/~esr/faqs/smart-questions.html'.


   If you do not follow the above guidelines, you may still elicit a
response, but you may not appreciate it!

   For inquiries about support contracts and commercial licensing, visit
`http://www.redhat.com/software/cygwin/'.

   Beyond that, perhaps nobody has time to answer your question.
Perhaps nobody knows the answer.

Using Cygwin
============

Why can't my application locate cygncurses5.dll?  or cygintl.dll?  or cygreadline5.dll?  or ...?
------------------------------------------------------------------------------------------------

   If you upgraded recently, and suddenly vim (or some other Cygwin
application) cannot find `cygncurses5.dll', it means that you did not
follow these instructions properly:
`http://cygwin.com/ml/cygwin-announce/2001/msg00124.html'.  To repair
the damage, you must run Cygwin Setup again, and re-install the
`libncurses5' package.

   Note that Cygwin Setup won't show this option by default.  In the
"Select packages to install" dialogue, click on the `Full/Part' button.
This lists all packages, even those that are already installed.
Scroll down to locate the `libncurses5' package.  Click on the "cycle"
glyph until it says "Reinstall".  Continue with the installation.

   Similarly, if something cannot find `cygintl.dll', then run Cygwin
Setup and re-install the `libintl' and `libintl1' packages.

   For a detailed explanation of the general problem, and how to extend
it to other missing DLLs (like cygreadline5.dll) and identify their
containing packages, see
`http://cygwin.com/ml/cygwin/2002-01/msg01619.html'.

Why is Cygwin suddenly _so_ slow?
---------------------------------

   If you recently upgraded the `cygwin' package and suddenly _every_
command takes a _very_ long time, then you probably have the obsolete
`//c' notation in your PATH.  This now means the _network share_ `c',
which will slow things down tremendously if it does not exist.  See
then next FAQ entry.

Why doesn't //c (for C:) work anymore?
--------------------------------------

   (Similarly for any drive letter, e.g. `//z' for `Z:')

   This "feature" has long been deprecated, and no longer works at all
in the latest release.  As of release 1.3.3, `//c' now means the
_network share_ `c'.

   For a detailed discussion of why this change was made, and how deal
with it now, refer to
`http://sources.redhat.com/ml/cygwin/2001-09/msg00014.html'.

How should I set my PATH?
-------------------------

   This is done for you in the file /etc/profile, which is sourced by
bash when you start it from the Desktop or Start Menu shortcut, created
by `setup.exe'.  The line is

     	PATH="/usr/local/bin:/usr/bin:/bin:$PATH"

   Effectively, this *prepends* /usr/local/bin and /usr/bin to your
Windows system path.  If you choose to reset your PATH, say in
$HOME/.bashrc, or by editing etc/profile directly, then you should
follow this rule.  You *must* have `/usr/bin' in your PATH *before* any
Windows system directories.  (And you must not omit the Windows system
directories!)  Otherwise you will likely encounter all sorts of
problems running Cygwin applications.

Bash says "command not found", but it's right there!
----------------------------------------------------

   If you compile a program, you might find that you can't run it:

     	bash$ gcc -o hello hello.c
             bash$ hello
             bash: hello: command not found

   Unlike Windows, bash does not look for programs in `.' (the current
directory) by default.  You can add `.' to your PATH (see above), but
this is not recommended (at least on UNIX) for security reasons.  Just
tell bash where to find it, when you type it on the command line:

     	bash$ gcc -o hello hello.c
             bash$ ./hello
             Hello World!

How do I convert between Windows and UNIX paths?
------------------------------------------------

   Use the 'cygpath' utility.  Type '`cygpath --help'' for information.
For example (on my installation):
     	bash$ cygpath --windows ~/.bashrc
             D:\starksb\.bashrc
             bash$ cygpath --unix C:/cygwin/bin/cygwin.bat
             /usr/bin/cygwin.bat
             bash$ cygpath --unix C:\\cygwin\\bin\\cygwin.bat
             /usr/bin/cygwin.bat
   Note that bash interprets the backslash '\' as an escape character,
so you must type it twice in the bash shell if you want it to be
recognized as such.

Why doesn't bash read my .bashrc file on startup?
-------------------------------------------------

   Your .bashrc is read from your home directory specified by the HOME
environment variable.  It uses /.bashrc if HOME is not set.  So you need
to set HOME correctly, or move your .bashrc to the top of the drive
mounted as / in Cygwin.

How can I get bash filename completion to be case insensitive?
--------------------------------------------------------------

   Add the following to your `~/.bashrc' file:

     	shopt -s nocaseglob

   and add the following to your `~/.inputrc' file:

     	set completion-ignore-case on

Can I use paths/filenames containing spaces in them?
----------------------------------------------------

   Cygwin does support spaces in filenames and paths.  That said, some
utilities that use the library may not, since files don't typically
contain spaces in Unix.  If you stumble into problems with this, you
will need to either fix the utilities or stop using spaces in filenames
used by Cygwin tools.

   In particular, bash interprets space as a word separator.  You would
have to quote a filename containing spaces, or escape the space
character.  For example:
     	bash-2.03$ cd '/cygdrive/c/Program Files'
   or
     	bash-2.03$ cd /cygdrive/c/Program\ Files

Why can't I cd into a shortcut to a directory?
----------------------------------------------

   This is only valid up to but not including version 1.3.0:

   Cygwin does not follow MS Windows Explorer Shortcuts (*.lnk files).
It sees a shortcut as a regular file and this you cannot "cd" into it.

   Some people have suggested replacing the current symbolic link scheme
with shortcuts.  The major problem with this is that .LNK files would
then be used to symlink Cygwin paths that may or may not be valid under
native Win32 non-Cygwin applications such as Explorer.

   Since version 1.3.0, Cygwin treats shortcuts as symlinks.

I'm having basic problems with find.  Why?
------------------------------------------

   Make sure you are using the find that came with Cygwin and that you
aren't picking up the Win32 find command instead.  You can verify that
you are getting the right one by doing a "type find" in bash.

   If the path argument to find, including current directory (default),
is itself a symbolic link, then find will not traverse it unless you
specify the `-follow' option.  This behavior is different than most
other UNIX implementations, but is not likely to change.

Why doesn't `su' work?
----------------------

   The `su' command has been in and out of Cygwin distributions, but it
has not been ported to Cygwin and has never worked.  It is currently
installed as part of the sh-utils, but again, it does not work.

   You may be able to use `login' instead, but you should read
`http://www.cygwin.com/ml/cygwin/2001-03/msg00337.html' first.

   For some technical background into why `su' doesn't work, read
`http://www.cygwin.com/ml/cygwin/2003-06/msg00897.html' and related
messages.

Why doesn't man (or apropos) work?
----------------------------------

   Even after installing the `man' package, you get an error like this:

     	bash-2.04$ man man
     	Error executing formatting or display command.
     	System command (cd /usr/man ; (echo -e ".pl 1100i"; cat /usr/man/man1/man.1; echo ".pl \n(nlu+10") | /usr/bin/tbl | /usr/bin/groff -Tascii -mandoc | less -is) exited with status 32512.
     	No manual entry for man

   You also need /bin/sh, which is found in the `ash' package.  You
must install this too.

   In addition, before you can use `man -k' or `apropos', you must
create the whatis database.  Just run the command

     	/usr/sbin/makewhatis

   (it may take a minute to complete).

Why doesn't chmod work?
-----------------------

   `ntsec' will allow UNIX permissions in Windows NT on NTFS file
systems.  This is on by default (a recent change).

   `ntea' works on NTFS _and_ FAT but it creates a huge, *undeletable*
file on FAT filesystems.

   (The `ntsec' and `ntea' settings are values for the `CYGWIN'
environment variable.  See the Cygwin User's Guide at
`http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html' for more
information on this variable and its settings.)

   There is no solution at all for Windows 9x.

   If you have an application that requires a certain permission mode
on a file, you may be able to work around this requirement by modifying
the application's source code.  For a hint, based on work done by
Corinna Vinschen for OpenSSH, see this message from the cygwin mailing
list: `http://cygwin.com/ml/cygwin/2000-11/msg01176.html'.

Why doesn't `mkdir -p' work on a network share?
-----------------------------------------------

   Unfortunately, you cannot do something like this:

     bash$ mkdir -p //MACHINE/Share/path/to/new/dir
     mkdir: cannot create directory `//MACHINE': No such file or directory

   This is because mkdir checks for the existence of each directory on
the path, creating them as necessary.  Since `//MACHINE' is not a
directory (you can't cd to it either), mkdir tries to create it, and
fails.

   This might get fixed someday, but for now, you have to work around
it:

     bash$ cd //MACHINE/Share
     bash$ mkdir -p path/to/new/dir

Why doesn't my shell script work?
---------------------------------

   There are two basic problems you might run into.  One is the fact
that /bin/sh is really ash, and is missing some features you might
expect in /bin/sh, particularly if you are used to /bin/sh actually
being bash (Linux) or ksh (Tru64).  For example:

   bullet No `~' expansion (use $HOME instead)

   bullet No job control

   bullet No getopts

   bullet No let

   bullet No functions exported

   bullet Must use `.' instead of `source' (true of sh and ksh too, not
     just ash)

   Or, it could be a permission problem, and Cygwin doesn't understand
that your script is executable.  Because `chmod' may not work (see FAQ
entry above), Cygwin must read the contents of files to determine if
they are executable.  If your script does not start with

     	#! /bin/sh

   (or any path to a script interpreter, it does not have to be /bin/sh)
then Cygwin will not know it is an executable script.  The Bourne shell
idiom

     	:
     	# This is the 2nd line, assume processing by /bin/sh

   also works.

   Note that you can use `mount -x' to force Cygwin to treat all files
under the mount point as executable.  This can be used for individual
files as well as directories.  Then Cygwin will not bother to read files
to determine whether they are executable.

How do I print under Cygwin?
----------------------------

   There is no working lp or lpr system as you would find on UNIX.

   Jason Tishler has written a couple of messages that explain how to
use a2ps (for nicely formatted text in PostScript) and ghostscript (to
print PostScript files on non-PostScript Windows printers).  Start at
`http://cygwin.com/ml/cygwin/2001-04/msg00657.html'.  Note that the
`file' command is now available as part of Cygwin setup.

   Alternatively, on NT, you can use the Windows `print' command.  (It
does not seem to be available on Win9x.)  Type

     	bash$ print /\?

   for usage instructions (note the `?' must be escaped from the shell).

   Finally, you can simply `cat' the file to the printer's share name:

     	bash$ cat myfile > //host/printer

   You may need to press the formfeed button on your printer or append
the formfeed character to your file.

Why don't international (8-bit) characters work?
------------------------------------------------

   Before you can type international characters () in bash, you must
add the following lines to your `~/.inputrc' file:

     	set meta-flag on
             set convert-meta off
             set output-meta on

   These are options to the `readline' library, which you can read
about in the `bash(1)' and `readline(3)' man pages. Other tools that do
not use `readline' for display, such as less and ls, require additional
settings, which could be put in your `~/.bashrc':
     alias less='/bin/less -r'
     alias ls='/bin/ls -F --color=tty --show-control-chars'

Why don't cursor keys work under Win95/Win98?
---------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   Careful examination shows that they not just non-functional, but
rather behave strangely, for example, with NumLock off, keys on numeric
keyboard work, until you press usual cursor keys, when even numeric
stop working, but they start working again after hitting alphanumeric
key, etc. This reported to happen on localized versions of Win98 and
Win95, and not specific to Cygwin (there're known cases of Alt+Enter
(fullscreen/windowed toggle) not working and shifts sticking with other
programs). The cause of this problem is Microsoft keyboard localizer
which by default installed in 'autoexec.bat'. Corresponding line looks
like:

     keyb ru,,C:\WINDOWS\COMMAND\keybrd3.sys

   (That's for russian locale.) You should comment that line if you want
your keys working properly. Of course, this will deprive you of your
local alphabet keyboard support, so you should think about another
localizer. exUSSR users are of course knowledgeable of Keyrus
localizer, and it might work for other locales too, since it has
keyboard layout editor. But it has russian messages and documentation
;-( Reference URL is http://www.hnet.ru/software/contrib/Utils/KeyRus/
(note the you may need to turn off Windows logo for Keyrus to operate
properly).

Is it OK to have multiple copies of the DLL?
--------------------------------------------

   You should only have one copy of the Cygwin DLL on your system.  If
you have multiple versions, they will conflict and cause problems.

   If you get the error "shared region is corrupted" or "shared region
version mismatch" it means you have multiple versions of cygwin1.dll
running at the same time.  This could happen, for example, if you update
cygwin1.dll without exiting _all_ Cygwin apps (including inetd)
beforehand.

   If you're trying to find multiple versions of the DLL that are
causing this problem, reboot first, in case DLL's still loaded in
memory are the cause.  Then use the Windows System find utility to
search your whole machine, not just components in your PATH (as 'type'
would do) or cygwin-mounted filesystems (as Cygwin 'find' would do).

Where can I find "more"?
------------------------

   If you are looking for the "more" pager, you should use the "less"
pager instead.

Why isn't package XXXX available in Cygwin?  (Or, why is your package so out of date?)
--------------------------------------------------------------------------------------

   Probably because there is nobody willing or able to maintain it.  It
takes time, and the priority for the Cygwin Team is the Cygwin package.
The rest is a volunteer effort.  Want to contribute?  See below.

How can I access other drives?
------------------------------

   You have some flexibility here.

   Cygwin has a builtin "cygdrive prefix" for drives that are not
mounted.  You can access any drive, say Z:, as '/cygdrive/z/'.

   In some applications (notably bash), you can use the familiar windows
<drive>:/path/, using posix forward-slashes ('/') instead of Windows
backward-slashes ('\').  (But see the warning below!)  This maps in the
obvious way to the Windows path, but will be converted internally to use
the Cygwin path, following mounts (default or explicit).  For example:
     	bash$ cd C:/Windows
     	bash$ pwd
             /cygdrive/c/Windows
   and
     	bash$ cd C:/cygwin
     	bash$ pwd
             /
   for a default setup.  You could also use backward-slashes in the
Windows path, but these would have to be escaped from the shell.

   *Warning:* There is some ambiguity in going from a Windows path to
the posix path, because different posix paths, through different mount
points, could map to the same Windows directory.  This matters because
different mount points may be binmode or textmode, so the behavior of
Cygwin apps will vary depending on the posix path used to get there.

   You can avoid the ambiguity of Windows paths, and avoid typing
"/cygdrive", by explicitly mounting drives to posix paths.  For example:
     	bash$ mkdir /c
     	bash$ mount c:/ /c
     	bash$ ls /c
   Then `/cygdrive/c/Windows' becomes `/c/Windows' which is a little
less typing.

   Note that you only need to mount drives once.  The mapping is kept
in the registry so mounts stay valid pretty much indefinitely.  You can
only get rid of them with umount, or the registry editor.

   The '-b' option to mount mounts the mountpoint in binary mode
("binmode") where text and binary files are treated equivalently.  This
should only be necessary for badly ported Unix programs where binary
flags are missing from open calls.  It is also the setting for /,
/usr/bin and /usr/lib in a default Cygwin installation.  The default for
new mounts is text mode ("textmode"), which is also the mode for all
"cygdrive" mounts.

   You can change the default `cygdrive' prefix and whether it is
binmode or textmode using the `mount' command.  For example,
     	bash$ mount -b --change-cygdrive-prefix cygdrive
   will change all `/cygdrive/...' mounts to binmode.

How can I copy and paste into Cygwin console windows?
-----------------------------------------------------

   First, consider using rxvt instead of the standard console window.
In rxvt, selecting with the left-mouse also copies, and middle-mouse
pastes.  It couldn't be easier!

   Under Windows NT, open the properties dialog of the console window.
The options contain a toggle button, named "Quick edit mode".  It must
be ON.  Save the properties.

   Under Windows 9x, open the properties dialog of the console window.
Select the Misc tab.  Uncheck Fast Pasting.  Check QuickEdit.

   You can also bind the insert key to paste from the clipboard by
adding the following line to your .inputrc file:
     	"\e[2~": paste-from-clipboard

What does "mount failed: Device or resource busy" mean?
-------------------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   This usually means that you are trying to mount to a location
already in use by mount.  For example, if c: is mounted as '/' and you
try to mount d: there as well, you will get this error message.  First
"umount" the old location, then "mount" the new one and you should have
better luck.

   If you are trying to umount '/' and are getting this message, you may
need to run `regedit.exe' and change the "native" key for the '/' mount
in one of the mount points kept under HKEY_CURRENT_USER/Software/Red
Hat, Inc./CYGWIN.DLL setup/<version> where <version> is the latest
registry version associated with the Cygwin library.

How can I share files between Unix and Windows?
-----------------------------------------------

   During development, we have both Unix boxes running Samba and
NT/Windows 95/98 machines.  We often build with cross-compilers under
Unix and copy binaries and source to the Windows system or just toy
with them directly off the Samba-mounted partition.  On dual-boot
NT/Windows 9x machines, we usually use the FAT filesystem so we can
also access the files under Windows 9x.

Are mixed-case filenames possible with Cygwin?
----------------------------------------------

   Several Unix programs expect to be able to use to filenames spelled
the same way, but with different case.  A prime example of this is
perl's configuration script, which wants `Makefile' and `makefile'.
WIN32 can't tell the difference between files with just different case,
so the configuration fails.

   In releases prior to beta 16, mount had a special mixed case option
which renamed files in such a way as to allow mixed case filenames.  We
chose to remove the support when we rewrote the path handling code for
beta 16.  The standard Windows apps - explorer.exe,
cmd.exe/command.com, etc. - do not distinguish filenames that differed
only in case, resulting in some (very) undesirable behavior.

   Sergey Okhapkin had maintained a mixed-case patch ('coolview') until
about B20.1, but this has not been updated to recent versions of Cygwin.

What about DOS special filenames?
---------------------------------

   Files cannot be named com1, lpt1, or aux (to name a few); either as
the root filename or as the extension part.  If you do, you'll have
trouble.  Unix programs don't avoid these names which can make things
interesting.  E.g., the perl distribution has a file called `aux.sh'.
The perl configuration tries to make sure that `aux.sh' is there, but
an operation on a file with the magic letters 'aux' in it will hang.

When it hangs, how do I get it back?
------------------------------------

   If something goes wrong and the tools hang on you for some reason
(easy to do if you try and read a file called aux.sh), first try
hitting ^C to return to bash or the cmd prompt.

   If you start up another shell, and applications don't run, it's a
good bet that the hung process is still running somewhere.  Use the Task
Manager, pview, or a similar utility to kill the process.

   And, if all else fails, there's always the reset button/power switch.
This should never be necessary under Windows NT.

Why the weird directory structure?
----------------------------------

   Why do /lib and /usr/lib (and /bin, /usr/bin) point to the same
thing?

   Why use mounts instead of symbolic links?

   Can I use a disk root (e.g., C:\) as Cygwin root?  Why is this
discouraged?

   After a new installation in the default location, your mount points
will look something like this:

     	bash$ mount
     	C:\cygwin\bin on /usr/bin type system (binmode)
     	C:\cygwin\lib on /usr/lib type system (binmode)
     	C:\cygwin on / type system (binmode)

   (Exactly what you see depends on what options you gave to
`setup.exe'.)

   Note that /bin and /usr/bin point to the same location, as do /lib
and /usr/lib.  This is intentional, and you should not undo these mounts
unless you _really_ know what you are doing.

   Various applications and packages may expect to be installed in /lib
or /usr/lib (similarly /bin or /usr/bin).  Rather than distinguish
between them and try to keep track of them (possibly requiring the
occasional duplication or symbolic link), it was decided to maintain
only one actual directory, with equivalent ways to access it.

   Symbolic links had been considered for this purpose, but were
dismissed because they do not always work on Samba drives.  Also,
mounts are faster to process because no disk access is required to
resolve them.

   Note that non-cygwin applications will not observe Cygwin mounts (or
symlinks for that matter).  For example, if you use WinZip to unpack the
tar distribution of a Cygwin package, it may not get installed to the
correct Cygwin path.  _So don't do this!_

   It is strongly recommended not to make the Cygwin root directory the
same as your drive's root directory, unless you know what you are doing
and are prepared to deal with the consequences.  It is generally easier
to maintain the Cygwin hierarchy if it is isolated from, say, C:\.  For
one thing, you avoid possible collisions with other (non-cygwin)
applications that may create (for example) \bin and \lib directories.
(Maybe you have nothing like that installed now, but who knows about
things you might add in the future?)

How do anti-virus programs like Cygwin?
---------------------------------------

   Users have reported that NAI (formerly McAfee) VirusScan for NT (and
others?) is incompatible with Cygwin.  This is because it tries to scan
the newly loaded shared memory in cygwin1.dll, which can cause fork() to
fail, wreaking havoc on many of the tools.  (It is not confirmed that
this is still a problem, however.)

   There have been several reports of NAI VirusScan causing the system
to hang when unpacking tar.gz archives.  This is surely a bug in
VirusScan, and should be reported to NAI.  The only workaround is to
disable VirusScan when accessing these files.  This can be an issue
during setup, and is discussed in that FAQ entry.

   Some users report a significant performance hit using Cygwin when
their anti-virus software is enabled.  Rather than disable the
anti-virus software completely, it may be possible to specify
directories whose contents are exempt from scanning.  In a default
installation, this would be ``C:\cygwin\bin''.  Obviously, this could be
exploited by a hostile non-Cygwin program, so do this at your own risk.

Is there a Cygwin port of GNU Emacs?
------------------------------------

   Yes!  It uses the X11 (`http://cygwin.com/xfree/') Windows
interface.  From a remote login shell, this "emacs -nw" works fine.
There is also a non-X11 version which just provides the text-only
terminal interface.  Use Cygwin Setup to install either one (or both).

What about NT Emacs?
--------------------

   If you want GNU Emacs with a native Microsoft Windows interface, but
without X, then you must use the native Windows port, commonly known as
"NT Emacs".  You get NT Emacs from any GNU mirror.  It is not available
from Cygwin Setup.

   NT Emacs uses the Windows command shell by default.  Since it is not
a Cygwin application, it has no knowledge of Cygwin mounts.  With those
points in mind, you need to add the following code to your ~/.emacs (or
~/_emacs) file in order to use Cygwin bash.  This is particularly useful
for the JDEE package (`http://jdee.sunsite.dk/').  The following
settings are for Emacs 21.1:

     	;; This assumes that Cygwin is installed in C:\cygwin (the
     	;; default) and that C:\cygwin\bin is not already in your
     	;; Windows Path (it generally should not be).
     	;;
     	(setq exec-path (cons "C:/cygwin/bin" exec-path))
     	(setenv "PATH" (concat "C:\\cygwin\\bin;" (getenv "PATH")))
     	;;
     	;; NT-emacs assumes a Windows command shell, which you change
     	;; here.
     	;;
     	(setq process-coding-system-alist '(("bash" . undecided-unix)))
     	(setq shell-file-name "bash")
     	(setenv "SHELL" shell-file-name)
     	(setq explicit-shell-file-name shell-file-name)
     	;;
     	;; This removes unsightly ^M characters that would otherwise
     	;; appear in the output of java applications.
     	;;
     	(add-hook 'comint-output-filter-functions
     	          'comint-strip-ctrl-m)

   If you want NT Emacs to understand Cygwin paths, get cygwin-mount.el
from `http://www.emacswiki.org/elisp/index.html'.

   Note that all of this "just works" if you use the Cygwin port of
Emacs from Cygwin Setup.

What about XEmacs?
------------------

   For a concise description of the current situation with XEmacs, see
this message from the Cygwin mailing list:
`http://cygwin.com/ml/cygwin/2002-11/msg00609.html'.

Is there a better alternative to the standard console window?
-------------------------------------------------------------

   Yes!  Use rxvt instead.  It's an optional package in Cygwin Setup.
You can use it with or without X11.  You can resize it easily by
dragging an edge or corner.  Copy and paste is easy with the left and
middle mouse buttons, respectively.  It will honor settings in your
~/.Xdefaults file, even without X.

   Don't invoke as simply "rxvt" because that will run /bin/sh (really
ash) which is not a good interactive shell.  For details see
`/usr/doc/Cygwin/rxvt-<ver>.README'.

info error "dir: No such file or directory"
-------------------------------------------

   Cygwin packages install their info documentation in the /usr/info
directory.  But you need to create a `dir' file there before the
standalone info program (probably `/usr/bin/info') can be used to read
those info files.  This is how you do it:
     	bash$ cd /usr/info
     	bash$ for f in *.info ; do install-info $f dir ; done
   This may generate warnings:
     	install-info: warning: no info dir entry in `gzip.info'
     	install-info: warning: no info dir entry in `time.info'
   The `install-info' command cannot parse these files, so you will
have to add their entries to `/usr/info/dir' by hand.

   Even if the dir file already exists, you may have to update it when
you install new Cygwin packages.  Some packages update the dir file for
you, but many don't.

Why do I get a message saying Out of Queue slots?
-------------------------------------------------

   "Out of queue slots!" generally occurs when you're trying to remove
many files that you do not have permission to remove (either because
you don't have permission, they are opened exclusively, etc).  What
happens is Cygwin queues up these files with the supposition that it
will be possible to delete these files in the future.  Assuming that
the permission of an affected file does change later on, the file will
be deleted as requested.  However, if too many requests come in to
delete inaccessible files, the queue overflows and you get the message
you're asking about.  Usually you can remedy this with a quick chmod,
close of a file, or other such thing.  (Thanks to Larry Hall for this
explanation).

Why don't symlinks work on samba-mounted filesystems?
-----------------------------------------------------

   Symlinks are marked with "system" file attribute.  Samba does not
enable this attribute by default.  To enable it, consult your Samba
documentation and then add these lines to your samba configuration file:

     	map system = yes
     	create mask = 0775

   Note that the 0775 can be anything as long as the 0010 bit is set.

Why does df report sizes incorrectly.
-------------------------------------

   There is a bug in the Win32 API function GetFreeDiskSpace that makes
it return incorrect values for disks larger than 2 GB in size.  Perhaps
that may be your problem?

Why doesn't Cygwin tcl/tk understand Cygwin paths?
--------------------------------------------------

   The versions of Tcl/Tk distributed with Cygwin (e.g. cygtclsh80.exe,
cygwish80.exe) are not actually "Cygwin versions" of those tools.  They
are built with the `-mno-cygwin' option to `gcc', which means they do
not understand Cygwin mounts or symbolic links.

   See the entry "How do I convert between Windows and UNIX paths?"
elsewhere in this FAQ.

Cygwin API Questions
====================

How does everything work?
-------------------------

   There's a C library which provides a Unix-style API.  The
applications are linked with it and voila - they run on Windows.

   The aim is to add all the goop necessary to make your apps run on
Windows into the C library.  Then your apps should run on Unix and
Windows with no changes at the source level.

   The C library is in a DLL, which makes basic applications quite
small.  And it allows relatively easy upgrades to the Win32/Unix
translation layer, providing that dll changes stay backward-compatible.

   For a good overview of Cygwin, you may want to read the paper on
Cygwin published by the Usenix Association in conjunction with the 2d
Usenix NT Symposium in August 1998.  It is available in html format on
the project WWW site.

Are development snapshots for the Cygwin library available?
-----------------------------------------------------------

   Yes.  They're made whenever anything interesting happens inside the
Cygwin library (usually roughly on a nightly basis, depending on how
much is going on).  They are only intended for those people who wish to
contribute code to the project.  If you aren't going to be happy
debugging problems in a buggy snapshot, avoid these and wait for a real
release.  The snapshots are available from http://cygwin.com/snapshots/

How is the DOS/Unix CR/LF thing handled?
----------------------------------------

   Let's start with some background.

   In UNIX, a file is a file and what the file contains is whatever the
program/programmer/user told it to put into it.  In Windows, a file is
also a file and what the file contains depends not only on the
program/programmer/user but also the file processing mode.

   When processing in text mode, certain values of data are treated
specially.  A \n (new line) written to the file will prepend a \r
(carriage return) so that if you `printf("Hello\n") you in fact get
"Hello\r\n".  Upon reading this combination, the \r is removed and the
number of bytes returned by the read is 1 less than was actually read.
This tends to confuse programs dependant on ftell() and fseek().  A
Ctrl-Z encountered while reading a file sets the End Of File flags even
though it truly isn't the end of file.

   One of Cygwin's goals is to make it possible to easily mix
Cygwin-ported Unix programs with generic Windows programs.  As a
result, Cygwin opens files in text mode as is normal under Windows.  In
the accompanying tools, tools that deal with binaries (e.g. objdump)
operate in unix binary mode and tools that deal with text files (e.g.
bash) operate in text mode.

   Some people push the notion of globally setting the default
processing mode to binary via mount point options or by setting the
CYGWIN environment variable.  But that creates a different problem.  In
binary mode, the program receives all of the data in the file, including
a \r.  Since the programs will no longer deal with these properly for
you, you would have to remove the \r from the relevant text files,
especially scripts and startup resource files.  This is a porter "cop
out", forcing the user to deal with the \r for the porter.

   It is rather easy for the porter to fix the source code by supplying
the appropriate file processing mode switches to the open/fopen
functions.  Treat all text files as text and treat all binary files as
binary.  To be specific, you can select binary mode by adding
`O_BINARY' to the second argument of an `open' call, or `"b"' to second
argument of an `fopen' call.  You can also call `setmode (fd,
O_BINARY)'.

   Note that because the open/fopen switches are defined by ANSI, they
exist under most flavors of Unix; open/fopen will just ignore the switch
since they have no meaning to UNIX.

   Explanation adapted from mailing list email by Earnie Boyd
<earnie_boyd@yahoo.com>.

Is the Cygwin library multi-thread-safe?
----------------------------------------

   Yes.

   There is also extensive support for 'POSIX threads', see the file
`cygwin.din' for the list of POSIX thread functions provided.

Why is some functionality only supported in Windows NT?
-------------------------------------------------------

   Windows 9x: n.  32 bit extensions and a graphical shell for a 16 bit
patch to an 8 bit operating system originally coded for a 4 bit
microprocessor, written by a 2 bit company that can't stand 1 bit of
competition.

   But seriously, Windows 9x lacks most of the security-related calls
and has several other deficiencies with respect to its version of the
Win32 API.  See the calls.texinfo document for more information as to
what is not supported in Win 9x.

How is fork() implemented?
--------------------------

   Cygwin fork() essentially works like a non-copy on write version of
fork() (like old Unix versions used to do).  Because of this it can be
a little slow.  In most cases, you are better off using the spawn
family of calls if possible.

   Here's how it works:

   Parent initializes a space in the Cygwin process table for child.
Parent creates child suspended using Win32 CreateProcess call, giving
the same path it was invoked with itself.  Parent calls setjmp to save
its own context and then sets a pointer to this in the Cygwin shared
memory area (shared among all Cygwin tasks).  Parent fills in the childs
.data and .bss subsections by copying from its own address space into
the suspended child's address space.  Parent then starts the child.
Parent waits on mutex for child to get to safe point.  Child starts and
discovers if has been forked and then longjumps using the saved jump
buffer.  Child sets mutex parent is waiting on and then blocks on
another mutex waiting for parent to fill in its stack and heap.  Parent
notices child is in safe area, copies stack and heap from itself into
child, releases the mutex the child is waiting on and returns from the
fork call.  Child wakes from blocking on mutex, recreates any mmapped
areas passed to it via shared area and then returns from fork itself.

How does wildcarding (globbing) work?
-------------------------------------

   If the DLL thinks it was invoked from a DOS style prompt, it runs a
`globber' over the arguments provided on the command line.  This means
that if you type `LS *.EXE' from DOS, it will do what you might expect.

   Beware: globbing uses `malloc'.  If your application defines
`malloc', that will get used.  This may do horrible things to you.

How do symbolic links work?
---------------------------

   Cygwin knows of two ways to create symlinks.

   The old method is the only valid one up to but not including version
1.3.0.  If it's enabled (from 1.3.0 on by setting `nowinsymlinks' in
the environment variable CYGWIN) Cygwin generates link files with a
magic header.  When you open a file or directory that is a link to
somewhere else, it opens the file or directory listed in the magic
header.  Because we don't want to have to open every referenced file to
check symlink status, Cygwin marks symlinks with the system attribute.
Files without the system attribute are not checked.  Because remote
samba filesystems do not enable the system attribute by default,
symlinks do not work on network drives unless you explicitly enable
this attribute.

   The new method which is introduced with Cygwin version 1.3.0 is
enabled by default or if `winsymlinks' is set in the environment
variable CYGWIN.  Using this method, Cygwin generates symlinks by
creating Windows shortcuts.  Cygwin created shortcuts have a special
header (which is in that way never created by Explorer) and the R/O
attribute set.  A DOS path is stored in the shortcut as usual and the
description entry is used to store the POSIX path.  While the POSIX
path is stored as is, the DOS path has perhaps to be rearranged to
result in a valid path.  This may result in a divergence between the
DOS and the POSIX path when symlinks are moved crossing mount points.
When a user changes the shortcut, this will be detected by Cygwin and
it will only use the DOS path then.  While Cygwin shortcuts are shown
without the ".lnk" suffix in `ls' output, non-Cygwin shortcuts are shown
with the suffix.  However, both are treated as symlinks.

   Both, the old and the new symlinks can live peacefully together
since Cygwin treats both as symlinks regardless of the setting of
`(no)winsymlinks' in the environment variable CYGWIN.

Why do some files, which are not executables have the 'x' type.
---------------------------------------------------------------

   When working out the unix-style attribute bits on a file, the library
has to fill out some information not provided by the WIN32 API.

   It guesses that files ending in .exe and .bat are executable, as are
ones which have a "#!" as their first characters.

How secure is Cygwin in a multi-user environment?
-------------------------------------------------

   Cygwin is not secure in a multi-user environment.  For example if
you have a long running daemon such as "inetd" running as admin while
ordinary users are logged in, or if you have a user logged in remotely
while another user is logged into the console, one cygwin client can
trick another into running code for it.  In this way one user may gain
the priveledge of another cygwin program running on the machine.  This
is because cygwin has shared state that is accessible by all processes.

   (Thanks to Tim Newsham (newsham@lava.net) for this explanation).

How do the net-related functions work?
--------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   The network support in Cygwin is supposed to provide the Unix API,
not the Winsock API.

   There are differences between the semantics of functions with the
same name under the API.

   E.g., the select system call on Unix can wait on a standard file
handles and handles to sockets.  The select call in winsock can only
wait on sockets.  Because of this, cygwin.dll does a lot of nasty stuff
behind the scenes, trying to persuade various winsock/win32 functions
to do what a Unix select would do.

   If you are porting an application which already uses Winsock, then
using the net support in Cygwin is wrong.

   But you can still use native Winsock, and use Cygwin.  The functions
which cygwin.dll exports are called 'cygwin_<name>'.  There are a load
of defines which map the standard Unix names to the names exported by
the dll - check out include/netdb.h:

     ..etc..
     void		cygwin_setprotoent (int);
     void		cygwin_setservent (int);
     void		cygwin_setrpcent (int);
     ..etc..
     #ifndef __INSIDE_CYGWIN_NET__
     #define endprotoent cygwin_endprotoent
     #define endservent cygwin_endservent
     #define endrpcent  cygwin_endrpcent
     ..etc..

   The idea is that you'll get the Unix->Cygwin mapping if you include
the standard Unix header files.  If you use this, you won't need to
link with libwinsock.a - all the net stuff is inside the dll.

   The mywinsock.h file is a standard winsock.h which has been hacked to
remove the bits which conflict with the standard Unix API, or are
defined in other headers.  E.g., in mywinsock.h, the definition of
struct hostent is removed.  This is because on a Unix box, it lives in
netdb.  It isn't a good idea to use it in your applications.

   As of the b19 release, this information may be slightly out of date.

I don't want Unix sockets, how do I use normal Win32 winsock?
-------------------------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   To use the vanilla Win32 winsock, you just need to #define
Win32_Winsock and #include "windows.h" at the top of your source
file(s).  You'll also want to add -lwsock32 to the compiler's command
line so you link against libwsock32.a.

What version numbers are associated with Cygwin?
------------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   There is a cygwin.dll major version number that gets incremented
every time we make a new Cygwin release available.  This corresponds to
the name of the release (e.g. beta 19's major number is "19").  There
is also a cygwin.dll minor version number.  If we release an update of
the library for an existing release, the minor number would be
incremented.

   There are also Cygwin API major and minor numbers.  The major number
tracks important non-backward-compatible interface changes to the API.
An executable linked with an earlier major number will not be compatible
with the latest DLL.  The minor number tracks significant API additions
or changes that will not break older executables but may be required by
newly compiled ones.

   Then there is a shared memory region compatibity version number.  It
is incremented when incompatible changes are made to the shared memory
region or to any named shared mutexes, semaphores, etc.

   Finally there is a mount point registry version number which keeps
track of non-backwards-compatible changes to the registry mount table
layout.  This has been "B15.0" since the beta 15 release.

Why isn't _timezone set correctly?
----------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   Did you explicitly call tzset() before checking the value of
_timezone?  If not, you must do so.

Is there a mouse interface?
---------------------------

   There is no way to capture mouse events from Cygwin.  There are
currently no plans to add support for this.

Programming Questions
=====================

How do I contribute a package?
------------------------------

   If you are willing to be a package maintainer, great.  We urgently
need volunteers to prepare and maintain packages, because the priority
of the Cygwin Team is Cygwin itself.

   The Cygwin Package Contributor's Guide is at
`http://cygwin.com/setup.html', which details everything you need to
know about being a package maintainer.  Use the cygwin-apps mailing
list (start at `http://cygwin.com/lists.html') for questions about
package maintenance, _after_ searching and browsing the cygwin-apps
list archives, of course.  Charles Wilson posted a short recipe of what
is involved, using texinfo as an example, available at
`http://cygwin.com/ml/cygwin-apps/2000-11/msg00055.html'.  This should
give you an idea of what is required.

   You should announce your intentions to the general cygwin list, in
case others were thinking the same thing.

How do I contribute to Cygwin?
------------------------------

   If you want to contribute to Cygwin itself, see
`http://cygwin.com/contrib.html'.

Why are compiled executables so huge?!?
---------------------------------------

   By default, gcc compiles in all symbols.  You'll also find that gcc
creates large executables on UNIX.

   If that bothers you, just use the 'strip' program, part of the
binutils package.  Or compile with the `-s' option to gcc.

Where is glibc?
---------------

   Cygwin does not provide glibc.  It uses newlib instead, which
provides much (but not all) of the same functionality.  Porting glibc
to Cygwin would be difficult.

Where is Objective C?
---------------------

   Objective C is not distributed with the Cygwin version of gcc, and
there are no plans to do so.  The gcc package maintainer had difficulty
building it, and once built there were problems using it.  It appears
that there is only minimual support for the Objective C front-end in the
main GCC distribution, anyway.

Why is make behaving badly?
---------------------------

   First of all, if you are using `make -j[N]', then stop.  It doesn't
work well.

   Otherwise, read on...

   Make has two operating modes, UNIX and WIN32.  You need to make sure
that you are operating in the right mode.

   In UNIX mode, make uses sh.exe as a subshell.  The path list
separator is ':', '\' is the escape character, POSIX paths are
expected, and Cygwin mounts will be understood.  Use this for Makefiles
written for UNIX.

   In WIN32 mode, make uses the "native" command shell (cmd.exe or
command.com), with all the restrictions that implies.  The path list
separator is ';', the path separator is '\', "copy" and "del" work, but
the Cygwin mount table is not understood.  Use this for nmake-style
Makefiles.

   The default mode for the Net Release of make (the one installed by
`setup.exe') is UNIX.  The default mode for commercial releases to
Redhat (formerly Cygnus) customers is WIN32.

   You can override the default by setting the environment variable
MAKE_MODE to "UNIX" (actually case is not significant) or "WIN32"
(actually anything other than "UNIX").  You can also specify the options
-unix or -win32 on the make command line.

Why the undefined reference to `WinMain@16'?
--------------------------------------------

   Try adding an empty main() function to one of your sources.

   Or, perhaps you have `-lm' too early in the link command line.  It
should be at the end:

         bash$ gcc hello.c -lm
         bash$ ./a.exe
         Hello World!

   works, but

         bash$  gcc -lm hello.c
         /c/TEMP/ccjLEGlU.o(.text+0x10):hello.c: multiple definition of `main'
         /usr/lib/libm.a(libcmain.o)(.text+0x0):libcmain.c: first defined here
         /usr/lib/libm.a(libcmain.o)(.text+0x6a):libcmain.c: undefined reference to `WinMain@16'
         collect2: ld returned 1 exit status

   This is an artifact of libm.a being a symbolic link to libcygwin.a.

How do I use Win32 API calls?
-----------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   It's pretty simple actually.  Cygwin tools require that you
explicitly link the import libraries for whatever Win32 API functions
that you are going to use, with the exception of kernel32, which is
linked automatically (because the startup and/or built-in code uses it).

   For example, to use graphics functions (GDI) you must link with
gdi32 like this:

   gcc -o foo.exe foo.o bar.o -lgdi32

   or (compiling and linking in one step):

   gcc -o foo.exe foo.c bar.c -lgdi32

   The following libraries are available for use in this way:

   advapi32  largeint  ole32     scrnsave  vfw32 cap       lz32
oleaut32  shell32   win32spl comctl32  mapi32    oledlg    snmp
winmm comdlg32  mfcuia32  olepro32  svrapi    winserve ctl3d32
mgmtapi   opengl32  tapi32    winspool dlcapi    mpr       penwin32
th32      winstrm gdi32     msacm32   pkpd32    thunk32   wow32 glaux
 nddeapi   rasapi32  url       wsock32 glu32     netapi32  rpcdce4
user32    wst icmp      odbc32    rpcndr    uuid imm32     odbccp32
rpcns4    vdmdbg kernel32  oldnames  rpcrt4    version

   The regular setup allows you to use the option -mwindows on the
command line to include a set of the basic libraries (and also make
your program a GUI program instead of a console program), including
user32, gdi32 and, IIRC, comdlg32.

   Note that you should never include -lkernel32 on your link line
unless you are invoking ld directly.  Do not include the same import
library twice on your link line.  Finally, it is a good idea to put
import libraries last on your link line, or at least after all the
object files and static libraries that reference them.

   The first two are related to problems the linker has (as of b18 at
least) when import libraries are referenced twice.  Tables get messed
up and programs crash randomly.  The last point has to do with the fact
that gcc processes the files listed on the command line in sequence and
will only resolve references to libraries if they are given after the
file that makes the reference.

How do I compile a Win32 executable that doesn't use Cygwin?
------------------------------------------------------------

   The -mno-cygwin flag to gcc makes gcc link against standard Microsoft
DLLs instead of Cygwin.  This is desirable for native Windows programs
that don't need a UNIX emulation layer.

   This is not to be confused with 'MinGW' (Minimalist GNU for Windows),
which is a completely separate effort.  That project's home page is
`http://www.mingw.org/index.shtml'.

Can I build a Cygwin program that does not require cygwin1.dll at runtime?
--------------------------------------------------------------------------

   No.  If your program uses the Cygwin API, then your executable cannot
run without cygwin1.dll.  In particular, it is not possible to
statically link with a Cygwin library to obtain an independent,
self-contained executable.

   If this is an issue because you intend to distribute your Cygwin
application, then you had better read and understand
`http://cygwin.com/licensing.html', which explains the licensing
options.  Unless you purchase a special commercial license from Red
Hat, then your Cygwin application must be Open Source.

Can I link with both MSVCRT*.DLL and cygwin1.dll?
-------------------------------------------------

   No, you must use one or the other, they are mutually exclusive.

How do I make the console window go away?
-----------------------------------------

   The default during compilation is to produce a console application.
It you are writing a GUI program, you should either compile with
-mwindows as explained above, or add the string
"-Wl,-subsystem,windows" to the GCC commandline.

Why does make complain about a "missing separator"?
---------------------------------------------------

   This problem usually occurs as a result of someone editing a Makefile
with a text editor that replaces tab characters with spaces.  Command
lines must start with tabs.  This is not specific to Cygwin.

Why can't we redistribute Microsoft's Win32 headers?
----------------------------------------------------

   Subsection 2.d.f of the `Microsoft Open Tools License agreement'
looks like it says that one may not "permit further redistribution of
the Redistributables to their end users".  We take this to mean that we
can give them to you, but you can't give them to anyone else, which is
something that Cygnus (err... Red Hat) can't agree to.  Fortunately, we
have our own Win32 headers which are pretty complete.

How do I link against .lib files?
---------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   1. Build a C file with a function table.  Put all functions you
intend to use in that table.  This forces the linker to include all the
object files from the .lib.  Maybe there is an option to force LINK.EXE
to include an object file.  2. Build a dummy 'LibMain'.  3. Build a
.def with all the exports you need.  4. Link with your .lib using
link.exe.

   or

   1. Extract all the object files from the .lib using LIB.EXE.  2.
Build a dummy C file referencing all the functions you need, either
with a direct call or through an initialized function pointer.  3.
Build a dummy LibMain.  4. Link all the objects with this file+LibMain.
5. Write a .def.  6. Link.

   You can use these methods to use MSVC (and many other runtime libs)
with Cygwin development tools.

   Note that this is a lot of work (half a day or so), but much less
than rewriting the runtime library in question from specs...

   (thanks to Jacob Navia (root@jacob.remcomp.fr) for this explanation)

How do I rebuild the tools on my NT box?
----------------------------------------

   Install all required components in one directory (we'll call it
/src).  Ideally, you should check out what you need from CVS
(`http://cygwin.com/cvs.html').  This is the _preferred method_ for
acquiring the sources.  Otherwise, you can install the appropriate
source packages from the cygwin distribution.

   As of this writing, you need to install at least the cygwin source
package and the w32api source package.  The winsup source package
should be extracted first and the w32api source directory should be
extracted into the resulting 'winsup' directory.  Then rename
w32api-whatever to w32api.

   It is possible that the cygwin source package may require a newer
version of the w32api package since the release of the packages is not
always in lock step (another reason to just use CVS).

   You _must_ build cygwin in a separate directory from the source.
So, create something like a /obj directory.  You'll be performing your
build in that directory:

     bash
     cd /obj
     /src/configure --prefix=/install -v > configure.log 2>&1
     make > make.log 2>&1
     make install > install.log 2>&1

   Normally, this procedure will also attempt to build the
documentation, which additionally requires db2html, and possibly other
tools, which are not included in the Cygwin distribution.  You can get
db2html as part of docbook, from
`http://sources.redhat.com/docbook-tools/'.

   To check a cygwin1.dll, run "make check" in the winsup/cygwin
directory.  If that works, install everything _except_ the dll (if you
can).  Then, close down all cygwin programs (including bash windows,
inetd, etc.), save your old dll, and copy the new dll to _all_ the
places where the old dll was (if there is more than one on your
machine).  Then start up a bash window and see what happens.  (Or
better, run a cygwin program from the Windows command prompt.)

   If you get the error "shared region is corrupted" it means that two
different versions of cygwin1.dll are running on your machine at the
same time.

How can I compile a powerpc NT toolchain?
-----------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   Unfortunately, this will be difficult.  It hasn't been built for
some time (late 1996) since Microsoft has dropped development of
powerpc NT.  Exception handling/signals support semantics/args have been
changed for x86 and not updated for ppc so the ppc specific support
would have to be rewritten.  We don't know of any other
incompatibilities.  Please send us patches if you do this work!

How can I compile an Alpha NT toolchain?
----------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   We have not ported the tools to Alpha NT and do not have plans to do
so at the present time.  We would be happy to add support for Alpha NT
if someone contributes the changes to us.

How can I adjust the heap/stack size of an application?
-------------------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   Pass heap/stack linker arguments to gcc.  To create foo.exe with a
heap size of 1024 and a stack size of 4096, you would invoke gcc as:

   `gcc -Wl,--heap,1024,--stack,4096 -o foo foo.c'

How can I find out which dlls are needed by an executable?
----------------------------------------------------------

   `objdump -p' provides this information, but is rather verbose.

   `cygcheck' will do this much more concisely, and operates
recursively, provided the command is in your path.

   Note there is currently a bug in cygcheck in that it will not report
on a program in a Windows system dir (e.g., C:\Windows or C:\WINNT) even
if it's in your path.  To work around this, supply the full Win32 path
to the executable, including the .exe extension:

     cygcheck c:\\winnt\\system32\\cmd.exe

   (Note the windows path separator must be escaped if this is typed in
bash.)

How do I build a DLL?
---------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   There's documentation that explains the process on the main Cygwin
project web page (http://cygwin.com/).

How can I set a breakpoint at MainCRTStartup?
---------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   Set a breakpoint at *0x401000 in gdb and then run the program in
question.

How can I build a relocatable dll?
----------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.  However, there was a discussion on the cygwin mailing
list recently that addresses this issue.  Read
`http://cygwin.com/ml/cygwin/2000-06/msg00688.html' and related
messages.)*

   You must execute the following sequence of five commands, in this
order:

     $(LD) -s --base-file BASEFILE --dll -o DLLNAME OBJS LIBS -e ENTRY
     
     $(DLLTOOL) --as=$(AS) --dllname DLLNAME --def DEFFILE \
             --base-file BASEFILE --output-exp EXPFILE
     
     $(LD) -s --base-file BASEFILE EXPFILE -dll -o DLLNAME OBJS LIBS -e ENTRY
     
     $(DLLTOOL) --as=$(AS) --dllname DLLNAME --def DEFFILE \
     	--base-file BASEFILE --output-exp EXPFILE
     
     $(LD) EXPFILE --dll -o DLLNAME OBJS LIBS -e ENTRY

   In this example, $(LD) is the linker, ld.

   $(DLLTOOL) is dlltool.

   $(AS) is the assembler, as.

   DLLNAME is the name of the DLL you want to create, e.g., tcl80.dll.

   OBJS is the list of object files you want to put into the DLL.

   LIBS is the list of libraries you want to link the DLL against.  For
example, you may or may not want -lcygwin.  You may want -lkernel32.
Tcl links against -lcygwin -ladvapi32 -luser32 -lgdi32 -lcomdlg32
-lkernel32.

   DEFFILE is the name of your definitions file.  A simple DEFFILE would
consist of "EXPORTS" followed by a list of all symbols which should be
exported from the DLL.  Each symbol should be on a line by itself.
Other programs will only be able to access the listed symbols.

   BASEFILE is a temporary file that is used during this five stage
process, e.g., tcl.base.

   EXPFILE is another temporary file, e.g., tcl.exp.

   ENTRY is the name of the function which you want to use as the entry
point.  This function should be defined using the WINAPI attribute, and
should take three arguments:         int WINAPI startup (HINSTANCE,
DWORD, LPVOID)

   This means that the actual symbol name will have an appended @12, so
if your entry point really is named `startup', the string you should
use for ENTRY in the above examples would be `startup@12'.

   If your DLL calls any Cygwin API functions, the entry function will
need to initialize the Cygwin impure pointer.  You can do that by
declaring a global variable `_impure_ptr', and then initializing it in
the entry function.  Be careful not to export the global variable
`_impure_ptr' from your DLL; that is, do not put it in DEFFILE.

     /* This is a global variable.  */
     struct _reent *_impure_ptr;
     extern struct _reent *__imp_reent_data;
     
     int entry (HINSTANT hinst, DWORD reason, LPVOID reserved)
     {
       _impure_ptr = __imp_reent_data;
       /* Whatever else you want to do.  */
     }

   You may put an optional `-subsystem windows' on the $(LD) lines.  The
Tcl build does this, but I admit that I no longer remember whether this
is important.  Note that if you specify a -subsytem <x> flag to ld, the
-e entry must come after the subsystem flag, since the subsystem flag
sets a different default entry point.

   You may put an optional `-image-base BASEADDR' on the $(LD) lines.
This will set the default image base.  Programs using this DLL will
start up a bit faster if each DLL occupies a different portion of the
address space.  Each DLL starts at the image base, and continues for
whatever size it occupies.

   Now that you've built your DLL, you may want to build a library so
that other programs can link against it.  This is not required: you
could always use the DLL via LoadLibrary.  However, if you want to be
able to link directly against the DLL, you need to create a library.
Do that like this:

   $(DLLTOOL) -as=$(AS) -dllname DLLNAME -def DEFFILE -output-lib
LIBFILE

   $(DLLTOOL), $(AS), DLLNAME, and DEFFILE are the same as above.  Make
sure you use the same DLLNAME and DEFFILE, or things won't work right.

   LIBFILE is the name of the library you want to create, e.g.,
libtcl80.a.  You can then link against that library using something
like -ltcl80 in your linker command.

How can I debug what's going on?
--------------------------------

   You can debug your application using `gdb'.  Make sure you compile
it with the -g flag!  If your application calls functions in MS dlls,
gdb will complain about not being able to load debug information for
them when you run your program.  This is normal since these dlls don't
contain debugging information (and even if they did, that debug info
would not be compatible with gdb).

Can I use a system trace mechanism instead?
-------------------------------------------

   Yes.  You can use the `strace.exe' utility to run other cygwin
programs with various debug and trace messages enabled.  For information
on using `strace', see the Cygwin User's Guide or the file
`winsup/utils/utils.sgml'.

Why doesn't gdb handle signals?
-------------------------------

   Unfortunately, there is only minimal signal handling support in gdb
currently.  Signal handling only works with Windows-type signals.
SIGINT may work, SIGFPE may work, SIGSEGV definitely does.  You cannot
'stop', 'print' or 'nopass' signals like SIGUSR1 or SIGHUP to the
process being debugged.

The linker complains that it can't find something.
--------------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   A common error is to put the library on the command line before the
thing that needs things from it.

   This is wrong `gcc -lstdc++ hello.cc'.  This is right `gcc hello.cc
-lstdc++'.

I use a function I know is in the API, but I still get a link error.
--------------------------------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   The function probably isn't declared in the header files, or the
UNICODE stuff for it isn't filled in.

Can you make DLLs that are linked against libc ?
------------------------------------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   Yes.

Where is malloc.h?
------------------

   *(Please note: This section has not yet been updated for the latest
net release.)*

   Include stdlib.h instead of malloc.h.

Can I use my own malloc?
------------------------

   If you define a function called `malloc' in your own code, and link
with the DLL, the DLL _will_ call your `malloc'.  Needless to say, you
will run into serious problems if your malloc is buggy.

   If you run any programs from the DOS command prompt, rather than
from in bash, the DLL will try and expand the wildcards on the command
line.  This process uses `malloc' _before_ your main line is started.
If you have written your own `malloc' to need some initialization to
occur after `main' is called, then this will surely break.

   Moreover, there is an outstanding issue with `_malloc_r' in
`newlib'.  This re-entrant version of `malloc' will be called directly
from within `newlib', by-passing your custom version, and is probably
incompatible with it.  But it may not be possible to replace
`_malloc_r' too, because `cygwin1.dll' does not export it and Cygwin
does not expect your program to replace it.  This is really a newlib
issue, but we are open to suggestions on how to deal with it.

Can I mix objects compiled with msvc++ and gcc?
-----------------------------------------------

   Yes, but only if you are combining C object files.  MSVC C++ uses a
different mangling scheme than GNU C++, so you will have difficulties
combining C++ objects.

Can I use the gdb debugger to debug programs built by VC++?
-----------------------------------------------------------

   No, not for full (high level source language) debugging.  The
Microsoft compilers generate a different type of debugging symbol
information, which gdb does not understand.

   However, the low-level (assembly-type) symbols generated by
Microsoft compilers are coff, which gdb DOES understand.  Therefore you
should at least be able to see all of your global symbols; you just
won't have any information about data types, line numbers, local
variables etc.

Where can I find info on x86 assembly?
--------------------------------------

   CPU reference manuals for Intel's current chips are available in
downloadable PDF form on Intel's web site:

   `http://developer.intel.com/design/pro/manuals/'

Shell scripts aren't running properly from my makefiles?
--------------------------------------------------------

   If your scripts are in the current directory, you must have `.'
(dot) in your $PATH.  (It is not normally there by default.)  Otherwise,
you would need to add /bin/sh in front of each and every shell script
invoked in your Makefiles.

What preprocessor do I need to know about?
------------------------------------------

   We use _WIN32 to signify access to the Win32 API and __CYGWIN__ for
access to the Cygwin environment provided by the dll.

   We chose _WIN32 because this is what Microsoft defines in VC++ and
we thought it would be a good idea for compatibility with VC++ code to
follow their example.  We use _MFC_VER to indicate code that should be
compiled with VC++.

   _WIN32 is only defined when you use either the -mno-cygwin or -mwin32
gcc command line options.  This is because Cygwin is supposed to be a
Unix emulation environment and defining _WIN32 confuses some programs
which think that they have to make special concessions for a Windows
environment which Cygwin handles automatically.

   Note that using -mno-cygwin replaces __CYGWIN__ with __MINGW32__ as
to tell which compiler (or settings) you're running.  Check this out in
detail by running, for example

            $ gcc  -dM -E -xc /dev/null >gcc.txt
            $ gcc -mno-cygwin -dM -E -xc /dev/null >gcc-mno-cygwin.txt
            $ gcc -mwin32 -dM -E -xc /dev/null >gcc-mwin32.txt
   Then use the diff and grep utilities to check what the difference is.

How should I port my Unix GUI to Windows?
-----------------------------------------

   There are two basic strategies for porting Unix GUIs to Windows.

   The first is to use a portable graphics library such as tcl/tk, X11,
or V (and others?).  Typically, you will end up with a GUI on Windows
that requires some runtime support.  With tcl/tk, you'll want to
include the necessary library files and the tcl/tk DLLs.  In the case
of X11, you'll need everyone using your program to have an X11 server
installed.

   The second method is to rewrite your GUI using Win32 API calls (or
MFC with VC++).  If your program is written in a fairly modular
fashion, you may still want to use Cygwin if your program contains a
lot of shared (non-GUI-related) code.  That way you still gain some of
the portability advantages inherent in using Cygwin.

Why not use DJGPP ?
-------------------

   DJGPP is a similar idea, but for DOS instead of Win32.  DJGPP uses a
"DOS extender" to provide a more reasonable operating interface for its
applications.   The Cygwin toolset doesn't have to do this since all of
the applications are native WIN32.   Applications compiled with the
Cygwin tools can access the Win32 API functions, so you can write
programs which use the Windows GUI.

   You can get more info on DJGPP by following
`http://www.delorie.com/'.

Known Problems in the Latest Net Release
****************************************

Aware of the problem, no solution known.
========================================

Pipe key (`|') doesn't work on non-US keyboards in Win9x/ME
-----------------------------------------------------------

   This might get fixed someday, but meanwhile, just use rxvt, which
does not have this problem.  This is no real loss, because rxvt has many
other advantages.  (Do not attempt to use the "broken" pipe key (`')
as a substitute, it is a different character.)

Cannot access tape devices with mt on Win9x
-------------------------------------------

   Win9x does not support the API used by the Cygwin fhandler_dev_tape
class.  Details at
`http://sources.redhat.com/ml/cygwin/2000-12/msg00331.html'.

On Win9x, scp leaves ssh processes running.
-------------------------------------------

Fixed in the Next Release
=========================

   (Nothing to report.)

History
*******

   This section of the FAQ is no longer maintained.

   Instead, see `http://cygwin.com/history.html'.

Who's behind the project?
*************************

   *(Please note that if you have cygwin-specific questions, all of
these people will appreciate it if you use the cygwin mailing lists
rather than sending personal email.)*

   Chris Faylor is behind many of the recent changes in Cygwin.  Prior
to joining Cygnus, he contributed significant fixes to the process
control and environ code, reworked the strace mechanism, and rewrote the
signal-related code from scratch as a Net contributor.  In addition to
continuing to make technical contributions, Chris is also currently the
group's manager.

   Corinna Vinschen has contributed several useful fixes to the path
handling code, console support, improved security handling, and raw
device support.  Corinna is currently employed by Red Hat as a
GDB/Cygwin engineer.

   DJ Delorie has done important work in profiling Cygwin, worked on
the Dejagnu automated testing framework, merged the dlltool
functionality into ld, wrote a good deal of the Cygwin Users' Guide,
authored the cygcheck utility, and made automated snapshots available
from our project WWW page.  DJ is currently employed by Red Hat as a
GCC engineer.

   Egor Duda has contributed many useful fixes.  He is responsible for
Cygwin's ability to start a debugger on detection of a fatal error as
well as produce core dumps.

   Robert Collins has contributed many improvements to thread handling
as well as generic fixes to cygwin itself.

   Kazuhiro Fujieda has contributed many bug fixes and bug reports.

   Earnie Boyd has contributed many bug fixes and is the mingw and
w32api maintainer.

   David Starks-Browning is our dedicated FAQ maintainer.

   Geoffrey Noer took over the Cygwin project from its initial author
Steve Chamberlain in mid-1996.  As maintainer, he produced Net releases
beta 16 through 20; made the development snapshots; worked with Net
contributors to fix bugs; made many various code improvements himself;
wrote a paper on Cygwin for the 1998 Usenix NT Symposium; authored the
project WWW pages, FAQ, README; etc.  Geoffrey is not currently employed
by Red Hat.

   Steve Chamberlain designed and implemented Cygwin in 1995-1996 while
working for Cygnus.  He worked with the Net to improve the technology,
ported/integrated many of the user tools for the first time to Cygwin,
and produced all of the releases up to beta 14.  Steve is not currently
employed by Red Hat.

   Marco Fuykschot and Peter Boncz of Data Distilleries contributed
nearly all of the changes required to make Cygwin thread-safe.  They
also provided the pthreads interface.

   Sergey Okhapkin has been an invaluable Net contributor.  He
implemented the tty/pty support, has played a significant role in
revamping signal and exception handling, and has made countless
contributions throughout the library.  He also provided binaries of the
development snapshots to the Net after the beta 19 release.

   Mumit Khan has been most helpful on the EGCS end of things, providing
quite a large number of stabilizing patches to the compiler tools for
the B20 release.

   Philippe Giacinti contributed the implementation of dlopen, dlclose,
dlsym, dlfork, and dlerror in Cygwin.

   Ian Lance Taylor did a much-needed rework of the path handling code
for beta 18, and has made many assorted fixes throughout the code.
Jeremy Allison made significant contributions in the area of file
handling and process control, and rewrote select from scratch.  Doug
Evans rewrote the path-handling code in beta 16, among other things.
Kim Knuttila and Michael Meissner put in many long hours working on the
now-defunct PowerPC port.  Jason Molenda and Mark Eichin have also made
important contributions.

   Please note that all of us working on Cygwin try to be as responsive
as possible and deal with patches and questions as we get them, but
realistically we don't have time to answer all of the email that is
sent to the main mailing list.  Making Net releases of the Win32 tools
and helping people on the Net out is not our primary job function, so
some email will have to go unanswered.

   Many thanks to everyone using the tools for their many contributions
in the form of advice, bug reports, and code fixes.  Keep them coming!

What are the copyrights ?
*************************

The general idea
================

   Most of the tools are covered by the GNU General Public License
(GPL), although some are public domain, and others have a X11-style
copyright.  To cover the GNU GPL requirements, the basic rule is if you
give out any binaries, you must also make the source available.  For
the full details, be sure to read the text of the GNU GPL which follows.

   The Cygwin API library found in the winsup subdirectory of the source
code is also covered by the GNU GPL.  By default, all executables link
against this library (and in the process include GPL'd Cygwin glue
code).  This means that unless you modify the tools so that compiled
executables do not make use of the Cygwin library, your compiled
programs will also have to be free software distributed under the GPL
with source code available to all.

   Cygwin is currently available for proprietary use only through a
proprietary-use license.  Please see
`http://www.redhat.com/software/cygwin/' for more information about the
Red Hat Cygwin Product.

   In accordance with section 10 of the GPL, Red Hat, Inc. permits
programs whose sources are distributed under a license that complies
with the Open Source definition to be linked with libcygwin.a without
libcygwin.a itself causing the resulting program to be covered by the
GNU GPL.

   This means that you can port an Open Source(tm) application to
cygwin, and distribute that executable as if it didn't include a copy of
libcygwin.a linked into it.  Note that this does not apply to the
cygwin DLL itself.  If you distribute a (possibly modified) version of
the DLL you must adhere to the terms of the GPL, i.e., you must provide
sources for the cygwin DLL.

   See `http://www.opensource.org/docs/definition_plain.html' for the
precise Open Source Definition referenced above.

GNU GENERAL PUBLIC LICENSE
==========================

     		   GNU GENERAL PUBLIC LICENSE
     		      Version 2, June 1991
     
      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                               675 Mass Ave, Cambridge, MA 02139, USA
      Everyone is permitted to copy and distribute verbatim copies
      of this license document, but changing it is not allowed.
     
     			    Preamble
     
       The licenses for most software are designed to take away your
     freedom to share and change it.  By contrast, the GNU General Public
     License is intended to guarantee your freedom to share and change free
     software--to make sure the software is free for all its users.  This
     General Public License applies to most of the Free Software
     Foundation's software and to any other program whose authors commit to
     using it.  (Some other Free Software Foundation software is covered by
     the GNU Library General Public License instead.)  You can apply it to
     your programs, too.
     
       When we speak of free software, we are referring to freedom, not
     price.  Our General Public Licenses are designed to make sure that you
     have the freedom to distribute copies of free software (and charge for
     this service if you wish), that you receive source code or can get it
     if you want it, that you can change the software or use pieces of it
     in new free programs; and that you know you can do these things.
     
       To protect your rights, we need to make restrictions that forbid
     anyone to deny you these rights or to ask you to surrender the rights.
     These restrictions translate to certain responsibilities for you if you
     distribute copies of the software, or if you modify it.
     
       For example, if you distribute copies of such a program, whether
     gratis or for a fee, you must give the recipients all the rights that
     you have.  You must make sure that they, too, receive or can get the
     source code.  And you must show them these terms so they know their
     rights.
     
       We protect your rights with two steps: (1) copyright the software, and
     (2) offer you this license which gives you legal permission to copy,
     distribute and/or modify the software.
     
       Also, for each author's protection and ours, we want to make certain
     that everyone understands that there is no warranty for this free
     software.  If the software is modified by someone else and passed on, we
     want its recipients to know that what they have is not the original, so
     that any problems introduced by others will not reflect on the original
     authors' reputations.
     
       Finally, any free program is threatened constantly by software
     patents.  We wish to avoid the danger that redistributors of a free
     program will individually obtain patent licenses, in effect making the
     program proprietary.  To prevent this, we have made it clear that any
     patent must be licensed for everyone's free use or not licensed at all.
     
       The precise terms and conditions for copying, distribution and
     modification follow.
     
     		    GNU GENERAL PUBLIC LICENSE
        TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
     
       0. This License applies to any program or other work which contains
     a notice placed by the copyright holder saying it may be distributed
     under the terms of this General Public License.  The "Program", below,
     refers to any such program or work, and a "work based on the Program"
     means either the Program or any derivative work under copyright law:
     that is to say, a work containing the Program or a portion of it,
     either verbatim or with modifications and/or translated into another
     language.  (Hereinafter, translation is included without limitation in
     the term "modification".)  Each licensee is addressed as "you".
     
     Activities other than copying, distribution and modification are not
     covered by this License; they are outside its scope.  The act of
     running the Program is not restricted, and the output from the Program
     is covered only if its contents constitute a work based on the
     Program (independent of having been made by running the Program).
     Whether that is true depends on what the Program does.
     
       1. You may copy and distribute verbatim copies of the Program's
     source code as you receive it, in any medium, provided that you
     conspicuously and appropriately publish on each copy an appropriate
     copyright notice and disclaimer of warranty; keep intact all the
     notices that refer to this License and to the absence of any warranty;
     and give any other recipients of the Program a copy of this License
     along with the Program.
     
     You may charge a fee for the physical act of transferring a copy, and
     you may at your option offer warranty protection in exchange for a fee.
     
       2. You may modify your copy or copies of the Program or any portion
     of it, thus forming a work based on the Program, and copy and
     distribute such modifications or work under the terms of Section 1
     above, provided that you also meet all of these conditions:
     
         a) You must cause the modified files to carry prominent notices
         stating that you changed the files and the date of any change.
     
         b) You must cause any work that you distribute or publish, that in
         whole or in part contains or is derived from the Program or any
         part thereof, to be licensed as a whole at no charge to all third
         parties under the terms of this License.
     
         c) If the modified program normally reads commands interactively
         when run, you must cause it, when started running for such
         interactive use in the most ordinary way, to print or display an
         announcement including an appropriate copyright notice and a
         notice that there is no warranty (or else, saying that you provide
         a warranty) and that users may redistribute the program under
         these conditions, and telling the user how to view a copy of this
         License.  (Exception: if the Program itself is interactive but
         does not normally print such an announcement, your work based on
         the Program is not required to print an announcement.)
     
     These requirements apply to the modified work as a whole.  If
     identifiable sections of that work are not derived from the Program,
     and can be reasonably considered independent and separate works in
     themselves, then this License, and its terms, do not apply to those
     sections when you distribute them as separate works.  But when you
     distribute the same sections as part of a whole which is a work based
     on the Program, the distribution of the whole must be on the terms of
     this License, whose permissions for other licensees extend to the
     entire whole, and thus to each and every part regardless of who wrote it.
     
     Thus, it is not the intent of this section to claim rights or contest
     your rights to work written entirely by you; rather, the intent is to
     exercise the right to control the distribution of derivative or
     collective works based on the Program.
     
     In addition, mere aggregation of another work not based on the Program
     with the Program (or with a work based on the Program) on a volume of
     a storage or distribution medium does not bring the other work under
     the scope of this License.
     
       3. You may copy and distribute the Program (or a work based on it,
     under Section 2) in object code or executable form under the terms of
     Sections 1 and 2 above provided that you also do one of the following:
     
         a) Accompany it with the complete corresponding machine-readable
         source code, which must be distributed under the terms of Sections
         1 and 2 above on a medium customarily used for software interchange; or,
     
         b) Accompany it with a written offer, valid for at least three
         years, to give any third party, for a charge no more than your
         cost of physically performing source distribution, a complete
         machine-readable copy of the corresponding source code, to be
         distributed under the terms of Sections 1 and 2 above on a medium
         customarily used for software interchange; or,
     
         c) Accompany it with the information you received as to the offer
         to distribute corresponding source code.  (This alternative is
         allowed only for noncommercial distribution and only if you
         received the program in object code or executable form with such
         an offer, in accord with Subsection b above.)
     
     The source code for a work means the preferred form of the work for
     making modifications to it.  For an executable work, complete source
     code means all the source code for all modules it contains, plus any
     associated interface definition files, plus the scripts used to
     control compilation and installation of the executable.  However, as a
     special exception, the source code distributed need not include
     anything that is normally distributed (in either source or binary
     form) with the major components (compiler, kernel, and so on) of the
     operating system on which the executable runs, unless that component
     itself accompanies the executable.
     
     If distribution of executable or object code is made by offering
     access to copy from a designated place, then offering equivalent
     access to copy the source code from the same place counts as
     distribution of the source code, even though third parties are not
     compelled to copy the source along with the object code.
     
       4. You may not copy, modify, sublicense, or distribute the Program
     except as expressly provided under this License.  Any attempt
     otherwise to copy, modify, sublicense or distribute the Program is
     void, and will automatically terminate your rights under this License.
     However, parties who have received copies, or rights, from you under
     this License will not have their licenses terminated so long as such
     parties remain in full compliance.
     
       5. You are not required to accept this License, since you have not
     signed it.  However, nothing else grants you permission to modify or
     distribute the Program or its derivative works.  These actions are
     prohibited by law if you do not accept this License.  Therefore, by
     modifying or distributing the Program (or any work based on the
     Program), you indicate your acceptance of this License to do so, and
     all its terms and conditions for copying, distributing or modifying
     the Program or works based on it.
     
       6. Each time you redistribute the Program (or any work based on the
     Program), the recipient automatically receives a license from the
     original licensor to copy, distribute or modify the Program subject to
     these terms and conditions.  You may not impose any further
     restrictions on the recipients' exercise of the rights granted herein.
     You are not responsible for enforcing compliance by third parties to
     this License.
     
       7. If, as a consequence of a court judgment or allegation of patent
     infringement or for any other reason (not limited to patent issues),
     conditions are imposed on you (whether by court order, agreement or
     otherwise) that contradict the conditions of this License, they do not
     excuse you from the conditions of this License.  If you cannot
     distribute so as to satisfy simultaneously your obligations under this
     License and any other pertinent obligations, then as a consequence you
     may not distribute the Program at all.  For example, if a patent
     license would not permit royalty-free redistribution of the Program by
     all those who receive copies directly or indirectly through you, then
     the only way you could satisfy both it and this License would be to
     refrain entirely from distribution of the Program.
     
     If any portion of this section is held invalid or unenforceable under
     any particular circumstance, the balance of the section is intended to
     apply and the section as a whole is intended to apply in other
     circumstances.
     
     It is not the purpose of this section to induce you to infringe any
     patents or other property right claims or to contest validity of any
     such claims; this section has the sole purpose of protecting the
     integrity of the free software distribution system, which is
     implemented by public license practices.  Many people have made
     generous contributions to the wide range of software distributed
     through that system in reliance on consistent application of that
     system; it is up to the author/donor to decide if he or she is willing
     to distribute software through any other system and a licensee cannot
     impose that choice.
     
     This section is intended to make thoroughly clear what is believed to
     be a consequence of the rest of this License.
     
       8. If the distribution and/or use of the Program is restricted in
     certain countries either by patents or by copyrighted interfaces, the
     original copyright holder who places the Program under this License
     may add an explicit geographical distribution limitation excluding
     those countries, so that distribution is permitted only in or among
     countries not thus excluded.  In such case, this License incorporates
     the limitation as if written in the body of this License.
     
       9. The Free Software Foundation may publish revised and/or new versions
     of the General Public License from time to time.  Such new versions will
     be similar in spirit to the present version, but may differ in detail to
     address new problems or concerns.
     
     Each version is given a distinguishing version number.  If the Program
     specifies a version number of this License which applies to it and "any
     later version", you have the option of following the terms and conditions
     either of that version or of any later version published by the Free
     Software Foundation.  If the Program does not specify a version number of
     this License, you may choose any version ever published by the Free Software
     Foundation.
     
       10. If you wish to incorporate parts of the Program into other free
     programs whose distribution conditions are different, write to the author
     to ask for permission.  For software which is copyrighted by the Free
     Software Foundation, write to the Free Software Foundation; we sometimes
     make exceptions for this.  Our decision will be guided by the two goals
     of preserving the free status of all derivatives of our free software and
     of promoting the sharing and reuse of software generally.
     
     			    NO WARRANTY
     
       11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
     FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
     OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
     PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
     OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
     TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
     PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
     REPAIR OR CORRECTION.
     
       12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
     WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
     REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
     INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
     OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
     TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
     YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGES.
     
     		     END OF TERMS AND CONDITIONS
     
     	Appendix: How to Apply These Terms to Your New Programs
     
       If you develop a new program, and you want it to be of the greatest
     possible use to the public, the best way to achieve this is to make it
     free software which everyone can redistribute and change under these terms.
     
       To do so, attach the following notices to the program.  It is safest
     to attach them to the start of each source file to most effectively
     convey the exclusion of warranty; and each file should have at least
     the "copyright" line and a pointer to where the full notice is found.
     
         <one line to give the program's name and a brief idea of what it does.>
         Copyright (C) 19yy  <name of author>
     
         This program is free software; you can redistribute it and/or modify
         it under the terms of the GNU General Public License as published by
         the Free Software Foundation; either version 2 of the License, or
         (at your option) any later version.
     
         This program is distributed in the hope that it will be useful,
         but WITHOUT ANY WARRANTY; without even the implied warranty of
         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
         GNU General Public License for more details.
     
         You should have received a copy of the GNU General Public License
         along with this program; if not, write to the Free Software
         Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     
     Also add information on how to contact you by electronic and paper mail.
     
     If the program is interactive, make it output a short notice like this
     when it starts in an interactive mode:
     
         Gnomovision version 69, Copyright (C) 19yy name of author
         Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
         This is free software, and you are welcome to redistribute it
         under certain conditions; type `show c' for details.
     
     The hypothetical commands `show w' and `show c' should show the appropriate
     parts of the General Public License.  Of course, the commands you use may
     be called something other than `show w' and `show c'; they could even be
     mouse-clicks or menu items--whatever suits your program.
     
     You should also get your employer (if you work as a programmer) or your
     school, if any, to sign a "copyright disclaimer" for the program, if
     necessary.  Here is a sample; alter the names:
     
       Yoyodyne, Inc., hereby disclaims all copyright interest in the program
       `Gnomovision' (which makes passes at compilers) written by James Hacker.
     
       <signature of Ty Coon>, 1 April 1989
       Ty Coon, President of Vice
     
     This General Public License does not permit incorporating your program into
     proprietary programs.  If your program is a subroutine library, you may
     consider it more useful to permit linking proprietary applications with the
     library.  If this is what you want to do, use the GNU Library General
     Public License instead of this License.

