Wed Oct 26 23:39:11 2022 UTC ()
sys/filedesc.h: New home for extern cwdi0.


(riastradh)
diff -r1.23 -r1.24 src/sys/dev/firmload.c
diff -r1.97 -r1.98 src/sys/kern/vfs_mount.c
diff -r1.93 -r1.94 src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -r1.69 -r1.70 src/sys/sys/filedesc.h

cvs diff -r1.23 -r1.24 src/sys/dev/firmload.c (expand / switch to unified diff)

--- src/sys/dev/firmload.c 2021/06/29 22:40:53 1.23
+++ src/sys/dev/firmload.c 2022/10/26 23:39:10 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: firmload.c,v 1.23 2021/06/29 22:40:53 dholland Exp $ */ 1/* $NetBSD: firmload.c,v 1.24 2022/10/26 23:39:10 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc. 4 * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.23 2021/06/29 22:40:53 dholland Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.24 2022/10/26 23:39:10 riastradh Exp $");
34 34
35/* 35/*
36 * The firmload API provides an interface for device drivers to access 36 * The firmload API provides an interface for device drivers to access
37 * firmware images that must be loaded onto their devices. 37 * firmware images that must be loaded onto their devices.
38 */ 38 */
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/fcntl.h> 41#include <sys/fcntl.h>
42#include <sys/filedesc.h> 42#include <sys/filedesc.h>
43#include <sys/kmem.h> 43#include <sys/kmem.h>
44#include <sys/namei.h> 44#include <sys/namei.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/sysctl.h> 46#include <sys/sysctl.h>
@@ -199,27 +199,26 @@ firmware_path_first(const char *drvname, @@ -199,27 +199,26 @@ firmware_path_first(const char *drvname,
199 * firmware_open: 199 * firmware_open:
200 * 200 *
201 * Open a firmware image and return its handle. 201 * Open a firmware image and return its handle.
202 */ 202 */
203int 203int
204firmware_open(const char *drvname, const char *imgname, firmware_handle_t *fhp) 204firmware_open(const char *drvname, const char *imgname, firmware_handle_t *fhp)
205{ 205{
206 struct pathbuf *pb; 206 struct pathbuf *pb;
207 struct vattr va; 207 struct vattr va;
208 char *pnbuf, *path, *prefix; 208 char *pnbuf, *path, *prefix;
209 firmware_handle_t fh; 209 firmware_handle_t fh;
210 struct vnode *vp; 210 struct vnode *vp;
211 int error; 211 int error;
212 extern struct cwdinfo cwdi0; 
213 212
214 if (drvname == NULL || imgname == NULL) 213 if (drvname == NULL || imgname == NULL)
215 return (EINVAL); 214 return (EINVAL);
216 215
217 if (cwdi0.cwdi_cdir == NULL) { 216 if (cwdi0.cwdi_cdir == NULL) {
218 printf("firmware_open(%s/%s) called too early.\n", 217 printf("firmware_open(%s/%s) called too early.\n",
219 drvname, imgname); 218 drvname, imgname);
220 return ENOENT; 219 return ENOENT;
221 } 220 }
222 221
223 pnbuf = PNBUF_GET(); 222 pnbuf = PNBUF_GET();
224 KASSERT(pnbuf != NULL); 223 KASSERT(pnbuf != NULL);
225 224

cvs diff -r1.97 -r1.98 src/sys/kern/vfs_mount.c (expand / switch to unified diff)

--- src/sys/kern/vfs_mount.c 2022/09/13 09:35:31 1.97
+++ src/sys/kern/vfs_mount.c 2022/10/26 23:39:10 1.98
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_mount.c,v 1.97 2022/09/13 09:35:31 riastradh Exp $ */ 1/* $NetBSD: vfs_mount.c,v 1.98 2022/10/26 23:39:10 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997-2020 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center, by Charles M. Hannum, and by Andrew Doran. 9 * NASA Ames Research Center, by Charles M. Hannum, and by Andrew Doran.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -57,27 +57,27 @@ @@ -57,27 +57,27 @@
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE. 64 * SUCH DAMAGE.
65 * 65 *
66 * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 66 * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
67 */ 67 */
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.97 2022/09/13 09:35:31 riastradh Exp $"); 70__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.98 2022/10/26 23:39:10 riastradh Exp $");
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/kernel.h> 73#include <sys/kernel.h>
74 74
75#include <sys/atomic.h> 75#include <sys/atomic.h>
76#include <sys/buf.h> 76#include <sys/buf.h>
77#include <sys/conf.h> 77#include <sys/conf.h>
78#include <sys/fcntl.h> 78#include <sys/fcntl.h>
79#include <sys/filedesc.h> 79#include <sys/filedesc.h>
80#include <sys/device.h> 80#include <sys/device.h>
81#include <sys/kauth.h> 81#include <sys/kauth.h>
82#include <sys/kmem.h> 82#include <sys/kmem.h>
83#include <sys/module.h> 83#include <sys/module.h>
@@ -1263,27 +1263,26 @@ vfs_mountroot(void) @@ -1263,27 +1263,26 @@ vfs_mountroot(void)
1263 error = EFTYPE; 1263 error = EFTYPE;
1264 } 1264 }
1265 1265
1266done: 1266done:
1267 if (error && device_class(root_device) == DV_DISK) { 1267 if (error && device_class(root_device) == DV_DISK) {
1268 vn_lock(rootvp, LK_EXCLUSIVE | LK_RETRY); 1268 vn_lock(rootvp, LK_EXCLUSIVE | LK_RETRY);
1269 VOP_CLOSE(rootvp, FREAD, FSCRED); 1269 VOP_CLOSE(rootvp, FREAD, FSCRED);
1270 VOP_UNLOCK(rootvp); 1270 VOP_UNLOCK(rootvp);
1271 vrele(rootvp); 1271 vrele(rootvp);
1272 } 1272 }
1273 if (error == 0) { 1273 if (error == 0) {
1274 mount_iterator_t *iter; 1274 mount_iterator_t *iter;
1275 struct mount *mp; 1275 struct mount *mp;
1276 extern struct cwdinfo cwdi0; 
1277 1276
1278 mountlist_iterator_init(&iter); 1277 mountlist_iterator_init(&iter);
1279 mp = mountlist_iterator_next(iter); 1278 mp = mountlist_iterator_next(iter);
1280 KASSERT(mp != NULL); 1279 KASSERT(mp != NULL);
1281 mountlist_iterator_destroy(iter); 1280 mountlist_iterator_destroy(iter);
1282 1281
1283 mp->mnt_flag |= MNT_ROOTFS; 1282 mp->mnt_flag |= MNT_ROOTFS;
1284 mp->mnt_op->vfs_refcount++; 1283 mp->mnt_op->vfs_refcount++;
1285 1284
1286 /* 1285 /*
1287 * Get the vnode for '/'. Set cwdi0.cwdi_cdir to 1286 * Get the vnode for '/'. Set cwdi0.cwdi_cdir to
1288 * reference it, and donate it the reference grabbed 1287 * reference it, and donate it the reference grabbed
1289 * with VFS_ROOT(). 1288 * with VFS_ROOT().

cvs diff -r1.93 -r1.94 src/sys/rump/librump/rumpvfs/rump_vfs.c (expand / switch to unified diff)

--- src/sys/rump/librump/rumpvfs/rump_vfs.c 2020/04/25 15:42:15 1.93
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c 2022/10/26 23:39:10 1.94
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rump_vfs.c,v 1.93 2020/04/25 15:42:15 bouyer Exp $ */ 1/* $NetBSD: rump_vfs.c,v 1.94 2022/10/26 23:39:10 riastradh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by the 6 * Development of this software was supported by the
7 * Finnish Cultural Foundation. 7 * Finnish Cultural Foundation.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
19 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.93 2020/04/25 15:42:15 bouyer Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.94 2022/10/26 23:39:10 riastradh Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/buf.h> 35#include <sys/buf.h>
36#include <sys/conf.h> 36#include <sys/conf.h>
37#include <sys/evcnt.h> 37#include <sys/evcnt.h>
38#include <sys/fcntl.h> 38#include <sys/fcntl.h>
39#include <sys/filedesc.h> 39#include <sys/filedesc.h>
40#include <sys/fstrans.h> 40#include <sys/fstrans.h>
41#include <sys/lockf.h> 41#include <sys/lockf.h>
42#include <sys/kthread.h> 42#include <sys/kthread.h>
43#include <sys/module.h> 43#include <sys/module.h>
44#include <sys/namei.h> 44#include <sys/namei.h>
45#include <sys/queue.h> 45#include <sys/queue.h>
@@ -47,27 +47,26 @@ __KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v @@ -47,27 +47,26 @@ __KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v
47#include <sys/vfs_syscalls.h> 47#include <sys/vfs_syscalls.h>
48#include <sys/vnode.h> 48#include <sys/vnode.h>
49#include <sys/wapbl.h> 49#include <sys/wapbl.h>
50#include <sys/bufq.h> 50#include <sys/bufq.h>
51 51
52#include <miscfs/specfs/specdev.h> 52#include <miscfs/specfs/specdev.h>
53 53
54#include <rump-sys/kern.h> 54#include <rump-sys/kern.h>
55#include <rump-sys/vfs.h> 55#include <rump-sys/vfs.h>
56 56
57#include <rump/rump.h> 57#include <rump/rump.h>
58#include <rump/rumpuser.h> 58#include <rump/rumpuser.h>
59 59
60extern struct cwdinfo cwdi0; 
61const char *rootfstype = ROOT_FSTYPE_ANY; 60const char *rootfstype = ROOT_FSTYPE_ANY;
62 61
63static void 62static void
64pvfs_init(struct proc *p) 63pvfs_init(struct proc *p)
65{ 64{
66 65
67 p->p_cwdi = cwdinit(); 66 p->p_cwdi = cwdinit();
68} 67}
69 68
70static void 69static void
71pvfs_rele(struct proc *p) 70pvfs_rele(struct proc *p)
72{ 71{
73 72

cvs diff -r1.69 -r1.70 src/sys/sys/filedesc.h (expand / switch to unified diff)

--- src/sys/sys/filedesc.h 2021/06/29 22:40:53 1.69
+++ src/sys/sys/filedesc.h 2022/10/26 23:39:10 1.70
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: filedesc.h,v 1.69 2021/06/29 22:40:53 dholland Exp $ */ 1/* $NetBSD: filedesc.h,v 1.70 2022/10/26 23:39:10 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -177,26 +177,28 @@ typedef struct cwdinfo { @@ -177,26 +177,28 @@ typedef struct cwdinfo {
177 u_int cwdi_cmask; /* a: mask for file creation */ 177 u_int cwdi_cmask; /* a: mask for file creation */
178 u_int cwdi_refcnt; /* a: reference count */ 178 u_int cwdi_refcnt; /* a: reference count */
179 179
180 krwlock_t cwdi_lock /* :: lock on struct */ 180 krwlock_t cwdi_lock /* :: lock on struct */
181 __aligned(COHERENCY_UNIT); /* -> gets own cache line */ 181 __aligned(COHERENCY_UNIT); /* -> gets own cache line */
182} cwdinfo_t; 182} cwdinfo_t;
183 183
184#ifdef _KERNEL 184#ifdef _KERNEL
185 185
186struct fileops; 186struct fileops;
187struct socket; 187struct socket;
188struct proc; 188struct proc;
189 189
 190extern struct cwdinfo cwdi0;
 191
190/* 192/*
191 * Kernel global variables and routines. 193 * Kernel global variables and routines.
192 */ 194 */
193void fd_sys_init(void); 195void fd_sys_init(void);
194int fd_open(const char*, int, int, int*); 196int fd_open(const char*, int, int, int*);
195int fd_dupopen(int, bool, int, int *); 197int fd_dupopen(int, bool, int, int *);
196int fd_alloc(struct proc *, int, int *); 198int fd_alloc(struct proc *, int, int *);
197void fd_tryexpand(struct proc *); 199void fd_tryexpand(struct proc *);
198int fd_allocfile(file_t **, int *); 200int fd_allocfile(file_t **, int *);
199void fd_affix(struct proc *, file_t *, unsigned); 201void fd_affix(struct proc *, file_t *, unsigned);
200void fd_abort(struct proc *, file_t *, unsigned); 202void fd_abort(struct proc *, file_t *, unsigned);
201filedesc_t *fd_copy(void); 203filedesc_t *fd_copy(void);
202filedesc_t *fd_init(filedesc_t *); 204filedesc_t *fd_init(filedesc_t *);