unix/dualinit

incl/common.h in master
Repositories | Summary | Log | Files | LICENSE

common.h (315B) download


 1#pragma once
 2
 3/**
 4 * program dies, if pid == 1 the program hangs in a while(1)-loop otherwise exit(1)
 5 */
 6void die() __attribute__((noreturn));
 7
 8/**
 9 * strdup but it returns NULL if `str` is empty
10 */
11char* strdupn(const char* str);
12
13/**
14 * just comparing strings
15 */
16#define streq(a, b) \
17	(strcmp((a), (b)) == 0)