Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: addmodulefd(..., FDT_INTERNAL or FDT_MODULE);
- X-seq: zsh-workers 41298
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: addmodulefd(..., FDT_INTERNAL or FDT_MODULE);
- Date: Wed, 14 Jun 2017 16:16:25 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=DpUeW5YM4lqxvn9Es4uz5ru8fUyXBzMXUF+7Trf2gxc=; b=Juwa2M0MNGwgYIIW79CENfubFtULzCut0kA0gZwh95QVcrsI3sc0BaIDzUw4evoq1g WrFMrPxa332yF51JgdEhs/6WafYKCgloyJAvND2Vkcs2H8/RxWmhhoSWW+ocZNtHWQfL moo7LoH9O1zwPCbI90HVp5sBvoA6OnPSUjnfSzKiPstE/cfIF29A0NgichK1zDHXAvr5 Mbe5gJ4v8j33kEZaoCDgEFU2mBPigLsKv51rDZK7+Cl71Yn5AIRppDRTH4UHok4zr/gd SOisHuIINoRYUj7vwq8afdkKVBICtZVwXB7KsZ3z/Auj4wQnZki7HampFi7U4p+0VD0G 6HKQ==
- In-reply-to: <etPan.5940c5ae.238e1f29.8fd5@MacMini>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.5940c5ae.238e1f29.8fd5@MacMini>
On Jun 14, 7:12am, Sebastian Gniazdowski wrote:
}
} I read whole 36870 topic ("Mangement of fdtable[]") and it's hard
} to get insight on FDT_INTERNAL vs. FDT_MODULE. I now follow initial
} db_gdbm.c code which used FDT_INTERNAL. Is it a good choice?
FDT_MODULE means two things:
(1) The user can't "accidentally" close the descriptor with {fd}>&-
(2) The shell will NOT close the descriptor upon exec(), so it is
left available for use by external child processes
} I think both gdbm and redis support cloned file descriptor on fork(),
} because test cases work fine - database-store in subshell works
} correctly. This also points that file descriptor isn't closed when
} using FDT_INTERNAL with addmodulefd().
Correct, FDT_INTERNAL descriptors are not closed on fork(), but if the
fork() is followed by an exec() they will be closed. You can share the
descriptor with a subshell but not with an external command.
So it's up to the module implementor to decide which behavior is the
correct one for his module.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author