tb %PID builtin command
This commit is contained in:
@ -22,4 +22,6 @@ typedef struct {
|
|||||||
size_t usemem;
|
size_t usemem;
|
||||||
} ProcStat;
|
} ProcStat;
|
||||||
|
|
||||||
|
typedef uint64_t PID_t;
|
||||||
|
|
||||||
#endif // SHARE_HDRS_PROCESSCTL_H_
|
#endif // SHARE_HDRS_PROCESSCTL_H_
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "runtime.h"
|
#include "runtime.h"
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
extern uint64_t PID;
|
extern PID_t PID;
|
||||||
|
|
||||||
static InterpResult RES;
|
static InterpResult RES;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#define LINEBUF_MAX 1024
|
#define LINEBUF_MAX 1024
|
||||||
|
|
||||||
uint64_t PID;
|
PID_t PID;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char *modestr;
|
char *modestr;
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include "runtime.h"
|
#include "runtime.h"
|
||||||
#include "interp.h"
|
#include "interp.h"
|
||||||
|
|
||||||
|
extern PID_t PID;
|
||||||
|
|
||||||
RtCmd *RTCMDS = NULL;
|
RtCmd *RTCMDS = NULL;
|
||||||
RtAlias *RTALIASES = NULL;
|
RtAlias *RTALIASES = NULL;
|
||||||
|
|
||||||
@ -45,7 +47,13 @@ bool rt_mkalias(Token *tks) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool rt_PID(Token *tks) {
|
||||||
|
uprintf("%lu\n", PID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void rt_init(void) {
|
void rt_init(void) {
|
||||||
RTCMD("%print", &rt_print);
|
RTCMD("%print", &rt_print);
|
||||||
RTCMD("%mkalias", &rt_mkalias);
|
RTCMD("%mkalias", &rt_mkalias);
|
||||||
|
RTCMD("%PID", &rt_PID);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user