Deleted Added
full compact
file.h (247602) file.h (254356)
1/*-
2 * Copyright (c) 1982, 1986, 1989, 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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)file.h 8.3 (Berkeley) 1/9/95
1/*-
2 * Copyright (c) 1982, 1986, 1989, 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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)file.h 8.3 (Berkeley) 1/9/95
30 * $FreeBSD: head/sys/sys/file.h 247602 2013-03-02 00:53:12Z pjd $
30 * $FreeBSD: head/sys/sys/file.h 254356 2013-08-15 07:54:31Z glebius $
31 */
32
33#ifndef _SYS_FILE_H_
34#define _SYS_FILE_H_
35
36#ifndef _KERNEL
37#include <sys/types.h> /* XXX */
38#include <sys/fcntl.h>

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

100typedef int fo_kqfilter_t(struct file *fp, struct knote *kn);
101typedef int fo_stat_t(struct file *fp, struct stat *sb,
102 struct ucred *active_cred, struct thread *td);
103typedef int fo_close_t(struct file *fp, struct thread *td);
104typedef int fo_chmod_t(struct file *fp, mode_t mode,
105 struct ucred *active_cred, struct thread *td);
106typedef int fo_chown_t(struct file *fp, uid_t uid, gid_t gid,
107 struct ucred *active_cred, struct thread *td);
31 */
32
33#ifndef _SYS_FILE_H_
34#define _SYS_FILE_H_
35
36#ifndef _KERNEL
37#include <sys/types.h> /* XXX */
38#include <sys/fcntl.h>

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

100typedef int fo_kqfilter_t(struct file *fp, struct knote *kn);
101typedef int fo_stat_t(struct file *fp, struct stat *sb,
102 struct ucred *active_cred, struct thread *td);
103typedef int fo_close_t(struct file *fp, struct thread *td);
104typedef int fo_chmod_t(struct file *fp, mode_t mode,
105 struct ucred *active_cred, struct thread *td);
106typedef int fo_chown_t(struct file *fp, uid_t uid, gid_t gid,
107 struct ucred *active_cred, struct thread *td);
108typedef int fo_sendfile_t(struct file *fp, int sockfd, struct uio *hdr_uio,
109 struct uio *trl_uio, off_t offset, size_t nbytes,
110 off_t *sent, int flags, int kflags, struct thread *td);
108typedef int fo_flags_t;
109
110struct fileops {
111 fo_rdwr_t *fo_read;
112 fo_rdwr_t *fo_write;
113 fo_truncate_t *fo_truncate;
114 fo_ioctl_t *fo_ioctl;
115 fo_poll_t *fo_poll;
116 fo_kqfilter_t *fo_kqfilter;
117 fo_stat_t *fo_stat;
118 fo_close_t *fo_close;
119 fo_chmod_t *fo_chmod;
120 fo_chown_t *fo_chown;
111typedef int fo_flags_t;
112
113struct fileops {
114 fo_rdwr_t *fo_read;
115 fo_rdwr_t *fo_write;
116 fo_truncate_t *fo_truncate;
117 fo_ioctl_t *fo_ioctl;
118 fo_poll_t *fo_poll;
119 fo_kqfilter_t *fo_kqfilter;
120 fo_stat_t *fo_stat;
121 fo_close_t *fo_close;
122 fo_chmod_t *fo_chmod;
123 fo_chown_t *fo_chown;
124 fo_sendfile_t *fo_sendfile;
121 fo_flags_t fo_flags; /* DFLAG_* below */
122};
123
124#define DFLAG_PASSABLE 0x01 /* may be passed via unix sockets. */
125#define DFLAG_SEEKABLE 0x02 /* seekable / nonsequential */
126#endif /* _KERNEL */
127
128#if defined(_KERNEL) || defined(_WANT_FILE)

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

230fo_ioctl_t soo_ioctl;
231fo_poll_t soo_poll;
232fo_kqfilter_t soo_kqfilter;
233fo_stat_t soo_stat;
234fo_close_t soo_close;
235
236fo_chmod_t invfo_chmod;
237fo_chown_t invfo_chown;
125 fo_flags_t fo_flags; /* DFLAG_* below */
126};
127
128#define DFLAG_PASSABLE 0x01 /* may be passed via unix sockets. */
129#define DFLAG_SEEKABLE 0x02 /* seekable / nonsequential */
130#endif /* _KERNEL */
131
132#if defined(_KERNEL) || defined(_WANT_FILE)

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

