fp@2433: /******************************************************************************
fp@2433: *
fp@2433: * $Id$
fp@2433: *
fp@2433: * Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
fp@2433: *
fp@2433: * This file is part of the IgH EtherCAT master userspace library.
fp@2433: *
fp@2433: * The IgH EtherCAT master userspace library is free software; you can
fp@2433: * redistribute it and/or modify it under the terms of the GNU Lesser General
fp@2433: * Public License as published by the Free Software Foundation; version 2.1
fp@2433: * of the License.
fp@2433: *
fp@2433: * The IgH EtherCAT master userspace library is distributed in the hope that
fp@2433: * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
fp@2433: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fp@2433: * GNU Lesser General Public License for more details.
fp@2433: *
fp@2433: * You should have received a copy of the GNU Lesser General Public License
fp@2433: * along with the IgH EtherCAT master userspace library. If not, see
fp@2433: * .
fp@2433: *
fp@2433: * ---
fp@2433: *
fp@2433: * The license mentioned above concerns the source code only. Using the
fp@2433: * EtherCAT technology and brand is only permitted in compliance with the
fp@2433: * industrial property and similar rights of Beckhoff Automation GmbH.
fp@2433: *
fp@2433: *****************************************************************************/
fp@2433:
fp@2433: #ifndef __EC_LIB_IOCTL_H__
fp@2433: #define __EC_LIB_IOCTL_H__
fp@2433:
fp@2433: /*****************************************************************************/
fp@2433:
fp@2433: #ifdef USE_RTDM
fp@2433: #include
fp@2433: #else
fp@2433: #include
fp@2433: #endif
fp@2433:
fp@2433: /*****************************************************************************/
fp@2433:
fp@2433: #include "master/ioctl.h"
fp@2433:
fp@2433: /*****************************************************************************/
fp@2433:
fp@2433: #ifdef USE_RTDM
fp@2433:
fp@2433: #define ioctl rt_dev_ioctl
fp@2433:
fp@2433: /* rt_dev_ioctl() returns negative error code */
fp@2433: #define EC_IOCTL_IS_ERROR(X) ((X) < 0)
fp@2433: #define EC_IOCTL_ERRNO(X) (-(X))
fp@2433:
fp@2433: #else
fp@2433:
fp@2433: #define ioctl ioctl
fp@2433:
fp@2433: /* libc's ioctl() always returns -1 on error and sets errno */
fp@2433: #define EC_IOCTL_IS_ERROR(X) ((X) == -1)
fp@2433: #define EC_IOCTL_ERRNO(X) (errno)
fp@2433:
fp@2433: #include
fp@2433:
fp@2433: #endif
fp@2433:
fp@2433: /*****************************************************************************/
fp@2433:
fp@2433: #endif /* __EC_LIB_IOCTL_H__ */
fp@2433:
fp@2433: /*****************************************************************************/
fp@2433: