#ifndef __FCNTL_H__
# define __FCNTL_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>

/* Access mode. */
#define O_RDONLY       0x0000
#define O_WRONLY       0x0001
#define O_RDWR         0x0002
/* Create file if nonexistent. */
#define O_CREAT        0x0004
/* Fail if not a directory. */
#define O_DIRECTORY    0x0008
/* Append and truncate modes. */
#define O_APPEND       0x0010
#define O_TRUNC        0x0020
/* Exclusive open requiring creation. */
#define O_EXCL         0x0040

/* Create, truncate and open a file. */
extern int creat(char const *__path, mode_t __mode);

/* Open file and return a file descriptor, -1 on error. */
extern int open(char const *__path, int __flags, ... /* mode_t __mode */);

#ifdef __cplusplus
}
#endif

#endif /*__FCNTL_H__*/