#include <minix/type.h>
#include <fcntl.h>
#include <unistd.h>
+#include <sys/mount.h>
#include <dirent.h>
#include <stdlib.h>
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
-#include <unistd.h>
+#include <sys/mount.h>
#include <fcntl.h>
#include <minix/config.h>
#include <minix/const.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
+#include <sys/mount.h>
int main(int argc, char *argv[])
{
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <sys/mount.h>
#include <stdio.h>
_PROTOTYPE(int main, (int argc, char **argv));
--- /dev/null
+/* <sys/mount.h>
+ * definitions for mount(2)
+ */
+
+#ifndef _MOUNT_H
+#define _MOUNT_H
+
+#define MS_RDONLY 0x001 /* Mount device read only */
+#define MS_REUSE 0x002 /* Tell RS to try reusing binary from memory */
+
+
+/* Function Prototypes. */
+#ifndef _ANSI_H
+#include <ansi.h>
+#endif
+
+_PROTOTYPE( int mount, (char *_spec, char *_name, int _mountflags,
+ char *type, char *args) );
+_PROTOTYPE( int umount, (const char *_name) );
+
+#endif /* _MOUNT_H */
_PROTOTYPE( int mknod4, (const char *_name, _mnx_Mode_t _mode, Dev_t _addr,
long _size) );
_PROTOTYPE( char *mktemp, (char *_template) );
-_PROTOTYPE( int mount, (char *_spec, char *_name, int _flag,
- char *type, char *args) );
_PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) );
_PROTOTYPE( char *sbrk, (int _incr) );
_PROTOTYPE( int sync, (void) );
_PROTOTYPE( int fsync, (int fd) );
-_PROTOTYPE( int umount, (const char *_name) );
_PROTOTYPE( int reboot, (int _how, ...) );
_PROTOTYPE( int gethostname, (char *_hostname, size_t _len) );
_PROTOTYPE( int getdomainname, (char *_domain, size_t _len) );
#define mount _mount
#define umount _umount
#include <string.h>
-#include <unistd.h>
+#include <sys/mount.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
return label;
}
-PUBLIC int mount(special, name, rwflag, type, args)
+PUBLIC int mount(special, name, mountflags, type, args)
char *name, *special, *type, *args;
-int rwflag;
+int mountflags;
{
int r;
message m;
char cmd[200];
FILE *pipe;
int ep;
+ int reuse;
/* Default values. */
if (type == NULL) type = FSDEFAULT;
if (args == NULL) args = "";
+ reuse = 0;
/* Make FS process label for RS from special name. */
if(!(label=makelabel(special))) {
return -1;
}
+ if(mountflags & MS_REUSE) {
+ reuse = 1;
+ mountflags &= ~MS_REUSE; /* Temporary: turn off to not confuse VFS */
+ }
+
sprintf(cmd, _PATH_SERVICE " up %s -label '%s' -config " _PATH_DRIVERS_CONF
" -args '%s%s' -printep yes",
path, label, args[0] ? "-o " : "", args);
/* Now perform mount(). */
m.m1_i1 = strlen(special) + 1;
m.m1_i2 = strlen(name) + 1;
- m.m1_i3 = rwflag;
+ m.m1_i3 = mountflags;
m.m1_p1 = special;
m.m1_p2 = name;
m.m1_p3 = (char*) ep;
.SH SYNOPSIS
.ft B
.nf
-#include <unistd.h>
#include <sys/mount.h>
-int mount(char *\fIspecial\fP, char *\fIname\fP, int \fIflag\fP, char *\fItype\fP, char *\fIargs\fP)
+int mount(char *\fIspecial\fP, char *\fIname\fP, int \fImountflags\fP, char *\fItype\fP, char *\fIargs\fP)
int umount(char *\fIname\fP)
.fi
.ft P