Date: Fri, 31 Aug 2001 10:46:22 +0800 From: "David Xu" <davidx@viasoft.com.cn> To: <freebsd-questions@freebsd.org> Subject: F_DUPFD close-on-exec flag and Posix compatible Message-ID: <007f01c131c7$20b2db90$6201a8c0@davidwnt>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. ------=_NextPart_000_007C_01C1320A.2C9D90B0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Hi, I have found our fcntl manual says : F_DUPFD Return a new descriptor as follows: o Lowest numbered available descriptor greater = than or equal to arg. o Same object references as the original = descriptor. o New descriptor shares the same file offset if = the object was a file. o Same access mode (read, write or read/write). o Same file status flags (i.e., both file = descriptors share the same file status flags). o The close-on-exec flag associated with the new = file descriptor is set to remain open across = execve(2) sys- tem calls. it seems close-on-exec flag is not compatible with Posix standard, Posix = says the close-on-exec flag for new descriptor is clear. -- David Xu ------=_NextPart_000_007C_01C1320A.2C9D90B0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Dgb2312" http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2>Hi,</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2> I have found our fcntl manual says = :</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2> F_DUPFD Return a new = descriptor=20 as follows:</FONT></DIV> <DIV> </DIV> <DIV><FONT=20 size=3D2> &nbs= p; =20 o Lowest numbered available descriptor greater than=20 or<BR> &= nbsp; =20 equal to=20 arg.<BR>  = ; =20 o Same object references as the original=20 descriptor.<BR> &nbs= p; =20 o New descriptor shares the same file offset if=20 the<BR> = = object was a=20 file.<BR> &nbs= p; =20 o Same access mode (read, write or=20 read/write).<BR> &nb= sp; =20 o Same file status flags (i.e., both file=20 descriptors<BR> &nbs= p;  = ; =20 share the same file status=20 flags).<BR> &n= bsp; =20 o The close-on-exec flag associated with the new=20 file<BR>  = ; = =20 descriptor is set to remain open across execve(2)=20 sys-<BR>  = ; = =20 tem calls.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>it seems close-on-exec flag is not compatible with = Posix=20 standard, Posix says</FONT></DIV> <DIV><FONT size=3D2>the close-on-exec flag for new descriptor is=20 clear.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>--</FONT></DIV> <DIV><FONT size=3D2>David Xu</FONT></DIV> <DIV> </DIV></BODY></HTML> ------=_NextPart_000_007C_01C1320A.2C9D90B0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?007f01c131c7$20b2db90$6201a8c0>