PERFORCE change 122468 for review
Roman Divacky
rdivacky at FreeBSD.org
Thu Jun 28 10:40:38 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=122468
Change 122468 by rdivacky at rdivacky_witten on 2007/06/28 10:40:19
Change names/positions of params to match the POSIX.
Suggested by: rwatson
Affected files ...
.. //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_file.c#15 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_misc.c#5 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_stats.c#9 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/init_sysent.c#7 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/syscalls.c#7 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/syscalls.master#7 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/systrace_args.c#7 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#34 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/sys/syscall.h#7 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/sys/syscall.mk#7 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/sys/syscallsubr.h#15 edit
.. //depot/projects/soc2007/rdivacky/linux_at/sys/sys/sysproto.h#7 edit
Differences ...
==== //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_file.c#15 (text+ko) ====
@@ -89,7 +89,7 @@
static int
-linux_common_open(struct thread *td, char *path, int l_flags, int mode, int dirfd)
+linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, int mode)
{
struct proc *p = td->td_proc;
struct file *fp;
@@ -132,7 +132,7 @@
/* XXX LINUX_O_NOATIME: unable to be easily implemented. */
if (dirfd != -1)
- error = kern_openat(td, path, UIO_SYSSPACE, bsd_flags, mode, dirfd);
+ error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode);
else
error = kern_open(td, path, UIO_SYSSPACE, bsd_flags, mode);
if (!error) {
@@ -202,7 +202,7 @@
path, args->flags, args->mode);
#endif
- return linux_common_open(td, path, args->flags, args->mode, dfd);
+ return linux_common_open(td, dfd, path, args->flags, args->mode);
}
int
@@ -221,7 +221,7 @@
path, args->flags, args->mode);
#endif
- return linux_common_open(td, path, args->flags, args->mode, -1);
+ return linux_common_open(td, -1, path, args->flags, args->mode);
}
int
@@ -592,7 +592,7 @@
printf(ARGS(access, "%s, %d"), path, args->mode);
#endif
- error = kern_accessat(td, path, UIO_SYSSPACE, args->mode, dfd);
+ error = kern_accessat(td, dfd, path, UIO_SYSSPACE, args->mode);
LFREEPATH(path);
return (error);
@@ -645,12 +645,12 @@
#endif
if (args->flag & LINUX_AT_REMOVEDIR)
- error = kern_rmdirat(td, path, UIO_SYSSPACE, dfd);
+ error = kern_rmdirat(td, dfd, path, UIO_SYSSPACE);
else
- error = kern_unlinkat(td, path, UIO_SYSSPACE, dfd);
+ error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE);
if (error == EPERM)
/* Introduce POSIX noncompliant behaviour of Linux */
- if (kern_statat(td, path, UIO_SYSSPACE, &st, dfd) == 0)
+ if (kern_statat(td, dfd, path, UIO_SYSSPACE, &st) == 0)
if (S_ISDIR(st.st_mode))
error = EISDIR;
LFREEPATH(path);
@@ -708,7 +708,7 @@
printf(ARGS(fchmodat, "%s, %d"), path, args->mode);
#endif
- error = kern_chmodat(td, path, UIO_SYSSPACE, args->mode, dfd);
+ error = kern_chmodat(td, dfd, path, UIO_SYSSPACE, args->mode);
LFREEPATH(path);
return (error);
}
@@ -747,7 +747,7 @@
if (ldebug(mkdirat))
printf(ARGS(mkdirat, "%s, %d"), path, args->mode);
#endif
- error = kern_mkdirat(td, path, UIO_SYSSPACE, args->mode, dfd);
+ error = kern_mkdirat(td, dfd, path, UIO_SYSSPACE, args->mode);
LFREEPATH(path);
return (error);
}
@@ -821,7 +821,7 @@
if (ldebug(renameat))
printf(ARGS(renameat, "%s, %s"), from, to);
#endif
- error = kern_renameat(td, from, to, UIO_SYSSPACE, olddfd, newdfd);
+ error = kern_renameat(td, olddfd, newdfd, from, to, UIO_SYSSPACE);
LFREEPATH(from);
LFREEPATH(to);
return (error);
@@ -875,7 +875,7 @@
printf(ARGS(symlinkat, "%s, %s"), path, to);
#endif
- error = kern_symlinkat(td, path, to, UIO_SYSSPACE, dfd);
+ error = kern_symlinkat(td, dfd, path, to, UIO_SYSSPACE);
LFREEPATH(path);
LFREEPATH(to);
return (error);
@@ -919,8 +919,8 @@
args->bufsiz);
#endif
- error = kern_readlinkat(td, name, UIO_SYSSPACE, args->buf, UIO_USERSPACE,
- args->bufsiz, dfd);
+ error = kern_readlinkat(td, dfd, name, UIO_SYSSPACE, args->buf,
+ UIO_USERSPACE, args->bufsiz);
LFREEPATH(name);
return (error);
}
@@ -1018,7 +1018,7 @@
args->newdfd, to, args->flags);
#endif
- error = kern_linkat(td, path, to, UIO_SYSSPACE, olddfd, newdfd, FOLLOW);
+ error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, FOLLOW);
LFREEPATH(path);
LFREEPATH(to);
return (error);
@@ -1511,9 +1511,9 @@
#endif
if (args->flag & LINUX_AT_SYMLINK_NOFOLLOW)
- error = kern_lchownat(td, path, UIO_SYSSPACE, args->uid, args->gid, dfd);
+ error = kern_lchownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid);
else
- error = kern_chownat(td, path, UIO_SYSSPACE, args->uid, args->gid, dfd);
+ error = kern_chownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid);
LFREEPATH(path);
return (error);
}
==== //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_misc.c#5 (text+ko) ====
@@ -854,7 +854,7 @@
tvp = tv;
}
- error = kern_utimesat(td, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE, dfd);
+ error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE, tvp, UIO_SYSSPACE);
LFREEPATH(fname);
return (error);
}
==== //depot/projects/soc2007/rdivacky/linux_at/sys/compat/linux/linux_stats.c#9 (text+ko) ====
@@ -144,7 +144,7 @@
if (!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode))
return;
temp = td->td_retval[0];
- if (kern_openat(td, path, UIO_SYSSPACE, O_RDONLY, 0, dfd) != 0)
+ if (kern_openat(td, dfd, path, UIO_SYSSPACE, O_RDONLY, 0) != 0)
return;
fd = td->td_retval[0];
td->td_retval[0] = temp;
@@ -621,9 +621,9 @@
#endif
if (args->flag & LINUX_AT_SYMLINK_NOFOLLOW)
- error = kern_lstatat(td, path, UIO_SYSSPACE, &buf, dfd);
+ error = kern_lstatat(td, dfd, path, UIO_SYSSPACE, &buf);
else
- error = kern_statat(td, path, UIO_SYSSPACE, &buf, dfd);
+ error = kern_statat(td, dfd, path, UIO_SYSSPACE, &buf);
translate_path_major_minor_at(td, args->pathname, &buf, dfd);
if (!error)
==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/init_sysent.c#7 (text+ko) ====
==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/syscalls.c#7 (text+ko) ====
==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/syscalls.master#7 (text+ko) ====
@@ -835,9 +835,9 @@
474 AUE_NULL STD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \
struct sockaddr * from, __socklen_t *fromlenaddr, \
struct sctp_sndrcvinfo *sinfo, int *msg_flags); }
-475 AUE_ACCESS STD { int faccessat(int dirfd, const char *path, int mode, int flag); }
-476 AUE_CHMOD STD { int fchmodat(int dirfd, const char *path, mode_t mode, int flag); }
-477 AUE_CHOWN STD { int fchownat(int dirfd, const char *path, uid_t uid, gid_t gid, int flag); }
+475 AUE_ACCESS STD { int faccessat(int fd, const char *path, int mode, int flag); }
+476 AUE_CHMOD STD { int fchmodat(int fd, const char *path, mode_t mode, int flag); }
+477 AUE_CHOWN STD { int fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); }
478 AUE_EXECVE STD { int fexecve(int fd, char **argv, char **envv); }
479 AUE_STAT STD { int fstatat(int fd, const char *path, struct stat *buf, int flag); }
480 AUE_UTIMES STD { int futimesat(int fd, const char *path, const struct timeval *times); }
==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/systrace_args.c#7 (text+ko) ====
@@ -2808,7 +2808,7 @@
/* faccessat */
case 475: {
struct faccessat_args *p = params;
- iarg[0] = p->dirfd; /* int */
+ iarg[0] = p->fd; /* int */
uarg[1] = (intptr_t) p->path; /* const char * */
iarg[2] = p->mode; /* int */
iarg[3] = p->flag; /* int */
@@ -2818,7 +2818,7 @@
/* fchmodat */
case 476: {
struct fchmodat_args *p = params;
- iarg[0] = p->dirfd; /* int */
+ iarg[0] = p->fd; /* int */
uarg[1] = (intptr_t) p->path; /* const char * */
iarg[2] = p->mode; /* mode_t */
iarg[3] = p->flag; /* int */
@@ -2828,7 +2828,7 @@
/* fchownat */
case 477: {
struct fchownat_args *p = params;
- iarg[0] = p->dirfd; /* int */
+ iarg[0] = p->fd; /* int */
uarg[1] = (intptr_t) p->path; /* const char * */
uarg[2] = p->uid; /* uid_t */
iarg[3] = p->gid; /* gid_t */
==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#34 (text+ko) ====
@@ -966,15 +966,15 @@
int
openat(struct thread *td, struct openat_args *args)
{
- return kern_openat(td, args->path, UIO_USERSPACE, args->flag,
- args->mode, args->fd);
+ return kern_openat(td, args->fd, args->path, UIO_USERSPACE,
+ args->flag, args->mode);
}
int
kern_open(struct thread *td, char *path, enum uio_seg pathseg, int flags,
int mode)
{
- return kern_openat(td, (const char *)path, pathseg, flags, mode, AT_FDCWD);
+ return kern_openat(td, AT_FDCWD, (const char *)path, pathseg, flags, mode);
}
static int
@@ -1017,8 +1017,8 @@
}
int
-kern_openat(struct thread *td, const char *path, enum uio_seg pathseg, int flags,
- int mode, int dirfd)
+kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ int flags, int mode)
{
struct nameidata nd;
struct vnode *dir_vn;
@@ -1038,7 +1038,7 @@
AUDIT_ARG(mode, mode);
/* XXX: audit dirfd */
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -1225,20 +1225,20 @@
int
mknodat(struct thread *td, struct mknodat_args *args)
{
- return kern_mknodat(td, args->path, UIO_USERSPACE, args->mode,
- args->dev, args->fd);
+ return kern_mknodat(td, args->fd, args->path, UIO_USERSPACE, args->mode,
+ args->dev);
}
int
kern_mknod(struct thread *td, char *path, enum uio_seg pathseg, int mode,
int dev)
{
- return kern_mknodat(td, (const char *)path, pathseg, mode, dev, AT_FDCWD);
+ return kern_mknodat(td, AT_FDCWD, (const char *)path, pathseg, mode, dev);
}
int
-kern_mknodat(struct thread *td, const char *path, enum uio_seg pathseg, int mode,
- int dev, int dirfd)
+kern_mknodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ int mode, int dev)
{
struct vnode *vp, *dir_vn = NULL;
struct mount *mp;
@@ -1270,7 +1270,7 @@
restart:
if (dir_vn)
vrele(dir_vn);
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
bwillwrite();
@@ -1387,18 +1387,18 @@
int
mkfifoat(struct thread *td, struct mkfifoat_args *args)
{
- return kern_mkfifoat(td, args->path, UIO_USERSPACE, args->mode, args->fd);
+ return kern_mkfifoat(td, args->fd, args->path, UIO_USERSPACE, args->mode);
}
int
kern_mkfifo(struct thread *td, char *path, enum uio_seg pathseg, int mode)
{
- return kern_mkfifoat(td, (const char *)path, pathseg, mode, AT_FDCWD);
+ return kern_mkfifoat(td, AT_FDCWD, (const char *)path, pathseg, mode);
}
int
-kern_mkfifoat(struct thread *td, const char *path, enum uio_seg pathseg, int mode,
- int dirfd)
+kern_mkfifoat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ int mode)
{
struct mount *mp;
struct vattr vattr;
@@ -1411,7 +1411,7 @@
restart:
if (dir_vn)
vrele(dir_vn);
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
bwillwrite();
@@ -1512,11 +1512,11 @@
return (EINVAL);
if (args->flag & AT_SYMLINK_FOLLOW)
- return kern_linkat(td, args->path1, args->path2,
- UIO_USERSPACE, args->fd1, args->fd2, FOLLOW);
+ return kern_linkat(td, args->fd1, args->fd2, args->path1,
+ args->path2, UIO_USERSPACE, FOLLOW);
else
- return kern_linkat(td, args->path1, args->path2,
- UIO_USERSPACE, args->fd1, args->fd2, 0);
+ return kern_linkat(td, args->fd1, args->fd2, args->path1,
+ args->path2, UIO_USERSPACE, 0);
}
static int hardlink_check_uid = 0;
@@ -1561,13 +1561,13 @@
int
kern_link(struct thread *td, char *path, char *link, enum uio_seg segflg)
{
- return kern_linkat(td, (const char *)path, (const char *)link,
- segflg, AT_FDCWD, AT_FDCWD, FOLLOW);
+ return kern_linkat(td, AT_FDCWD, AT_FDCWD, (const char *)path,
+ (const char *)link, segflg, FOLLOW);
}
int
-kern_linkat(struct thread *td, const char *path, const char *link,
- enum uio_seg segflg, int olddirfd, int newdirfd, int follow)
+kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, const char *path2,
+ enum uio_seg segflg, int follow)
{
struct nameidata ndp, ndl;
int error;
@@ -1577,19 +1577,19 @@
int vfslocked;
int lvfslocked;
- error = kern_get_at(td, olddirfd, &pdir_vn);
- if (error && !kern_absolute_path(path, segflg))
+ error = kern_get_at(td, fd1, &pdir_vn);
+ if (error && !kern_absolute_path(path1, segflg))
return (error);
NDINIT_AT(&ndp, LOOKUP, ((error) ? ATBADF : 0) | follow | MPSAFE |
- AUDITVNODE1, segflg, path, td, pdir_vn);
+ AUDITVNODE1, segflg, path1, td, pdir_vn);
- error = kern_get_at(td, newdirfd, &ldir_vn);
- if (error && !kern_absolute_path(link, segflg))
+ error = kern_get_at(td, fd2, &ldir_vn);
+ if (error && !kern_absolute_path(path2, segflg))
return (error);
NDINIT_AT(&ndl, CREATE, ((error) ? ATBADF : 0) | LOCKPARENT |
- SAVENAME | MPSAFE | AUDITVNODE1, segflg, link, td, ldir_vn);
+ SAVENAME | MPSAFE | AUDITVNODE1, segflg, path2, td, ldir_vn);
bwillwrite();
if ((error = namei(&ndp)) != 0)
@@ -1678,19 +1678,19 @@
int
symlinkat(struct thread *td, struct symlinkat_args *args)
{
- return kern_symlinkat(td, args->path1, args->path2, UIO_USERSPACE, args->fd);
+ return kern_symlinkat(td, args->path1, args->fd, args->path2, UIO_USERSPACE);
}
int
kern_symlink(struct thread *td, char *path, char *link, enum uio_seg segflg)
{
- return kern_symlinkat(td, (const char *)path, (const char *)link,
- segflg, AT_FDCWD);
+ return kern_symlinkat(td, (const char *)path, AT_FDCWD, (const char *)link,
+ segflg);
}
int
-kern_symlinkat(struct thread *td, const char *path, const char *link,
- enum uio_seg segflg, int dirfd)
+kern_symlinkat(struct thread *td, const char *path1, int fd, const char *path2,
+ enum uio_seg segflg)
{
struct mount *mp;
struct vattr vattr;
@@ -1701,22 +1701,22 @@
struct vnode *dir_vn = NULL;
if (segflg == UIO_SYSSPACE) {
- syspath = __DECONST(char *, path);
+ syspath = __DECONST(char *, path1);
} else {
syspath = uma_zalloc(namei_zone, M_WAITOK);
- if ((error = copyinstr(path, syspath, MAXPATHLEN, NULL)) != 0)
+ if ((error = copyinstr(path1, syspath, MAXPATHLEN, NULL)) != 0)
goto out;
}
AUDIT_ARG(text, syspath);
restart:
if (dir_vn)
vrele(dir_vn);
- error = kern_get_at(td, dirfd, &dir_vn);
- if (error && !kern_absolute_path(link, segflg))
+ error = kern_get_at(td, fd, &dir_vn);
+ if (error && !kern_absolute_path(path2, segflg))
return (error);
bwillwrite();
NDINIT_AT(&nd, CREATE, ((error) ? ATBADF : 0) | LOCKPARENT |
- SAVENAME | MPSAFE | AUDITVNODE1, segflg, link, td, dir_vn);
+ SAVENAME | MPSAFE | AUDITVNODE1, segflg, path2, td, dir_vn);
if ((error = namei(&nd)) != 0)
goto out;
vfslocked = NDHASGIANT(&nd);
@@ -1856,19 +1856,19 @@
return (EINVAL);
if (args->flag & AT_REMOVEDIR)
- return kern_rmdirat(td, args->path, UIO_USERSPACE, args->fd);
+ return kern_rmdirat(td, args->fd, args->path, UIO_USERSPACE);
else
- return kern_unlinkat(td, args->path, UIO_USERSPACE, args->fd);
+ return kern_unlinkat(td, args->fd, args->path, UIO_USERSPACE);
}
int
kern_unlink(struct thread *td, char *path, enum uio_seg pathseg)
{
- return kern_unlinkat(td, (const char *)path, pathseg, AT_FDCWD);
+ return kern_unlinkat(td, AT_FDCWD, (const char *)path, pathseg);
}
int
-kern_unlinkat(struct thread *td, const char *path, enum uio_seg pathseg, int dirfd)
+kern_unlinkat(struct thread *td, int fd, const char *path, enum uio_seg pathseg)
{
struct mount *mp;
struct vnode *vp, *dir_vn = NULL;
@@ -1879,7 +1879,7 @@
restart:
if (dir_vn)
vrele(dir_vn);
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
bwillwrite();
@@ -2134,18 +2134,18 @@
if (args->flag & ~AT_EACCESS)
return (EINVAL);
/* XXX: what about mode? */
- return kern_accessat(td, args->path, UIO_USERSPACE, args->flag, args->dirfd);
+ return kern_accessat(td, args->fd, args->path, UIO_USERSPACE, args->flag);
}
int
kern_access(struct thread *td, char *path, enum uio_seg pathseg, int flags)
{
- return kern_accessat(td, (const char *)path, pathseg, flags, AT_FDCWD);
+ return kern_accessat(td, AT_FDCWD, (const char *)path, pathseg, flags);
}
int
-kern_accessat(struct thread *td, const char *path, enum uio_seg pathseg,
- int flags, int dirfd)
+kern_accessat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ int flags)
{
int error;
struct nameidata nd;
@@ -2154,7 +2154,7 @@
struct vnode *vp;
int vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -2365,27 +2365,27 @@
return (EINVAL);
if (args->flag & AT_SYMLINK_NOFOLLOW)
- return kern_lstatat(td, args->path, UIO_USERSPACE, args->buf, args->fd);
+ return kern_lstatat(td, args->fd, args->path, UIO_USERSPACE, args->buf);
else
- return kern_statat(td, args->path, UIO_USERSPACE, args->buf, args->fd);
+ return kern_statat(td, args->fd, args->path, UIO_USERSPACE, args->buf);
}
int
kern_stat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp)
{
- return kern_statat(td, (const char *)path, pathseg, sbp, AT_FDCWD);
+ return kern_statat(td, AT_FDCWD, (const char *)path, pathseg, sbp);
}
int
-kern_statat(struct thread *td, const char *path, enum uio_seg pathseg,
- struct stat *sbp, int dirfd)
+kern_statat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ struct stat *sbp)
{
struct nameidata nd;
struct vnode *dir_vn;
struct stat sb;
int error, vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -2442,12 +2442,12 @@
int
kern_lstat(struct thread *td, char *path, enum uio_seg pathseg, struct stat *sbp)
{
- return kern_lstatat(td, (const char *)path, pathseg, sbp, AT_FDCWD);
+ return kern_lstatat(td, AT_FDCWD, (const char *)path, pathseg, sbp);
}
int
-kern_lstatat(struct thread *td, const char *path, enum uio_seg pathseg,
- struct stat *sbp, int dirfd)
+kern_lstatat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ struct stat *sbp)
{
struct nameidata nd;
struct vnode *dir_vn;
@@ -2455,7 +2455,7 @@
struct stat sb;
int error, vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -2640,21 +2640,21 @@
ssize_t
readlinkat(struct thread *td, struct readlinkat_args *args)
{
- return kern_readlinkat(td, args->path, UIO_USERSPACE,
- args->buf, UIO_USERSPACE, args->bufsize, args->fd);
+ return kern_readlinkat(td, args->fd, args->path, UIO_USERSPACE,
+ args->buf, UIO_USERSPACE, args->bufsize);
}
int
kern_readlink(struct thread *td, char *path, enum uio_seg pathseg, char *buf,
enum uio_seg bufseg, int count)
{
- return kern_readlinkat(td, (const char *)path, pathseg, buf, bufseg,
- count, AT_FDCWD);
+ return kern_readlinkat(td, AT_FDCWD, (const char *)path, pathseg, buf,
+ bufseg, count);
}
int
-kern_readlinkat(struct thread *td, const char *path, enum uio_seg pathseg,
- char *buf, enum uio_seg bufseg, int count, int dirfd)
+kern_readlinkat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ char *buf, enum uio_seg bufseg, int count)
{
struct nameidata nd;
struct vnode *dir_vn;
@@ -2663,7 +2663,7 @@
struct uio auio;
int error, vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -2912,28 +2912,28 @@
return (EINVAL);
if (args->flag & AT_SYMLINK_NOFOLLOW)
- return kern_lchmodat(td, args->path, UIO_USERSPACE,
- args->mode, args->dirfd);
+ return kern_lchmodat(td, args->fd, args->path, UIO_USERSPACE,
+ args->mode);
else
- return kern_chmodat(td, args->path, UIO_USERSPACE,
- args->mode, args->dirfd);
+ return kern_chmodat(td, args->fd, args->path, UIO_USERSPACE,
+ args->mode);
}
int
kern_chmod(struct thread *td, char *path, enum uio_seg pathseg, int mode)
{
- return kern_chmodat(td, (const char *)path, pathseg, mode, AT_FDCWD);
+ return kern_chmodat(td, AT_FDCWD, (const char *)path, pathseg, mode);
}
int
-kern_chmodat(struct thread *td, const char *path, enum uio_seg pathseg,
- mode_t mode, int dirfd)
+kern_chmodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ mode_t mode)
{
struct nameidata nd;
struct vnode *dir_vn;
int error, vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -2970,20 +2970,20 @@
int mode;
} */ *uap;
{
- return kern_lchmodat(td, uap->path, UIO_USERSPACE, uap->mode, AT_FDCWD);
+ return kern_lchmodat(td, AT_FDCWD, uap->path, UIO_USERSPACE, uap->mode);
}
int
-kern_lchmodat(struct thread *td, const char *path, enum uio_seg pathseg,
- mode_t mode, int dirfd)
+kern_lchmodat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ mode_t mode)
{
int error;
struct nameidata nd;
int vfslocked;
struct vnode *dir_vn;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -3101,29 +3101,29 @@
return (EINVAL);
if (args->flag & AT_SYMLINK_NOFOLLOW)
- return kern_lchownat(td, args->path, UIO_USERSPACE, args->uid,
- args->gid, args->dirfd);
+ return kern_lchownat(td, args->fd, args->path, UIO_USERSPACE,
+ args->uid, args->gid);
else
- return kern_chownat(td, args->path, UIO_USERSPACE, args->uid,
- args->gid, args->dirfd);
+ return kern_chownat(td, args->fd, args->path, UIO_USERSPACE,
+ args->uid, args->gid);
}
int
kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid,
int gid)
{
- return kern_chownat(td, (const char *)path, pathseg, uid, gid, AT_FDCWD);
+ return kern_chownat(td, AT_FDCWD, (const char *)path, pathseg, uid, gid);
}
int
-kern_chownat(struct thread *td, const char *path, enum uio_seg pathseg, int uid,
- int gid, int dirfd)
+kern_chownat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ int uid, int gid)
{
struct nameidata nd;
struct vnode *dir_vn;
int error, vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -3170,18 +3170,18 @@
kern_lchown(struct thread *td, char *path, enum uio_seg pathseg, int uid,
int gid)
{
- return kern_lchownat(td, (const char *)path, pathseg, uid, gid, AT_FDCWD);
+ return kern_lchownat(td, AT_FDCWD, (const char *)path, pathseg, uid, gid);
}
int
-kern_lchownat(struct thread *td, const char *path, enum uio_seg pathseg, int uid,
- int gid, int dirfd)
+kern_lchownat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ int uid, int gid)
{
struct nameidata nd;
struct vnode *dir_vn;
int error, vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -3345,27 +3345,28 @@
int
futimesat(struct thread *td, struct futimesat_args *args)
{
- return kern_utimesat(td, args->path, UIO_USERSPACE, args->times, UIO_USERSPACE, args->fd);
+ return kern_utimesat(td, args->fd, args->path, UIO_USERSPACE,
+ args->times, UIO_USERSPACE);
}
int
kern_utimes(struct thread *td, char *path, enum uio_seg pathseg,
struct timeval *tptr, enum uio_seg tptrseg)
{
- return kern_utimesat(td, (const char *)path, pathseg,
- (const struct timeval *)tptr, tptrseg, AT_FDCWD);
+ return kern_utimesat(td, AT_FDCWD, (const char *)path, pathseg,
+ (const struct timeval *)tptr, tptrseg);
}
int
-kern_utimesat(struct thread *td, const char *path, enum uio_seg pathseg,
- const struct timeval *tptr, enum uio_seg tptrseg, int dirfd)
+kern_utimesat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
+ const struct timeval *tptr, enum uio_seg tptrseg)
{
struct nameidata nd;
struct vnode *dir_vn;
struct timespec ts[2];
int error, vfslocked;
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
@@ -3742,20 +3743,20 @@
int
renameat(struct thread *td, struct renameat_args *args)
{
- return kern_renameat(td, args->old, args->new, UIO_USERSPACE,
- args->oldfd, args->newfd);
+ return kern_renameat(td, args->oldfd, args->old, args->newfd, args->new,
+ UIO_USERSPACE);
}
int
kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
{
- return kern_renameat(td, (const char *)from, (const char *)to, pathseg,
- AT_FDCWD, AT_FDCWD);
+ return kern_renameat(td, AT_FDCWD, (const char *)from, AT_FDCWD,
+ (const char *)to, pathseg);
}
int
-kern_renameat(struct thread *td, const char *from, const char *to,
- enum uio_seg pathseg, int fdirfd, int tdirfd)
+kern_renameat(struct thread *td, int oldfd, const char *old, int newfd,
+ const char *new, enum uio_seg pathseg)
{
struct nameidata fromnd, tond;
struct vnode *fdir_vn, *tdir_vn;
@@ -3765,23 +3766,23 @@
int fvfslocked;
int error;
- error = kern_get_at(td, fdirfd, &fdir_vn);
- if (error && !kern_absolute_path(from, pathseg))
+ error = kern_get_at(td, oldfd, &fdir_vn);
+ if (error && !kern_absolute_path(old, pathseg))
return (error);
- error = kern_get_at(td, tdirfd, &tdir_vn);
- if (error && !kern_absolute_path(to, pathseg))
+ error = kern_get_at(td, newfd, &tdir_vn);
+ if (error && !kern_absolute_path(new, pathseg))
return (error);
#ifdef MAC
NDINIT_AT(&fromnd, DELETE, ((error) ? ATBADF : 0) | LOCKPARENT |
- LOCKLEAF | SAVESTART | MPSAFE | AUDITVNODE1, pathseg, from, td, fdir_vn);
+ LOCKLEAF | SAVESTART | MPSAFE | AUDITVNODE1, pathseg, old, td, fdir_vn);
#else
NDINIT_AT(&fromnd, DELETE, ((error) ? ATBADF : 0) | WANTPARENT |
- SAVESTART | MPSAFE | AUDITVNODE1, pathseg, from, td, fdir_vn);
+ SAVESTART | MPSAFE | AUDITVNODE1, pathseg, old, td, fdir_vn);
#endif
NDINIT_AT(&tond, RENAME, ((error) ? ATBADF : 0) | LOCKPARENT |
LOCKLEAF | NOCACHE | SAVESTART | MPSAFE | AUDITVNODE2,
- pathseg, to, td, tdir_vn);
+ pathseg, new, td, tdir_vn);
bwillwrite();
if ((error = namei(&fromnd)) != 0)
@@ -3915,18 +3916,18 @@
int
mkdirat(struct thread *td, struct mkdirat_args *args)
{
- return kern_mkdirat(td, args->path, UIO_USERSPACE, args->mode, args->fd);
+ return kern_mkdirat(td, args->fd, args->path, UIO_USERSPACE, args->mode);
}
int
kern_mkdir(struct thread *td, char *path, enum uio_seg segflg, int mode)
{
- return kern_mkdirat(td, (const char *)path, segflg, mode, AT_FDCWD);
+ return kern_mkdirat(td, AT_FDCWD, (const char *)path, segflg, mode);
}
int
-kern_mkdirat(struct thread *td, const char *path, enum uio_seg segflg,
- int mode, int dirfd)
+kern_mkdirat(struct thread *td, int fd, const char *path, enum uio_seg segflg,
+ int mode)
{
struct mount *mp;
struct vnode *vp, *dir_vn = NULL;
@@ -3939,7 +3940,7 @@
restart:
if (dir_vn)
vrele(dir_vn);
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, segflg))
return (error);
bwillwrite();
@@ -4030,11 +4031,11 @@
int
kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg)
{
- return kern_rmdirat(td, (const char *)path, pathseg, AT_FDCWD);
+ return kern_rmdirat(td, AT_FDCWD, (const char *)path, pathseg);
}
int
-kern_rmdirat(struct thread *td, const char *path, enum uio_seg pathseg, int dirfd)
+kern_rmdirat(struct thread *td, int fd, const char *path, enum uio_seg pathseg)
{
struct mount *mp;
struct vnode *vp, *dir_vn = NULL;
@@ -4043,7 +4044,7 @@
int vfslocked;
restart:
- error = kern_get_at(td, dirfd, &dir_vn);
+ error = kern_get_at(td, fd, &dir_vn);
if (error && !kern_absolute_path(path, pathseg))
return (error);
bwillwrite();
==== //depot/projects/soc2007/rdivacky/linux_at/sys/sys/syscall.h#7 (text+ko) ====
==== //depot/projects/soc2007/rdivacky/linux_at/sys/sys/syscall.mk#7 (text+ko) ====
==== //depot/projects/soc2007/rdivacky/linux_at/sys/sys/syscallsubr.h#15 (text+ko) ====
@@ -56,8 +56,8 @@
socklen_t *namelen, struct file **fp);
int kern_access(struct thread *td, char *path, enum uio_seg pathseg,
int flags);
-int kern_accessat(struct thread *td, const char *path, enum uio_seg pathseg,
- int flags, int dirfd);
+int kern_accessat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, int flags);
int kern_adjtime(struct thread *td, struct timeval *delta,
struct timeval *olddelta);
int kern_alternate_path(struct thread *td, const char *prefix, const char *path,
@@ -66,14 +66,14 @@
int kern_chdir(struct thread *td, char *path, enum uio_seg pathseg);
int kern_chmod(struct thread *td, char *path, enum uio_seg pathseg,
int mode);
-int kern_chmodat(struct thread *td, const char *path, enum uio_seg pathseg,
- mode_t mode, int dirfd);
+int kern_chmodat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, mode_t mode);
int kern_chown(struct thread *td, char *path, enum uio_seg pathseg, int uid,
int gid);
-int kern_chownat(struct thread *td, const char *path, enum uio_seg pathseg, int uid,
- int gid, int dirfd);
-int kern_lchmodat(struct thread *td, const char *path, enum uio_seg pathseg,
- mode_t mode, int dirfd);
+int kern_chownat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, int uid, int gid);
+int kern_lchmodat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, mode_t mode);
int kern_clock_getres(struct thread *td, clockid_t clock_id,
struct timespec *ts);
int kern_clock_gettime(struct thread *td, clockid_t clock_id,
@@ -110,30 +110,30 @@
int kern_kldunload(struct thread *td, int fileid, int flags);
int kern_lchown(struct thread *td, char *path, enum uio_seg pathseg,
int uid, int gid);
-int kern_lchownat(struct thread *td, const char *path, enum uio_seg pathseg,
- int uid, int gid, int dirfd);
+int kern_lchownat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, int uid, int gid);
int kern_link(struct thread *td, char *path, char *link,
enum uio_seg segflg);
-int kern_linkat(struct thread *td, const char *path, const char *link,
- enum uio_seg segflg, int olddfd, int newdfd, int follow);
+int kern_linkat(struct thread *td, int fd1, int fd2, const char *path1,
+ const char *path2, enum uio_seg segflg, int follow);
int kern_lstat(struct thread *td, char *path, enum uio_seg pathseg,
struct stat *sbp);
-int kern_lstatat(struct thread *td, const char *path, enum uio_seg pathseg,
- struct stat *sbp, int dfd);
+int kern_lstatat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, struct stat *sbp);
int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg,
struct timeval *tptr, enum uio_seg tptrseg);
int kern_mkdir(struct thread *td, char *path, enum uio_seg segflg,
int mode);
-int kern_mkdirat(struct thread *td, const char *path, enum uio_seg segflg,
- int mode, int dirfd);
+int kern_mkdirat(struct thread *td, int fd, const char *path,
+ enum uio_seg segflg, int mode);
int kern_mkfifo(struct thread *td, char *path, enum uio_seg pathseg,
int mode);
-int kern_mkfifoat(struct thread *td, const char *path, enum uio_seg pathseg,
- int mode, int dirfd);
+int kern_mkfifoat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, int mode);
int kern_mknod(struct thread *td, char *path, enum uio_seg pathseg,
int mode, int dev);
-int kern_mknodat(struct thread *td, const char *path, enum uio_seg pathseg,
- int mode, int dev, int dirfd);
+int kern_mknodat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, int mode, int dev);
int kern_msgctl(struct thread *, int, int, struct msqid_ds *);
int kern_msgsnd(struct thread *, int, const void *, size_t, int, long);
int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *);
@@ -141,8 +141,8 @@
struct timespec *rmt);
int kern_open(struct thread *td, char *path, enum uio_seg pathseg,
int flags, int mode);
-int kern_openat(struct thread *td, const char *path, enum uio_seg pathseg,
- int flags, int mode, int dirfd);
+int kern_openat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, int flags, int mode);
int kern_pathconf(struct thread *td, char *path, enum uio_seg pathseg,
int name);
int kern_preadv(struct thread *td, int fd, struct uio *auio, off_t offset);
@@ -151,17 +151,17 @@
int kern_pwritev(struct thread *td, int fd, struct uio *auio, off_t offset);
int kern_readlink(struct thread *td, char *path, enum uio_seg pathseg,
char *buf, enum uio_seg bufseg, int count);
-int kern_readlinkat(struct thread *td, const char *path, enum uio_seg pathseg,
- char *buf, enum uio_seg bufseg, int count, int dirfd);
+int kern_readlinkat(struct thread *td, int fd, const char *path,
+ enum uio_seg pathseg, char *buf, enum uio_seg bufseg, int count);
int kern_readv(struct thread *td, int fd, struct uio *auio);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list