diff options
| author | Mateusz Guzik <mjg@FreeBSD.org> | 2014-09-26 19:48:47 +0000 |
|---|---|---|
| committer | Mateusz Guzik <mjg@FreeBSD.org> | 2014-09-26 19:48:47 +0000 |
| commit | 0c4a09a37879f35343a80165a07e512f2f0b3941 (patch) | |
| tree | 2e041508933af66a1fb9b65c95d7cf1af6c52c45 /sys | |
| parent | db25c97a1a7cc0c65be3f74d4902b6aeb17f0890 (diff) | |
Make do_dup() static and move relevant macros to kern_descrip.c
No functional changes.
Notes
svn path=/head/; revision=272185
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/kern_descrip.c | 9 | ||||
| -rw-r--r-- | sys/sys/filedesc.h | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 333faf246316..c48378c1fecd 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -101,6 +101,8 @@ static uma_zone_t file_zone; static int closefp(struct filedesc *fdp, int fd, struct file *fp, struct thread *td, int holdleaders); +static int do_dup(struct thread *td, int flags, int old, int new, + register_t *retval); static int fd_first_free(struct filedesc *fdp, int low, int size); static int fd_last_used(struct filedesc *fdp, int size); static void fdgrowtable(struct filedesc *fdp, int nfd); @@ -109,6 +111,11 @@ static void fdunused(struct filedesc *fdp, int fd); static void fdused(struct filedesc *fdp, int fd); static int getmaxfd(struct proc *p); +/* Flags for do_dup() */ +#define DUP_FIXED 0x1 /* Force fixed allocation. */ +#define DUP_FCNTL 0x2 /* fcntl()-style errors. */ +#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ + /* * Each process has: * @@ -785,7 +792,7 @@ getmaxfd(struct proc *p) /* * Common code for dup, dup2, fcntl(F_DUPFD) and fcntl(F_DUP2FD). */ -int +static int do_dup(struct thread *td, int flags, int old, int new, register_t *retval) { diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index d407cd20f44b..9d2366202100 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -109,11 +109,6 @@ struct filedesc_to_leader { #ifdef _KERNEL -/* Flags for do_dup() */ -#define DUP_FIXED 0x1 /* Force fixed allocation. */ -#define DUP_FCNTL 0x2 /* fcntl()-style errors. */ -#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ - /* Lock a file descriptor table. */ #define FILEDESC_LOCK_INIT(fdp) sx_init(&(fdp)->fd_sx, "filedesc structure") #define FILEDESC_LOCK_DESTROY(fdp) sx_destroy(&(fdp)->fd_sx) @@ -137,8 +132,6 @@ void filecaps_move(struct filecaps *src, struct filecaps *dst); void filecaps_free(struct filecaps *fcaps); int closef(struct file *fp, struct thread *td); -int do_dup(struct thread *td, int flags, int old, int new, - register_t *retval); int dupfdopen(struct thread *td, struct filedesc *fdp, int dfd, int mode, int openerror, int *indxp); int falloc(struct thread *td, struct file **resultfp, int *resultfd, |
