Created
January 28, 2013 14:05
-
-
Save ma34s/4655749 to your computer and use it in GitHub Desktop.
/proc/cmdlineを再設定するバイナリのコード
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*---------------------------------------------------------------------------** | |
ma34s. All rights reserved. | |
**---------------------------------------------------------------------------** | |
$HeadURL: $ | |
$LastChangedDate:: #$ | |
$LastChangedRevision: $ | |
$LastChangedBy: $ | |
**------------------------------------------------------------------------*//** | |
@file | |
@author ma34s | |
@date 2013/01/28 start | |
*//*-------------------------------------------------------------------------*/ | |
/*============================================================================= | |
Include | |
==============================================================================*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
/*============================================================================= | |
Macro | |
==============================================================================*/ | |
#define UI_PARAMETER_FILE "/data/kbc/cmdline" | |
/*============================================================================= | |
Typedef | |
==============================================================================*/ | |
/*============================================================================= | |
Prototype | |
==============================================================================*/ | |
/*============================================================================= | |
Variable | |
==============================================================================*/ | |
/*===========================================================================** | |
Functiuon | |
**============================================================================*/ | |
int main(int argc,char argv[]) | |
{ | |
static char cmd[1024]; | |
// printf("setcmdline\n"); | |
FILE* f = fopen(UI_PARAMETER_FILE, "rt"); | |
if (f == NULL) { | |
return; | |
} | |
fclose(f); | |
sprintf(cmd,"cat %s > /proc/cmdline",USR_CMDLINE); | |
// printf("cmd::%s\n",cmd); | |
system(cmd); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment