cygwin User Guide.pdf

(407 KB) Pobierz
29196741 UNPDF
Cygwin User’s Guide
Cygwin User’s Guide
Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
Table of Contents
1. Cygwin Overview .......................................................................................................1
1.1. What is it? .........................................................................................................1
1.2. Are the Cygwin tools free software? ................................................................1
1.3. A brief history of the Cygwin project ...............................................................1
1.4. Expectations for UNIX Programmers...............................................................2
1.5. Expectations for Windows Programmers..........................................................2
1.6. Highlights of Cygwin Functionality .................................................................2
1.6.1. Introduction............................................................................................3
1.6.2. Supporting both Windows NT and 9x ...................................................3
1.6.3. Permissions and Security .......................................................................4
1.6.4. File Access .............................................................................................4
1.6.5. Text Mode vs. Binary Mode ..................................................................6
1.6.6. ANSI C Library......................................................................................6
1.6.7. Process Creation.....................................................................................6
1.6.8. Signals....................................................................................................7
1.6.9. Sockets ...................................................................................................8
1.6.10. Select....................................................................................................8
2. Setting Up Cygwin ...................................................................................................10
2.1. Internet Setup ..................................................................................................10
2.1.1. Download Source.................................................................................10
2.1.2. Selecting an Install Directory...............................................................11
2.1.3. Local Package Directory......................................................................11
2.1.4. Connection Method..............................................................................11
2.1.5. Choosing Mirrors .................................................................................12
2.1.6. Choosing Packages ..............................................................................12
2.1.7. Download and Installation Progress ....................................................13
2.1.8. Icons .....................................................................................................13
2.1.9. Post-Install Scripts ...............................................................................13
2.2. Environment Variables ....................................................................................13
2.3. Changing Cygwin’s Maximum Memory ........................................................14
2.4. NT security and the ntsec usage ...................................................................15
2.4.1. NT security...........................................................................................16
2.4.2. Process privileges.................................................................................19
2.4.3. File permissions ...................................................................................19
2.4.4. New since Cygwin release 1.1 .............................................................21
2.4.5. The mapping leak.................................................................................23
2.4.6. New acl API .........................................................................................25
i
2.4.7. New setuid concept ..............................................................................26
2.4.8. New since Cygwin release 1.3.3 ..........................................................28
2.4.9. Special values of user and group ids....................................................29
2.5. Customizing bash............................................................................................30
3. Using Cygwin............................................................................................................32
3.1. Mapping path names .......................................................................................32
3.1.1. Introduction..........................................................................................32
3.1.2. The Cygwin Mount Table ....................................................................32
3.1.3. Additional Path-related Information ....................................................34
3.2. Text and Binary modes ...................................................................................34
3.2.1. The Issue ..............................................................................................34
3.2.2. The default Cygwin behavior...............................................................35
3.2.3. Example ...............................................................................................36
3.2.4. Binary or text?......................................................................................36
3.2.5. Programming........................................................................................37
3.3. File permissions ..............................................................................................37
3.4. Special filenames ............................................................................................38
3.4.1. DOS devices.........................................................................................38
3.4.2. POSIX devices .....................................................................................38
3.4.3. The .exe extension................................................................................41
3.4.4. The @pathnames .................................................................................41
3.5. The CYGWIN environment variable ..............................................................42
3.6. Cygwin Utilities ..............................................................................................44
3.6.1. cygcheck ..............................................................................................44
3.6.2. cygpath .................................................................................................46
3.6.3. dumper .................................................................................................47
3.6.4. getfacl...................................................................................................48
3.6.5. kill ........................................................................................................49
3.6.6. mkgroup ...............................................................................................51
3.6.7. mkpasswd.............................................................................................52
3.6.8. mount ...................................................................................................54
3.6.8.1. Using mount..............................................................................54
3.6.8.2. Cygdrive mount points..............................................................56
3.6.8.3. Limitations ................................................................................57
3.6.9. passwd..................................................................................................57
3.6.10. ps ........................................................................................................59
3.6.11. regtool ................................................................................................60
3.6.12. setfacl .................................................................................................62
3.6.13. ssp ......................................................................................................64
3.6.14. strace ..................................................................................................67
ii
3.6.15. umount ...............................................................................................68
3.7. Using Cygwin effectively with Windows .......................................................69
3.7.1. Pathnames ............................................................................................69
3.7.2. Console Programs ................................................................................70
3.7.3. Cygwin and Windows Networking ......................................................70
3.7.4. The cygutils package............................................................................71
3.7.5. Creating shortcuts with cygutils...........................................................71
3.7.6. Printing with cygutils ...........................................................................72
4. Programming with Cygwin .....................................................................................73
4.1. Using GCC with Cygwin ................................................................................73
4.1.1. Console Mode Applications.................................................................73
4.1.2. GUI Mode Applications.......................................................................73
4.2. Debugging Cygwin Programs.........................................................................76
4.3. Building and Using DLLs...............................................................................77
4.3.1. Building DLLs .....................................................................................78
4.3.2. Linking Against DLLs .........................................................................79
4.4. Defining Windows Resources .........................................................................79
iii
Zgłoś jeśli naruszono regulamin