Date: Fri, 30 Mar 2007 07:59:48 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 116908 for review Message-ID: <200703300759.l2U7xmHf016205@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=116908 Change 116908 by rdivacky@rdivacky_witten on 2007/03/30 07:59:17 Remove fchmodat and faccessat from linux32_dummy.c and add stubs for those two functions to linux_file.c. Its beyond my imagination how it is possible that it compiles/links without it on my PC. Also some whitespace fixes Submitted by: Scot Hetzel <swhetzel@gmail.com> Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_dummy.c#12 edit .. //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#19 edit Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_dummy.c#12 (text+ko) ==== @@ -96,8 +96,6 @@ DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); DUMMY(migrate_pages); -DUMMY(fchmodat); -DUMMY(faccessat); DUMMY(pselect6); DUMMY(ppoll); DUMMY(unshare); ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#19 (text+ko) ==== @@ -83,7 +83,7 @@ int linux_at(struct thread *td, int dirfd, char *filename, char **newpath, char **freebuf) { - struct file *fp; + struct file *fp; int error = 0; struct vnode *dvp; struct filedesc *fdp = td->td_proc->p_fd; @@ -92,23 +92,23 @@ /* don't do anything if the pathname is absolute */ if (*filename == '/') { - *newpath= filename; - return (0); + *newpath= filename; + return (0); } /* check for AT_FDWCD */ if (dirfd == LINUX_AT_FDCWD) { - FILEDESC_LOCK(fdp); + FILEDESC_LOCK(fdp); dvp = fdp->fd_cdir; - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK(fdp); } else { - error = fget(td, dirfd, &fp); + error = fget(td, dirfd, &fp); if (error) - return (error); + return (error); dvp = fp->f_vnode; /* only a dir can be dfd */ if (dvp->v_type != VDIR) { - fdrop(fp, td); + fdrop(fp, td); return (ENOTDIR); } fdrop(fp, td); @@ -116,7 +116,8 @@ error = vn_fullpath(td, dvp, &fullpath, &freepath); if (!error) { - *newpath = malloc(strlen(fullpath) + strlen(filename) + 2, M_TEMP, M_WAITOK | M_ZERO); + *newpath = malloc(strlen(fullpath) + strlen(filename) + 2, + M_TEMP, M_WAITOK | M_ZERO); *freebuf = freepath; sprintf(*newpath, "%s/%s", fullpath, filename); } @@ -124,7 +125,6 @@ return (error); } - int linux_creat(struct thread *td, struct linux_creat_args *args) { @@ -237,7 +237,7 @@ int linux_openat(struct thread *td, struct linux_openat_args *args) { - char *newpath, *oldpath, *freebuf = NULL, *path; + char *newpath, *oldpath, *freebuf = NULL, *path; int error; oldpath = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); @@ -251,18 +251,18 @@ error = linux_at(td, args->dfd, oldpath, &newpath, &freebuf); if (error) - return (error); + return (error); #ifdef DEBUG printf(LMSG("newpath: %s"), newpath); #endif - if (args->flags & LINUX_O_CREAT) + if (args->flags & LINUX_O_CREAT) LCONVPATH_SEG(td, newpath, &path, 1, UIO_SYSSPACE); - else + else LCONVPATH_SEG(td, newpath, &path, 0, UIO_SYSSPACE); if (freebuf) - free(freebuf, M_TEMP); + free(freebuf, M_TEMP); if (*oldpath != '/') - free(newpath, M_TEMP); + free(newpath, M_TEMP); error = linux_common_open(td, path, args->flags, args->mode, 1); free(oldpath, M_TEMP); @@ -272,12 +272,12 @@ int linux_open(struct thread *td, struct linux_open_args *args) { - char *path; + char *path; - if (args->flags & LINUX_O_CREAT) - LCONVPATHCREAT(td, args->path, &path); - else - LCONVPATHEXIST(td, args->path, &path); + if (args->flags & LINUX_O_CREAT) + LCONVPATHCREAT(td, args->path, &path); + else + LCONVPATHEXIST(td, args->path, &path); #ifdef DEBUG if (ldebug(open)) @@ -285,7 +285,7 @@ path, args->flags, args->mode); #endif - return linux_common_open(td, path, args->flags, args->mode, 0); + return linux_common_open(td, path, args->flags, args->mode, 0); } int @@ -635,6 +635,12 @@ } int +linux_faccessat(struct thread *td, struct linux_faccessat_args *args) +{ + return (ENOSYS); +} + +int linux_unlink(struct thread *td, struct linux_unlink_args *args) { char *path; @@ -699,6 +705,12 @@ } int +linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args) +{ + return (ENOSYS); +} + +int linux_mkdir(struct thread *td, struct linux_mkdir_args *args) { char *path;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703300759.l2U7xmHf016205>