[net.bugs.4bsd] 4.2BSD <fcntl.h> does not define O_CREAT, and other O_.* constants

arnold@gatech.CSNET (Arnold Robbins) (07/24/85)

Subject: 4.2 BSD <fcntl.h> is incomplete

Index: /usr/include/fcntl.h, /usr/include/sys/file.h

Description:
	(This has probably been reported before, and I just haven't
	seen it....)

	4.2 has the System III/V extended open(2) system call, but
	the include file <fcntl.h> is incomplete.  In order to fully use
	the new open, you have to include <sys/file.h>.  The System V
	open defines all of O_RDONLY, O_WRONLY, O_RDWR, O_NDELAY, O_APPEND,
	O_CREAT, O_TRUNC, and O_EXCL, and 4.2 does have these, but
	in <sys/file.h>. The file <fcntl.h> only defines the first 5.
	This is an unnecessary portability stumbling block.

Repeat-by:
	Try to port a System V program which includes <fcntl.h> and uses
	open (file, O_RDWR|O_CREAT, 0666), and watch it die.

Fix:
	Add the necessary definitions to <fcntl.h> from <sys/file.h>, or
	better yet, change the contents of <fcntl.h> to be
	#include <sys/file.h>, or make it a symbolic link to <sys/file.h>.
-- 
Arnold Robbins
CSNET:	arnold@gatech	ARPA:	arnold%gatech.csnet@csnet-relay.arpa
UUCP:	{ akgua, allegra, hplabs, ihnp4, seismo, ut-sally }!gatech!arnold

Hello. You have reached the Coalition to Eliminate Answering Machines.
Unfortunately, no one can come to the phone right now....