epoc32/include/libc/sys/ioctl.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/libc/sys/ioctl.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/libc/sys/ioctl.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,88 @@
     1.4 -ioctl.h
     1.5 +/*
     1.6 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +
    1.24 +
    1.25 +
    1.26 +
    1.27 +/**
    1.28 + @file
    1.29 + @publishedAll
    1.30 + @released
    1.31 +*/
    1.32 +
    1.33 +#ifndef _SYS_IOCTL_H_
    1.34 +#define _SYS_IOCTL_H_
    1.35 +
    1.36 +#include <_ansi.h>
    1.37 +#include <sys/serial.h>
    1.38 +
    1.39 +#ifdef __cplusplus
    1.40 +extern "C" {
    1.41 +#endif
    1.42 +
    1.43 +/**
    1.44 +ioctls under EPOC32 are only loosely related to ioctls in other systems
    1.45 +The _IOR(), _IOW() and _IOWR() macros are provided for documentation purposes,
    1.46 +to indicate the appropriate form of the third parameter
    1.47 +*/
    1.48 +#define _IOW(n,T)	(n)	/* passes in a T value via the supplied T* ptr */
    1.49 +#define _IOR(n,T)	(n)	/* returns a T value via the supplied T* ptr */ 
    1.50 +#define _IOWR(n,T)	(n)	/* both of the above */
    1.51 +
    1.52 +IMPORT_C int ioctl (int, int, void*);
    1.53 +
    1.54 +/**
    1.55 +number of bytes available to be read - cf BSD FIONREAD 
    1.56 +*/
    1.57 +#define E32IONREAD	_IOR( 1,int)	
    1.58 +
    1.59 +/**
    1.60 +ioctl-based form of select with infinite timeout - specify a mask of selectable
    1.61 +states and receive back the mask of triggering states
    1.62 +*/
    1.63 +#define E32IOSELECT	_IOWR(2,int)	
    1.64 +#   define E32SELECT_READ	0x01
    1.65 +#   define E32SELECT_WRITE	0x02
    1.66 +#   define E32SELECT_EXCEPT	0x04
    1.67 +
    1.68 +
    1.69 +/**
    1.70 +ioctls for serial port			values may change
    1.71 +*/
    1.72 +#define COMMIOCTL_SETSIGNALS		1
    1.73 +#define	COMMIOCTL_GETSIGNALS		2
    1.74 +#define COMMIOCTL_SETCONFIG			3
    1.75 +#define	COMMIOCTL_GETCONFIG			4
    1.76 +#define	COMMIOCTL_BREAK				5
    1.77 +#define	COMMIOCTL_SETREADTIMEOUT	6
    1.78 +#define	COMMIOCTL_GETREADTIMEOUT	7
    1.79 +#define	COMMIOCTL_SETREADTHRESHOLD	8
    1.80 +#define	COMMIOCTL_GETREADTHRESHOLD	9
    1.81 +#define	COMMIOCTL_SETBUFFERLENGTH	10
    1.82 +#define	COMMIOCTL_GETBUFFERLENGTH	11
    1.83 +#define	COMMIOCTL_NOTIFYSUPPORTED	12
    1.84 +#define	COMMIOCTL_NOTIFY			0x400d
    1.85 +
    1.86 +#define	REAL_COMMIOCTL_NOTIFY		13		// = COMMIOCTL_NOTIFY-0x4000
    1.87 +
    1.88 +
    1.89 +#ifdef __cplusplus
    1.90 +}
    1.91 +#endif
    1.92 +#endif