Cygwin User's Guide

Copyright © Cygwin authors

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.

Abstract

Cygwin User's Guide


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
What's new and what changed in 3.5
What's new and what changed in 3.4
What's new and what changed in 3.3
What's new and what changed in 3.2
What's new and what changed in 3.1
What's new and what changed in 3.0
What's new and what changed in 2.11
What's new and what changed in 2.10
What's new and what changed in 2.9
What's new and what changed in 2.8
What's new and what changed in 2.7
What's new and what changed in 2.6
What's new and what changed in 2.5
What's new and what changed in 2.4
What's new and what changed in 2.3
What's new and what changed in 2.2
What's new and what changed in 2.1
What's new and what changed in 2.0
What's new and what changed in 1.7.35
What's new and what changed in 1.7.34
What's new and what changed in 1.7.33
What's new and what changed in 1.7.32
What's new and what changed in 1.7.31
What's new and what changed in 1.7.29
What's new and what changed in 1.7.28
What's new and what changed in 1.7.27
What's new and what changed in 1.7.26
What's new and what changed in 1.7.25
What's new and what changed in 1.7.24
What's new and what changed in 1.7.23
What's new and what changed in 1.7.22
What's new and what changed in 1.7.21
What's new and what changed in 1.7.19
What's new and what changed in 1.7.18
What's new and what changed in 1.7.17
What's new and what changed in 1.7.16
What's new and what changed in 1.7.15
What's new and what changed in 1.7.14
What's new and what changed in 1.7.13
What's new and what changed in 1.7.12
What's new and what changed in 1.7.11
What's new and what changed in 1.7.10
What's new and what changed in 1.7.9
What's new and what changed in 1.7.8
What's new and what changed in 1.7.7
What's new and what changed in 1.7.6
What's new and what changed in 1.7.5
What's new and what changed in 1.7.3
What's new and what changed in 1.7.2
What's new and what changed from 1.5 to 1.7
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
The usertemp file system type
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
Case sensitive directories
POSIX devices
The .exe extension
The /proc filesystem
The /proc/registry filesystem
The @pathnames
The CYGWIN environment variable
Implemented options
Obsolete options
POSIX accounts, permission, and security
Brief overview of Windows security
Mapping Windows accounts to POSIX accounts
Mapping Windows SIDs to POSIX uid/gid values
Caching account information
Cygwin user names, home dirs, login shells
The /etc/nsswitch.conf file
The /etc/nsswitch.conf syntax
The passwd: and group: settings
The db_enum: setting
Settings defining how to create the passwd entry
The db_home setting
The db_shell setting
The db_gecos setting
The cygwin schema
The unix schema
The desc schema
NFS account mapping
Samba account mapping
File permissions
Switching the user context
Switching the user context with password authentication
Switching the user context without password, Method 1: Kerberos/MsV1_0 S4U authentication
Switching the user context without password, Method 2: With password
Switching the user context, how does it all fit together?
Cygserver
What is Cygserver?
Cygserver command line options
How to install Cygserver
How to start Cygserver
The Cygserver configuration file
Cygwin Utilities
chattr
cygcheck
cygpath
dumper
getconf
getfacl
gmondump
kill
ldd
locale
lsattr
minidumper
mkgroup
mkpasswd
mount
newgrp
passwd
pldd
profiler
ps
regtool
setfacl
setmetamode
ssp
strace
tzset
umount
Using Cygwin effectively with Windows
Pathnames
Cygwin and Windows Networking
Creating shortcuts
Printing
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
Profiling Cygwin Programs
Introduction
Examples
Special situations
Profiling multi-threaded programs
Profiling programs that fork
Getting better profiling resolution
Profiling programs with their libraries
Profiling Cygwin itself

List of Examples

3.1. Displaying the current set of mount points
3.2. Using @pathname
3.3. Example cygcheck -e/-i usage
3.4. Example cygcheck -f/-l usage
3.5. Searching all packages for a file
3.6. Example cygpath usage
3.7. Using the kill command
3.8. Setting up group entry for current user with different domain/group separator
3.9. Using an alternate home root
3.10. Displaying the current set of mount points
3.11. Adding mount points
3.12. Changing the default prefix
3.13. 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
4.7. Flat profile
4.8. Call graph
4.9. Source line profile
4.10.