Cygwin User's Guide

Copyright © 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc.

Permission is granted to make and distribute verbatim copies of this documentation provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.


Table of Contents

1. Cygwin Overview
What is it?
Quick Start Guide for those more experienced with Windows
Quick Start Guide for those more experienced with UNIX
Are the Cygwin tools free software?
A brief history of the Cygwin project
Highlights of Cygwin Functionality
Introduction
Permissions and Security
File Access
Text Mode vs. Binary Mode
ANSI C Library
Process Creation
Signals
Sockets
Select
What's new and what changed in Cygwin 1.7
What's new and what changed from 1.7.30 to 1.7.31
What's new and what changed from 1.7.28 to 1.7.29
What's new and what changed from 1.7.27 to 1.7.28
What's new and what changed from 1.7.26 to 1.7.27
What's new and what changed from 1.7.25 to 1.7.26
What's new and what changed from 1.7.24 to 1.7.25
What's new and what changed from 1.7.23 to 1.7.24
What's new and what changed from 1.7.22 to 1.7.23
What's new and what changed from 1.7.21 to 1.7.22
What's new and what changed from 1.7.20 to 1.7.21
What's new and what changed from 1.7.18 to 1.7.19
What's new and what changed from 1.7.17 to 1.7.18
What's new and what changed from 1.7.16 to 1.7.17
What's new and what changed from 1.7.15 to 1.7.16
What's new and what changed from 1.7.14 to 1.7.15
What's new and what changed from 1.7.13 to 1.7.14
What's new and what changed from 1.7.12 to 1.7.13
What's new and what changed from 1.7.11 to 1.7.12
What's new and what changed from 1.7.10 to 1.7.11
What's new and what changed from 1.7.9 to 1.7.10
What's new and what changed from 1.7.8 to 1.7.9
What's new and what changed from 1.7.7 to 1.7.8
What's new and what changed from 1.7.6 to 1.7.7
What's new and what changed from 1.7.5 to 1.7.6
What's new and what changed from 1.7.3 to 1.7.5
What's new and what changed from 1.7.2 to 1.7.3
What's new and what changed from 1.7.1 to 1.7.2
OS related changes
File Access related changes
Network related changes
Device related changes
Other POSIX related changes
Security related changes
Miscellaneous
2. Setting Up Cygwin
Internet Setup
Download Source
Selecting an Install Directory
Local Package Directory
Connection Method
Choosing Mirrors
Choosing Packages
Download and Installation Progress
Shortcuts
Post-Install Scripts
Troubleshooting
Environment Variables
Overview
Restricted Win32 environment
Changing Cygwin's Maximum Memory
Internationalization
Overview
How to set the locale
The Windows Console character set
Potential Problems when using Locales
List of supported character sets
Customizing bash
3. Using Cygwin
Mapping path names
Introduction
The Cygwin Mount Table
UNC paths
The cygdrive path prefix
Symbolic links
Using native Win32 paths
Using the Win32 file API in Cygwin applications
Additional Path-related Information
Text and Binary modes
The Issue
The default Cygwin behavior
Binary or text?
Programming
File permissions
Special filenames
Special files in /etc
Invalid filenames
Forbidden characters in filenames
Filenames with unusual (foreign) characters
Case sensitive filenames
POSIX devices
The .exe extension
The /proc filesystem
The /proc/registry filesystem
The @pathnames
The CYGWIN environment variable
Implemented options
Obsolete options
Using Windows security in Cygwin
Overview
File permissions
Special values of user and group ids
The POSIX permission mapping leak
Switching the user context
Switching the user context with password authentication
Switching the user context without password, Method 1: Create a token from scratch
Switching the user context without password, Method 2: LSA authentication package
Switching the user context without password, Method 3: With password
Switching the user context, how does it all fit together?
Cygserver
What is Cygserver?
Cygserver command line options
How to start Cygserver
The Cygserver configuration file
Cygwin Utilities
cygcheck
cygpath
dumper
getconf
getfacl
kill
ldd
locale
minidumper
mkgroup
mkpasswd
mount
passwd
pldd
ps
regtool
setfacl
setmetamode
ssp
strace
tzset
umount
Using Cygwin effectively with Windows
Pathnames
Cygwin and Windows Networking
The cygutils package
Creating shortcuts with cygutils
Printing with cygutils
4. Programming with Cygwin
Using GCC with Cygwin
Standard Usage
Building applications for 64 bit Cygwin
GUI Mode Applications
Debugging Cygwin Programs
Building and Using DLLs
Building DLLs
Linking Against DLLs
Defining Windows Resources

List of Examples

3.1. Displaying the current set of mount points
3.2. Using @pathname
3.3. /etc/passwd:
3.4. /etc/passwd, tweaked:
3.5. /etc/group, tweaked:
3.6. Example cygcheck usage
3.7. Searching all packages for a file
3.8. Example cygpath usage
3.9. Using the kill command
3.10. Setting up group entry for current user with different domain/group separator
3.11. Using an alternate home root
3.12. Displaying the current set of mount points
3.13. Adding mount points
3.14. Changing the default prefix
3.15. Changing the default prefix with specific mount options
4.1. Building Hello World with GCC
4.2. 64bit-programming, Using ReadFile, 1st try
4.3. 64bit-programming, Using ReadFile, 2nd try
4.4. Compiling with -g
4.5. "break" in gdb
4.6. Debugging with command line arguments