Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12838641
  • 博文数量: 1293
  • 博客积分: 13501
  • 博客等级: 上将
  • 技术积分: 17974
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-08 18:11
文章分类

全部博文(1293)

文章存档

2019年(1)

2018年(1)

2016年(118)

2015年(257)

2014年(128)

2013年(222)

2012年(229)

2011年(337)

分类: C/C++

2011-04-08 23:36:10

/*

* test_pm.c

*

* Test application code for testing the ioctl driver

*

* Copyright (C) 2005 Farsight

*

* This program is free software; you can redistribute it and/or modify

* it under the terms of the GNU General Public License as published by

* the Free Software Foundation; either version 2 of the License, or

* (at your option) any later version.

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*

*/

#include

#include

#include

#include

#include

#include

#define APM_IOC_STANDBY _IO('A', 1)

#define APM_IOC_SUSPEND _IO('A', 2)

int main (void)

{

int fd;

fd = open ("/dev/apm_bios",O_RDWR);

if (fd < 0) {

  printf ("fd open failed\n");

  exit(0);

}

printf ("\n/dev/hello opened, fd=%d\n",fd);

ioctl (fd, APM_IOC_SUSPEND);

close (fd);

printf ("/dev/apm_bios closed :)\n");

return 0;

}

阅读(2253) | 评论(0) | 转发(0) |
0

上一篇:start_pm.c

下一篇:VLC Overview

给主人留下些什么吧!~~