Wed Mar 9 23:26:20 2011 UTC ()
Make getfh() a pathcall instead of a fhcall.  while it does pertain
to file handles, it still gets passed a path and we can DTRT based
on that.


(pooka)
diff -r1.81 -r1.82 src/lib/librumphijack/hijack.c

cvs diff -r1.81 -r1.82 src/lib/librumphijack/hijack.c (expand / switch to unified diff)

--- src/lib/librumphijack/hijack.c 2011/03/09 20:48:57 1.81
+++ src/lib/librumphijack/hijack.c 2011/03/09 23:26:19 1.82
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: hijack.c,v 1.81 2011/03/09 20:48:57 pooka Exp $ */ 1/* $NetBSD: hijack.c,v 1.82 2011/03/09 23:26:19 pooka Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2011 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2011 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 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
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__RCSID("$NetBSD: hijack.c,v 1.81 2011/03/09 20:48:57 pooka Exp $"); 29__RCSID("$NetBSD: hijack.c,v 1.82 2011/03/09 23:26:19 pooka Exp $");
30 30
31#define __ssp_weak_name(fun) _hijack_ ## fun 31#define __ssp_weak_name(fun) _hijack_ ## fun
32 32
33#include <sys/param.h> 33#include <sys/param.h>
34#include <sys/types.h> 34#include <sys/types.h>
35#include <sys/event.h> 35#include <sys/event.h>
36#include <sys/ioctl.h> 36#include <sys/ioctl.h>
37#include <sys/mman.h> 37#include <sys/mman.h>
38#include <sys/mount.h> 38#include <sys/mount.h>
39#include <sys/poll.h> 39#include <sys/poll.h>
40#include <sys/socket.h> 40#include <sys/socket.h>
41#include <sys/statvfs.h> 41#include <sys/statvfs.h>
42 42
@@ -2189,40 +2189,40 @@ PATHCALL(int, REALMOUNT, DUALCALL_MOUNT, @@ -2189,40 +2189,40 @@ PATHCALL(int, REALMOUNT, DUALCALL_MOUNT,
2189 (const char *, const char *, int, void *, size_t), \ 2189 (const char *, const char *, int, void *, size_t), \
2190 (type, path, flags, data, dlen)) 2190 (type, path, flags, data, dlen))
2191 2191
2192PATHCALL(int, unmount, DUALCALL_UNMOUNT, \ 2192PATHCALL(int, unmount, DUALCALL_UNMOUNT, \
2193 (const char *path, int flags), \ 2193 (const char *path, int flags), \
2194 (const char *, int), \ 2194 (const char *, int), \
2195 (path, flags)) 2195 (path, flags))
2196 2196
2197PATHCALL(int, REALQUOTACTL, DUALCALL_QUOTACTL, \ 2197PATHCALL(int, REALQUOTACTL, DUALCALL_QUOTACTL, \
2198 (const char *path, struct plistref *p), \ 2198 (const char *path, struct plistref *p), \
2199 (const char *, struct plistref *), \ 2199 (const char *, struct plistref *), \
2200 (path, p)) 2200 (path, p))
2201 2201
 2202PATHCALL(int, REALGETFH, DUALCALL_GETFH, \
 2203 (const char *path, void *fhp, size_t *fh_size), \
 2204 (const char *, void *, size_t *), \
 2205 (path, fhp, fh_size))
 2206
2202/* 2207/*
2203 * These act different on a per-process vfs configuration 2208 * These act different on a per-process vfs configuration
2204 */ 2209 */
2205 2210
2206VFSCALL(VFSBIT_GETVFSSTAT, int, getvfsstat, DUALCALL_GETVFSSTAT, \ 2211VFSCALL(VFSBIT_GETVFSSTAT, int, getvfsstat, DUALCALL_GETVFSSTAT, \
2207 (struct statvfs *buf, size_t buflen, int flags), \ 2212 (struct statvfs *buf, size_t buflen, int flags), \
2208 (struct statvfs *, size_t, int), \ 2213 (struct statvfs *, size_t, int), \
2209 (buf, buflen, flags)) 2214 (buf, buflen, flags))
2210 2215
2211VFSCALL(VFSBIT_FHCALLS, int, REALGETFH, DUALCALL_GETFH, \ 
2212 (const char *path, void *fhp, size_t *fh_size), \ 
2213 (const char *, void *, size_t *), \ 
2214 (path, fhp, fh_size)) 
2215 
2216VFSCALL(VFSBIT_FHCALLS, int, REALFHOPEN, DUALCALL_FHOPEN, \ 2216VFSCALL(VFSBIT_FHCALLS, int, REALFHOPEN, DUALCALL_FHOPEN, \
2217 (const void *fhp, size_t fh_size, int flags), \ 2217 (const void *fhp, size_t fh_size, int flags), \
2218 (const char *, size_t, int), \ 2218 (const char *, size_t, int), \
2219 (fhp, fh_size, flags)) 2219 (fhp, fh_size, flags))
2220 2220
2221VFSCALL(VFSBIT_FHCALLS, int, REALFHSTAT, DUALCALL_FHSTAT, \ 2221VFSCALL(VFSBIT_FHCALLS, int, REALFHSTAT, DUALCALL_FHSTAT, \
2222 (const void *fhp, size_t fh_size, struct stat *sb), \ 2222 (const void *fhp, size_t fh_size, struct stat *sb), \
2223 (const char *, size_t, struct stat *), \ 2223 (const char *, size_t, struct stat *), \
2224 (fhp, fh_size, sb)) 2224 (fhp, fh_size, sb))
2225 2225
2226VFSCALL(VFSBIT_FHCALLS, int, REALFHSTATVFS1, DUALCALL_FHSTATVFS1, \ 2226VFSCALL(VFSBIT_FHCALLS, int, REALFHSTATVFS1, DUALCALL_FHSTATVFS1, \
2227 (const void *fhp, size_t fh_size, struct statvfs *sb, int flgs),\ 2227 (const void *fhp, size_t fh_size, struct statvfs *sb, int flgs),\
2228 (const char *, size_t, struct statvfs *, int), \ 2228 (const char *, size_t, struct statvfs *, int), \