mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +00:00
Add Linux ptrace() tutorial
This commit is contained in:
parent
98909b1391
commit
3b9e66ecba
14 changed files with 1290 additions and 23 deletions
|
@ -41,6 +41,7 @@
|
|||
} while (0)
|
||||
|
||||
extern bool __nomultics;
|
||||
extern bool __replmode;
|
||||
|
||||
static const char kSpecialFloats[2][2][4] = {{"INF", "inf"}, {"NAN", "nan"}};
|
||||
|
||||
|
@ -377,8 +378,15 @@ hidden int __fmt(void *fn, void *arg, const char *format, va_list va) {
|
|||
goto FormatString;
|
||||
|
||||
case 'r':
|
||||
flags |= FLAGS_REPR;
|
||||
/* fallthrough */
|
||||
// undocumented %r specifier
|
||||
// used for good carriage return
|
||||
// helps integrate loggers with repls
|
||||
if (!__replmode) {
|
||||
break;
|
||||
} else {
|
||||
p = "\r\e[K";
|
||||
goto FormatString;
|
||||
}
|
||||
|
||||
case 'q':
|
||||
flags |= FLAGS_QUOTE;
|
||||
|
@ -393,6 +401,8 @@ hidden int __fmt(void *fn, void *arg, const char *format, va_list va) {
|
|||
break;
|
||||
|
||||
case 'n':
|
||||
// nonstandard %n specifier
|
||||
// used to print newlines that work in raw terminal modes
|
||||
if (__nomultics) PUT('\r');
|
||||
PUT('\n');
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue