request that the file system manager flush inodes and blocks to disk
#include <sys/types.h> #include <unistd.h> int qnx_sync( nid_t nid );
The qnx_sync() function requests that the filesystem manager running on the node indicated by nid start flushing all updated in-memory inodes and blocks in the buffer cache to disk.
The function will likely return before the operation is complete. There's no way to determine when the operation is complete. |
/* * Tell Fsys on a specified node to start sync'ing */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> void main( int argc, char *argv[] ) { nid_t nid = 0; int status = EXIT_SUCCESS; if( argc > 2 ) { fprintf( stderr, "use: %s [node]\n", argv[0] ); exit( 0 ); } else if( argc == 2 ) nid = atol( argv[1] ); if( qnx_sync( nid ) != 0 ) { status = EXIT_FAILURE; perror("sync"); } exit( status ); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes, but modifies errno |
Thread | Yes |
errno, fdatasync(), fsync(), sync(), umount()