Deleted Added
full compact
linux_file.c (319573) linux_file.c (320469)
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: stable/11/sys/compat/linux/linux_file.c 319573 2017-06-04 19:56:21Z dchagin $");
30__FBSDID("$FreeBSD: stable/11/sys/compat/linux/linux_file.c 320469 2017-06-29 12:49:03Z avg $");
31
32#include "opt_compat.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/capsicum.h>
37#include <sys/conf.h>
38#include <sys/dirent.h>

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

389
390 retval += linuxreclen;
391 outp += linuxreclen;
392 resid -= linuxreclen;
393 }
394 td->td_retval[0] = retval;
395
396out:
31
32#include "opt_compat.h"
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/capsicum.h>
37#include <sys/conf.h>
38#include <sys/dirent.h>

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

389
390 retval += linuxreclen;
391 outp += linuxreclen;
392 resid -= linuxreclen;
393 }
394 td->td_retval[0] = retval;
395
396out:
397 free(lbuf, M_LINUX);
397 free(lbuf, M_TEMP);
398out1:
398out1:
399 free(buf, M_LINUX);
399 free(buf, M_TEMP);
400 return (error);
401}
402
403int
404linux_getdents64(struct thread *td, struct linux_getdents64_args *args)
405{
406 struct dirent *bdp;
407 caddr_t inp, buf; /* BSD-format */

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

517 linux_dirent->d_off = linuxreclen;
518 linux_dirent->d_reclen = bdp->d_namlen;
519 strlcpy(linux_dirent->d_name, bdp->d_name,
520 linuxreclen - offsetof(struct l_dirent, d_name));
521 error = copyout(linux_dirent, args->dent, linuxreclen);
522 if (error == 0)
523 td->td_retval[0] = linuxreclen;
524
400 return (error);
401}
402
403int
404linux_getdents64(struct thread *td, struct linux_getdents64_args *args)
405{
406 struct dirent *bdp;
407 caddr_t inp, buf; /* BSD-format */

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

517 linux_dirent->d_off = linuxreclen;
518 linux_dirent->d_reclen = bdp->d_namlen;
519 strlcpy(linux_dirent->d_name, bdp->d_name,
520 linuxreclen - offsetof(struct l_dirent, d_name));
521 error = copyout(linux_dirent, args->dent, linuxreclen);
522 if (error == 0)
523 td->td_retval[0] = linuxreclen;
524
525 free(lbuf, M_LINUX);
525 free(lbuf, M_TEMP);
526out:
526out:
527 free(buf, M_LINUX);
527 free(buf, M_TEMP);
528 return (error);
529}
530#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
531
532
533/*
534 * These exist mainly for hooks for doing /compat/linux translation.
535 */

--- 1138 unchanged lines hidden ---
528 return (error);
529}
530#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
531
532
533/*
534 * These exist mainly for hooks for doing /compat/linux translation.
535 */

--- 1138 unchanged lines hidden ---