11de7b4b8SPedro F. Giffuni /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 31de7b4b8SPedro F. Giffuni * 4c69a34d4SMatthew Dillon * Copyright (c) 1999 Martin Blapp 5c69a34d4SMatthew Dillon * All rights reserved. 6c69a34d4SMatthew Dillon * 7c69a34d4SMatthew Dillon * Redistribution and use in source and binary forms, with or without 8c69a34d4SMatthew Dillon * modification, are permitted provided that the following conditions 9c69a34d4SMatthew Dillon * are met: 10c69a34d4SMatthew Dillon * 1. Redistributions of source code must retain the above copyright 11c69a34d4SMatthew Dillon * notice, this list of conditions and the following disclaimer. 12c69a34d4SMatthew Dillon * 2. Redistributions in binary form must reproduce the above copyright 13c69a34d4SMatthew Dillon * notice, this list of conditions and the following disclaimer in the 14c69a34d4SMatthew Dillon * documentation and/or other materials provided with the distribution. 15c69a34d4SMatthew Dillon * 16c69a34d4SMatthew Dillon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17c69a34d4SMatthew Dillon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18c69a34d4SMatthew Dillon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19c69a34d4SMatthew Dillon * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20c69a34d4SMatthew Dillon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21c69a34d4SMatthew Dillon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22c69a34d4SMatthew Dillon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23c69a34d4SMatthew Dillon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24c69a34d4SMatthew Dillon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25c69a34d4SMatthew Dillon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26c69a34d4SMatthew Dillon * SUCH DAMAGE. 27c69a34d4SMatthew Dillon */ 28c69a34d4SMatthew Dillon 290775314bSDoug Rabson #define STRSIZ (MNTNAMLEN+MNTPATHLEN+100) 30c69a34d4SMatthew Dillon #define PATH_MOUNTTAB "/var/db/mounttab" 31c69a34d4SMatthew Dillon 32c69a34d4SMatthew Dillon /* Structure for /var/db/mounttab */ 33c69a34d4SMatthew Dillon struct mtablist { 34c69a34d4SMatthew Dillon time_t mtab_time; 350775314bSDoug Rabson char mtab_host[MNTNAMLEN]; 360775314bSDoug Rabson char mtab_dirp[MNTPATHLEN]; 37c69a34d4SMatthew Dillon struct mtablist *mtab_next; 38c69a34d4SMatthew Dillon }; 39c69a34d4SMatthew Dillon 40afe1ef24SIan Dowse extern struct mtablist *mtabhead; 41afe1ef24SIan Dowse 42c69a34d4SMatthew Dillon int add_mtab(char *, char *); 43afe1ef24SIan Dowse void clean_mtab(char *, char *, int); 44afe1ef24SIan Dowse int read_mtab(void); 45afe1ef24SIan Dowse int write_mtab(int); 46c69a34d4SMatthew Dillon void free_mtab(void); 47