get the device for a file
#include <sys/fsys.h> int fsys_get_mount_dev( const char *path, char *device );
fsys_get_mount_dev() finds and returns the device that a file is on. For instance, if you have a file /home/bill/old, and you need to know its physical device, you could use the path to find that device (/dev/hd0t77).
#include <limits.h> #include <sys/fsys.h> void main(int argc, char **argv) { char buf[_POSIX_NAME_MAX]; fsys_get_mount_dev( argv[1], buf ); printf( "'%s' is on the %s device\n", argv[1], buf ); }
QNX
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes, but modifies errno |
Thread | Yes |