[libbsd 15/22] Use define for maxfiles and maxfilesperproc

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jun 24 06:33:43 UTC 2022


Update #4475.
---
 freebsd/sys/sys/file.h                                | 5 +++++
 rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h | 2 --
 rtemsbsd/rtems/rtems-kernel-init.c                    | 4 ----
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/freebsd/sys/sys/file.h b/freebsd/sys/sys/file.h
index 68c33299..14300cd8 100644
--- a/freebsd/sys/sys/file.h
+++ b/freebsd/sys/sys/file.h
@@ -243,8 +243,13 @@ struct xfile {
 extern struct fileops vnops;
 extern struct fileops badfileops;
 extern struct fileops socketops;
+#ifndef __rtems__
 extern int maxfiles;		/* kernel limit on number of open files */
 extern int maxfilesperproc;	/* per process limit on number of open files */
+#else /* __rtems__ */
+#define	maxfiles rtems_libio_number_iops
+#define	maxfilesperproc rtems_libio_number_iops
+#endif /* __rtems__ */
 extern volatile int openfiles;	/* actual number of open files */
 
 #ifndef __rtems__
diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
index 6f28fea4..9a7b0c09 100644
--- a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
+++ b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
@@ -3476,8 +3476,6 @@
 #define	mallocarray _bsd_mallocarray
 #define	maxbcache _bsd_maxbcache
 #define	maxbcachebuf _bsd_maxbcachebuf
-#define	maxfiles _bsd_maxfiles
-#define	maxfilesperproc _bsd_maxfilesperproc
 #define	maxpipekva _bsd_maxpipekva
 #define	maxproc _bsd_maxproc
 #define	maxvfsconf _bsd_maxvfsconf
diff --git a/rtemsbsd/rtems/rtems-kernel-init.c b/rtemsbsd/rtems/rtems-kernel-init.c
index 454943b3..305010b1 100644
--- a/rtemsbsd/rtems/rtems-kernel-init.c
+++ b/rtemsbsd/rtems/rtems-kernel-init.c
@@ -107,8 +107,6 @@ struct bintime tc_tick_bt;
 sbintime_t tc_tick_sbt;
 int tc_precexp;
 int maxproc;
-int maxfiles;
-int maxfilesperproc;
 int ngroups_max;
 int unmapped_buf_allowed;
 caddr_t unmapped_base;
@@ -213,8 +211,6 @@ rtems_bsd_initialize(void)
 	bio_transient_maxcnt = 1024;
 	sx_init(&allproc_lock, "allproc");
 
-	maxfiles = rtems_libio_number_iops;
-	maxfilesperproc = maxfiles;
 	maxproc = 16;
 	ngroups_max = 4;
 
-- 
2.35.3



More information about the devel mailing list