From owner-freebsd-questions Mon Sep 2 17:39:07 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA21454 for questions-outgoing; Mon, 2 Sep 1996 17:39:07 -0700 (PDT) Received: from hpcsos.col.hp.com (hpcsos.col.hp.com [15.255.240.16]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA21449 for ; Mon, 2 Sep 1996 17:39:05 -0700 (PDT) Received: from hpautobo.aus.hp.com by hpcsos.col.hp.com with ESMTP (1.37.109.16/15.5+IOS 3.14) id AA027771143; Mon, 2 Sep 1996 18:39:03 -0600 Message-Id: <199609030039.AA027771143@hpcsos.col.hp.com> Received: by hpautobo.aus.hp.com (1.37.109.16/16.2) id AA078941139; Tue, 3 Sep 1996 10:38:59 +1000 From: M C Wong Subject: conditionally optional parameter in C function declartion To: questions@freebsd.org Date: Tue, 3 Sep 96 10:38:59 EST Mailer: Elm [revision: 70.85] Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, Maybe I am being paranoia, but different systems have different declaration for open(2): eg on HPUX: #include int open( const char *path, int oflag, ... /* mode_t mode */); eg on FreeBSD: int open(const char *path, int flags, mode_t mode) Which is more POSIX than another ? Also, the use of mode depends very much of the value of oflag ie only when O_CREAT is part of the value of flags. My question is, if someone is to specify many of such functions with conditionally optional parameter, is there a better way of specifying the declaration accurately to reflect the conditional nature, and not doing in it the man page or comments ?