From owner-freebsd-questions Thu Aug 30 19:50:23 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.viasoft.com.cn (unknown [61.153.1.177]) by hub.freebsd.org (Postfix) with ESMTP id 9C19437B403 for ; Thu, 30 Aug 2001 19:50:13 -0700 (PDT) (envelope-from davidx@viasoft.com.cn) Received: from davidwnt ([192.168.1.98]) by mail.viasoft.com.cn (8.9.3/8.9.3) with SMTP id KAA06416 for ; Fri, 31 Aug 2001 10:52:17 +0800 Message-ID: <007f01c131c7$20b2db90$6201a8c0@davidwnt> From: "David Xu" To: Subject: F_DUPFD close-on-exec flag and Posix compatible Date: Fri, 31 Aug 2001 10:46:22 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_007C_01C1320A.2C9D90B0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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
Hi,
 
  I have found our fcntl manual says = :
 
  F_DUPFD    Return a new = descriptor=20 as follows:
 
          &nbs= p;        =20 o   Lowest numbered available descriptor greater than=20 or
           &= nbsp;           =20 equal to=20 arg.
           = ;        =20 o   Same object references as the original=20 descriptor.
         &nbs= p;         =20 o   New descriptor shares the same file offset if=20 the
           =              = object was a=20 file.
          &nbs= p;        =20 o   Same access mode (read, write or=20 read/write).
         &nb= sp;         =20 o   Same file status flags (i.e., both file=20 descriptors
         &nbs= p;            = ; =20 share the same file status=20 flags).
          &n= bsp;        =20 o   The close-on-exec flag associated with the new=20 file
           = ;            = =20 descriptor is set to remain open across execve(2)=20 sys-
           = ;            = =20 tem calls.
 
it seems close-on-exec flag is not compatible with = Posix=20 standard, Posix says
the close-on-exec flag for new descriptor is=20 clear.
 
--
David Xu
 
------=_NextPart_000_007C_01C1320A.2C9D90B0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message