234fo_ioctl_t soo_ioctl;
235fo_poll_t soo_poll;
236fo_kqfilter_t soo_kqfilter;
237fo_stat_t soo_stat;
238fo_close_t soo_close;
239
240fo_chmod_t invfo_chmod;
241fo_chown_t invfo_chown;
242fo_sendfile_t invfo_sendfile;
238
239void finit(struct file *, u_int, short, void *, struct fileops *);
240int fgetvp(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp);
241int fgetvp_exec(struct thread *td, int fd, cap_rights_t rights,
242 struct vnode **vpp);
243int fgetvp_rights(struct thread *td, int fd, cap_rights_t need,
244 struct filecaps *havecaps, struct vnode **vpp);
245int fgetvp_read(struct thread *td, int fd, cap_rights_t rights,

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

268static __inline fo_truncate_t fo_truncate;
269static __inline fo_ioctl_t fo_ioctl;
270static __inline fo_poll_t fo_poll;
271static __inline fo_kqfilter_t fo_kqfilter;
272static __inline fo_stat_t fo_stat;
273static __inline fo_close_t fo_close;
274static __inline fo_chmod_t fo_chmod;
275static __inline fo_chown_t fo_chown;
243
244void finit(struct file *, u_int, short, void *, struct fileops *);
245int fgetvp(struct thread *td, int fd, cap_rights_t rights, struct vnode **vpp);
246int fgetvp_exec(struct thread *td, int fd, cap_rights_t rights,
247 struct vnode **vpp);
248int fgetvp_rights(struct thread *td, int fd, cap_rights_t need,
249 struct filecaps *havecaps, struct vnode **vpp);
250int fgetvp_read(struct thread *td, int fd, cap_rights_t rights,

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

273static __inline fo_truncate_t fo_truncate;
274static __inline fo_ioctl_t fo_ioctl;
275static __inline fo_poll_t fo_poll;
276static __inline fo_kqfilter_t fo_kqfilter;
277static __inline fo_stat_t fo_stat;
278static __inline fo_close_t fo_close;
279static __inline fo_chmod_t fo_chmod;
280static __inline fo_chown_t fo_chown;
281static __inline fo_sendfile_t fo_sendfile;
276
277static __inline int
278fo_read(struct file *fp, struct uio *uio, struct ucred *active_cred,
279 int flags, struct thread *td)
280{
281
282 return ((*fp->f_ops->fo_read)(fp, uio, active_cred, flags, td));
283}

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

347static __inline int
348fo_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred,
349 struct thread *td)
350{
351
352 return ((*fp->f_ops->fo_chown)(fp, uid, gid, active_cred, td));
353}
354
282
283static __inline int
284fo_read(struct file *fp, struct uio *uio, struct ucred *active_cred,
285 int flags, struct thread *td)
286{
287
288 return ((*fp->f_ops->fo_read)(fp, uio, active_cred, flags, td));
289}

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

353static __inline int
354fo_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred,
355 struct thread *td)
356{
357
358 return ((*fp->f_ops->fo_chown)(fp, uid, gid, active_cred, td));
359}
360
361static __inline int
362fo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio,
363 struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags,
364 int kflags, struct thread *td)
365{
366
367 return ((*fp->f_ops->fo_sendfile)(fp, sockfd, hdr_uio, trl_uio, offset,
368 nbytes, sent, flags, kflags, td));
369}
370
355#endif /* _KERNEL */
356
357#endif /* !SYS_FILE_H */
371#endif /* _KERNEL */
372
373#endif /* !SYS_FILE_H */