gettimeofday.2
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 77 行
2
77 行
.\" SCCSID: @(#)gettimeofday.2 8.1 9/11/90.TH gettimeofday 2.SH Namegettimeofday, settimeofday \- get or set date and time.SH Syntax.nf.ft B#include <sys/time.h>.PP.ft Bgettimeofday(tp, tzp)struct timeval *tp;struct timezone *tzp;.PP.ft Bsettimeofday(tp, tzp)struct timeval *tp;struct timezone *tzp;.fi.SH Description.NXR "gettimeofday system call".NXR "settimeofday system call".NXA "gettimeofday system call" "stime system call".NXR "time" "getting".NXR "time" "setting"The.PN gettimeofdaysystem callreturns the system's notion of the current Greenwich time andthe current time zone. Time returned is expressed relativein seconds and microseconds since midnight January 1, 1970..PPThe structures pointed to by.I tpand.I tzpare defined in <sys/time.h>as:.PP.EXstruct timeval { long tv_sec; /* seconds since Jan. 1, 1970 */ long tv_usec; /* and microseconds */};.sp 1struct timezone { int tz_minuteswest; /* of Greenwich */ int tz_dsttime; /* type of dst correction to apply */};.EE.PPThe .I timezonestructure indicates the local time zone(measured in minutes of time westward from Greenwich),and a flag that, if nonzero, indicates thatDaylight Saving time applies locally duringthe appropriate part of the year..PPOnly the superuser can set the time of day..SH Return ValuesA 0 return value indicates that the call succeeded.A \-1 return value indicates an error occurred, and in thiscase an error code is stored into the global variable \fIerrno\fP..SH DiagnosticsThe .PN gettimeofdaycall fails under the following conditions:.TP 15[EFAULT]An argument address referenced invalid memory..TP 15[EPERM]A user other than the superuser attempted to set the time..SH See Alsodate(1), stime(2), ctime(3)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?