FAT | RFS | XFS | ZFS
unmount()
PROTOTYPE
#include <posix.h>
int unmount(char *name);
DESCRIPTION
unmount() makes files on the volume specified by name inaccessible to applications. Open files on the volume have their buffered changes - if any - saved to the underlying storage media, but the open handles still must be closed to recover their file control blocks. The call does not return until all changes are saved.
Unmounted volumes use a minimum of system resources. Volumes may be mounted and unmounted as necessary to manage use of system resources.
unmount() returns 0 if successful, -1 on error.
ERROR CODES
| EFAULT | name equals NULL. |
| EINVAL | The named volume is unmounted. |
| ENOENT | No attached volume matches name. |
EXAMPLE
/*-----------------------------------------------------------------*/
/* Unmount the flash file system and check for success. */
/*-----------------------------------------------------------------*/
if (unmount("flash"))
printf("unmount(\"flash\") failed!\n");