设为首页 加入收藏

TOP

利用BLCR加快Android的启动过程(五)
2014-11-24 07:48:44 来源: 作者: 【 】 浏览:8
Tags:利用 BLCR 加快 Android 启动 过程
KERNEL_HEADERS) \


$(LOCAL_PATH)/../../include \


$(LOCAL_PATH)/arch/arm/



LOCAL_MODULE := cr_restart


include $(BUILD_EXECUTABLE)



cat ./util/cr_restart/Android.mk


LOCAL_PATH := $(my-dir)



include $(CLEAR_VARS)


LOCAL_SHARED_LIBRARIES := libcutils


LOCAL_SHARED_LIBRARIES += libdl


LOCAL_SHARED_LIBRARIES += libc


LOCAL_SHARED_LIBRARIES += libcr_run


LOCAL_SHARED_LIBRARIES += libcr


LOCAL_SRC_FILES:=cr_restart.c


LOCAL_C_INCLUDES := \


$(KERNEL_HEADERS) \


$(LOCAL_PATH)/../../include \


$(LOCAL_PATH)/arch/arm/



LOCAL_MODULE := cr_restart


include $(BUILD_EXECUTABLE)


[root@wen blcr-0.8.2]#


[root@wen blcr-0.8.2]#


[root@wen blcr-0.8.2]# cat ./util/cr_checkpoint/Android.mk


LOCAL_PATH := $(my-dir)



include $(CLEAR_VARS)


LOCAL_SHARED_LIBRARIES := libcutils


LOCAL_SHARED_LIBRARIES += libdl


LOCAL_SHARED_LIBRARIES += libc


LOCAL_SHARED_LIBRARIES += libcr_run


LOCAL_SHARED_LIBRARIES += libcr


LOCAL_SRC_FILES:=cr_checkpoint.c


LOCAL_C_INCLUDES := \


$(KERNEL_HEADERS) \


$(LOCAL_PATH)/../../include \


$(LOCAL_PATH)/arch/arm/



LOCAL_MODULE := cr_checkpoint


include $(BUILD_EXECUTABLE)




下面是crut_util_libcr.c,放到上面同一个目录下面。你也可以自己从blcr中复制出来。




/*


* Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c)


* 2008, The Regents of the University of California, through Lawrence


* Berkeley National Laboratory (subject to receipt of any required


* approvals from the U.S. Dept. of Energy). All rights reserved.


*


* Portions may be copyrighted by others, as may be noted in specific


* copyright notices within specific files.


*


* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


*


* $Id: crut_util_libcr.c,v 1.5 2008/12/26 10:50:35 phargrov Exp $


*


* Utility functions for BLCR tests (libcr-dependent portions)


*/



#define _LARGEFILE64_SOURCE 1 /* For O_LARGEFILE */


#include


#include


#include


#include


#include


#include


#include



#include "crut_util.h"



/* checkpoint request/poll wrappers for simpler code */



int


crut_checkpoint_request(cr_checkpoint_handle_t *handle_p, const char *filename) {


int rc;


cr_checkpoint_args_t my_args;



if (filename) {


/* remove existing context file, if any */


(void)unlink(filename);



/* open the context file */


rc = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0600);


} else {


/* NULL -> /dev/null */


rc = open("/dev/null", O_WRONLY | O_LARGEFILE);


}


if (rc < 0) {


perror("open");


return rc;


}



cr_initialize_checkpoint_args_t(&my_args);


my_args.cr_fd = rc; /* still holds the return from open() */


my_args.cr_scope = CR_SCOPE_PROC;



/* issue the request */


rc = cr_request_checkpoint(&my_args, handle_p);


if (rc < 0) {


(void)close(my_args.cr_fd);


if (filename) (void)unlink(filename);


perror("

首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇在Android中加入抓屏软件fbdump. 下一篇在Android中加入充电指示

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C++ Lambda表达式保 (2025-12-26 05:49:45)
·C++ Lambda表达式的 (2025-12-26 05:49:42)
·深入浅出 C++ Lambda (2025-12-26 05:49:40)
·C语言指针从入门到基 (2025-12-26 05:21:36)
·【C语言指针初阶】C (2025-12-26 05:21:33)