new libunwind, updated to netbsd b1f513eedd
[minix3.git] / servers / iso9660fs / misc.c
blob6749affe5d4ddcd461b50971c0ecd07e7f46ae07
1 #include "inc.h"
2 #include <fcntl.h>
3 #include <minix/vfsif.h>
4 #include <minix/bdev.h>
7 /*===========================================================================*
8 * fs_sync *
9 *===========================================================================*/
10 int fs_sync()
12 /* Always mounted read only, so nothing to sync */
13 return(OK); /* sync() can't fail */
17 /*===========================================================================*
18 * fs_new_driver *
19 *===========================================================================*/
20 int fs_new_driver(void)
22 /* Set a new driver endpoint for this device. */
23 dev_t dev;
24 cp_grant_id_t label_gid;
25 size_t label_len;
26 char label[sizeof(fs_dev_label)];
27 int r;
29 dev = fs_m_in.m_vfs_fs_new_driver.device;
30 label_gid = fs_m_in.m_vfs_fs_new_driver.grant;
31 label_len = fs_m_in.m_vfs_fs_new_driver.path_len;
33 if (label_len > sizeof(label))
34 return(EINVAL);
36 r = sys_safecopyfrom(fs_m_in.m_source, label_gid, (vir_bytes) 0,
37 (vir_bytes) label, label_len);
39 if (r != OK) {
40 printf("ISOFS: fs_new_driver safecopyfrom failed (%d)\n", r);
41 return(EINVAL);
44 bdev_driver(dev, label);
46 return(OK);