2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include "afs/param.h"
16 #include "afs/sysincludes.h"
17 #include "afsincludes.h"
18 #include <sys/namei.h>
20 #ifdef AFS_DARWIN80_ENV
22 osi_lookupname(char *aname, enum uio_seg seg, int followlink,
25 char tname[PATHBUFLEN];
28 if (seg == AFS_UIOUSER) { /* XXX 64bit */
29 AFS_COPYINSTR(aname, tname, PATHBUFLEN, code);
36 flag |= VNODE_LOOKUP_NOFOLLOW;
37 ctx=vfs_context_create(NULL);
38 code = vnode_lookup(aname, flags, vpp, ctx);
39 vfs_context_rele(ctx);
44 osi_lookupname(char *aname, enum uio_seg seg, int followlink,
55 NDINIT(&n, LOOKUP, flags, seg, aname, current_proc());
56 if (error = namei(&n))
59 /* should we do this? */
60 VOP_UNLOCK(n.ni_vp, 0, current_proc());
66 * afs_suser() returns true if the caller is superuser, false otherwise.
68 * Note that it must NOT set errno.
71 afs_suser(void *credp)
74 struct proc *p = current_proc();
79 if ((error = suser(p->p_ucred, &p->p_acflag)) == 0) {
86 #ifdef AFS_DARWIN80_ENV
87 uio_t afsio_darwin_partialcopy(uio_t auio, int size) {
93 /* XXX 64 bit userspaace? */
94 res = uio_create(uio_iovcnt(auio), uio_offset(auio),
95 uio_isuserspace(auio) ? UIO_USERSPACE32 : UIO_SYSSPACE32,
98 for (i = 0;i < uio_iovcnt(auio) && size > 0;i++) {
99 if (uio_getiov(auio, index, &iovaddr, &iovsize))
103 if (uio_addiov(res, iovaddr, iovsize))