2018-02-28 09:04:46 +03:00
|
|
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
|
|
|
* This file is part of ToaruOS and is released under the terms
|
|
|
|
* of the NCSA / University of Illinois License - see LICENSE.md
|
2018-05-01 11:12:56 +03:00
|
|
|
* Copyright (C) 2014-2018 K. Lange
|
2018-02-28 09:04:46 +03:00
|
|
|
*
|
|
|
|
* mount
|
|
|
|
*
|
|
|
|
* Mount a filesystem.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2018-07-19 16:36:34 +03:00
|
|
|
#include <errno.h>
|
2018-08-15 09:49:01 +03:00
|
|
|
#include <sys/mount.h>
|
2018-02-28 09:04:46 +03:00
|
|
|
|
|
|
|
int main(int argc, char ** argv) {
|
|
|
|
if (argc < 4) {
|
|
|
|
fprintf(stderr, "Usage: %s type device mountpoint\n", argv[0]);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2018-07-19 16:36:34 +03:00
|
|
|
int ret = mount(argv[2], argv[3], argv[1], 0, NULL);
|
|
|
|
|
|
|
|
if (ret < 0) {
|
|
|
|
fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
|
|
|
|
return ret;
|
2018-02-28 09:04:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|