cctools
work_queue_process.h
1 #ifndef WORK_QUEUE_PROCESS_H
2 #define WORK_QUEUE_PROCESS_H
3 
4 #include "work_queue.h"
5 #include "timestamp.h"
6 
7 #include <unistd.h>
8 #include <sys/types.h>
9 #include <sys/resource.h>
10 
11 /*
12 work_queue_process is a running instance of a work_queue_task.
13 This object is private to the work_queue_worker.
14 */
15 
17  pid_t pid;
18  int task_status; // Any of WORK_QUEUE_RESULT_*
19  int exit_status; // Exit code, or signal number to task process.
20 
21  struct rusage rusage;
22  timestamp_t execution_start;
23  timestamp_t execution_end;
24 
25  char *sandbox;
26 
27  char *output_file_name;
28  int output_fd;
29 
30  struct work_queue_task *task;
31 };
32 
33 struct work_queue_process * work_queue_process_create( int taskid );
34 pid_t work_queue_process_execute( struct work_queue_process *p );
35 void work_queue_process_kill( struct work_queue_process *p );
36 void work_queue_process_delete( struct work_queue_process *p );
37 
38 #endif
A task description.
Definition: work_queue.h:74
A master-worker library.
Portable routines for high resolution timing.
UINT64_T timestamp_t
A type to hold the current time, in microseconds since January 1st, 1970.
Definition: timestamp.h:20
Definition: work_queue_process.h:16