|
|
1.1 ! root 1: /* ! 2: * Return 1 if under Coherent else 0. ! 3: */ ! 4: #include <sys/utsname.h> ! 5: #include <string.h> ! 6: ! 7: if_COHERENT() ! 8: { ! 9: static char OS_VERSION[] = "COHERENT"; ! 10: struct utsname tsname; ! 11: ! 12: if (uname(&tsname) < 0) ! 13: return (0); ! 14: return (!strncmp(tsname.version, OS_VERSION, sizeof(OS_VERSION) - 1)); ! 15: } ! 16: ! 17: #ifdef TEST ! 18: main() ! 19: { ! 20: puts(if_COHERENT() ! 21: ? "Congratulations! This is COHERENT!" ! 22: : "You fool! This is not COHERENT!"); ! 23: } ! 24: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.