Deleted Added
full compact
kern_descrip.c (194881) kern_descrip.c (195104)
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
35 */
36
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94
35 */
36
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/sys/kern/kern_descrip.c 194881 2009-06-24 18:44:38Z lulf $");
38__FBSDID("$FreeBSD: head/sys/kern/kern_descrip.c 195104 2009-06-27 13:58:44Z rwatson $");
39
40#include "opt_compat.h"
41#include "opt_ddb.h"
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46

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

1139/* ARGSUSED */
1140int
1141closefrom(struct thread *td, struct closefrom_args *uap)
1142{
1143 struct filedesc *fdp;
1144 int fd;
1145
1146 fdp = td->td_proc->p_fd;
39
40#include "opt_compat.h"
41#include "opt_ddb.h"
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46

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

1139/* ARGSUSED */
1140int
1141closefrom(struct thread *td, struct closefrom_args *uap)
1142{
1143 struct filedesc *fdp;
1144 int fd;
1145
1146 fdp = td->td_proc->p_fd;
1147 AUDIT_ARG(fd, uap->lowfd);
1147 AUDIT_ARG_FD(uap->lowfd);
1148
1149 /*
1150 * Treat negative starting file descriptor values identical to
1151 * closefrom(0) which closes all files.
1152 */
1153 if (uap->lowfd < 0)
1154 uap->lowfd = 0;
1155 FILEDESC_SLOCK(fdp);

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

1214}
1215
1216int
1217kern_fstat(struct thread *td, int fd, struct stat *sbp)
1218{
1219 struct file *fp;
1220 int error;
1221
1148
1149 /*
1150 * Treat negative starting file descriptor values identical to
1151 * closefrom(0) which closes all files.
1152 */
1153 if (uap->lowfd < 0)
1154 uap->lowfd = 0;
1155 FILEDESC_SLOCK(fdp);

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

1214}
1215
1216int
1217kern_fstat(struct thread *td, int fd, struct stat *sbp)
1218{
1219 struct file *fp;
1220 int error;
1221
1222 AUDIT_ARG(fd, fd);
1222 AUDIT_ARG_FD(fd);
1223
1224 if ((error = fget(td, fd, &fp)) != 0)
1225 return (error);
1226
1223
1224 if ((error = fget(td, fd, &fp)) != 0)
1225 return (error);
1226
1227 AUDIT_ARG(file, td->td_proc, fp);
1227 AUDIT_ARG_FILE(td->td_proc, fp);
1228
1229 error = fo_stat(fp, sbp, td->td_ucred, td);
1230 fdrop(fp, td);
1231#ifdef KTRACE
1232 if (error == 0 && KTRPOINT(td, KTR_STRUCT))
1233 ktrstat(sbp);
1234#endif
1235 return (error);

--- 2161 unchanged lines hidden ---
1228
1229 error = fo_stat(fp, sbp, td->td_ucred, td);
1230 fdrop(fp, td);
1231#ifdef KTRACE
1232 if (error == 0 && KTRPOINT(td, KTR_STRUCT))
1233 ktrstat(sbp);
1234#endif
1235 return (error);

--- 2161 unchanged lines hidden ---