use EPOCHREALTIME as variable, somewhat compatible with “zmodload zsh/datetime”, as ormaaj belatedly found out
This commit is contained in:
parent
b58d7b8053
commit
007cf09db6
4
main.c
4
main.c
|
@ -34,7 +34,7 @@
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.240 2012/11/20 18:07:42 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.241 2012/11/26 22:49:48 tg Exp $");
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ static void x_sigwinch(int);
|
||||||
static const char initifs[] = "IFS= \t\n";
|
static const char initifs[] = "IFS= \t\n";
|
||||||
|
|
||||||
static const char initsubs[] =
|
static const char initsubs[] =
|
||||||
"${PS2=> } ${PS3=#? } ${PS4=+ } ${SECONDS=0} ${TMOUT=0} ${MKSH_UNIXTIME=}";
|
"${PS2=> } ${PS3=#? } ${PS4=+ } ${SECONDS=0} ${TMOUT=0} ${EPOCHREALTIME=}";
|
||||||
|
|
||||||
static const char *initcoms[] = {
|
static const char *initcoms[] = {
|
||||||
Ttypeset, "-r", initvsn, NULL,
|
Ttypeset, "-r", initvsn, NULL,
|
||||||
|
|
6
mksh.1
6
mksh.1
|
@ -1,4 +1,4 @@
|
||||||
.\" $MirOS: src/bin/mksh/mksh.1,v 1.299 2012/11/20 18:25:12 tg Exp $
|
.\" $MirOS: src/bin/mksh/mksh.1,v 1.300 2012/11/26 22:49:49 tg Exp $
|
||||||
.\" $OpenBSD: ksh.1,v 1.144 2012/07/08 08:13:20 guenther Exp $
|
.\" $OpenBSD: ksh.1,v 1.144 2012/07/08 08:13:20 guenther Exp $
|
||||||
.\"-
|
.\"-
|
||||||
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
.\" with -mandoc, it might implement .Mx itself, but we want to
|
.\" with -mandoc, it might implement .Mx itself, but we want to
|
||||||
.\" use our own definition. And .Dd must come *first*, always.
|
.\" use our own definition. And .Dd must come *first*, always.
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: November 20 2012 $
|
.Dd $Mdocdate: November 26 2012 $
|
||||||
.\"
|
.\"
|
||||||
.\" Check which macro package we use, and do other -mdoc setup.
|
.\" Check which macro package we use, and do other -mdoc setup.
|
||||||
.\"
|
.\"
|
||||||
|
@ -1880,7 +1880,7 @@ executed.
|
||||||
.It Ev LINES
|
.It Ev LINES
|
||||||
Set to the number of lines on the terminal or window.
|
Set to the number of lines on the terminal or window.
|
||||||
Always set, defaults to 24.
|
Always set, defaults to 24.
|
||||||
.It Ev MKSH_UNIXTIME
|
.It Ev EPOCHREALTIME
|
||||||
Time since the epoch, as returned by
|
Time since the epoch, as returned by
|
||||||
.Xr gettimeofday 2 ,
|
.Xr gettimeofday 2 ,
|
||||||
formatted as decimal
|
formatted as decimal
|
||||||
|
|
4
var.c
4
var.c
|
@ -27,7 +27,7 @@
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.158 2012/11/20 18:07:45 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.159 2012/11/26 22:49:50 tg Exp $");
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Variables
|
* Variables
|
||||||
|
@ -1112,7 +1112,7 @@ getspec(struct tbl *vp)
|
||||||
case V_LINES:
|
case V_LINES:
|
||||||
i = x_lins;
|
i = x_lins;
|
||||||
break;
|
break;
|
||||||
case V_MKSH_UNIXTIME: {
|
case V_EPOCHREALTIME: {
|
||||||
/* 10(%u) + 1(.) + 6 + NUL */
|
/* 10(%u) + 1(.) + 6 + NUL */
|
||||||
char buf[18];
|
char buf[18];
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#if defined(VARSPEC_DEFNS)
|
#if defined(VARSPEC_DEFNS)
|
||||||
__RCSID("$MirOS: src/bin/mksh/var_spec.h,v 1.4 2012/11/20 18:07:45 tg Exp $");
|
__RCSID("$MirOS: src/bin/mksh/var_spec.h,v 1.5 2012/11/26 22:49:51 tg Exp $");
|
||||||
#define FN(name) /* nothing */
|
#define FN(name) /* nothing */
|
||||||
#elif defined(VARSPEC_ENUMS)
|
#elif defined(VARSPEC_ENUMS)
|
||||||
#define FN(name) V_##name,
|
#define FN(name) V_##name,
|
||||||
|
@ -28,7 +28,7 @@ FN(HISTSIZE)
|
||||||
FN(IFS)
|
FN(IFS)
|
||||||
FN(LINENO)
|
FN(LINENO)
|
||||||
FN(LINES)
|
FN(LINES)
|
||||||
FN(MKSH_UNIXTIME)
|
FN(EPOCHREALTIME)
|
||||||
FN(OPTIND)
|
FN(OPTIND)
|
||||||
FN(PATH)
|
FN(PATH)
|
||||||
FN(RANDOM)
|
FN(RANDOM)
|
||||||
|
|
Loading…
Reference in New Issue