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