Changeset a65c28e in rtems


Ignore:
Timestamp:
Sep 30, 1998, 3:42:46 PM (21 years ago)
Author:
Wade A Smith <warm38@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
c11f512
Parents:
9dd23877
Message:

Documented the fsync and fdatasync routines in this file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/new_chapters/io.t

    r9dd23877 ra65c28e  
    2424@item @code{fcntl} - Manipulates an open file descriptor
    2525@item @code{lseek} - Reposition read/write file offset
    26 @item @code{fsync} - XXX
    27 @item @code{fdatasync} - XXX
     26@item @code{fsync} - Synchronize a file's complete in-core state with that on disk
     27@item @code{fdatasync} - synchronize a file's in-core data with that on disk
    2828@item @code{mount} - Mount a file system
    2929@item @code{umount} - Unmount file systems
     
    9292#include <unistd.h>
    9393
    94 int dup(int fildes
     94int dup(
     95  int fildes
    9596);
    9697@end example
     
    178179#include <unistd.h>
    179180
    180 int close(int fildes
     181int close(
     182  int fildes
    181183);
    182184@end example
     
    235237@table @b
    236238@item EAGAIN
    237 The
     239The O_NONBLOCK flag is set for a file descriptor and the process
     240would be delayed in the I/O operation.
    238241
    239242@item EBADF
     
    311314#include <unistd.h>
    312315
    313 int write(int         fildes,
    314           const void *buf,
    315           unsigned int nbytes
     316int write(
     317  int           fildes,
     318  const void   *buf,
     319  unsigned int  nbytes
    316320);
    317321@end example
     
    332336
    333337@item EFBIG
    334 The
     338An attempt was made to write to a file that exceeds the maximum file
     339size
    335340
    336341@item EINTR
     
    567572
    568573@page
    569 @subsection fsync -
     574@subsection fsync - Synchronize a file's complete in-core state with that on disk
    570575
    571576@subheading CALLING SEQUENCE:
     
    574579@example
    575580int fsync(
    576 );
    577 @end example
    578 @end ifset
    579 
    580 @ifset is-Ada
    581 @end ifset
    582 
    583 @subheading STATUS CODES:
    584 
    585 @table @b
    586 @item E
    587 The
    588 
    589 @end table
    590 
    591 @subheading DESCRIPTION:
    592 
    593 @subheading NOTES:
    594 
    595 @page
    596 @subsection fdatasync -
     581  int fd
     582);
     583@end example
     584@end ifset
     585
     586@ifset is-Ada
     587@end ifset
     588
     589@subheading STATUS CODES:
     590
     591On success, zero is returned.  On error, -1 is returned, and @code{errno}
     592is set appropriately.
     593
     594@table @b
     595@item EBADF
     596@code{fd} is not a valid descriptor open for writing
     597
     598@item EINVAL
     599@code{fd} is bound to a special file which does not support support synchronization
     600
     601@item EROFS
     602@code{fd} is bound to a special file which does not support support synchronization
     603
     604@item EIO
     605An error occurred during synchronization
     606
     607@end table
     608
     609@subheading DESCRIPTION:
     610
     611@code{fsync} copies all in-core parts of a file to disk.
     612
     613@subheading NOTES:
     614
     615NONE
     616
     617@page
     618@subsection fdatasync - synchronize a file's in-core data with that on disk.
    597619
    598620@subheading CALLING SEQUENCE:
     
    601623@example
    602624int fdatasync(
    603 );
    604 @end example
    605 @end ifset
    606 
    607 @ifset is-Ada
    608 @end ifset
    609 
    610 @subheading STATUS CODES:
    611 
    612 @table @b
    613 @item E
    614 The
    615 
    616 @end table
    617 
    618 @subheading DESCRIPTION:
    619 
    620 @subheading NOTES:
     625  int fd
     626);
     627@end example
     628@end ifset
     629
     630@ifset is-Ada
     631@end ifset
     632
     633@subheading STATUS CODES:
     634
     635On success, zeor is returned.  On error, -1 is returned, and @code{errno} is
     636set appropriately.
     637
     638@table @b
     639@item EBADF
     640@code{fd} is not a valid file descriptor open for writing.
     641
     642@item EINVAL
     643@code{fd} is bound to a special file which dows not support synchronization.
     644
     645@item EIO
     646An error occurred during synchronization.
     647
     648@item EROFS
     649@code{fd} is bound to a special file which dows not support synchronization.
     650
     651@end table
     652
     653@subheading DESCRIPTION:
     654
     655@code{fdatasync} flushes all data buffers of a file to disk (before the system call
     656returns).  It resembles @code{fsync} but is not required to update the metadata such 
     657as access time.
     658
     659Applications that access databases or log files often write a tiny data fragment
     660(e.g., one line in a log file) and then call @code{fsync} immediately in order to 
     661ensure that the written data is physically stored on the harddisk.  Unfortunately,
     662fsync will always initiate two write operations: one for the newly written data and
     663another one in order to update the modification time stored in the inode.  If the
     664modification time is not a part of the transaction concept @code{fdatasync} can be
     665used to avoid unnecessary inode disk write operations.
     666
     667@subheading NOTES:
     668
     669NONE
    621670
    622671@page
Note: See TracChangeset for help on using the changeset viewer.