hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/fdtable.h
....@@ -22,6 +22,7 @@
2222 * as this is the granularity returned by copy_fdset().
2323 */
2424 #define NR_OPEN_DEFAULT BITS_PER_LONG
25
+#define NR_OPEN_MAX ~0U
2526
2627 struct fdtable {
2728 unsigned int max_fds;
....@@ -109,7 +110,7 @@
109110 void put_files_struct(struct files_struct *fs);
110111 void reset_files_struct(struct files_struct *);
111112 int unshare_files(struct files_struct **);
112
-struct files_struct *dup_fd(struct files_struct *, int *) __latent_entropy;
113
+struct files_struct *dup_fd(struct files_struct *, unsigned, int *) __latent_entropy;
113114 void do_close_on_exec(struct files_struct *);
114115 int iterate_fd(struct files_struct *, unsigned,
115116 int (*)(const void *, struct file *, unsigned),
....@@ -121,6 +122,10 @@
121122 unsigned int fd, struct file *file);
122123 extern int __close_fd(struct files_struct *files,
123124 unsigned int fd);
125
+extern int __close_range(unsigned int fd, unsigned int max_fd, unsigned int flags);
126
+extern int close_fd_get_file(unsigned int fd, struct file **res);
127
+extern int unshare_fd(unsigned long unshare_flags, unsigned int max_fds,
128
+ struct files_struct **new_fdp);
124129
125130 extern struct kmem_cache *files_cachep;
126131