From 4da8ebe2882eb2b08dca38685ecea0ef07d1f5cc Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 30 Aug 2010 13:19:39 +0000 Subject: [PATCH] * new-features.sgml (ov-new1.7.7): Document change to binmode/textmode link libs. * textbinary.sgml (textbin-devel): Ditto. --- winsup/doc/ChangeLog | 6 ++++++ winsup/doc/new-features.sgml | 6 ++++++ winsup/doc/textbinary.sgml | 24 ++++++++++++++++-------- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog index 3e231b5e4..fe47e959e 100644 --- a/winsup/doc/ChangeLog +++ b/winsup/doc/ChangeLog @@ -1,3 +1,9 @@ +2010-08-30 Corinna Vinschen + + * new-features.sgml (ov-new1.7.7): Document change to binmode/textmode + link libs. + * textbinary.sgml (textbin-devel): Ditto. + 2010-08-28 Corinna Vinschen * new-features.sgml (ov-new1.7.7): Document change to avoid DLL diff --git a/winsup/doc/new-features.sgml b/winsup/doc/new-features.sgml index e459d5ffa..fdaa01ac4 100644 --- a/winsup/doc/new-features.sgml +++ b/winsup/doc/new-features.sgml @@ -17,6 +17,12 @@ Make sure to follow the Microsoft security advisory concerning DLL hijacking. See the Microsoft Security Advisory (2269637) "Insecure Library Loading Could Allow Remote Code Execution" for details. + +Allow to link against -lbinmode instead of /lib/binmode.o. Same for +-ltextmode, -ltextreadmode and -lautomode. +See for details. + + diff --git a/winsup/doc/textbinary.sgml b/winsup/doc/textbinary.sgml index 7f4aae5fb..6e6e83025 100644 --- a/winsup/doc/textbinary.sgml +++ b/winsup/doc/textbinary.sgml @@ -142,38 +142,46 @@ in your project, like this: $ gcc my_tiny_app.c /lib/binmode.o -o my_tiny_app +Starting with Cygwin 1.7.7, you can use the even simpler: + + + $ gcc my_tiny_app.c -lbinmode -o my_tiny_app + + This adds code which sets the default open mode for all files opened by my_tiny_app to binary for reading and writing. -Cygwin provides the following object files to set the default open mode -just by linking an application against them: +Cygwin provides the following libraries and object files to set the +default open mode just by linking an application against them: -/lib/automode.o - Open files for reading in textmode - Open files for writing in binary mode +/lib/libautomode.a - Open files for reading in textmode, +/lib/automode.o open files for writing in binary mode -/lib/binmode.o - Open files for reading and writing in binary mode +/lib/libbinmode.a - Open files for reading and writing in binary mode +/lib/binmode.o -/lib/textmode.o - Open files for reading and writing in textmode +/lib/libtextmode.a - Open files for reading and writing in textmode +/lib/textmode.o -/lib/textreadmode.o - Open files for reading in textmode - Keep default behaviour for writing. +/lib/libtextreadmode.a - Open files for reading in textmode, +/lib/textreadmode.o keep default behaviour for writing.