![]() |
![]() |
![]() |
unmount a previously mounted file system or partition
#include <unistd.h> int umount( const char *special );
The umount() function requests that a previously mounted file system or previously mounted partitions contained on the block special file identified by special be unmounted. After unmounting the file system, the directory on which it was mounted (if any) reverts to its ordinary meaning.
The umount() function won't return until all dirty blocks are written to the disk. This action is similar to the sync() function with the exception that umount() blocks while waiting for the operation to be completed.
/* * Unmount the filesystem that's on the floppy */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> void main() { if( umount( "/dev/fd0" ) != 0 ) { perror( "umount /dev/fd0" ); exit( EXIT_FAILURE ); } exit( EXIT_SUCCESS ); }
UNIX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
errno, mount(), qnx_sync(), sync()
![]() |
![]() |
![]() |