summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/sys/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/sys/file.h')
-rw-r--r--freebsd/sys/sys/file.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/freebsd/sys/sys/file.h b/freebsd/sys/sys/file.h
index 18274d67..2adbd0af 100644
--- a/freebsd/sys/sys/file.h
+++ b/freebsd/sys/sys/file.h
@@ -413,6 +413,13 @@ rtems_bsd_fdrop(struct file *fp)
rtems_libio_iop_drop(&fp->f_io);
}
+/*
+ * WARNING: fdalloc() and falloc_caps() do not increment the reference count of
+ * the file descriptor in contrast to FreeBSD. We must not call the fdrop()
+ * corresponding to a fdalloc() or falloc_caps(). The reason for this is that
+ * FreeBSD performs a lazy cleanup once the reference count reaches zero.
+ * RTEMS uses the reference count to determine if a cleanup is allowed.
+ */
#define fdrop(fp, td) rtems_bsd_fdrop(fp)
#endif /* __rtems__ */