version 1.61.2.4, 2004/09/18 14:43:42 |
version 1.61.2.5, 2004/09/21 13:25:38 |
Line 154 linux_sys_creat(l, v, retval) |
|
Line 154 linux_sys_creat(l, v, retval) |
|
caddr_t sg; |
caddr_t sg; |
|
|
sg = stackgap_init(p, 0); |
sg = stackgap_init(p, 0); |
CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); |
CHECK_ALT_CREAT(l, &sg, SCARG(uap, path)); |
|
|
SCARG(&oa, path) = SCARG(uap, path); |
SCARG(&oa, path) = SCARG(uap, path); |
SCARG(&oa, flags) = O_CREAT | O_TRUNC | O_WRONLY; |
SCARG(&oa, flags) = O_CREAT | O_TRUNC | O_WRONLY; |
Line 190 linux_sys_open(l, v, retval) |
|
Line 190 linux_sys_open(l, v, retval) |
|
fl = linux_to_bsd_ioflags(SCARG(uap, flags)); |
fl = linux_to_bsd_ioflags(SCARG(uap, flags)); |
|
|
if (fl & O_CREAT) |
if (fl & O_CREAT) |
CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); |
CHECK_ALT_CREAT(l, &sg, SCARG(uap, path)); |
else |
else |
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
SCARG(&boa, path) = SCARG(uap, path); |
SCARG(&boa, path) = SCARG(uap, path); |
SCARG(&boa, flags) = fl; |
SCARG(&boa, flags) = fl; |
Line 218 linux_sys_open(l, v, retval) |
|
Line 218 linux_sys_open(l, v, retval) |
|
FILE_USE(fp); |
FILE_USE(fp); |
if (fp->f_type == DTYPE_VNODE) { |
if (fp->f_type == DTYPE_VNODE) { |
(fp->f_ops->fo_ioctl) (fp, TIOCSCTTY, |
(fp->f_ops->fo_ioctl) (fp, TIOCSCTTY, |
(caddr_t) 0, p); |
(caddr_t) 0, l); |
} |
} |
FILE_UNUSE(fp, p); |
FILE_UNUSE(fp, l); |
} |
} |
} |
} |
return 0; |
return 0; |
Line 365 linux_sys_fcntl(l, v, retval) |
|
Line 365 linux_sys_fcntl(l, v, retval) |
|
val &= ~O_ASYNC; |
val &= ~O_ASYNC; |
else { |
else { |
/* not a pipe, do not modify anything */ |
/* not a pipe, do not modify anything */ |
FILE_UNUSE(fp, p); |
FILE_UNUSE(fp, l); |
fp = NULL; |
fp = NULL; |
} |
} |
} |
} |
Line 380 linux_sys_fcntl(l, v, retval) |
|
Line 380 linux_sys_fcntl(l, v, retval) |
|
if (fp) { |
if (fp) { |
if (!error) |
if (!error) |
fp->f_flag |= FASYNC; |
fp->f_flag |= FASYNC; |
FILE_UNUSE(fp, p); |
FILE_UNUSE(fp, l); |
} |
} |
|
|
return (error); |
return (error); |
Line 433 linux_sys_fcntl(l, v, retval) |
|
Line 433 linux_sys_fcntl(l, v, retval) |
|
if (fp->f_type != DTYPE_VNODE |
if (fp->f_type != DTYPE_VNODE |
|| (vp = (struct vnode *)fp->f_data) == NULL |
|| (vp = (struct vnode *)fp->f_data) == NULL |
|| vp->v_type != VCHR) { |
|| vp->v_type != VCHR) { |
FILE_UNUSE(fp, p); |
FILE_UNUSE(fp, l); |
|
|
not_tty: |
not_tty: |
/* Not a tty, proceed with common fcntl() */ |
/* Not a tty, proceed with common fcntl() */ |
Line 441 linux_sys_fcntl(l, v, retval) |
|
Line 441 linux_sys_fcntl(l, v, retval) |
|
break; |
break; |
} |
} |
|
|
error = VOP_GETATTR(vp, &va, p->p_ucred, p); |
error = VOP_GETATTR(vp, &va, p->p_ucred, l); |
|
|
FILE_UNUSE(fp, p); |
FILE_UNUSE(fp, l); |
|
|
if (error) |
if (error) |
return error; |
return error; |
Line 577 linux_stat1(l, v, retval, dolstat) |
|
Line 577 linux_stat1(l, v, retval, dolstat) |
|
sg = stackgap_init(p, 0); |
sg = stackgap_init(p, 0); |
st = stackgap_alloc(p, &sg, sizeof (struct stat)); |
st = stackgap_alloc(p, &sg, sizeof (struct stat)); |
if (dolstat) |
if (dolstat) |
CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, path)); |
CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, path)); |
else |
else |
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
SCARG(&sa, ub) = st; |
SCARG(&sa, ub) = st; |
SCARG(&sa, path) = SCARG(uap, path); |
SCARG(&sa, path) = SCARG(uap, path); |
Line 645 linux_sys_access(l, v, retval) |
|
Line 645 linux_sys_access(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
return sys_access(l, uap, retval); |
return sys_access(l, uap, retval); |
} |
} |
Line 665 linux_sys_unlink(l, v, retval) |
|
Line 665 linux_sys_unlink(l, v, retval) |
|
int error; |
int error; |
struct nameidata nd; |
struct nameidata nd; |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
error = sys_unlink(l, uap, retval); |
error = sys_unlink(l, uap, retval); |
if (error != EPERM) |
if (error != EPERM) |
Line 678 linux_sys_unlink(l, v, retval) |
|
Line 678 linux_sys_unlink(l, v, retval) |
|
* is the case. |
* is the case. |
*/ |
*/ |
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, |
NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, |
SCARG(uap, path), p); |
SCARG(uap, path), l); |
if (namei(&nd) == 0) { |
if (namei(&nd) == 0) { |
struct stat sb; |
struct stat sb; |
|
|
if (vn_stat(nd.ni_vp, &sb, p) == 0 |
if (vn_stat(nd.ni_vp, &sb, l) == 0 |
&& S_ISDIR(sb.st_mode)) |
&& S_ISDIR(sb.st_mode)) |
error = EISDIR; |
error = EISDIR; |
|
|
Line 704 linux_sys_chdir(l, v, retval) |
|
Line 704 linux_sys_chdir(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
return sys_chdir(l, uap, retval); |
return sys_chdir(l, uap, retval); |
} |
} |
Line 723 linux_sys_mknod(l, v, retval) |
|
Line 723 linux_sys_mknod(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); |
CHECK_ALT_CREAT(l, &sg, SCARG(uap, path)); |
|
|
/* |
/* |
* BSD handles FIFOs separately |
* BSD handles FIFOs separately |
Line 763 linux_sys_chmod(l, v, retval) |
|
Line 763 linux_sys_chmod(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
return sys_chmod(l, uap, retval); |
return sys_chmod(l, uap, retval); |
} |
} |
Line 784 linux_sys_chown16(l, v, retval) |
|
Line 784 linux_sys_chown16(l, v, retval) |
|
struct sys___posix_chown_args bca; |
struct sys___posix_chown_args bca; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
SCARG(&bca, path) = SCARG(uap, path); |
SCARG(&bca, path) = SCARG(uap, path); |
SCARG(&bca, uid) = ((linux_uid_t)SCARG(uap, uid) == (linux_uid_t)-1) ? |
SCARG(&bca, uid) = ((linux_uid_t)SCARG(uap, uid) == (linux_uid_t)-1) ? |
Line 832 linux_sys_lchown16(l, v, retval) |
|
Line 832 linux_sys_lchown16(l, v, retval) |
|
struct sys___posix_lchown_args bla; |
struct sys___posix_lchown_args bla; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, path)); |
CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, path)); |
|
|
SCARG(&bla, path) = SCARG(uap, path); |
SCARG(&bla, path) = SCARG(uap, path); |
SCARG(&bla, uid) = ((linux_uid_t)SCARG(uap, uid) == (linux_uid_t)-1) ? |
SCARG(&bla, uid) = ((linux_uid_t)SCARG(uap, uid) == (linux_uid_t)-1) ? |
Line 859 linux_sys_chown(l, v, retval) |
|
Line 859 linux_sys_chown(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
return sys___posix_chown(l, uap, retval); |
return sys___posix_chown(l, uap, retval); |
} |
} |
Line 878 linux_sys_lchown(l, v, retval) |
|
Line 878 linux_sys_lchown(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, path)); |
CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, path)); |
|
|
return sys___posix_lchown(l, uap, retval); |
return sys___posix_lchown(l, uap, retval); |
} |
} |
Line 897 linux_sys_rename(l, v, retval) |
|
Line 897 linux_sys_rename(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, from)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, from)); |
CHECK_ALT_CREAT(p, &sg, SCARG(uap, to)); |
CHECK_ALT_CREAT(l, &sg, SCARG(uap, to)); |
|
|
return sys___posix_rename(l, uap, retval); |
return sys___posix_rename(l, uap, retval); |
} |
} |
Line 916 linux_sys_mkdir(l, v, retval) |
|
Line 916 linux_sys_mkdir(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_CREAT(p, &sg, SCARG(uap, path)); |
CHECK_ALT_CREAT(l, &sg, SCARG(uap, path)); |
|
|
return sys_mkdir(l, uap, retval); |
return sys_mkdir(l, uap, retval); |
} |
} |
Line 933 linux_sys_rmdir(l, v, retval) |
|
Line 933 linux_sys_rmdir(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
return sys_rmdir(l, uap, retval); |
return sys_rmdir(l, uap, retval); |
} |
} |
Line 951 linux_sys_symlink(l, v, retval) |
|
Line 951 linux_sys_symlink(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
CHECK_ALT_CREAT(p, &sg, SCARG(uap, to)); |
CHECK_ALT_CREAT(l, &sg, SCARG(uap, to)); |
|
|
return sys_symlink(l, uap, retval); |
return sys_symlink(l, uap, retval); |
} |
} |
Line 970 linux_sys_link(l, v, retval) |
|
Line 970 linux_sys_link(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
CHECK_ALT_CREAT(p, &sg, SCARG(uap, link)); |
CHECK_ALT_CREAT(l, &sg, SCARG(uap, link)); |
|
|
return sys_link(l, uap, retval); |
return sys_link(l, uap, retval); |
} |
} |
Line 990 linux_sys_readlink(l, v, retval) |
|
Line 990 linux_sys_readlink(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_SYMLINK(p, &sg, SCARG(uap, name)); |
CHECK_ALT_SYMLINK(l, &sg, SCARG(uap, name)); |
|
|
return sys_readlink(l, uap, retval); |
return sys_readlink(l, uap, retval); |
} |
} |
Line 1008 linux_sys_truncate(l, v, retval) |
|
Line 1008 linux_sys_truncate(l, v, retval) |
|
struct proc *p = l->l_proc; |
struct proc *p = l->l_proc; |
caddr_t sg = stackgap_init(p, 0); |
caddr_t sg = stackgap_init(p, 0); |
|
|
CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); |
CHECK_ALT_EXIST(l, &sg, SCARG(uap, path)); |
|
|
return compat_43_sys_truncate(l, uap, retval); |
return compat_43_sys_truncate(l, uap, retval); |
} |
} |