This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta - finalize with acknowledgements for 5.17.3
[perl5.git] / pod / perlapio.pod
index 98fc53d..bb7115f 100644 (file)
@@ -160,9 +160,14 @@ so it is (currently) legal to use C<printf(fmt,...)> in perl sources.
 
 =item B<PerlIO_read(f,buf,count)>, B<PerlIO_write(f,buf,count)>
 
-These correspond to fread() and fwrite(). Note that arguments are
-different, there is only one "count" and order has "file"
-first. Returns a byte count if successful (which may be zero or
+These correspond functionally to fread() and fwrite() but the
+arguments and return values are different.  The PerlIO_read() and
+PerlIO_write() signatures have been modeled on the more sane low level
+read() and write() functions instead: The "file" argument is passed
+first, there is only one "count", and the return value can distinguish
+between error and C<EOF>.
+
+Returns a byte count if successful (which may be zero or
 positive), returns negative value and sets C<errno> on error.
 Depending on implementation C<errno> may be C<EINTR> if operation was
 interrupted by a signal.
@@ -220,7 +225,7 @@ This corresponds to clearerr(), i.e., clears 'error' and (usually)
 
 This corresponds to fflush().  Sends any buffered write data to the
 underlying file.  If called with C<NULL> this may flush all open
-streams (or core dump with some USE_STDIO implementattions).  Calling
+streams (or core dump with some USE_STDIO implementations).  Calling
 on a handle open for read only, or on which last operation was a read
 of some kind may lead to undefined behaviour on some USE_STDIO
 implementations.  The USE_PERLIO (layers) implementation tries to
@@ -232,7 +237,7 @@ seeking the handle to the current logical position.
 
 This corresponds to fseek().  Sends buffered write data to the
 underlying file, or discards any buffered read data, then positions
-the file desciptor as specified by B<offset> and B<whence> (sic).
+the file descriptor as specified by B<offset> and B<whence> (sic).
 This is the correct thing to do when switching between read and write
 on the same handle (see issues with PerlIO_flush() above).  Offset is
 of type C<Off_t> which is a perl Configure value which may not be same
@@ -385,8 +390,7 @@ vary from handle to handle.
 
   PerlIO_fast_gets(f) = PerlIO_has_cntptr(f) && \
                         PerlIO_canset_cnt(f) && \
-                        `Can set pointer into buffer'
-
+                        'Can set pointer into buffer'
 
 =item B<PerlIO_has_cntptr(f)>
 
@@ -481,7 +485,7 @@ of passing NULL.)
 
 Portable cases are:
 
-    PerlIO_binmode(f,ptype,O_BINARY,Nullch);
+    PerlIO_binmode(f,ptype,O_BINARY,NULL);
 and
     PerlIO_binmode(f,ptype,O_TEXT,":crlf");