In my comprehension the open and the close system call seem very much related.
- both deal with files
- available in most all unix flavours (?any unix that does not feature them existed?)
I therefore expected to find them declared both in the
/usr/include/unistd.h header file. However -strangely- there is only "close", but no "open" declared there (on my 4.17 linux kernel system)?
The omission of the open system call in
unistd.h seems confirmed reading the The Open Group Base Specifications Issue 7, 2018 edition
which tells in paragraph "Declarations"
The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.
int access(const char *, int);
int chdir(const char *);
int chown(const char *,> uid_t, gid_t);
[... some more declarations, but no "open"]
Then -stangely to me again - the file
/usr/include/asm/unistd_64.h contains the line
#define __NR_open 2
as if unistd.h still cared somewhat about "opening of files"?