filedesc.h (96122) | filedesc.h (100072) |
---|---|
1/* 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)filedesc.h 8.1 (Berkeley) 6/2/93 | 1/* 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)filedesc.h 8.1 (Berkeley) 6/2/93 |
34 * $FreeBSD: head/sys/sys/filedesc.h 96122 2002-05-06 19:31:28Z alfred $ | 34 * $FreeBSD: head/sys/sys/filedesc.h 100072 2002-07-15 13:08:44Z markm $ |
35 */ 36 37#ifndef _SYS_FILEDESC_H_ 38#define _SYS_FILEDESC_H_ 39 40#include <sys/_lock.h> 41#include <sys/_mutex.h> 42#include <sys/queue.h> --- 114 unchanged lines hidden (view full) --- 157pid_t fgetown(struct sigio *sigio); 158int fsetown(pid_t pgid, struct sigio **sigiop); 159void funsetown(struct sigio **sigiop); 160void funsetownlst(struct sigiolst *sigiolst); 161int getvnode(struct filedesc *fdp, int fd, struct file **fpp); 162void setugidsafety(struct thread *td); 163 164static __inline struct file * | 35 */ 36 37#ifndef _SYS_FILEDESC_H_ 38#define _SYS_FILEDESC_H_ 39 40#include <sys/_lock.h> 41#include <sys/_mutex.h> 42#include <sys/queue.h> --- 114 unchanged lines hidden (view full) --- 157pid_t fgetown(struct sigio *sigio); 158int fsetown(pid_t pgid, struct sigio **sigiop); 159void funsetown(struct sigio **sigiop); 160void funsetownlst(struct sigiolst *sigiolst); 161int getvnode(struct filedesc *fdp, int fd, struct file **fpp); 162void setugidsafety(struct thread *td); 163 164static __inline struct file * |
165fget_locked(fdp, fd) 166 struct filedesc *fdp; 167 int fd; | 165fget_locked(struct filedesc *fdp, int fd) |
168{ 169 170 /* u_int cast checks for negative descriptors. */ | 166{ 167 168 /* u_int cast checks for negative descriptors. */ |
171 return ((u_int)fd >= fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]); | 169 return ((u_int)fd >= (u_int)fdp->fd_nfiles ? NULL : fdp->fd_ofiles[fd]); |
172} 173 174#endif /* _KERNEL */ 175 176#endif /* !_SYS_FILEDESC_H_ */ | 170} 171 172#endif /* _KERNEL */ 173 174#endif /* !_SYS_FILEDESC_H_ */ |