Deleted Added
full compact
linux_file.c (225617) linux_file.c (227691)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_file.c 225617 2011-09-16 13:58:51Z kmacy $");
30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_file.c 227691 2011-11-19 06:35:15Z ed $");
31
32#include "opt_compat.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/capability.h>
37#include <sys/conf.h>
38#include <sys/dirent.h>

--- 521 unchanged lines hidden (view full) ---

560
561int
562linux_access(struct thread *td, struct linux_access_args *args)
563{
564 char *path;
565 int error;
566
567 /* linux convention */
31
32#include "opt_compat.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/capability.h>
37#include <sys/conf.h>
38#include <sys/dirent.h>

--- 521 unchanged lines hidden (view full) ---

560
561int
562linux_access(struct thread *td, struct linux_access_args *args)
563{
564 char *path;
565 int error;
566
567 /* linux convention */
568 if (args->flags & ~(F_OK | X_OK | W_OK | R_OK))
568 if (args->amode & ~(F_OK | X_OK | W_OK | R_OK))
569 return (EINVAL);
570
571 LCONVPATHEXIST(td, args->path, &path);
572
573#ifdef DEBUG
574 if (ldebug(access))
569 return (EINVAL);
570
571 LCONVPATHEXIST(td, args->path, &path);
572
573#ifdef DEBUG
574 if (ldebug(access))
575 printf(ARGS(access, "%s, %d"), path, args->flags);
575 printf(ARGS(access, "%s, %d"), path, args->amode);
576#endif
576#endif
577 error = kern_access(td, path, UIO_SYSSPACE, args->flags);
577 error = kern_access(td, path, UIO_SYSSPACE, args->amode);
578 LFREEPATH(path);
579
580 return (error);
581}
582
583int
584linux_faccessat(struct thread *td, struct linux_faccessat_args *args)
585{
586 char *path;
587 int error, dfd;
588
589 /* linux convention */
578 LFREEPATH(path);
579
580 return (error);
581}
582
583int
584linux_faccessat(struct thread *td, struct linux_faccessat_args *args)
585{
586 char *path;
587 int error, dfd;
588
589 /* linux convention */
590 if (args->mode & ~(F_OK | X_OK | W_OK | R_OK))
590 if (args->amode & ~(F_OK | X_OK | W_OK | R_OK))
591 return (EINVAL);
592
593 dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
594 LCONVPATHEXIST_AT(td, args->filename, &path, dfd);
595
596#ifdef DEBUG
597 if (ldebug(access))
591 return (EINVAL);
592
593 dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
594 LCONVPATHEXIST_AT(td, args->filename, &path, dfd);
595
596#ifdef DEBUG
597 if (ldebug(access))
598 printf(ARGS(access, "%s, %d"), path, args->mode);
598 printf(ARGS(access, "%s, %d"), path, args->amode);
599#endif
600
601 error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0 /* XXX */,
599#endif
600
601 error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0 /* XXX */,
602 args->mode);
602 args->amode);
603 LFREEPATH(path);
604
605 return (error);
606}
607
608int
609linux_unlink(struct thread *td, struct linux_unlink_args *args)
610{

--- 922 unchanged lines hidden ---
603 LFREEPATH(path);
604
605 return (error);
606}
607
608int
609linux_unlink(struct thread *td, struct linux_unlink_args *args)
610{

--- 922 unchanged lines hidden ---