Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Sep 96 10:38:59 EST
From:      M C Wong <mcw@hpato.aus.hp.com>
To:        questions@freebsd.org
Subject:   conditionally optional parameter in C function declartion
Message-ID:  <199609030039.AA027771143@hpcsos.col.hp.com>

next in thread | raw e-mail | index | archive | help
Hi,
    Maybe I am being paranoia, but different systems have
different declaration for open(2):

eg on HPUX:
#include <fcntl.h>

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 ?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609030039.AA027771143>