Deleted Added
sdiff udiff text old ( 120945 ) new ( 142403 )
full compact
1/*
2 * Copyright (c) 1995 - 2000, 2002 Kungliga Tekniska H�gskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include "kafs_locl.h"
35
36RCSID("$Id: afssys.c,v 1.69 2003/03/18 04:18:45 lha Exp $");
37
38int _kafs_debug; /* this should be done in a better way */
39
40#define NO_ENTRY_POINT 0
41#define SINGLE_ENTRY_POINT 1
42#define MULTIPLE_ENTRY_POINT 2
43#define SINGLE_ENTRY_POINT2 3
44#define SINGLE_ENTRY_POINT3 4
45#define AIX_ENTRY_POINTS 5
46#define UNKNOWN_ENTRY_POINT 6
47static int afs_entry_point = UNKNOWN_ENTRY_POINT;
48static int afs_syscalls[2];
49
50/* Magic to get AIX syscalls to work */
51#ifdef _AIX
52
53static int (*Pioctl)(char*, int, struct ViceIoctl*, int);
54static int (*Setpag)(void);
55
56#include "dlfcn.h"

--- 70 unchanged lines hidden (view full) ---

127 return 0;
128 }
129 }
130 }
131 fclose (f);
132 return -1;
133}
134
135int
136k_pioctl(char *a_path,
137 int o_opcode,
138 struct ViceIoctl *a_paramsP,
139 int a_followSymlinks)
140{
141#ifndef NO_AFS
142 switch(afs_entry_point){

--- 4 unchanged lines hidden (view full) ---

147 return syscall(afs_syscalls[0], AFSCALL_PIOCTL,
148 a_path, o_opcode, a_paramsP, a_followSymlinks);
149#endif
150#if defined(AFS_PIOCTL)
151 case MULTIPLE_ENTRY_POINT:
152 return syscall(afs_syscalls[0],
153 a_path, o_opcode, a_paramsP, a_followSymlinks);
154#endif
155#ifdef _AIX
156 case AIX_ENTRY_POINTS:
157 return Pioctl(a_path, o_opcode, a_paramsP, a_followSymlinks);
158#endif
159 }
160
161 errno = ENOSYS;
162#ifdef SIGSYS
163 kill(getpid(), SIGSYS); /* You lose! */
164#endif
165#endif /* NO_AFS */
166 return -1;
167}
168

--- 26 unchanged lines hidden (view full) ---

195 case SINGLE_ENTRY_POINT2:
196 case SINGLE_ENTRY_POINT3:
197 return syscall(afs_syscalls[0], AFSCALL_SETPAG);
198#endif
199#if defined(AFS_PIOCTL)
200 case MULTIPLE_ENTRY_POINT:
201 return syscall(afs_syscalls[1]);
202#endif
203#ifdef _AIX
204 case AIX_ENTRY_POINTS:
205 return Setpag();
206#endif
207 }
208
209 errno = ENOSYS;
210#ifdef SIGSYS

--- 172 unchanged lines hidden (view full) ---

383 }
384 }
385#endif
386
387 if(try_aix() == 0)
388 goto done;
389#endif
390
391done:
392#ifdef SIGSYS
393 signal(SIGSYS, saved_func);
394#endif
395#endif /* NO_AFS */
396 errno = saved_errno;
397 return afs_entry_point != NO_ENTRY_POINT;
398}