1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
21 ***********************************************************************/
25 * AT&T Bell Laboratories
28 * only active for non-shared 3d library
31 #define mount ______mount
44 char val
[sizeof(FS3D_off
) + 8];
47 static char on
[] = FS3D_on
;
48 static char off
[] = FS3D_off
;
54 * get the current setting
57 if (!fsview
&& (!getenv("LD_PRELOAD") || mount("", "", 0, NiL
)))
59 if (FS3D_op(op
) == FS3D_OP_INIT
&& mount(FS3D_init
, NiL
, FS3D_VIEW
, NiL
))
61 if (mount(on
, val
, FS3D_VIEW
|FS3D_GET
|FS3D_SIZE(sizeof(val
)), NiL
))
63 if (v
= strchr(val
, ' '))
69 else if (!strncmp(v
, off
, sizeof(off
) - 1) && v
[sizeof(off
)] == '=')
70 cur
= FS3D_LIMIT((int)strtol(v
+ sizeof(off
) + 1, NiL
, 0));
84 sfsprintf(val
, sizeof(val
), "%s=%d", off
, FS3D_arg(op
));
91 if (v
&& mount(v
, NiL
, FS3D_VIEW
, NiL
))
102 * user code that includes <fs3d.h> will have mount() mapped to fs3d_mount()
103 * this restricts the various "standard" mount prototype conflicts to this spot
104 * this means that code that includes <fs3d.h> cannot access the real mount
105 * (at least without some additional macro hackery
110 extern int mount(const char*, char*, int, void*);
113 fs3d_mount(const char* source
, char* target
, int flags
, void* data
)
115 return mount(source
, target
, flags
, data
);