search for: timespec

Displaying 20 results from an estimated 459 matches for "timespec".

2023 Jan 14
1
[klibc:time64] time: Use 64-bit time types on all architectures
...0 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 14 Jan 2023 18:10:12 +0100 [klibc] time: Use 64-bit time types on all architectures - Define time_t as __kernel_time64_t - In <sys/time.h>, replace <linux/time.h> with suitable definitions: - Define struct timespec and itimerspec to match the kernel's 64-bit structures - Define struct timeval using __kernel_time64_t (although there are no new system calls using struct timeval) - Keep the old struct itimerval definition, because there aren't simple replacements available for the {get,se...
2011 Oct 03
2
patch: Replace many usleep and some sleep calls with nanosleep
...= --- a/clients/upssched.c 2011-05-31 13:36:47.000000000 +0300 +++ b/clients/upssched.c 2011-08-17 00:40:17.000000000 +0300 @@ -652,7 +652,7 @@ static int check_parent(const char *cmd, unlink(lockfn); /* give the other one a chance to start it, then try again */ - usleep(250000); + struct timespec delay = {0, 250e6}; nanosleep(&delay, NULL); } upslog_with_errno(LOG_ERR, "Failed to connect to parent and failed to create parent"); @@ -705,7 +705,7 @@ static void sendcmd(const char *cmd, con if (pipefd == PARENT_STARTED) { /* loop back and try to connect now */ -...
2023 Jan 26
0
[klibc:time64] time: Use clock_* system calls for time-of-day and sleep
.../time.h +++ b/usr/include/sys/time.h @@ -50,6 +50,9 @@ static inline int FD_ISSET(int __fd, fd_set *__fdsetp) __extern int gettimeofday(struct timeval *, struct timezone *); __extern int settimeofday(const struct timeval *, const struct timezone *); +__extern int clock_gettime(clockid_t, struct timespec *); +__extern int clock_settime(clockid_t, const struct timespec *); +__extern int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *); __extern int getitimer(int, struct itimerval *); __extern int setitimer(int, const struct itimerval *, struct itimerval *); __extern int...
2003 Mar 17
3
nanosleep() replacement
...Server 3 box broke so I can't test it there. -------------< cut here >---------------- --- openssh/configure.ac.old 2003-03-09 17:16:43.000000000 -0800 +++ openssh/configure.ac 2003-03-16 15:38:28.520560008 -0800 @@ -1483,6 +1483,8 @@ have_struct_timeval=1 fi +AC_CHECK_TYPES(struct timespec) + # If we don't have int64_t then we can't compile sftp-server. So don't # even attempt to do it. if test "x$ac_cv_have_int64_t" = "xno" -a \ --- openssh/openbsd-compat/bsd-misc.c.old 2003-01-19 19:21:01.000000000 -0800 +++ openssh/openbsd-compat/bsd-misc.c 200...
2023 Nov 03
0
9.3p1 Daemon Rejects Client Connections on armv7l-dey-linux-gnueabihf w/ GCC 10/11/12
...m-none-linux-gnueabihf/arm-none-linux-gnueabihf/libc/usr/include/bits/syscall.h:# define SYS_clock_gettime64 __NR_clock_gettime64 /opt/sysroots/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/libc/usr/include/time.h: timespec *__tp), __clock_gettime64) /opt/sysroots/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-linux-gnueabihf/arm-none-linux-gnueabihf/libc/usr/include/time.h:# define clock_gettime __clock_gettime64 The <time.h> header has this block: #ifdef __USE_POSIX199309 # ifndef __USE_TIME_BITS6...
2018 Aug 10
2
[cfe-dev] Filesystem has Landed in Libc++
.... I believe it is a mistake to model file_time_type with 128 bits. It would be acceptable if this was absolutely necessary to get the job done, but it isn’t. The 16 byte integer is unnecessarily expensive to get the job done. file_time_type does not need to model the full range and precision of timespec (which on 64 bit platforms is a 128 bit type). All file_time_type needs to model is the full range and precision of what the underlying file system libraries are capable of producing. The latest Linux file system is ext4 (https://en.wikipedia.org/wiki/Ext4) and is capable of nanosecond resolution...
2018 Sep 17
11
[patch V2 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support
Matt attempted to add CLOCK_TAI support to the VDSO clock_gettime() implementation, which extended the clockid switch case and added yet another slightly different copy of the same code. Especially the extended switch case is problematic as the compiler tends to generate a jump table which then requires to use retpolines. If jump tables are disabled it adds yet another conditional to the existing
2013 Nov 12
0
[klibc:master] poll, select: fix style problems
...ions(-) diff --git a/usr/klibc/poll.c b/usr/klibc/poll.c index 69da693..f539b99 100644 --- a/usr/klibc/poll.c +++ b/usr/klibc/poll.c @@ -4,7 +4,7 @@ #ifndef __NR_poll -int poll (struct pollfd *fds, nfds_t nfds, long timeout) +int poll(struct pollfd *fds, nfds_t nfds, long timeout) { struct timespec timeout_ts; struct timespec *timeout_ts_p = NULL; diff --git a/usr/klibc/select.c b/usr/klibc/select.c index e416794..7af28fe 100644 --- a/usr/klibc/select.c +++ b/usr/klibc/select.c @@ -8,10 +8,10 @@ struct __pselect6; __extern int __pselect6(int, fd_set *, fd_set *, fd_set *, -...
2008 May 18
1
compile troubles - stat.mtim - 1.1hg
...dan/software_projects/dovecot-1.1/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/dan/software_projects/dovecot-1.1' fgrep HAVE_STAT config.h /* #undef HAVE_STATFS_MNTFROMNAME */ /* #undef HAVE_STATVFS_MNTFROMNAME */ #define HAVE_STAT_XTIM /* #undef HAVE_STAT_XTIMESPEC */ from config.log configure:28085: checking if struct stat has st_?tim timespec fields configure:28117: gcc -c -std=gnu99 -g -O2 -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -Wstrict-aliasing=2 conftest.c >&5 conft...
2005 Feb 24
1
[PATCH] Drop SETGROUPS_NOOP
...VE_TRUNCATE */ -#if !defined(HAVE_SETGROUPS) && defined(SETGROUPS_NOOP) -/* - * Cygwin setgroups should be a noop. - */ -int -setgroups(size_t size, const gid_t *list) -{ - return (0); -} -#endif - #if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP) int nanosleep(const struct timespec *req, struct timespec *rem) { Index: openbsd-compat/bsd-misc.h =================================================================== RCS file: /cvs/openssh_cvs/openbsd-compat/bsd-misc.h,v retrieving revision 1.17 diff -p -u -r1.17 bsd-misc.h --- openbsd-compat/bsd-misc.h 15 Aug 2004 08:41:00 -0000 1...
2023 Sep 07
1
Privacy improving suggestions for ObscureKeystrokeTiming
...of keystroke timing intervals */ +#define SSH_KEYSTROKE_TIMING_FUZZ 10 + /* import options */ extern Options options; @@ -519,6 +522,33 @@ send_chaff(struct ssh *ssh) return 1; } +/* Sets the next interval to send a keystroke or chaff packet */ +static void +set_next_interval(const struct timespec *now, struct timespec *next_interval, + u_int interval_ms, u_int interval_fuzz_pct) +{ + struct timespec tmp; + long long interval_ns, fuzz_ns; + + interval_ns = interval_ms * (1000LL * 1000); + fuzz_ns = (interval_ns * interval_fuzz_pct) / 100; + /* Center fuzz around requested interval */ + if...
2015 May 18
5
kernel/libc uapi changes for y2038
In the patch series I posted recently [1], I introduce new system calls to deal with modified data structures, but left the question open on how these should be best accessed from libc. The patches introduce a new __kernel_time64_t type and based on that five new data structured: struct __kernel_timespec, struct __kernel_itimerspec, struct __kernel_stat, struct __kernel_rusage, and struct __kernel_timex. This works fine for the case when all libc implementations provide their own definitions to user space, but not for the simplest case (e.g. klibc) where the user-visible structures come directly fr...
2012 Sep 03
4
finding messages deleted before timespec
Hi! I've been pondering about doveadm-search-query(7) and trying to formulate a search query for some time now and it seems there is no way to search for messages, which have been marked DELETED before a certain time. I want to use this to expunge all DELETED messages which have been in that state for 24h or longer. For example a cronjob runs at midnight to expunge those messages but a user
2018 Sep 14
24
[patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support
Matt attempted to add CLOCK_TAI support to the VDSO clock_gettime() implementation, which extended the clockid switch case and added yet another slightly different copy of the same code. Especially the extended switch case is problematic as the compiler tends to generate a jump table which then requires to use retpolines. If jump tables are disabled it adds yet another conditional to the existing
2018 Sep 14
24
[patch 00/11] x86/vdso: Cleanups, simmplifications and CLOCK_TAI support
Matt attempted to add CLOCK_TAI support to the VDSO clock_gettime() implementation, which extended the clockid switch case and added yet another slightly different copy of the same code. Especially the extended switch case is problematic as the compiler tends to generate a jump table which then requires to use retpolines. If jump tables are disabled it adds yet another conditional to the existing
2017 Apr 19
6
[PATCH supermin 0/3] Require root= parameter, refactor init.
Require the root= parameter is passed to specify which root (apppliance) to mount. Libguestfs has done this since 2012. The other two patches are small code refactorings in the init program. Rich.
2018 Sep 14
0
[patch 09/11] x86/vdso: Simplify the invalid vclock case
...ct timeval *tv, struct timezone *tz) -{ - long ret; - - asm("syscall" : "=a" (ret) : - "0" (__NR_gettimeofday), "D" (tv), "S" (tz) : "memory"); - return ret; -} - - #else notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) @@ -75,21 +65,6 @@ notrace static long vdso_fallback_gettim return ret; } -notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz) -{ - long ret; - - asm( - "mov %%ebx, %%edx \n" - "mov %2, %%ebx \n" - "call __kernel_vsyscall \n" -...
2023 Jan 13
0
[klibc:master] mips64: Fix struct stat layout
...Hutchings <ben at decadent.org.uk> AuthorDate: Wed, 4 Jan 2023 01:34:39 +0100 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Wed, 4 Jan 2023 01:34:39 +0100 [klibc] mips64: Fix struct stat layout On mips64, struct stat has 32-bit time fields instead of following struct timespec. Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/include/arch/mips64/klibc/archstat.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/usr/include/arch/mips64/klibc/archstat.h b/usr/include/arch/mips64/klibc/archstat.h index 2dbb907c..16f50c9e...
2023 Jan 14
1
[klibc:time64] time: Use 64-bit time types on all architectures
On Sat, Jan 14, 2023, at 23:03, klibc-bot for Ben Hutchings wrote: > > #include <klibc/extern.h> > +#include <klibc/endian.h> > #include <stddef.h> > #include <sys/types.h> > -#include <linux/time.h> > + > +struct timespec { > + __kernel_time64_t tv_sec; > +#if __BYTE_ORDER == __BIG_ENDIAN && __BITS_PER_LONG == 32 > + long __tv_pad; > +#endif > + long tv_nsec; > +#if __BYTE_ORDER == __LITTLE_ENDIAN && __BITS_PER_LONG == 32 > + long __tv_pad; > +#endif > +}; The proble...
2013 Nov 12
0
[klibc:master] arm64: Fix struct stat
....git;a=commit;h=3de648dd97d9d6086598aa80206a3007a13ed61b Author: H. Peter Anvin <hpa at zytor.com> AuthorDate: Mon, 11 Nov 2013 19:41:55 -0800 Committer: H. Peter Anvin <hpa at zytor.com> CommitDate: Mon, 11 Nov 2013 19:46:47 -0800 [klibc] arm64: Fix struct stat Use actual struct timespec fields in struct stat, and use the proper __stdev64 macro for the dev_t fields. Also fix bizarre formatting. Cc: Neil Williams <codehelp at debian.org> Cc: Anil Singhar <anil.singhar at linaro.org> Cc: Steve Capper <steve.capper at linaro.org> Signed-off-by: H. Peter Anvin <h...