About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/read.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 read Context: slangrtl

Synopsis

Read from an open file descriptor

Syntax

UInt_Type read (FD_Type fd, Ref_Type buf, UInt_Type num)

Description

The read function attempts to read at most num bytes into the variable indicated by buf from the open file descriptor fd. It returns the number of bytes read, or -1 and sets errno upon failure. The number of bytes read may be less than num, and will be zero if an attempt is made to read past the end of the file.

read is a low-level function and may return -1 for a variety of reasons. For example, if non-blocking I/O has been specified for the open file descriptor and no data is available for reading then the function will return -1 and set errno to EAGAIN.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.