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("