mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
FBSD: properly register our syscall
Use the provided interface, syscall_register(), instead of manually tweaking the sysent table. Starting afsd will still fail at present on FreeBSD HEAD without an additional kernel patch to syscalls.master. Change-Id: I18db7c8b74dbd114165f7617df25e462cb372e88 Reviewed-on: http://gerrit.openafs.org/2616 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
2ea508ea0f
commit
5b71bab4ff
@ -20,40 +20,50 @@ int afs_pbuf_freecnt = -1;
|
|||||||
extern int Afs_xsetgroups();
|
extern int Afs_xsetgroups();
|
||||||
extern int afs_xioctl();
|
extern int afs_xioctl();
|
||||||
|
|
||||||
static sy_call_t *old_handler;
|
static struct sysent old_sysent;
|
||||||
|
|
||||||
|
static struct sysent afs_sysent = {
|
||||||
|
5, /* int sy_narg */
|
||||||
|
afs3_syscall, /* sy_call_t *sy_call */
|
||||||
|
#ifdef AFS_FBSD60_ENV
|
||||||
|
AUE_NULL, /* au_event_t sy_auevent */
|
||||||
|
#ifdef AFS_FBSD70_ENV
|
||||||
|
NULL, /* systrace_args_funt_t sy_systrace_args_func */
|
||||||
|
0, /* u_int32_t sy_entry */
|
||||||
|
0, /* u_int32_t sy_return */
|
||||||
|
#ifdef AFS_FBSD90_ENV
|
||||||
|
0, /* u_int32_t sy_flags */
|
||||||
|
0 /* u_int32_t sy_thrcnt */
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif /* FBSD60 */
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
afs_init(struct vfsconf *vfc)
|
afs_init(struct vfsconf *vfc)
|
||||||
{
|
{
|
||||||
if (sysent[AFS_SYSCALL].sy_call != nosys
|
int code;
|
||||||
&& sysent[AFS_SYSCALL].sy_call != lkmnosys) {
|
int offset = AFS_SYSCALL;
|
||||||
printf("AFS_SYSCALL in use. aborting\n");
|
|
||||||
return EBUSY;
|
code = syscall_register(&offset, &afs_sysent, &old_sysent);
|
||||||
|
if (code) {
|
||||||
|
printf("AFS_SYSCALL in use, error %i. aborting\n", code);
|
||||||
|
return code;
|
||||||
}
|
}
|
||||||
osi_Init();
|
osi_Init();
|
||||||
afs_pbuf_freecnt = nswbuf / 2 + 1;
|
afs_pbuf_freecnt = nswbuf / 2 + 1;
|
||||||
#if 0
|
|
||||||
sysent[SYS_setgroups].sy_call = Afs_xsetgroups;
|
|
||||||
sysent[SYS_ioctl].sy_call = afs_xioctl;
|
|
||||||
#endif
|
|
||||||
old_handler = sysent[AFS_SYSCALL].sy_call;
|
|
||||||
sysent[AFS_SYSCALL].sy_call = afs3_syscall;
|
|
||||||
sysent[AFS_SYSCALL].sy_narg = 5;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
afs_uninit(struct vfsconf *vfc)
|
afs_uninit(struct vfsconf *vfc)
|
||||||
{
|
{
|
||||||
|
int offset = AFS_SYSCALL;
|
||||||
|
|
||||||
if (afs_globalVFS)
|
if (afs_globalVFS)
|
||||||
return EBUSY;
|
return EBUSY;
|
||||||
#if 0
|
syscall_deregister(&offset, &old_sysent);
|
||||||
sysent[SYS_ioctl].sy_call = ioctl;
|
|
||||||
sysent[SYS_setgroups].sy_call = setgroups;
|
|
||||||
#endif
|
|
||||||
sysent[AFS_SYSCALL].sy_narg = 0;
|
|
||||||
sysent[AFS_SYSCALL].sy_call = old_handler;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user