Jump to content

Cygwin: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Description: Rephrase to avoid implying users have to use gcc to run Unix-like programs
No edit summary
 
(39 intermediate revisions by 26 users not shown)
Line 1: Line 1:
{{Advertisement|date=January 2024}}
{{Short description|Unix subsystem for Windows machines}}
{{Use mdy dates|date=May 2024}}{{Short description|Unix-like environment for Windows}}
{{Infobox software
{{Infobox software
| name = Cygwin
| name = Cygwin
Line 15: Line 16:
| programming language = [[C (programming language)|C]]/[[C++]]
| programming language = [[C (programming language)|C]]/[[C++]]
| genre = [[:Category:Unix SUS2008 utilities|POSIX standard utilities]], [[C POSIX library|POSIX standard library]], [[C standard library]], [[compatibility layer]]
| genre = [[:Category:Unix SUS2008 utilities|POSIX standard utilities]], [[C POSIX library|POSIX standard library]], [[C standard library]], [[compatibility layer]]
| license = [[GNU General Public License|GPLv3]], [[GNU Lesser General Public License|LGPLv3]]<ref>{{Cite web | url = https://cygwin.com/licensing.html | title = Cygwin Licensing Terms | access-date = 2022-12-15 | archive-date = 2012-07-28 | archive-url = https://web.archive.org/web/20120728133502/http://cygwin.com/licensing.html | url-status = live }}</ref>
| license = [[GNU Lesser General Public License|LGPLv3]]
}}
}}
'''Cygwin''' ({{IPAc-en|ˈ|s|ɪ|ɡ|w|ɪ|n}} {{respell|SIG|win}})<ref>{{Cite mailing list | mailing-list = Cygwin | url = http://cygwin.com/ml/cygwin/2004-09/msg00702.html | title = Re: How do you pronounce it? | first = Larry | last = Hall | date = 2004-09-14 | access-date = 2007-10-10}}</ref> is a [[POSIX]]-compatible programming and [[runtime environment]] that runs natively on [[Microsoft Windows]]. Under Cygwin, [[source code]] designed for [[Unix-like]] operating systems may be compiled with minimal modification and executed.<ref name="auto">{{Cite web|url=https://www.cygwin.com/|title=Cygwin|website=www.cygwin.com}}</ref>


'''Cygwin''' ({{IPAc-en|ˈ|s|ɪ|ɡ|w|ɪ|n}} {{respell|SIG|win}})<ref>{{Cite mailing list | mailing-list = Cygwin | url = http://cygwin.com/ml/cygwin/2004-09/msg00702.html | title = Re: How do you pronounce it? | first = Larry | last = Hall | date = 2004-09-14 | access-date = 2007-10-10 | archive-date = 2011-08-30 | archive-url = https://web.archive.org/web/20110830025943/http://www.cygwin.com/ml/cygwin/2004-09/msg00702.html | url-status = live }}</ref> is a [[free and open-source software|free and open-source]] [[Unix-like]] [[runtime environment|environment]] and [[command-line interface]] for [[Microsoft Windows]]. The project also provides a software repository containing many [[Open-source software|open-source]] packages. Cygwin allows [[source code]] for Unix-like operating systems to be compiled and run on Windows. Cygwin provides native integration of Windows-based applications.<ref name="auto1">{{Cite web|url=https://cygwin.com/faq.html|title=Cygwin FAQ|website=cygwin.com|access-date=2021-01-07|archive-date=2021-05-07|archive-url=https://web.archive.org/web/20210507021924/http://cygwin.com/faq.html|url-status=live}}</ref>
The Cygwin installation has a directory layout that is similar to the root file system of Unix-like systems, with familiar directories, such as /bin, /home, /etc, /usr, and /var. Cygwin installs with hundreds of command-line tools and other programs commonly found on a Unix-like system. Additionally, many applications may be installed from a packaging system. The terminal emulator [[Mintty]] is the default [[command-line interface]] provided to interact with the environment.<ref name="auto"/>


The [[terminal emulator]] [[Mintty]] is the default command-line interface provided to interact with the environment.<ref name="auto">{{Cite web |title=Cygwin |url=https://www.cygwin.com/ |url-status=live |archive-url=https://web.archive.org/web/20151121011348/http://www.cygwin.com/ |archive-date=2015-11-21 |access-date=2015-11-21 |website=www.cygwin.com}}</ref> The Cygwin installation directory layout mimics the root file system of Unix-like systems, with directories such as /bin, /home, /etc, /usr, and /var.
Cygwin provides native integration of Windows-based applications.<ref name="auto1">{{Cite web|url=https://cygwin.com/faq.html|title=Cygwin FAQ|website=cygwin.com}}</ref> Thus it is possible to launch Windows applications from the Cygwin environment, as well as to use Cygwin tools and applications within the Windows operating context.


Cygwin is released under the [[GNU Lesser General Public License]] version 3.<ref>{{cite web|title=Cygwin library now available under GNU Lesser General Public License|url=https://www.redhat.com/en/about/blog/cygwin-library-now-available-under-gnu-lesser-general-public-license|website=Red Hat|access-date=2016-06-23|archive-date=2016-06-24|archive-url=https://web.archive.org/web/20160624112409/https://www.redhat.com/en/about/blog/cygwin-library-now-available-under-gnu-lesser-general-public-license|url-status=live}}</ref> It was originally developed by [[Cygnus Solutions]],<ref>{{Cite web|url=https://cygwin.com/cygwin-ug-net/brief-history.html|title=A brief history of the Cygwin project|date=2018-02-02|website=Cygwin|access-date=2020-01-10|archive-date=2020-01-08|archive-url=https://web.archive.org/web/20200108185000/http://cygwin.com/cygwin-ug-net/brief-history.html|url-status=live}}</ref><ref>{{Cite web|url=https://www.usenix.org/legacy/publications/library/proceedings/usenix-nt98/full_papers/noer/noer_html/noer.html|title=Cygwin32: A Free Win32 Porting Layer for UNIX Applications|date=1998-08-03|website=USENIX|access-date=2020-01-10|archive-date=2020-01-11|archive-url=https://web.archive.org/web/20200111073949/https://www.usenix.org/legacy/publications/library/proceedings/usenix-nt98/full_papers/noer/noer_html/noer.html|url-status=live}}</ref> which was later acquired by [[Red Hat]] (now part of [[IBM]]), to port the Linux [[toolchain]] to [[Win32]], including the [[GNU Compiler Collection|GNU Compiler Suite]]. Rather than rewrite the tools to use the Win32 runtime environment, Cygwin implemented a POSIX-compatible environment in the form of a DLL.<ref>{{Cite web|url=https://discuss.howtogeek.com/t/solved-linux-subsystem-vs-cygwin-vs-mobaxterm/56366|title=(Solved) Linux Subsystem vs Cygwin vs MobaXterm|date=2017-01-24|website=Tech Help Forum by How-To Geek|access-date=2019-03-15|archive-date=2023-02-20|archive-url=https://web.archive.org/web/20230220141544/https://www.facebook.com/groups/geektalkgroup/|url-status=live}}</ref>
Cygwin consists of two parts: a [[dynamic-link library]] (DLL) as an [[Application programming interface|API]] compatibility layer in the form of a [[C standard library]] providing a substantial part of the POSIX API functionality, and an extensive collection of [[Programming tool|software tools]] and applications that provide a Unix-like [[look and feel]].<ref name="auto1"/>


The brand motto is "Get that Linux feeling – on Windows".<ref>{{Cite web |title=Cygwin |url=https://www.cygwin.com/ |access-date=2024-03-11 |website=www.cygwin.com}}</ref>
Cygwin is [[free and open-source software]], released under the [[GNU Lesser General Public License]] version 3.<ref>{{cite web|title=Cygwin library now available under GNU Lesser General Public License|url=https://www.redhat.com/en/about/blog/cygwin-library-now-available-under-gnu-lesser-general-public-license|website=Red Hat}}</ref> It was originally developed by [[Cygnus Solutions]],<ref>{{Cite web|url=https://cygwin.com/cygwin-ug-net/brief-history.html|title=A brief history of the Cygwin project|date=2018-02-02|website=Cygwin|access-date=2020-01-10}}</ref><ref>{{Cite web|url=https://www.usenix.org/legacy/publications/library/proceedings/usenix-nt98/full_papers/noer/noer_html/noer.html|title=Cygwin32: A Free Win32 Porting Layer for UNIX® Applications|date=1998-08-03|website=USENIX|access-date=2020-01-10}}</ref> which was later acquired by [[Red Hat]] (now part of [[IBM]]), to port the Linux [[toolchain]] to Win32, including the [[GNU Compiler Collection|GNU Compiler Suite]]. Rather than rewrite the tools to use the [[Windows API|Win32]] runtime environment, Cygwin implemented a POSIX-compatible environment in the form of a [[dynamic-link library]] (DLL).<ref>{{Cite web|url=https://discuss.howtogeek.com/t/solved-linux-subsystem-vs-cygwin-vs-mobaxterm/56366|title=(Solved) Linux Subsystem vs Cygwin vs MobaXterm|date=2017-01-24|website=Tech Help Forum by How-To Geek|access-date=2019-03-15}}</ref>


==Description==
== History ==
{{More citations needed section|date=January 2024}}
The Cygwin environment is provided in two versions; the full 64-bit version and a stripped down 32-bit version that is slowly being phased out. Cygwin consists of a library that implements the [[POSIX]] system call [[application programming interface|API]] in terms of Windows system calls to enable running of a large number of application programs equivalent to those on [[Unix]] systems, and a [[GNU]] development toolchain (including [[GNU Compiler Collection|GCC]] and [[GNU Debugger|GDB]]) to allow software development. Programmers have ported many Unix, GNU, [[BSD]] and [[Linux]] programs and packages to Cygwin, including the [[X Window System]], [[K Desktop Environment 3]], [[GNOME]],<ref>{{cite web|url=http://sourceware.org/cygwinports/|title=Cygwin Ports|access-date=2 May 2015}}</ref> [[Apache HTTP Server|Apache]], and [[TeX]]. Cygwin permits installing [[inetd]], [[syslogd]], [[Secure Shell|sshd]], [[Apache HTTP Server|Apache]], and other daemons as standard [[Windows service]]s, allowing Microsoft Windows systems to emulate Unix and Linux servers.
Cygwin began in 1995 as a project of Steve Chamberlain, a [[Cygnus Solutions|Cygnus]] engineer who observed that Windows NT and 95 used [[COFF]] as their [[object file format]], and that GNU already included support for [[x86]] and COFF, and the [[C standard library|C library]] [[newlib]]. He thought that it would be possible to retarget [[GNU Compiler Collection|GCC]] and produce a [[cross compiler]] generating executables that could run on Windows. A prototype was later developed. Chamberlain [[Bootstrapping (compilers)|bootstrap]]ped the compiler on a Windows system, to emulate Unix to let the [[Autoconf|GNU configure]] [[shell script]] run.


Initially, Cygwin was called ''gnuwin32''.{{Efn|Not to be confused with the current [[GnuWin32]] project.|group=note}} When [[Microsoft]] registered the trademark Win32, the "32" was dropped to simply become ''Cygwin''.
Cygwin programs are installed by running Cygwin's "setup"<ref>{{Cite mailing list|mailing-list=Cygwin|title=New Cygwin Net Release|date=2000-04-17|last=Delorie|first=DJ|url=https://cygwin.com/ml/cygwin/2000-04/msg00269.html|access-date=2020-01-10}}</ref> program, which downloads the necessary program and feature package files from repositories on the Internet. As mentioned, there are two versions of this setup program, one for 32-bit versions of the Cygwin DLL, and corresponding applications, and one for 64-bit versions. Setup can install, update, and remove programs and their source code packages. A complete installation will take in excess of 90&nbsp;GB<ref>{{Cite web|url=https://stackoverflow.com/questions/21230657/what-is-the-current-full-install-size-of-cygwin/21233990|title=What is the current full install size of Cygwin?|date=2018-05-28|website=StackOverflow|access-date=2020-01-11}}</ref> of hard disk space, but usable configurations may require as little as 1 or 2&nbsp;GB.


In 1999, Cygnus offered Cygwin 1.0 as a commercial product.<ref>{{cite web|url=https://books.google.com/books?id=_k4EAAAAMBAJ&q=InfoWorld+15+Nov+1999+Cygwin&pg=PA110|title=Cygwin Unites Unix and Windows Apps|website=Google Books|date=1999-11-15|access-date=2020-01-13|archive-date=2023-02-20|archive-url=https://web.archive.org/web/20230220141540/https://books.google.com/books?id=_k4EAAAAMBAJ&q=InfoWorld+15+Nov+1999+Cygwin&pg=PA110|url-status=live}}</ref> Subsequent versions have not been released, instead relying on continued open source releases.
Efforts to reconcile concepts that differ between Unix and Windows systems include:
* A Cygwin-specific version of the Unix [[Mount (computing)|<code>mount</code>]] command allows mounting Windows paths as "filesystems" in the Unix file space. Initial mount-points can be configured in <code>[[fstab|/etc/fstab]]</code>, which has a format very similar to Unix systems, except that Windows paths appear in place of devices. Filesystems can be mounted in binary mode (by default), or in text mode, which enables automatic [[Newline#Common problems|conversion]] between [[Newline|LF]] and [[CRLF]] endings (which only affects programs that open files without explicitly specifying text or binary mode).
* Cygwin 1.7 introduced comprehensive support for POSIX [[Locale (computer software)|locales]] and many [[character encoding]]s, whereby the [[UTF-8]] [[Unicode]] encoding became the default. Windows file-names and other identifiers, which are encoded as [[UTF-16]], are automatically converted to and from the selected character-encoding.
* Windows [[drive letter]]s map to a special directory, so for example <code>C:</code> appears as <code>/cygdrive/c</code>. The <code>/cygdrive</code> prefix can be changed. Windows network paths of the form <code>\\HOST\SHARE\FILE</code> are mapped to <code>//HOST/SHARE/FILE</code>. Windows paths can also be used directly from Cygwin programs, but many programs do not support them correctly, hence this is discouraged.
* Full-featured <code>[[/dev]]</code> and <code>[[/proc]]</code> file-systems are provided. <code>/proc/registry</code> provides direct filesystem access to the registry.
* Cygwin supports POSIX [[symbolic link]]s, representing them as plain-text files with the system [[attrib]]ute set. Cygwin 1.5 represented them as [[Windows Explorer]] [[File shortcut|shortcuts]], but this was changed for reasons of performance and POSIX correctness. Cygwin also recognises NTFS [[NTFS junction point|junction points]] and [[NTFS symbolic link|symbolic links]] and treats them as POSIX symbolic links, but it does not create them as their semantics are not fully POSIX-compliant.
* The POSIX API for handling [[access control list]]s (ACLs) is supported and maps to the Windows NT ACL system.<ref>{{Cite mailing list|last=Vinschen|first=Corinna|title=Updated: Cygwin 2.4.0-1|mailing-list=Cygwin Announcements|date=2016-01-16|url=http://www.cygwin.org/ml/cygwin-announce/2016-01/msg00018.html|access-date = 2020-01-11}}</ref>
* Special formats of <code>/etc/passwd</code> and <code>/etc/group</code> are provided that include pointers to the Windows equivalent [[Security Identifier|SID]]s (in the [[Gecos field]]), allowing for mapping between Unix and Windows users and groups.
* The [[fork (system call)|fork]] system call for duplicating a process is fully implemented, but it does not map well to the Windows API. For example, the [[copy-on-write]] optimization strategy could not be used.<ref>
{{cite web
| title = Cygwin FAQ: How is fork() implemented?
| url = https://www.cygwin.com/faq.html
| access-date = Oct 10, 2010
}}
</ref><ref>
{{cite web
| title = Highlights of Cygwin Functionality: Process Creation
| url = http://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process
| access-date = Dec 24, 2014
}}
</ref><ref>
{{Cite mailing list
| last = Blake
| first = Eric
| title = Bash doesn't launch the applications directly
| mailing-list = Cygwin
| date = Jan 15, 2009
| url = http://www.cygwin.com/ml/cygwin/2009-01/msg00461.html
| access-date = Oct 10, 2010
}}
</ref> As a result, Cygwin's fork is rather slow compared with Linux and others. (That overhead can often be avoided by replacing uses of the [[fork-exec|fork/exec]] technique with calls to the [[spawn (computing)|spawn]] functions declared in the Windows-specific [[process.h]] header).
* The Cygwin DLL contains a console driver that emulates a Unix-style [[Terminal emulator|terminal]] within the [[Win32 console|Windows console]]. Cygwin's default user interface is the [[Bash (Unix shell)|bash]] shell running in the Cygwin console.
* The DLL also implements [[pseudo terminal]] (pty) devices. Cygwin ships with a number of [[terminal emulator]]s that are based on them, including [[mintty]], [[rxvt]]([[rxvt-unicode|-unicode]]), and [[xterm]]. These are more compliant with Unix terminal standards and user interface conventions than the Cygwin console, but are less suited for running Windows console programs.
* Various utilities are provided for converting between Windows and Unix paths and file formats, for handling line ending (CRLF/LF) issues, for displaying the [[Dynamic-link library|DLL]]s that an executable is linked with, etc.
* Apart from always being linked against the Cygwin DLL, Cygwin executables are normal Windows executables. This means that Cygwin programs have full access to the [[Windows API]] and other Windows libraries, which allows gradual porting of programs from one platform to the other. However, programmers need to be careful about mixing conflicting POSIX and Windows functions.


Geoffrey Noer was the project lead from 1996 to 1999.<ref>{{cite mailing list|mailing-list=Cygwin|first=DJ|last=Delorie|date=1999-02-17|url=https://cygwin.com/ml/cygwin/1999-02/msg00556.html|title=fyi: who does what|access-date=2020-01-13|archive-date=2004-02-14|archive-url=https://web.archive.org/web/20040214161103/http://cygwin.com/ml/cygwin/1999-02/msg00556.html|url-status=live}}</ref><ref>{{cite mailing list|mailing-list=Cygwin|first=Geoffrey|last=Noer|date=1999-02-19|url=https://cygwin.com/ml/cygwin/1999-02/msg00639.html|title=A partial goodbye...|access-date=2020-01-13|archive-date=2004-02-02|archive-url=https://web.archive.org/web/20040202163707/http://cygwin.com/ml/cygwin/1999-02/msg00639.html|url-status=live}}</ref> Christopher Faylor was lead from 1999 to 2004; he left Red Hat and became co-lead with Corinna Vinschen.<ref>{{cite mailing list |mailing-list=Cygwin |first=Christopher |last=Faylor |date=2004-03-31 |url=https://cygwin.com/ml/cygwin/2004-03/msg01568.html |title=Changing jobs |access-date=2020-01-13 |archive-date=2015-09-06 |archive-url=https://web.archive.org/web/20150906184105/http://cygwin.com/ml/cygwin/2004-03/msg01568.html |url-status=live}}</ref><ref>{{cite mailing list |mailing-list=Cygwin |first=Christopher |last=Faylor |date=2014-07-31 |url=https://sourceware.org/ml/cygwin/2014-07/msg00392.html |title=Christopher Faylor – Withdrawing from the project |access-date=2 May 2015 |archive-date=2014-12-17 |archive-url=https://web.archive.org/web/20141217193224/https://sourceware.org/ml/cygwin/2014-07/msg00392.html |url-status=live}}</ref> Corinna Vinschen has been the project lead from mid-2014 to date (as of March 30, 2023).<ref>{{Cite web |title=Cygwin Notables |url=https://cygwin.com/who.html |url-status=live |archive-url=https://web.archive.org/web/20240326223639/https://cygwin.com/who.html |archive-date=March 26, 2024 |access-date=2023-03-30 |website=cygwin.com}}</ref>
The version of [[GNU Compiler Collection|gcc]] that comes with Cygwin has various extensions for creating Windows DLLs, specifying whether a program is a windowing or console-mode program, adding resources, etc. Support for compiling programs that do not require the POSIX compatibility layer provided by the Cygwin DLL used to be included in the default <code>gcc</code>, but {{as of | 2014 | lc = on}} is provided by cross-compilers contributed by the [[MinGW#MinGW-w64|MinGW-w64]] project.


From June 23, 2016, the Cygwin library version 2.5.2 was licensed under the [[GNU Lesser General Public License]] (LGPL) version 3.<ref>{{Cite web|url=https://www.redhat.com/en/blog/cygwin-library-now-available-under-gnu-lesser-general-public-license|title=Cygwin library now available under GNU Lesser General Public License|website=www.redhat.com|access-date=2021-05-27|archive-date=2021-06-16|archive-url=https://web.archive.org/web/20210616015533/https://www.redhat.com/en/blog/cygwin-library-now-available-under-gnu-lesser-general-public-license|url-status=live}}</ref>
Cygwin is used heavily for porting many popular pieces of software to the Windows platform.{{Citation needed|date=June 2022}} It is used to compile [[Sun Microsystems|Sun]] [[Java (programming language)|Java]], [[LibreOffice]], and even web server software like [[Lighttpd]] and [[Hiawatha (web server)|Hiawatha]].<ref>{{Cite web|url=https://www.hiawatha-webserver.org/|title=Hiawatha webserver|first=Hugo|last=Leisink|website=www.hiawatha-webserver.org}}</ref>


== Description ==
The Cygwin API library is licensed under the [[GNU Lesser General Public License]] version 3 (or later) with an exception to allow linking to any [[free and open-source software]] whose license conforms to the [[Open Source Definition]]<ref name="cyglicense">{{cite web | url = https://cygwin.com/licensing.html | title = What are the licensing terms? | archive-url = https://web.archive.org/web/20120728133502/http://cygwin.com/licensing.html | archive-date=2012-07-28 | url-status = live |work = Cygwin}}
Cygwin is provided in two versions: the full 64-bit version and a stripped-down 32-bit version, whose final version was released in 2022.<ref>{{Cite web |last=Turney |first=Jon |date=November 25, 2022 |title=Cygwin x86 end-of-life |url=https://cygwin.com/pipermail/cygwin-announce/2022-November/010810.html |access-date=2023-09-14}}</ref> Cygwin consists of a library that implements the [[POSIX]] system call [[application programming interface|API]] in terms of Windows system calls to enable the running of a large number of application programs equivalent to those on [[Unix]] systems, and a [[GNU]] development toolchain (including [[GNU Compiler Collection|GCC]] and [[GNU Debugger|GDB]]). Programmers have ported the [[X Window System]], [[K Desktop Environment 3]], [[GNOME]],<ref>{{cite web|url=http://sourceware.org/cygwinports/|title=Cygwin Ports|access-date=2 May 2015|archive-date=11 May 2015|archive-url=https://web.archive.org/web/20150511055548/http://sourceware.org/cygwinports/|url-status=live}}</ref> [[Apache HTTP Server|Apache]], and [[TeX]]. Cygwin permits installing [[inetd]], [[syslogd]], [[Secure Shell|sshd]], [[Apache HTTP Server|Apache]], and other daemons as standard [[Windows service]]s. Cygwin programs have full access to the [[Windows API]] and other Windows libraries.
</ref> (less strict than the Free Software Definition).


Cygwin programs are installed by running Cygwin's "setup"<ref>{{Cite mailing list|mailing-list=Cygwin|title=New Cygwin Net Release|date=2000-04-17|last=Delorie|first=DJ|url=https://cygwin.com/ml/cygwin/2000-04/msg00269.html|access-date=2020-01-10|archive-date=2014-12-20|archive-url=https://web.archive.org/web/20141220040523/http://www.cygwin.com/ml/cygwin/2000-04/msg00269.html|url-status=live}}</ref> program, which downloads them from repositories on the Internet.
==History==
Cygwin began in 1995 as a project of Steve Chamberlain, a [[Cygnus Solutions|Cygnus]] engineer who observed that Windows NT and 95 used [[COFF]] as their [[object file format]], and that GNU already included support for [[x86]] and COFF, and the C library [[newlib]]. He thought it would be possible to retarget [[GNU Compiler Collection|GCC]] and produce a [[cross compiler]] generating executables that could run on Windows. This proved practical and a prototype was quickly developed.


The Cygwin API library is licensed under the GNU Lesser General Public License version 3 (or later), with an exception to allow linking to any [[free and open-source software]] whose license conforms to the [[Open Source Definition]].<ref name="cyglicense">{{cite web |title=What are the licensing terms? |url=https://cygwin.com/licensing.html |url-status=live |archive-url=https://web.archive.org/web/20120728133502/http://cygwin.com/licensing.html |archive-date=2012-07-28 |work=Cygwin}}
The next step was to attempt to [[Bootstrapping (compilers)|bootstrap]] the compiler on a Windows system, requiring sufficient emulation of Unix to let the [[Autoconf|GNU configure]] [[shell script]] run. A [[Bourne shell]]-compatible command interpreter, such as [[Bash (Unix shell)|bash]], was needed and in turn a fork system call emulation and [[Standard streams|standard input/output]]. Windows includes similar functionality, so the Cygwin library just needed to provide a [[POSIX]]-compatible [[application programming interface]] (API) and properly translate calls and manage private versions of data, such as [[file descriptor]]s.
</ref>


Cygwin consists of two parts:
Initially, Cygwin was called gnuwin32 (not to be confused with the current [[GnuWin32]] project). The name was changed to Cygwin32 to emphasize Cygnus' role in creating it. When [[Microsoft]] registered the trademark [[Win32]], the 32 was dropped to simply become Cygwin.
# A [[dynamic-link library]] in the form of a [[C standard library]] that acts as a [[compatibility layer]] for the POSIX API and
# A collection of [[Programming tool|software tools]] and applications that provide a Unix-like [[look and feel]].<ref name="auto1" />
Cygwin supports POSIX [[symbolic link]]s, representing them as plain-text files with the system attribute set. Cygwin 1.5 represented them as [[Windows Explorer]] [[File shortcut|shortcuts]], but this was changed for reasons of performance and POSIX correctness. Cygwin also recognises [[NTFS junction point|NTFS junction points]] and symbolic links and treats them as POSIX symbolic links, but it does not create them. The POSIX API for handling [[access control list]]s (ACLs) is supported.<ref>{{Cite mailing list |last=Vinschen |first=Corinna |title=Updated: Cygwin 2.4.0-1 |mailing-list=Cygwin Announcements |date=2016-01-16 |url=http://www.cygwin.org/ml/cygwin-announce/2016-01/msg00018.html |access-date=2020-01-11 |archive-url=https://web.archive.org/web/20200111185248/http://www.cygwin.org/ml/cygwin-announce/2016-01/msg00018.html |archive-date=2020-01-11 |url-status=live}}</ref>


=== Technical details ===
By 1996, other engineers had joined in, because it was clear that Cygwin would be a useful way to provide Cygnus' embedded tools hosted on Windows systems (the previous strategy had been to use [[DJGPP]]). It was especially attractive because it was possible to do a [[Canadian cross|three-way cross-compile]], for instance to use a hefty [[Sun Microsystems]] workstation to build, say, a Windows-x-[[MIPS architecture|MIPS]] cross-compiler, which was faster than using the PC at the time. In 1999, Cygnus offered Cygwin 1.0 as a commercial product<ref>{{cite web|url=https://books.google.com/books?id=_k4EAAAAMBAJ&q=InfoWorld+15+Nov+1999+Cygwin&pg=PA110|title=Cygwin Unites Unix and Windows Apps|website=Google Books|date=1999-11-15|access-date=2020-01-13}}</ref> of interest in its own right although subsequent versions have not been released, instead relying on continued open source releases.
A Cygwin-specific version of the Unix [[Mount (computing)|<code>mount</code>]] command allows mounting Windows paths as "filesystems" in the Unix file space. Initial mount points can be configured in <code>[[fstab|/etc/fstab]]</code>, which has a format very similar to Unix systems, except that Windows paths appear in place of devices. Filesystems can be mounted in binary mode (by default), or in text mode, which enables automatic [[Newline#Common problems|conversion]] between [[Newline|LF]] and [[CRLF]] endings (which only affects programs that open files without explicitly specifying text or binary mode).


Cygwin 1.7 introduced comprehensive support for POSIX [[Locale (computer software)|locales]], and the [[UTF-8]] [[Unicode]] encoding became the default.
Geoffrey Noer was the project lead from 1996 to 1999.<ref>{{cite mailing list|mailing-list=Cygwin|first=DJ|last=Delorie|date=1999-02-17|url=https://cygwin.com/ml/cygwin/1999-02/msg00556.html|title=fyi: who does what|access-date=2020-01-13}}</ref><ref>{{cite mailing list|mailing-list=Cygwin|first=Geoffrey|last=Noer|date=1999-02-19|url=https://cygwin.com/ml/cygwin/1999-02/msg00639.html|title=A partial goodbye...|access-date=2020-01-13}}</ref> Christopher Faylor was the project lead from 1999 to mid-2014. Corinna Vinschen became co-lead since 2004<ref>{{cite mailing list|mailing-list=Cygwin|first=Christopher|last=Faylor|date=2004-03-31|url=https://cygwin.com/ml/cygwin/2004-03/msg01568.html|title=Changing jobs|access-date=2020-01-13}}</ref> when Faylor left Red Hat and has been lead since mid-2014, when Faylor withdrew from active participation in the project.<ref>{{cite mailing list|mailing-list=Cygwin|first=Christopher|last=Faylor|date=2014-07-31|url=https://sourceware.org/ml/cygwin/2014-07/msg00392.html|title=Christopher Faylor – Withdrawing from the project|access-date=2 May 2015}}</ref>


The [[fork (system call)|fork]] system call for duplicating a process is fully implemented, but the [[copy-on-write]] optimization strategy could not be used.<ref>{{cite web |title=Cygwin FAQ: How is fork() implemented? |url=https://www.cygwin.com/faq.html#faq.api.fork |url-status=live |archive-url=https://web.archive.org/web/20101020183656/http://cygwin.com/faq.html |archive-date=October 20, 2010 |access-date=October 10, 2010 |website=cygwin.com}}</ref><ref>{{cite web
From June 23, 2016 the Cygwin library version 2.5.2 was licensed under the GNU Lesser General Public License (LGPL) version 3,<ref>{{Cite web|url=https://www.redhat.com/en/blog/cygwin-library-now-available-under-gnu-lesser-general-public-license|title=Cygwin library now available under GNU Lesser General Public License|website=www.redhat.com|access-date=2021-05-27}}</ref> so is now possible to link against closed source applications. Before this was available there were two possibilities: to release the source code of the application or buy a Cygwin license to release a closed source application.
| title = Highlights of Cygwin Functionality: Process Creation
| url = http://cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process
| access-date = Dec 24, 2014
| archive-date = December 30, 2014
| archive-url = https://web.archive.org/web/20141230220232/http://www.cygwin.com/cygwin-ug-net/highlights.html#ov-hi-process
| url-status = live
}}</ref><ref>{{Cite mailing list |last=Blake |first=Eric |title=Bash doesn't launch the applications directly |mailing-list=Cygwin |date=January 15, 2009 |url=http://www.cygwin.com/ml/cygwin/2009-01/msg00461.html |access-date=October 10, 2010 |archive-url=https://web.archive.org/web/20110613042854/http://www.cygwin.com/ml/cygwin/2009-01/msg00461.html |archive-date=June 13, 2011 |url-status=live}}</ref>


The Cygwin [[Dynamic-link library|DLL]] contains a console driver that emulates a Unix-style [[Terminal emulator|terminal]] within the [[Win32 console|Windows console]]. Cygwin's default user interface is the [[Bash (Unix shell)|bash]] shell running in the Cygwin console. The DLL also implements [[pseudo terminal]] (pty) devices. Cygwin ships with a number of [[terminal emulator]]s that are based on them, including [[mintty]], [[rxvt]]/urxvt, and [[xterm]]. The version of GCC that comes with Cygwin has various extensions for creating Windows DLLs, such as specifying whether a program is a windowing or console-mode program. Support for compiling programs that do not require the POSIX compatibility layer provided by the Cygwin DLL used to be included in the default GCC, but {{as of | 2014 | lc = on}}, it is provided by cross-compilers contributed by the [[MinGW#MinGW-w64|MinGW-w64]] project.
==Features==
Cygwin's base package selection is fairly small (about 100&nbsp;MB<ref>{{cite web|url=https://cygwin.com/install.html|title=Installing and Updating Cygwin Packages|website=Cygwin|access-date=2020-01-11}}</ref>), containing little more than the [[Bash (Unix shell)|bash]] (interactive user) and [[Dash (shell)|dash]] (installation) shells and the core file and text manipulation utilities expected of a Unix command line. Additional packages are available as optional installs from within Cygwin's package manager ("setup-x86.exe" – 32bit & "setup-x86_64.exe" – 64bit). These include (among many others<ref>{{cite web|url=https://cygwin.com/packages/package_list.html|title=Cygwin Package List|website=Cygwin|access-date=2020-01-11}}</ref>):
* Shells (i.e. command line interpreters): [[Bash (Unix shell)|bash]], [[Debian Almquist shell|dash]], [[Friendly interactive shell|fish]], [[KornShell|pdksh]], [[tcsh]], [[zsh]], [[mksh]]
* File and system utilities: [[coreutils]], [[findutils]], [[util-linux]]
* Text utilities: [[grep]], [[sed]], [[diff]], [[patch (Unix)|patch]], [[awk]]
* Terminals: [[mintty]], [[rxvt]], [[GNU Screen|screen]]
* Editors: [[ed (editor)|ed]], [[emacs]], [[Joe's Own Editor|joe]], [[mined (text editor)|mined]], [[nano (text editor)|nano]], [[Vim (text editor)|vim]]
* Remote login: [[OpenSSH|ssh]], [[Remote Shell|rsh]], [[telnet]]
* Remote file transfer/synchronization: [[ftp]], [[Secure copy|scp]], [[rsync]], unison, [[rtorrent]]
* Compression/archiving: [[tar (file format)|tar]], [[gzip]], [[bzip2]], [[lzma]], [[ZIP (file format)|zip]]
* Text processing: [[TeX]], [[groff (software)|groff]], [[Ghostscript]]
* Programming languages: [[C (programming language)|C]], [[C++]], [[Objective-C]], [[Fortran]], [[Gambas]], [[Perl]], [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Tcl]], [[Ada (programming language)|Ada]], [[CLISP]], [[Scheme (programming language)|Scheme]], [[OCaml]], [[Prolog]]
* Development tools: [[make (software)|make]], [[autotools]], [[flex lexical analyser|flex]], [[GNU bison|bison]], [[doxygen]]
* Version control systems: [[Concurrent Versions System|cvs]], [[Subversion (software)|subversion]], [[Git (software)|git]], [[mercurial]]
* Servers: [[Apache HTTP Server|Apache]], [[BIND]], [[PostgreSQL]], [[Pure-FTPd]], [[OpenSSH]], [[telnetd]], [[exim]], [[UW IMAP]]
* Clients: [[Mutt (e-mail client)|Mutt]] (email), [[Lynx (web browser)|Lynx]] (web), [[Irssi]] (IRC), [[tin (newsreader)|tin]] (newsgroups)


== Software packages ==
The [[Cygwin/X]] project contributes an implementation of the [[X Window System]] that allows graphical Unix programs to display their user interfaces on the Windows desktop. This can be used with both local and remote programs. Cygwin/X supports over 500 packages including major X window managers, desktop environments, and applications, for example:
Cygwin's base package selection is about 100&nbsp;MB,<ref>{{cite web|url=https://cygwin.com/install.html|title=Installing and Updating Cygwin Packages|website=Cygwin|access-date=2020-01-11|archive-date=2020-01-10|archive-url=https://web.archive.org/web/20200110145803/http://cygwin.com/install.html|url-status=live}}</ref> containing the [[Bash (Unix shell)|bash]] (interactive user) and [[Dash (shell)|dash]] (installation) shells and the core file and text manipulation utilities. Additional packages are available as optional installs from within the Cygwin "setup" program and package manager ("setup-x86_64.exe" – 64 bit).<ref>{{cite web|url=https://cygwin.com/packages/package_list.html|title=Cygwin Package List|website=Cygwin|access-date=2020-01-11|archive-date=2016-02-05|archive-url=https://web.archive.org/web/20160205174704/https://cygwin.com/packages/package_list.html|url-status=live}}</ref> The Cygwin Ports project provided{{When|date=June 2022}} additional packages that were not available in the Cygwin distribution itself. Examples included [[GNOME]], [[K Desktop Environment 3]], [[MySQL]] database, and the [[PHP]] scripting language. Most ports have been adopted by volunteer maintainers as Cygwin packages, and Cygwin Ports are no longer maintained. Cygwin ships with [[GTK+]] and [[Qt (software)|Qt]].
* Terminals: [[rxvt-unicode]], [[xterm]]
* Editors: emacs-X11, [[Vim (text editor)|gvim]]
* Text processors/viewers: [[LyX]], [[xpdf]], [[Device independent file format|xdvi]]
* Web browsers: [[Epiphany (GNOME)|epiphany]], [[konqueror]], [[Links (web browser)|links]], [[Lynx (web browser)|lynx]], [[Midori (web browser)|midori]], [[qupzilla]], [[w3m]]


The [[Cygwin/X]] project allows graphical Unix programs to display their user interfaces on the Windows desktop for both local and remote programs.
In addition to the low-level [[Xlib]]/[[XCB]] libraries for developing X applications, Cygwin ships with various higher-level and cross-platform [[Graphical user interface|GUI]] frameworks, including [[GTK+]] and [[Qt (software)|Qt]].

The Cygwin Ports project provided{{When|date=June 2022}} many additional packages that were not available in the Cygwin distribution itself. Examples included [[GNOME]] and [[K Desktop Environment 3]] as well as the [[MySQL]] database and the [[PHP]] scripting language. Most ports have been adopted by volunteer maintainers as Cygwin packages, and Cygwin Ports are no longer maintained.


== See also ==
== See also ==

* {{annotated link|Windows Subsystem for Linux}}
* {{annotated link|Windows Subsystem for Linux}}


==References==
== Notes ==
{{reflist|group=note}}

== References ==
{{Reflist}}
{{Reflist}}


==External links==
== External links ==
{{wikibooks}}
{{wikibooks}}
* {{official website}}
* {{official website}}
Line 129: Line 89:
{{Unix-Windows Interoperability}}
{{Unix-Windows Interoperability}}


[[Category:1995 software]]
[[Category:Compatibility layers]]
[[Category:Compatibility layers]]
[[Category:Programming tools]]
[[Category:Programming tools]]

Latest revision as of 14:23, 4 June 2024

Cygwin
Original author(s)Steve Chamberlain, Cygnus Solutions
Developer(s)Cygnus Solutions, Red Hat, Cygwin project volunteers
Initial releaseOctober 18, 1995; 28 years ago (1995-10-18)
Stable release
3.5.3[1] Edit this on Wikidata / 3 April 2024; 2 months ago (3 April 2024)
Repository
Written inC/C++
Operating systemMicrosoft Windows
TypePOSIX standard utilities, POSIX standard library, C standard library, compatibility layer
LicenseGPLv3, LGPLv3[2]
Websitecygwin.com Edit this on Wikidata

Cygwin (/ˈsɪɡwɪn/ SIG-win)[3] is a free and open-source Unix-like environment and command-line interface for Microsoft Windows. The project also provides a software repository containing many open-source packages. Cygwin allows source code for Unix-like operating systems to be compiled and run on Windows. Cygwin provides native integration of Windows-based applications.[4]

The terminal emulator Mintty is the default command-line interface provided to interact with the environment.[5] The Cygwin installation directory layout mimics the root file system of Unix-like systems, with directories such as /bin, /home, /etc, /usr, and /var.

Cygwin is released under the GNU Lesser General Public License version 3.[6] It was originally developed by Cygnus Solutions,[7][8] which was later acquired by Red Hat (now part of IBM), to port the Linux toolchain to Win32, including the GNU Compiler Suite. Rather than rewrite the tools to use the Win32 runtime environment, Cygwin implemented a POSIX-compatible environment in the form of a DLL.[9]

The brand motto is "Get that Linux feeling – on Windows".[10]

History[edit]

Cygwin began in 1995 as a project of Steve Chamberlain, a Cygnus engineer who observed that Windows NT and 95 used COFF as their object file format, and that GNU already included support for x86 and COFF, and the C library newlib. He thought that it would be possible to retarget GCC and produce a cross compiler generating executables that could run on Windows. A prototype was later developed. Chamberlain bootstrapped the compiler on a Windows system, to emulate Unix to let the GNU configure shell script run.

Initially, Cygwin was called gnuwin32.[note 1] When Microsoft registered the trademark Win32, the "32" was dropped to simply become Cygwin.

In 1999, Cygnus offered Cygwin 1.0 as a commercial product.[11] Subsequent versions have not been released, instead relying on continued open source releases.

Geoffrey Noer was the project lead from 1996 to 1999.[12][13] Christopher Faylor was lead from 1999 to 2004; he left Red Hat and became co-lead with Corinna Vinschen.[14][15] Corinna Vinschen has been the project lead from mid-2014 to date (as of March 30, 2023).[16]

From June 23, 2016, the Cygwin library version 2.5.2 was licensed under the GNU Lesser General Public License (LGPL) version 3.[17]

Description[edit]

Cygwin is provided in two versions: the full 64-bit version and a stripped-down 32-bit version, whose final version was released in 2022.[18] Cygwin consists of a library that implements the POSIX system call API in terms of Windows system calls to enable the running of a large number of application programs equivalent to those on Unix systems, and a GNU development toolchain (including GCC and GDB). Programmers have ported the X Window System, K Desktop Environment 3, GNOME,[19] Apache, and TeX. Cygwin permits installing inetd, syslogd, sshd, Apache, and other daemons as standard Windows services. Cygwin programs have full access to the Windows API and other Windows libraries.

Cygwin programs are installed by running Cygwin's "setup"[20] program, which downloads them from repositories on the Internet.

The Cygwin API library is licensed under the GNU Lesser General Public License version 3 (or later), with an exception to allow linking to any free and open-source software whose license conforms to the Open Source Definition.[21]

Cygwin consists of two parts:

  1. A dynamic-link library in the form of a C standard library that acts as a compatibility layer for the POSIX API and
  2. A collection of software tools and applications that provide a Unix-like look and feel.[4]

Cygwin supports POSIX symbolic links, representing them as plain-text files with the system attribute set. Cygwin 1.5 represented them as Windows Explorer shortcuts, but this was changed for reasons of performance and POSIX correctness. Cygwin also recognises NTFS junction points and symbolic links and treats them as POSIX symbolic links, but it does not create them. The POSIX API for handling access control lists (ACLs) is supported.[22]

Technical details[edit]

A Cygwin-specific version of the Unix mount command allows mounting Windows paths as "filesystems" in the Unix file space. Initial mount points can be configured in /etc/fstab, which has a format very similar to Unix systems, except that Windows paths appear in place of devices. Filesystems can be mounted in binary mode (by default), or in text mode, which enables automatic conversion between LF and CRLF endings (which only affects programs that open files without explicitly specifying text or binary mode).

Cygwin 1.7 introduced comprehensive support for POSIX locales, and the UTF-8 Unicode encoding became the default.

The fork system call for duplicating a process is fully implemented, but the copy-on-write optimization strategy could not be used.[23][24][25]

The Cygwin DLL contains a console driver that emulates a Unix-style terminal within the Windows console. Cygwin's default user interface is the bash shell running in the Cygwin console. The DLL also implements pseudo terminal (pty) devices. Cygwin ships with a number of terminal emulators that are based on them, including mintty, rxvt/urxvt, and xterm. The version of GCC that comes with Cygwin has various extensions for creating Windows DLLs, such as specifying whether a program is a windowing or console-mode program. Support for compiling programs that do not require the POSIX compatibility layer provided by the Cygwin DLL used to be included in the default GCC, but as of 2014, it is provided by cross-compilers contributed by the MinGW-w64 project.

Software packages[edit]

Cygwin's base package selection is about 100 MB,[26] containing the bash (interactive user) and dash (installation) shells and the core file and text manipulation utilities. Additional packages are available as optional installs from within the Cygwin "setup" program and package manager ("setup-x86_64.exe" – 64 bit).[27] The Cygwin Ports project provided[when?] additional packages that were not available in the Cygwin distribution itself. Examples included GNOME, K Desktop Environment 3, MySQL database, and the PHP scripting language. Most ports have been adopted by volunteer maintainers as Cygwin packages, and Cygwin Ports are no longer maintained. Cygwin ships with GTK+ and Qt.

The Cygwin/X project allows graphical Unix programs to display their user interfaces on the Windows desktop for both local and remote programs.

See also[edit]

Notes[edit]

  1. ^ Not to be confused with the current GnuWin32 project.

References[edit]

  1. ^ "cygwin 3.5.3-1". April 3, 2024. Retrieved April 18, 2024.
  2. ^ "Cygwin Licensing Terms". Archived from the original on July 28, 2012. Retrieved December 15, 2022.
  3. ^ Hall, Larry (September 14, 2004). "Re: How do you pronounce it?". Cygwin (Mailing list). Archived from the original on August 30, 2011. Retrieved October 10, 2007.
  4. ^ a b "Cygwin FAQ". cygwin.com. Archived from the original on May 7, 2021. Retrieved January 7, 2021.
  5. ^ "Cygwin". www.cygwin.com. Archived from the original on November 21, 2015. Retrieved November 21, 2015.
  6. ^ "Cygwin library now available under GNU Lesser General Public License". Red Hat. Archived from the original on June 24, 2016. Retrieved June 23, 2016.
  7. ^ "A brief history of the Cygwin project". Cygwin. February 2, 2018. Archived from the original on January 8, 2020. Retrieved January 10, 2020.
  8. ^ "Cygwin32: A Free Win32 Porting Layer for UNIX Applications". USENIX. August 3, 1998. Archived from the original on January 11, 2020. Retrieved January 10, 2020.
  9. ^ "(Solved) Linux Subsystem vs Cygwin vs MobaXterm". Tech Help Forum by How-To Geek. January 24, 2017. Archived from the original on February 20, 2023. Retrieved March 15, 2019.
  10. ^ "Cygwin". www.cygwin.com. Retrieved March 11, 2024.
  11. ^ "Cygwin Unites Unix and Windows Apps". Google Books. November 15, 1999. Archived from the original on February 20, 2023. Retrieved January 13, 2020.
  12. ^ Delorie, DJ (February 17, 1999). "fyi: who does what". Cygwin (Mailing list). Archived from the original on February 14, 2004. Retrieved January 13, 2020.
  13. ^ Noer, Geoffrey (February 19, 1999). "A partial goodbye..." Cygwin (Mailing list). Archived from the original on February 2, 2004. Retrieved January 13, 2020.
  14. ^ Faylor, Christopher (March 31, 2004). "Changing jobs". Cygwin (Mailing list). Archived from the original on September 6, 2015. Retrieved January 13, 2020.
  15. ^ Faylor, Christopher (July 31, 2014). "Christopher Faylor – Withdrawing from the project". Cygwin (Mailing list). Archived from the original on December 17, 2014. Retrieved May 2, 2015.
  16. ^ "Cygwin Notables". cygwin.com. Archived from the original on March 26, 2024. Retrieved March 30, 2023.
  17. ^ "Cygwin library now available under GNU Lesser General Public License". www.redhat.com. Archived from the original on June 16, 2021. Retrieved May 27, 2021.
  18. ^ Turney, Jon (November 25, 2022). "Cygwin x86 end-of-life". Retrieved September 14, 2023.
  19. ^ "Cygwin Ports". Archived from the original on May 11, 2015. Retrieved May 2, 2015.
  20. ^ Delorie, DJ (April 17, 2000). "New Cygwin Net Release". Cygwin (Mailing list). Archived from the original on December 20, 2014. Retrieved January 10, 2020.
  21. ^ "What are the licensing terms?". Cygwin. Archived from the original on July 28, 2012.
  22. ^ Vinschen, Corinna (January 16, 2016). "Updated: Cygwin 2.4.0-1". Cygwin Announcements (Mailing list). Archived from the original on January 11, 2020. Retrieved January 11, 2020.
  23. ^ "Cygwin FAQ: How is fork() implemented?". cygwin.com. Archived from the original on October 20, 2010. Retrieved October 10, 2010.
  24. ^ "Highlights of Cygwin Functionality: Process Creation". Archived from the original on December 30, 2014. Retrieved December 24, 2014.
  25. ^ Blake, Eric (January 15, 2009). "Bash doesn't launch the applications directly". Cygwin (Mailing list). Archived from the original on June 13, 2011. Retrieved October 10, 2010.
  26. ^ "Installing and Updating Cygwin Packages". Cygwin. Archived from the original on January 10, 2020. Retrieved January 11, 2020.
  27. ^ "Cygwin Package List". Cygwin. Archived from the original on February 5, 2016. Retrieved January 11, 2020.

External links[edit]