-void do_umount( char *const argv[], int n, int fd ) {
-
- // write the length
- char buf[1024];
- sprintf( buf, "%08x\n", n );
- write( fd, buf, strlen(buf) );
-
- // now write each arg
- int i;
- for( i = 0; i < n; i++ ) {
- assert( strlen(argv[i]) < 1024 );
- sprintf( buf, "%s\n", argv[i] );
- write( fd, buf, strlen(buf) );
- }
-
- char inbuf[10];
- int n2 = read( fd, inbuf, 10 );
- inbuf[n2] = '\0';
-
- int r = atoi(inbuf);
-
-}
-
-int umount2( const char *mnt, int flags ) {
-
- int fd = connect_socket();
-
- const char *argv[3];
- argv[0] = "fusermount";
- argv[1] = "-u";
- argv[2] = mnt;
-
- do_umount( (char **const) argv, 3, fd );
-
- close(fd);
-
-}
-