⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syscalls_89.html

📁 Linux系统调用
💻 HTML
字号:
<!-- This HTML file has been created by texi2html 1.29
     from syscalls.texi on 4 June 1994 -->

<TITLE>Syscall specifications of Linux - gettimeofday</TITLE>
<P>Go to the <A HREF="syscalls_88.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_88.html">previous</A>, <A HREF="syscalls_90.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_90.html">next</A> section.<P>
<H2><A NAME="SEC89" HREF="syscalls_toc.html#SEC89" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_toc.html#SEC89">gettimeofday and settimeofday</A></H2>
<P>
<H3>SYNOPSIS</H3>
<P>
<CODE>int gettimeofday(struct timeval *<VAR>tv</VAR>, struct timezone *<VAR>tz</VAR>);</CODE>
<P>
<CODE>int settimeofday(const struct timeval *<VAR>tv</VAR>, const struct
timezone *<VAR>tz</VAR>);</CODE>
<P>
<H3>PARAMETERS</H3>
<P>
<VAR>tv</VAR>: for <CODE>gettimeofday</CODE>, [out] points to a buffer that will
contain the time. For <CODE>settimeofday</CODE>, [in] points to a buffer
containing the new time.
<P>
<VAR>tz</VAR>: for <CODE>gettimeofday</CODE>, [out] points to a buffer that will
contain the timezone information. For <CODE>settimeofday</CODE>, [in] points
to a buffer containing the new timezone information.
<P>
<H3>DESCRIPTION</H3>
<P>
<CODE>gettimeofday</CODE> retreives the current time and timezone information.
<CODE>settimeofday</CODE> sets the current time and timezone information. Only
the superuser may call <CODE>settimeofday</CODE>. A value of <CODE>NULL</CODE> for a
parameter of <CODE>settimeofday</CODE> specifies not to change this parameter.
<P>
<H3>RETURN VALUE</H3>
<P>
On success zero is returned. On error -1 is returned and <CODE>errno</CODE> is
set to one of the following values:
<P>
<UL>
<LI><CODE>EPERM</CODE>: <CODE>settimeofday</CODE> was called but the task has not
superuser privileges.
<LI><CODE>EINVAL</CODE>.
</UL>
<P>
<P>Go to the <A HREF="syscalls_88.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_88.html">previous</A>, <A HREF="syscalls_90.html" tppabs="http://personal.xfol.com/%7erezaie/syscall/syscalls_90.html">next</A> section.<P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -