Add a global flag named 'tainted'. Its purpose is to report various
status about experimental features used for the current process
lifetime.
By default it is initialized to 0. It can be set/retrieve by a couple of
new functions mark_tainted()/get_tainted(). Once a flag is set, it
cannot be resetted.
Currently, no tainted status is implemented, it will be the subject of
the following commits.
return mask ? mask : all_threads_mask;
}
+/* handle 'tainted' status */
+enum tainted_flags {
+ TAINTED_UNIMPLEMENTED, // TO REMOVE once an enum value is implemented
+};
+void mark_tainted(const enum tainted_flags flag);
+unsigned int get_tainted();
+
/* simplified way to declare static build options in a file */
#define REGISTER_BUILD_OPTS(str) \
INITCALL2(STG_REGISTER, hap_register_build_opts, (str), 0)
/* bitfield of a few warnings to emit just once (WARN_*) */
unsigned int warned = 0;
+/* set if experimental features have been used for the current process */
+static unsigned int tainted = 0;
+
/* master CLI configuration (-S flag) */
struct list mworker_cli_conf = LIST_HEAD_INIT(mworker_cli_conf);
return ret == 0;
}
+void mark_tainted(const enum tainted_flags flag)
+{
+ HA_ATOMIC_OR(&tainted, flag);
+}
+
+unsigned int get_tainted()
+{
+ int tainted_state;
+ HA_ATOMIC_STORE(&tainted_state, tainted);
+ return tainted_state;
+}
/*
* This function initializes all the necessary variables. It only returns