linux_stats.c (89306) | linux_stats.c (89319) |
---|---|
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 --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 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 * | 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 --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 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 * $FreeBSD: head/sys/compat/linux/linux_stats.c 89306 2002-01-13 11:58:06Z alfred $ | 28 * $FreeBSD: head/sys/compat/linux/linux_stats.c 89319 2002-01-14 00:13:45Z alfred $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/conf.h> 33#include <sys/dirent.h> 34#include <sys/file.h> 35#include <sys/filedesc.h> 36#include <sys/proc.h> --- 118 unchanged lines hidden (view full) --- 155 struct stat buf; 156 int error; 157 158#ifdef DEBUG 159 if (ldebug(newfstat)) 160 printf(ARGS(newfstat, "%d, *"), args->fd); 161#endif 162 | 29 */ 30 31#include <sys/param.h> 32#include <sys/conf.h> 33#include <sys/dirent.h> 34#include <sys/file.h> 35#include <sys/filedesc.h> 36#include <sys/proc.h> --- 118 unchanged lines hidden (view full) --- 155 struct stat buf; 156 int error; 157 158#ifdef DEBUG 159 if (ldebug(newfstat)) 160 printf(ARGS(newfstat, "%d, *"), args->fd); 161#endif 162 |
163 fp = ffind_hold(td, args->fd); 164 if (fp == NULL) 165 return (EBADF); | 163 if ((error = fget(td, args->fd, &fp)) != 0) 164 return (error); |
166 167 error = fo_stat(fp, &buf, td); 168 fdrop(fp, td); 169 if (!error) 170 error = newstat_copyout(&buf, args->buf); 171 172 return (error); 173} --- 307 unchanged lines hidden --- | 165 166 error = fo_stat(fp, &buf, td); 167 fdrop(fp, td); 168 if (!error) 169 error = newstat_copyout(&buf, args->buf); 170 171 return (error); 172} --- 307 unchanged lines hidden --- |