mingw-5.1.4/win32/include/fcntl.h
author jjkang
Fri, 11 Jun 2010 15:22:19 +0800
changeset 3 d6b1fbb42aec
parent 0 76b1f169d9fe
permissions -rw-r--r--
Change SFL to EPL
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     1
/*
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     2
 * fcntl.h
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     3
 * This file has no copyright assigned and is placed in the Public Domain.
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     4
 * This file is a part of the mingw-runtime package.
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     5
 * No warranty is given; refer to the file DISCLAIMER within the package.
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     6
 *
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     7
 * Access constants for _open. Note that the permissions constants are
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     8
 * in sys/stat.h (ick).
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     9
 *
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    10
 */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    11
#ifndef _FCNTL_H_
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    12
#define _FCNTL_H_
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    13
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    14
/* All the headers include this file. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    15
#include <_mingw.h>
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    16
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    17
/*
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    18
 * It appears that fcntl.h should include io.h for compatibility...
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    19
 */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    20
#include <io.h>
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    21
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    22
/* Specifiy one of these flags to define the access mode. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    23
#define	_O_RDONLY	0
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    24
#define _O_WRONLY	1
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    25
#define _O_RDWR		2
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    26
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    27
/* Mask for access mode bits in the _open flags. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    28
#define _O_ACCMODE	(_O_RDONLY|_O_WRONLY|_O_RDWR)
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    29
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    30
#define	_O_APPEND	0x0008	/* Writes will add to the end of the file. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    31
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    32
#define	_O_RANDOM	0x0010
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    33
#define	_O_SEQUENTIAL	0x0020
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    34
#define	_O_TEMPORARY	0x0040	/* Make the file dissappear after closing.
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    35
				 * WARNING: Even if not created by _open! */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    36
#define	_O_NOINHERIT	0x0080
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    37
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    38
#define	_O_CREAT	0x0100	/* Create the file if it does not exist. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    39
#define	_O_TRUNC	0x0200	/* Truncate the file if it does exist. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    40
#define	_O_EXCL		0x0400	/* Open only if the file does not exist. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    41
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    42
#define _O_SHORT_LIVED  0x1000
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    43
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    44
/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    45
#define	_O_TEXT		0x4000	/* CR-LF in file becomes LF in memory. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    46
#define	_O_BINARY	0x8000	/* Input and output is not translated. */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    47
#define	_O_RAW		_O_BINARY
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    48
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    49
#if (__MSVCRT_VERSION__ >= 0x0800)
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    50
#define _O_WTEXT	0x10000
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    51
#define _O_U16TEXT	0x20000
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    52
#define _O_U8TEXT	0x40000
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    53
#endif
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    54
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    55
#ifndef	_NO_OLDNAMES
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    56
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    57
/* POSIX/Non-ANSI names for increased portability */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    58
#define	O_RDONLY	_O_RDONLY
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    59
#define O_WRONLY	_O_WRONLY
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    60
#define O_RDWR		_O_RDWR
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    61
#define O_ACCMODE	_O_ACCMODE
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    62
#define	O_APPEND	_O_APPEND
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    63
#define	O_CREAT		_O_CREAT
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    64
#define	O_TRUNC		_O_TRUNC
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    65
#define	O_EXCL		_O_EXCL
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    66
#define	O_TEXT		_O_TEXT
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    67
#define	O_BINARY	_O_BINARY
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    68
#define	O_TEMPORARY	_O_TEMPORARY
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    69
#define O_NOINHERIT	_O_NOINHERIT
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    70
#define O_SEQUENTIAL	_O_SEQUENTIAL
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    71
#define	O_RANDOM	_O_RANDOM
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    72
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    73
#endif	/* Not _NO_OLDNAMES */
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    74
76b1f169d9fe DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    75
#endif	/* Not _FCNTL_H_ */