Sun Oct 18 20:14:06 2009 UTC ()
include some headers we use


(pooka)
diff -r1.27 -r1.28 src/lib/libpuffs/null.c

cvs diff -r1.27 -r1.28 src/lib/libpuffs/null.c (expand / switch to unified diff)

--- src/lib/libpuffs/null.c 2009/01/08 02:19:48 1.27
+++ src/lib/libpuffs/null.c 2009/10/18 20:14:06 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: null.c,v 1.27 2009/01/08 02:19:48 lukem Exp $ */ 1/* $NetBSD: null.c,v 1.28 2009/10/18 20:14:06 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2007 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -17,44 +17,46 @@ @@ -17,44 +17,46 @@
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE. 25 * SUCH DAMAGE.
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29#if !defined(lint) 29#if !defined(lint)
30__RCSID("$NetBSD: null.c,v 1.27 2009/01/08 02:19:48 lukem Exp $"); 30__RCSID("$NetBSD: null.c,v 1.28 2009/10/18 20:14:06 pooka Exp $");
31#endif /* !lint */ 31#endif /* !lint */
32 32
33/* 33/*
34 * A "nullfs" using puffs, i.e. maps one location in the hierarchy 34 * A "nullfs" using puffs, i.e. maps one location in the hierarchy
35 * to another using standard system calls. 35 * to another using standard system calls.
36 */ 36 */
37 37
38#include <sys/types.h> 38#include <sys/types.h>
 39#include <sys/stat.h>
39#include <sys/time.h> 40#include <sys/time.h>
40 41
41#include <assert.h> 42#include <assert.h>
42#include <dirent.h> 43#include <dirent.h>
43#include <errno.h> 44#include <errno.h>
44#include <fcntl.h> 45#include <fcntl.h>
45#include <puffs.h> 46#include <puffs.h>
46#include <stdio.h> 47#include <stdio.h>
47#include <stdlib.h> 48#include <stdlib.h>
 49#include <time.h>
48#include <unistd.h> 50#include <unistd.h>
49 51
50PUFFSOP_PROTOS(puffs_null) 52PUFFSOP_PROTOS(puffs_null)
51 53
52/* 54/*
53 * set attributes to what is specified. XXX: no rollback in case of failure 55 * set attributes to what is specified. XXX: no rollback in case of failure
54 */ 56 */
55static int 57static int
56processvattr(const char *path, const struct vattr *va, int regular) 58processvattr(const char *path, const struct vattr *va, int regular)
57{ 59{
58 struct timeval tv[2]; 60 struct timeval tv[2];
59 61
60 /* XXX: -1 == PUFFS_VNOVAL, but shouldn't trust that */ 62 /* XXX: -1 == PUFFS_VNOVAL, but shouldn't trust that */