aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/file.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2012-07-02 21:01:03 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2012-07-02 21:01:03 +0000
commitc5c1199c83b05316971c0d32456d3383cacd9c98 (patch)
tree26c1ae1ac3dde3bf8b9b01fad04caad427a4ef48 /sys/sys/file.h
parent9f1dae79da25d27d7b6a3085d491796ed0de30b3 (diff)
downloadsrc-c5c1199c83b05316971c0d32456d3383cacd9c98.tar.gz
src-c5c1199c83b05316971c0d32456d3383cacd9c98.zip
Notes
Diffstat (limited to 'sys/sys/file.h')
-rw-r--r--sys/sys/file.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/sys/file.h b/sys/sys/file.h
index b89e5848396b..c4c6dbfc7a39 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -72,10 +72,25 @@ struct socket;
struct file;
struct ucred;
+#define FOF_OFFSET 0x01 /* Use the offset in uio argument */
+#define FOF_NOLOCK 0x02 /* Do not take FOFFSET_LOCK */
+#define FOF_NEXTOFF 0x04 /* Also update f_nextoff */
+#define FOF_NOUPDATE 0x10 /* Do not update f_offset */
+off_t foffset_lock(struct file *fp, int flags);
+void foffset_lock_uio(struct file *fp, struct uio *uio, int flags);
+void foffset_unlock(struct file *fp, off_t val, int flags);
+void foffset_unlock_uio(struct file *fp, struct uio *uio, int flags);
+
+static inline off_t
+foffset_get(struct file *fp)
+{
+
+ return (foffset_lock(fp, FOF_NOLOCK));
+}
+
typedef int fo_rdwr_t(struct file *fp, struct uio *uio,
struct ucred *active_cred, int flags,
struct thread *td);
-#define FOF_OFFSET 1 /* Use the offset in uio argument */
typedef int fo_truncate_t(struct file *fp, off_t length,
struct ucred *active_cred, struct thread *td);
typedef int fo_ioctl_t(struct file *fp, u_long com, void *data,