From owner-freebsd-hackers Wed May 22 09:58:29 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA10008 for hackers-outgoing; Wed, 22 May 1996 09:58:29 -0700 (PDT) Received: from sierra.zyzzyva.com (ppp0.zyzzyva.com [198.183.2.50]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id JAA10003 for ; Wed, 22 May 1996 09:58:24 -0700 (PDT) Received: from zyzzyva.com (localhost [127.0.0.1]) by sierra.zyzzyva.com (8.7.5/8.6.11) with ESMTP id LAA01473 for ; Wed, 22 May 1996 11:58:15 -0500 (CDT) Message-Id: <199605221658.LAA01473@sierra.zyzzyva.com> To: freebsd-hackers@freebsd.org Subject: mount() flags X-uri: http://www.zyzzyva.com/ Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 22 May 1996 11:58:15 -0500 From: Randy Terbush Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Could someone offer some feedback about the following scenario, and perhaps some clues about the flags MNT_UPDATE and MNT_RELOAD? These flags aren't mentioned in the manpage. I have the following snippet of code. What I am trying to do is change a read-only mounted filesystem to read-write, change something on the filesystem, then remount read-only. This seems to cause a system panic, (details currently unavailable). Trying to duplicate the problem with a floppy device I am finding that it looks as though these types of requests don't get queued. It would also appear that I may be in for a challenge to figure out how to wait for the first to finish. Suggestions for the clueless are welcome. In the case below, the second call to mount will fail since the first call is still in progress. Is there a way to wait() on the first call? main () { struct ufs_args *ufs; ufs = (struct ufs_args *) malloc (sizeof (struct ufs_args)); ufs->fspec = "/dev/fd0a"; if ((mount (MOUNT_UFS, "/mnt", MNT_UPDATE, ufs)) != 0) { fprintf (stderr, "failed to change mount status\n"); perror ("mount"); } exec something here..... if ((mount (MOUNT_UFS, "/mnt", MNT_RDONLY, ufs)) != 0) { fprintf (stderr, "failed to change mount status\n"); perror ("mount"); } }