4 ms·
https://github.com/brho/plan9/blob/89d43d2262ad43eb4b26c2a8d6a27cfeddb33828/nix/sys/src/cmd/tcs/plan9.h https://github.com/brho/plan9/blob/89d43d2262ad43eb4b26c
by ygra 7y ago
https://github.com/brho/plan9/blob/89d43d2262ad43eb4b26c2a8d6a27cfeddb33828/nix/sys/src/cmd/tcs/plan9.h https://github.com/brho/plan9/blob/89d43d2262ad43eb4b26c2a8d... seems to be a global variable.
https://9fans.github.io/plan9port/man/man3/arg.html https://9fans.github.io/plan9port/man/man3/arg.html also references it.
- henesy 7y agoUsed by sysfatal(2): https://github.com/0intro/plan9-contrib/blob/master/sys/src/libc/9sys/sysfatal.c#L11 https://github.com/0intro/plan9-contrib/blob/master/sys/src/... Also mentioned in sysfatal(2)'s manual: http://man.cat-v.org/9front/2/perror http://man.cat-v.org/9front/2/perror
- g82918 7y agoThank you, that bit was very interesting. I like the idea for single threaded applications of having argv0 be a global.
- sherincall 7y agoDoesn't have to be single-threaded even. Main writes the pointer at the start, and no one else is going to change it, just read from it.
- Someone 7y agoAlso used in the beautiful (for those who like being creative with the preprocessor) options parser https://9fans.github.io/plan9port/man/man3/arg.html https://9fans.github.io/plan9port/man/man3/arg.html