File: child.h

package info (click to toggle)
trinity 1.9%2Bgit20230109.87f1530-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,116 kB
  • sloc: ansic: 33,463; sh: 536; makefile: 163
file content (58 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once

#include <stdio.h>
#include <sys/types.h>
#include <types.h>
#include "objects.h"
#include "syscall.h"

struct childdata {
	/* The actual syscall records each child uses. */
	struct syscallrecord syscall;

	/* log file related stuff */
	FILE *logfile;
	bool logdirty;

	/* ONLY to be read by main. */
	FILE *pidstatfile;

	struct objhead objects[MAX_OBJECT_TYPES];

	/* last time the child made progress. */
	struct timespec tp;
	unsigned long op_nr;

	unsigned int seed;

	unsigned int num;

	unsigned char xcpu_count;

	unsigned char kill_count;

	bool dontkillme;	/* provide temporary protection from the reaper. */

	bool dropped_privs;
};

extern unsigned int max_children;

struct childdata * this_child(void);

void clean_childdata(struct childdata *child);

void init_child_mappings(void);

void child_process(struct childdata *child, int childno);

void set_dontkillme(struct childdata *child, bool state);

void reap_child(struct childdata *child);

/* Childops */
bool random_syscall(struct childdata *child);
bool read_all_files(struct childdata *child);
bool thrash_pidfiles(struct childdata *child);
bool drop_privs(struct childdata *child);
bool truncate_testfile(struct childdata *child);