linux_stats.c (133716) | linux_stats.c (133816) |
---|---|
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_stats.c 133716 2004-08-14 08:38:17Z phk $"); | 30__FBSDID("$FreeBSD: head/sys/compat/linux/linux_stats.c 133816 2004-08-16 07:28:16Z tjr $"); |
31 32#include "opt_mac.h" 33 34#include <sys/param.h> 35#include <sys/conf.h> 36#include <sys/dirent.h> 37#include <sys/file.h> 38#include <sys/filedesc.h> 39#include <sys/proc.h> 40#include <sys/mac.h> 41#include <sys/malloc.h> 42#include <sys/mount.h> 43#include <sys/namei.h> 44#include <sys/stat.h> 45#include <sys/systm.h> 46#include <sys/vnode.h> 47 | 31 32#include "opt_mac.h" 33 34#include <sys/param.h> 35#include <sys/conf.h> 36#include <sys/dirent.h> 37#include <sys/file.h> 38#include <sys/filedesc.h> 39#include <sys/proc.h> 40#include <sys/mac.h> 41#include <sys/malloc.h> 42#include <sys/mount.h> 43#include <sys/namei.h> 44#include <sys/stat.h> 45#include <sys/systm.h> 46#include <sys/vnode.h> 47 |
48#include "opt_compat.h" 49 50#if !COMPAT_LINUX32 |
|
48#include <machine/../linux/linux.h> 49#include <machine/../linux/linux_proto.h> | 51#include <machine/../linux/linux.h> 52#include <machine/../linux/linux_proto.h> |
53#else 54#include <machine/../linux32/linux.h> 55#include <machine/../linux32/linux32_proto.h> 56#endif |
|
50 51#include <compat/linux/linux_util.h> 52 53static int 54newstat_copyout(struct stat *buf, void *ubuf) 55{ 56 struct l_newstat tbuf; 57 struct cdevsw *cdevsw; --- 329 unchanged lines hidden (view full) --- 387 388 lu.f_tfree = stat->f_bfree; 389 lu.f_tinode = stat->f_ffree; 390 } 391 392 return (copyout(&lu, args->ubuf, sizeof(lu))); 393} 394 | 57 58#include <compat/linux/linux_util.h> 59 60static int 61newstat_copyout(struct stat *buf, void *ubuf) 62{ 63 struct l_newstat tbuf; 64 struct cdevsw *cdevsw; --- 329 unchanged lines hidden (view full) --- 394 395 lu.f_tfree = stat->f_bfree; 396 lu.f_tinode = stat->f_ffree; 397 } 398 399 return (copyout(&lu, args->ubuf, sizeof(lu))); 400} 401 |
395#if defined(__i386__) | 402#if defined(__i386__) || (defined(__amd64__) && COMPAT_LINUX32) |
396 397static int 398stat64_copyout(struct stat *buf, void *ubuf) 399{ 400 struct l_stat64 lbuf; 401 struct cdevsw *cdevsw; 402 struct cdev *dev; 403 --- 122 unchanged lines hidden (view full) --- 526 527 error = fo_stat(fp, &buf, td->td_ucred, td); 528 if (!error) 529 error = stat64_copyout(&buf, args->statbuf); 530 531 return (error); 532} 533 | 403 404static int 405stat64_copyout(struct stat *buf, void *ubuf) 406{ 407 struct l_stat64 lbuf; 408 struct cdevsw *cdevsw; 409 struct cdev *dev; 410 --- 122 unchanged lines hidden (view full) --- 533 534 error = fo_stat(fp, &buf, td->td_ucred, td); 535 if (!error) 536 error = stat64_copyout(&buf, args->statbuf); 537 538 return (error); 539} 540 |
534#endif /* __i386__ */ | 541#endif /* __i386__ || __amd64__ */ |