epoc32/include/stdapis/sys/fcntl.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 /*-
     1 /*-
     2  * © Portions copyright (c) 2005 Nokia Corporation.  All rights reserved.
     2  * 
     3  * © Portions copyright (c) 2006-2007 Symbian Software Ltd. All rights reserved.
       
     4  * Copyright (c) 1983, 1990, 1993
     3  * Copyright (c) 1983, 1990, 1993
     5  *	The Regents of the University of California.  All rights reserved.
     4  *	The Regents of the University of California.  All rights reserved.
     6  * (c) UNIX System Laboratories, Inc.
     5  * (c) UNIX System Laboratories, Inc.
     7  * All or some portions of this file are derived from material licensed
     6  * All or some portions of this file are derived from material licensed
     8  * to the University of California by American Telephone and Telegraph
     7  * to the University of California by American Telephone and Telegraph
    30  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    31  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    33  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    34  * SUCH DAMAGE.
    33  * SUCH DAMAGE.
       
    34  * * © * Portions Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
    35  *
    35  *
    36  *	@(#)fcntl.h	8.3 (Berkeley) 1/21/94
    36  *	@(#)fcntl.h	8.3 (Berkeley) 1/21/94
    37  * $FreeBSD: src/sys/sys/fcntl.h,v 1.16 2004/04/07 04:19:49 imp Exp $
    37  * $FreeBSD: src/sys/sys/fcntl.h,v 1.16 2004/04/07 04:19:49 imp Exp $
    38  */
    38  */
    39 
    39 
    54 #define	_MODE_T_DECLARED
    54 #define	_MODE_T_DECLARED
    55 #endif
    55 #endif
    56 
    56 
    57 #ifndef _OFF_T_DECLARED
    57 #ifndef _OFF_T_DECLARED
    58 typedef	__off_t		off_t;
    58 typedef	__off_t		off_t;
       
    59 
       
    60 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
    61 typedef	__off_t		off64_t;
       
    62 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
       
    63 
    59 #define	_OFF_T_DECLARED
    64 #define	_OFF_T_DECLARED
    60 #endif
    65 #endif
    61 
    66 
    62 #ifndef _PID_T_DECLARED
    67 #ifndef _PID_T_DECLARED
    63 typedef	__pid_t		pid_t;
    68 typedef	__pid_t		pid_t;
    74 /* open-only flags */
    79 /* open-only flags */
    75 #define	O_RDONLY	0x0000		/* open for reading only */
    80 #define	O_RDONLY	0x0000		/* open for reading only */
    76 #define	O_WRONLY	0x0001		/* open for writing only */
    81 #define	O_WRONLY	0x0001		/* open for writing only */
    77 #define	O_RDWR		0x0002		/* open for reading and writing */
    82 #define	O_RDWR		0x0002		/* open for reading and writing */
    78 #define	O_ACCMODE	0x0003		/* mask for above modes */
    83 #define	O_ACCMODE	0x0003		/* mask for above modes */
       
    84 
       
    85 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
    86 #define O_LARGEFILE 0x0004
       
    87 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
    79 
    88 
    80 /*
    89 /*
    81  * Kernel encoding of open mode; separate read and write bits that are
    90  * Kernel encoding of open mode; separate read and write bits that are
    82  * independently testable: 1 greater than the above.
    91  * independently testable: 1 greater than the above.
    83  *
    92  *
   171 
   180 
   172 /*SYMBIAN Flag for tmpfile removal*/
   181 /*SYMBIAN Flag for tmpfile removal*/
   173 #ifdef __SYMBIAN32__
   182 #ifdef __SYMBIAN32__
   174 #define O_TMPFILE 	0x10000000		/* flag for cleanup of tmpfiles*/
   183 #define O_TMPFILE 	0x10000000		/* flag for cleanup of tmpfiles*/
   175 #endif //__SYMBIAN32__
   184 #endif //__SYMBIAN32__
   176 
   185 /*SYMBIAN Flag for shm_open()*/
       
   186 #ifdef __SYMBIAN32__
       
   187 #define O_SHMFLG 	0x01000000		/* flag for shm_open()*/
       
   188 #endif //__SYMBIAN32__
   177 /*
   189 /*
   178  * Constants used for fcntl(2)
   190  * Constants used for fcntl(2)
   179  */
   191  */
   180 
   192 
   181 /* command values */
   193 /* command values */
   190 #endif
   202 #endif
   191 #define	F_GETLK		7		/* get record locking information */
   203 #define	F_GETLK		7		/* get record locking information */
   192 #define	F_SETLK		8		/* set record locking information */
   204 #define	F_SETLK		8		/* set record locking information */
   193 #define	F_SETLKW	9		/* F_SETLK; wait if blocked */
   205 #define	F_SETLKW	9		/* F_SETLK; wait if blocked */
   194 
   206 
       
   207 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
   208 #define F_GETLK64	F_GETLK
       
   209 #define F_SETLK64	F_SETLK
       
   210 #define F_SETLKW64	F_SETLKW
       
   211 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
       
   212 
   195 /* file descriptor flags (F_GETFD, F_SETFD) */
   213 /* file descriptor flags (F_GETFD, F_SETFD) */
   196 #define	FD_CLOEXEC	1		/* close-on-exec flag */
   214 #define	FD_CLOEXEC	1		/* close-on-exec flag */
   197 
   215 
   198 /* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
   216 /* record locking flags (F_GETLK, F_SETLK, F_SETLKW) */
   199 #define	F_RDLCK		1		/* shared or read lock */
   217 #define	F_RDLCK		1		/* shared or read lock */
   215 	pid_t	l_pid;		/* lock owner */
   233 	pid_t	l_pid;		/* lock owner */
   216 	short	l_type;		/* lock type: read/write, etc. */
   234 	short	l_type;		/* lock type: read/write, etc. */
   217 	short	l_whence;	/* type of l_start */
   235 	short	l_whence;	/* type of l_start */
   218 };
   236 };
   219 
   237 
       
   238 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
   239 #define flock64	flock
       
   240 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
       
   241 
   220 
   242 
   221 #if __BSD_VISIBLE
   243 #if __BSD_VISIBLE
   222 /* lock operations for flock(2) */
   244 /* lock operations for flock(2) */
   223 #define	LOCK_SH		0x01		/* shared file lock */
   245 #define	LOCK_SH		0x01		/* shared file lock */
   224 #define	LOCK_EX		0x02		/* exclusive file lock */
   246 #define	LOCK_EX		0x02		/* exclusive file lock */
   233 #ifndef _KERNEL
   255 #ifndef _KERNEL
   234 __BEGIN_DECLS
   256 __BEGIN_DECLS
   235 IMPORT_C int	open(const char *, int, ...);
   257 IMPORT_C int	open(const char *, int, ...);
   236 IMPORT_C int	creat(const char *, mode_t);
   258 IMPORT_C int	creat(const char *, mode_t);
   237 IMPORT_C int	fcntl(int, int, ...);
   259 IMPORT_C int	fcntl(int, int, ...);
       
   260 
       
   261 #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS)
       
   262 #define open64	open
       
   263 #define creat64	creat
       
   264 #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */
       
   265 
   238 #if __BSD_VISIBLE
   266 #if __BSD_VISIBLE
   239 int	flock(int, int);
   267 int	flock(int, int);
   240 #endif
   268 #endif
   241 __END_DECLS
   269 __END_DECLS
   242 #endif
   270 #endif