Skip to content

Instantly share code, notes, and snippets.

@ma34s
Created January 25, 2013 07:59
Show Gist options
  • Save ma34s/4632633 to your computer and use it in GitHub Desktop.
Save ma34s/4632633 to your computer and use it in GitHub Desktop.
getfuse.c
/*---------------------------------------------------------------------------**
ma34s. All rights reserved.
**---------------------------------------------------------------------------**
$HeadURL: $
$LastChangedDate:: 2011-07-19 12:39:07 #$
$LastChangedRevision: 22 $
$LastChangedBy: $
**------------------------------------------------------------------------*//**
@file
@author ma34s
@date 2012/06/19 start
*//*-------------------------------------------------------------------------*/
/*=============================================================================
Include
==============================================================================*/
#include <stdio.h>
#if 0
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <unistd.h>
#include <utime.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "ioctl.h"
/*=============================================================================
Macro
==============================================================================*/
#if 1
#define LOCAL_LOG
#define LOCAL_LOGD
#endif
#define TAG "BootAnimLib"
/*=============================================================================
for Debug
==============================================================================*/
#ifdef LOCAL_LOG
//#include <android/log.h>
#endif
#define TZIC_IOC_MAGIC 0x9E
#define TZIC_IOCTL_SET_FUSE_REQ _IO(TZIC_IOC_MAGIC, 1)
#define TZIC_IOCTL_GET_FUSE_REQ _IOR(TZIC_IOC_MAGIC, 0, unsigned int)
#define TZIC_DEVICE "/dev/tzic"
/*=============================================================================
Typedef
==============================================================================*/
/*=============================================================================
Prototype
==============================================================================*/
/*=============================================================================
Variable
==============================================================================*/
/*===========================================================================**
Functiuon
**============================================================================*/
int main(int argc,char argv[])
{
int fh;
unsigned long pushed;
if ((fh = open(TZIC_DEVICE,O_RDWR)) < 0) {
printf("open error");
goto end;
}
if (ioctl(fh,TZIC_IOCTL_GET_FUSE_REQ,&pushed) < 0) {
//string = strerror(errno);
//printf("open error",string);
goto close_end;
}
printf("%d\n",pushed);
close_end:
close(fh);
end:
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment