Home
last modified time | relevance | path

Searched +full:tv +full:- +full:set (Results 1 – 25 of 444) sorted by relevance

12345678910>>...18

/freebsd/contrib/ntp/libntp/lib/isc/unix/
H A Dstdtime.c3 * Copyright (C) 1999-2001 Internet Software Consortium.
41 fix_tv_usec(struct timeval *tv) { in fix_tv_usec() argument
44 if (tv->tv_usec < 0) { in fix_tv_usec()
47 tv->tv_sec -= 1; in fix_tv_usec()
48 tv->tv_usec += US_PER_S; in fix_tv_usec()
49 } while (tv->tv_usec < 0); in fix_tv_usec()
50 } else if (tv->tv_usec >= US_PER_S) { in fix_tv_usec()
53 tv->tv_sec += 1; in fix_tv_usec()
54 tv->tv_usec -= US_PER_S; in fix_tv_usec()
55 } while (tv->tv_usec >=US_PER_S); in fix_tv_usec()
[all …]
/freebsd/cddl/contrib/opensolaris/lib/libdtrace/common/
H A Ddt_work.c49 dt_proc_hash_t *dph = dtp->dt_procs; in dtrace_sleep()
50 dtrace_optval_t policy = dtp->dt_options[DTRACEOPT_BUFPOLICY]; in dtrace_sleep()
54 struct timespec tv; in dtrace_sleep() local
61 dtrace_optval_t interval = dtp->dt_options[opt]; in dtrace_sleep()
64 * If the buffering policy is set to anything other than in dtrace_sleep()
65 * "switch", we ignore the aggrate and switchrate -- they're in dtrace_sleep()
76 (void) pthread_mutex_lock(&dph->dph_lock); in dtrace_sleep()
81 (void) pthread_mutex_unlock(&dph->dph_lock); in dtrace_sleep()
86 tv.tv_sec = (earliest - now) / NANOSEC; in dtrace_sleep()
87 tv.tv_nsec = (earliest - now) % NANOSEC; in dtrace_sleep()
[all …]
/freebsd/contrib/pf/libevent/
H A Devent.c2 * Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
56 #include "event-internal.h"
118 /* Handle signals - This is a deprecated interface */
119 int (*event_sigcb)(void); /* Signal callback when gotsig is set */
120 volatile sig_atomic_t event_gotsig; /* Set in signal handler */
136 if (timercmp(&a->ev_timeout, &b->ev_timeout, <)) in compare()
137 return (-1); in compare()
138 else if (timercmp(&a->ev_timeout, &b->ev_timeout, >)) in compare()
141 return (-1); in compare()
154 if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) in gettime()
[all …]
/freebsd/sys/netinet/
H A Dtcp_hpts.c1 /*-
2 * Copyright (c) 2016-2018 Netflix, Inc.
78 * The stack must also set the flag on the INP that it supports this
80 * this flag as well and will queue packets when it is set.
87 * the current hpts timer run (this is usually set when
93 * knows how to take the input queue of packets from tp->t_inqueue
163 * This gives a range of 10usec - 1024ms to place
166 * when seeing the remainder will re-insert the
174 #define HPTS_MTX_ASSERT(hpts) mtx_assert(&(hpts)->p_mtx, MA_OWNED)
175 #define HPTS_LOCK(hpts) mtx_lock(&(hpts)->p_mtx)
[all …]
H A Dtcp_hpts.h1 /*-
2 * Copyright (c) 2016-2018 Netflix, Inc.
38 uint32_t p_hpts_active; /* bbr->flex7 x */
39 uint32_t p_nxt_slot; /* bbr->flex1 x */
40 uint32_t p_cur_slot; /* bbr->flex2 x */
41 uint32_t p_prev_slot; /* bbr->delivered */
42 uint32_t p_runningslot; /* bbr->inflight */
43 uint32_t slot_req; /* bbr->flex3 x */
44 uint32_t inp_hptsslot; /* bbr->flex4 x */
45 uint32_t slot_remaining; /* bbr->flex5 x */
[all …]
/freebsd/crypto/heimdal/lib/krb5/
H A Dtime.c2 * Copyright (c) 1997-2004 Kungliga Tekniska Högskolan
37 * Set the absolute time that the caller knows the kdc has so the
55 struct timeval tv; in krb5_set_real_time() local
57 gettimeofday(&tv, NULL); in krb5_set_real_time()
59 context->kdc_sec_offset = sec - tv.tv_sec; in krb5_set_real_time()
66 context->kdc_usec_offset = usec - tv.tv_usec; in krb5_set_real_time()
68 if (context->kdc_usec_offset < 0) { in krb5_set_real_time()
69 context->kdc_sec_offset--; in krb5_set_real_time()
70 context->kdc_usec_offset += 1000000; in krb5_set_real_time()
73 context->kdc_usec_offset = tv.tv_usec; in krb5_set_real_time()
[all …]
H A Dtest_time.c43 struct timeval tv; in check_set_time() local
47 gettimeofday(&tv, NULL); in check_set_time()
49 ret = krb5_set_real_time(context, tv.tv_sec + diff, tv.tv_usec); in check_set_time()
57 diff2 = abs(sec - tv.tv_sec); in check_set_time()
60 krb5_errx(context, 1, "set time error: diff: %d", in check_set_time()
61 abs(sec - tv.tv_sec)); in check_set_time()
/freebsd/contrib/netbsd-tests/lib/libc/gen/
H A Dt_sleep.c3 /*-
34 #include <atf-c.h>
46 #define BILLION 1000000000LL /* nano-seconds per second */
47 #define MILLION 1000000LL /* nano-seconds per milli-second */
51 #define KEVNT_TIMEOUT 10300 /* measured in milli-seconds */
52 #define FUZZ (40 * MILLION) /* scheduling fuzz accepted - 40 ms */
58 * starts at 1sec (since it cannot handle sub-second intervals).
66 * The ALARM is only set if the current pass's delay is longer, and
69 * The 'kevent' test needs the ALARM to be set on a different pass
70 * from when the KEVNT_TIMEOUT fires. So set ALARM to fire on the
[all …]
/freebsd/contrib/ntp/sntp/libevent/
H A Devent.c2 * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
3 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
27 #include "event2/event-config.h"
28 #include "evconfig-private.h"
62 #include "event-internal.h"
63 #include "defer-internal.h"
64 #include "evthread-internal.h"
67 #include "log-internal.h"
68 #include "evmap-internal.h"
69 #include "iocp-internal.h"
[all …]
H A Devutil_time.c2 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
27 #include "event2/event-config.h"
28 #include "evconfig-private.h"
62 #include "util-internal.h"
63 #include "log-internal.h"
64 #include "mm-internal.h"
72 evutil_gettimeofday(struct timeval *tv, struct timezone *tz) in evutil_gettimeofday() argument
82 * an unaligned (!) 64-bit value containing the number of in evutil_gettimeofday()
83 * 100-nanosecond intervals since 1 January 1601 UTC. */ in evutil_gettimeofday()
93 if (tv == NULL) in evutil_gettimeofday()
[all …]
/freebsd/contrib/libevent/
H A Devent.c2 * Copyright (c) 2000-2007 Niels Provos <provos@citi.umich.edu>
3 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
27 #include "event2/event-config.h"
28 #include "evconfig-private.h"
62 #include "event-internal.h"
63 #include "defer-internal.h"
64 #include "evthread-internal.h"
67 #include "log-internal.h"
68 #include "evmap-internal.h"
69 #include "iocp-internal.h"
[all …]
H A Devutil_time.c2 * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
27 #include "event2/event-config.h"
28 #include "evconfig-private.h"
62 #include "util-internal.h"
63 #include "log-internal.h"
64 #include "mm-internal.h"
72 evutil_gettimeofday(struct timeval *tv, struct timezone *tz) in evutil_gettimeofday() argument
82 * an unaligned (!) 64-bit value containing the number of in evutil_gettimeofday()
83 * 100-nanosecond intervals since 1 January 1601 UTC. */ in evutil_gettimeofday()
93 if (tv == NULL) in evutil_gettimeofday()
[all …]
/freebsd/tools/regression/poll/
H A Dpipeselect.c19 #define SETUP(fd, rfds, tv) do { \ argument
22 (tv).tv_sec = 0; \
23 (tv).tv_usec = 0; \
31 return (events ? "set" : "clear"); in decode_events()
38 printf("ok %-2d ", num); in report()
40 printf("not ok %-2d", num); in report()
62 struct timeval tv; in child() local
75 SETUP(fd, rfds, tv); in child()
76 if (select(fd + 1, &rfds, NULL, NULL, &tv) < 0) in child()
81 * for poll(). select() must see a ready-to-read descriptor in child()
[all …]
/freebsd/sbin/adjkerntz/
H A Dadjkerntz.c1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (C) 1993-1998 by Andrey A. Chernov, Moscow, Russia.
34 * using zoneinfo rules or direct TZ environment variable set.
55 #define Unknown (-1)
73 struct timeval tv, *stv; in main() local
81 int initial_isdst = -1, final_isdst; in main()
86 while ((ch = getopt(argc, argv, "ais")) != -1) in main()
151 if (sysctlbyname("machdep.adjkerntz", &kern_offset, &len, NULL, 0) == -1) { in main()
159 if (gettimeofday(&tv, &tz)) { in main()
[all …]
/freebsd/contrib/netbsd-tests/lib/librumphijack/
H A Dh_client.c52 struct timeval tv; in main() local
56 tv.tv_sec = 0; in main()
57 tv.tv_usec = 1; in main()
59 if (pipe(pipefd) == -1) in main()
64 rv = select(pipefd[0]+1, &rfds, NULL, NULL, &tv); in main()
65 if (rv == -1) in main()
71 errx(EXIT_FAILURE, "stdin fileno is still set"); in main()
75 struct timeval tv; in main() local
78 tv.tv_sec = 0; in main()
79 tv.tv_usec = 1; in main()
[all …]
/freebsd/contrib/mtree/
H A Dcompare.c3 /*-
85 printf("%*s", INDENTNAMELEN - (int)len, ""); \
95 if (flags != p->fts_statp->st_flags) { \
99 sf = flags_to_string(p->fts_statp->st_flags, "none"); \
103 if (lchflags(p->fts_accpath, flags)) { \
115 * given pflags, additionally set those flags specified in s->st_flags and
120 flags = (s->st_flags & (mask)) | (pflags); \
125 * given pflags, reset the flags specified in s->st_flags and selected by mask
130 flags = (~(s->st_flags & (mask)) & CH_MASK) & (pflags); \
147 switch(s->type) { in compare()
[all …]
/freebsd/tools/test/stress2/testcases/mkfifo/
H A Dmkfifo.c1 /*-
47 fd_set set; in reader() local
48 struct timeval tv; in reader() local
57 FD_ZERO(&set); in reader()
58 FD_SET(fd, &set); in reader()
59 tv.tv_sec = 10; in reader()
60 tv.tv_usec = 0; in reader()
61 if (select(fd + 1, &set, NULL, NULL, &tv) == 1) { in reader()
100 reserve_in = 200 * op->incarnations; in setup()
101 reserve_bl = 2048 * op->incarnations; in setup()
[all …]
/freebsd/contrib/ntp/clockstuff/
H A Dchutest.c2 * chutest - test the CHU clock
61 int dofilter = 0; /* set to 1 when we should run filter algorithm */
62 int showtimes = 0; /* set to 1 when we should show char arrival times */
63 int doprocess = 0; /* set to 1 when we do processing analogous to driver */
65 int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */
68 int usechuldisc = 0; /* set to 1 when CHU line discipline should be used */
79 void raw_filter(unsigned int c, struct timeval *tv);
84 * main - parse arguments and handle options
133 (void) fprintf(stderr, "usage: %s [-dft] tty_device\n", in main()
137 (void) fprintf(stderr, "usage: %s [-dft] tty_device\n", in main()
[all …]
/freebsd/bin/sh/
H A Dmiscbltin.c1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
86 .buflen = (cur != -1) ? READ_BUFLEN : 1, in fdctx_init()
87 .ep = &fdc->buf[0], /* No data */ in fdctx_init()
96 if (&fdc->buf[fdc->off] == fdc->ep) { in fdgetc()
97 nread = read(fdc->fd, fdc->buf, fdc->buflen); in fdgetc()
99 fdc->off = 0; in fdgetc()
100 fdc->ep = fdc->buf + nread; in fdgetc()
104 *c = fdc->buf[fdc->off++]; in fdgetc()
114 if (fdc->buflen > 1) { in fdctx_destroy()
[all …]
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/
H A Dsanitizer_netbsd.cpp1 //===-- sanitizer_netbsd.cpp ----------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is shared between Sanitizer run-time libraries and implements
10 // NetBSD-specific functions from sanitizer_libc.h.
11 //===----------------------------------------------------------------------===//
96 // --------------- sanitizer_libc.h
178 return -1; in internal_filesize()
244 timeval tv; in NanoTime() local
246 internal_memset(&tv, 0, sizeof(tv)); in NanoTime()
[all …]
/freebsd/contrib/ntp/include/
H A Dtimepps-SCO.h3 * Copyright (c) David L. Mills 1999-2000 *
19 * This header file complies with "Pulse-Per-Second API for UNIX-like *
37 * based on code by Poul-Henning Kamp <phk@FreeBSD.org> *
41 * "THE BEER-WARE LICENSE" (Revision 42): *
45 * in return. Poul-Henning Kamp *
58 * means the bit is set.
66 #define PPS_JAN_1970 2208988800UL /* 1970 - 1900 in seconds */
73 (x).tv_nsec -= PPS_NANOSECOND; \
77 (x).tv_sec--; \
126 #define PPS_KC_HARDPPS_PLL 1 /* phase-lock mode */
[all …]
/freebsd/lib/libc/rpc/
H A Dauth_time.c45 #include "un-namespace.h"
68 * from internet time-service time, into UNIX time we subtract the
71 #define NYEARS (1970 - 1900)
93 sin->sin_addr.s_addr |= (a[i] & 0x000000FF) << (8 * i); in uaddr_to_sockaddr()
98 sin->sin_family = AF_INET; /* always */ in uaddr_to_sockaddr()
99 bcopy((char *)&p_bytes, (char *)&sin->sin_port, 2); in uaddr_to_sockaddr()
133 * host - name of the time host
134 * srv - nis_server struct to use.
135 * eps[] - array of endpoints
136 * maxep - max array size
[all …]
/freebsd/contrib/nvi/ex/
H A Dex_script.c1 /*-
54 * ex_script -- : sc[ript][!] [file]
70 if (cmdp->argc != 0 && ex_edit(sp, cmdp)) in ex_script()
81 * sscr_init --
95 sp->script = sc; in sscr_init()
96 sc->sh_prompt = NULL; in sscr_init()
97 sc->sh_prompt_len = 0; in sscr_init()
103 sc->sh_master = sc->sh_slave = -1; in sscr_init()
105 if (tcgetattr(STDIN_FILENO, &sc->sh_term) == -1) { in sscr_init()
113 sc->sh_term.c_oflag &= ~OPOST; in sscr_init()
[all …]
/freebsd/contrib/bsnmp/lib/
H A Dsnmpclient.c2 * Copyright (c) 2004-2005,2018-2019
5 * Copyright (c) 2001-2003
92 * Prototype table entry. All C-structure produced by the table function must
94 * are compatible with each other in the sense implied by ANSI-C.
128 * Set the error string
136 vsnprintf(sc->error, sizeof(sc->error), fmt, ap); in seterr()
152 while ((w = TAILQ_FIRST(&work->worklist)) != NULL) { in table_free()
153 TAILQ_REMOVE(&work->worklist, w, link); in table_free()
160 while ((e = TAILQ_FIRST(work->table)) != NULL) { in table_free()
161 for (i = 0; work->descr->entries[i].syntax != SNMP_SYNTAX_NULL; in table_free()
[all …]
/freebsd/contrib/llvm-project/lldb/source/Utility/
H A DSelectHelper.cpp1 //===-- SelectHelper.cpp --------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
19 #include "lldb/lldb-enumerations.h"
20 #include "lldb/lldb-types.h"
64 return pos->second.read_is_set; in FDIsSetRead()
72 return pos->second.write_is_set; in FDIsSetWrite()
80 return pos->second.error_is_set; in FDIsSetError()
177 // Set the FD bits in the fdsets for read/write/error in Select()
193 struct timeval tv = {0, 0}; in Select() local
[all …]

12345678910>>...18