~ubuntu-branches/ubuntu/feisty/comedilib/feisty

« back to all changes in this revision

Viewing changes to lib/ioctl.c

  • Committer: Bazaar Package Importer
  • Author(s): David Schleef
  • Date: 2003-09-23 18:11:12 UTC
  • Revision ID: james.westby@ubuntu.com-20030923181112-sat05jyh702rb1at
Tags: upstream-0.7.21
ImportĀ upstreamĀ versionĀ 0.7.21

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    lib/ioctl.c
 
3
    low-level functions
 
4
 
 
5
    COMEDILIB - Linux Control and Measurement Device Interface Library
 
6
    Copyright (C) 1997-2001 David A. Schleef <ds@schleef.org>
 
7
 
 
8
    This library is free software; you can redistribute it and/or
 
9
    modify it under the terms of the GNU Lesser General Public
 
10
    License as published by the Free Software Foundation, version 2.1
 
11
    of the License.
 
12
 
 
13
    This library is distributed in the hope that it will be useful,
 
14
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
    Lesser General Public License for more details.
 
17
 
 
18
    You should have received a copy of the GNU Lesser General Public
 
19
    License along with this library; if not, write to the Free Software
 
20
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 
21
    USA.
 
22
*/
 
23
 
 
24
#include <stdio.h>
 
25
#include <math.h>
 
26
#include <stdlib.h>
 
27
#include <sys/types.h>
 
28
#include <sys/stat.h>
 
29
#include <fcntl.h>
 
30
#include <unistd.h>
 
31
#include <sys/ioctl.h>
 
32
#include <errno.h>
 
33
#include <string.h>
 
34
 
 
35
#include "libinternal.h"
 
36
 
 
37
 
 
38
/* ioctl wrappers */
 
39
 
 
40
int _comedi_ioctl( int fd, int request, unsigned long arg )
 
41
{
 
42
        int ret;
 
43
 
 
44
        ret = ioctl( fd, request, arg );
 
45
        if( ret < 0 )
 
46
                libc_error();
 
47
        return ret;
 
48
}
 
49
 
 
50
int _comedi_ioctl_debug(int fd, int request, unsigned long arg)
 
51
{
 
52
        int ret;
 
53
 
 
54
        fprintf(stderr,"ioctl(%d,0x%08x,0x%08lx) = ",fd,request,arg);
 
55
        ret = _comedi_ioctl(fd,request,arg);
 
56
        fprintf(stderr,"%d\n",ret);
 
57
 
 
58
        return ret;
 
59
}
 
60
 
 
61