X-Spam-Check-By: sourceware.org Date: Tue, 21 Mar 2006 20:05:59 -0800 (PST) From: "Paul J. Lucas" To: cygwin AT cygwin DOT com Subject: Reading too few bytes Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Here's a small test program: #include #include #include using namespace std; int main() { int fd = ::open( "ESLF", O_RDONLY ); if ( fd == -1 ) { cerr << "could not open ESLF file" << endl; ::exit( 1 ); } char buf[ 64 ]; ssize_t bytesRead = ::read( fd, buf, sizeof( buf ) ); cout << "read " << bytesRead << " bytes" << endl; ::close( fd ); } Here's the contents of a small biinary file "ESLF" (printed in hex bytes): 54 39 CA 1A 44 When I compile the program as: g++ -o test test.cpp and run it, it prints "read 5 bytes" as one would expect. When I compile the program as: g++ -mno-cygwin -o test test.cpp and run it, it prints "read 3 bytes". Why? How do I teg it to read all 5 bytes? - Paul -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/