work_queue_process.h
00001 #ifndef WORK_QUEUE_PROCESS_H
00002 #define WORK_QUEUE_PROCESS_H
00003
00004 #include "work_queue.h"
00005 #include "timestamp.h"
00006 #include "path_disk_size_info.h"
00007
00008 #include <unistd.h>
00009 #include <sys/types.h>
00010 #include <sys/resource.h>
00011
00012 #define NONE 0
00013 #define DOCKER 1
00014 #define DOCKER_PRESERVE 2
00015 #define UMBRELLA 3
00016
00017 #define MAX_BUFFER_SIZE 4096
00018
00019
00020
00021
00022
00023
00024 struct work_queue_process {
00025 pid_t pid;
00026 int task_status;
00027 int exit_status;
00028
00029 struct rusage rusage;
00030 timestamp_t execution_start;
00031 timestamp_t execution_end;
00032
00033 char *sandbox;
00034 char *tmpdir;
00035 char *output_file_name;
00036 int output_fd;
00037
00038 struct work_queue_task *task;
00039
00040
00041 int64_t disk;
00042
00043 int loop_mount;
00044
00045
00046 int64_t sandbox_size;
00047 int64_t sandbox_file_count;
00048
00049
00050 struct path_disk_size_info *disk_measurement_state;
00051
00052 char container_id[MAX_BUFFER_SIZE];
00053 };
00054
00055 struct work_queue_process * work_queue_process_create( struct work_queue_task *task, int disk_allocation );
00056 pid_t work_queue_process_execute( struct work_queue_process *p, int container_mode, ... );
00057
00058 void work_queue_process_kill( struct work_queue_process *p );
00059 void work_queue_process_delete( struct work_queue_process *p );
00060 void work_queue_process_compute_disk_needed( struct work_queue_process *p );
00061
00062 int work_queue_process_measure_disk(struct work_queue_process *p, int max_time_on_measurement);
00063
00064 #endif