/// <summary> /// Adds a timeout to a previously prepared linked item to the Submission Queue without it being submitted. /// The actual submission can be deferred to avoid unnecessary memory barriers. /// </summary> /// <param name="ts">The amount of time after which the timeout should trigger</param> /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param> /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param> /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param> /// <exception cref="SubmissionQueueFullException">If no more free space in the Submission Queue is available</exception> public void PrepareLinkTimeout(timespec *ts, TimeoutOptions timeoutOptions, ulong userData = 0, SubmissionOption options = SubmissionOption.None) { if (!TryPrepareLinkTimeout(ts, timeoutOptions, userData, options)) { ThrowSubmissionQueueFullException(); } }
/// <summary> /// Adds a timeout to the Submission Queue without it being submitted. /// The actual submission can be deferred to avoid unnecessary memory barriers. /// </summary> /// <param name="ts">The amount of time after which the timeout should trigger if less than <paramref name="count"/> submissions completed.</param> /// <param name="count">The amount of completed submissions after which the timeout should trigger</param> /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param> /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param> /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param> /// <exception cref="SubmissionQueueFullException">If no more free space in the Submission Queue is available</exception> public void PrepareTimeout(timespec *ts, uint count = 1, TimeoutOptions timeoutOptions = TimeoutOptions.Relative, ulong userData = 0, SubmissionOption options = SubmissionOption.None) { if (!TryPrepareTimeout(ts, count, timeoutOptions, userData, options)) { ThrowSubmissionQueueFullException(); } }
private unsafe int Utimens(path *path, timespec *tv, fuse_file_info *fi) { try { Span <timespec> specs = new Span <timespec>(tv, 2); return(_fileSystem.UpdateTimestamps(ToSpan(path), ref MemoryMarshal.GetReference(specs), ref MemoryMarshal.GetReference(specs.Slice(1)), ToFileInfo(fi))); } catch { return(-EIO); } }
/// <summary> /// Prepares this Submission Queue Entry as a timeout to a previously prepared linked item. /// </summary> /// <param name="ts">The amount of time after which the timeout should trigger</param> /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param> /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param> /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param> /// <param name="personality">The personality to impersonate for this submission</param> public void PrepareLinkTimeout(timespec *ts, TimeoutOptions timeoutOptions = TimeoutOptions.Relative, ulong userData = 0, SubmissionOption options = SubmissionOption.None, ushort personality = 0) { var sqe = _sqe; unchecked { sqe->opcode = IORING_OP_LINK_TIMEOUT; sqe->flags = (byte)options; sqe->fd = -1; sqe->addr = (ulong)ts; sqe->len = 1; sqe->timeout_flags = (uint)timeoutOptions; sqe->user_data = userData; sqe->personality = personality; } }
public static extern unsafe int kevent64(int kq, kevent64_s *changelist, int nchanges, kevent64_s *eventlist, int nevents, uint flags, timespec *timeout);
public static extern int ppoll(pollfd *fds, ulong_t nfds, timespec *timeout, sigset_t *sigmask);
public static extern int clock_gettime(clockid_t __clock_id, [NativeTypeName("struct timespec *")] timespec *__tp);
public static extern int nanosleep([NativeTypeName("const struct timespec *")] timespec *__requested_time, [NativeTypeName("struct timespec *")] timespec *__remaining);
public static void TIMEVAL_TO_TIMESPEC(timeval *tv, timespec *ts) { (ts)->tv_sec = (tv)->tv_sec; (ts)->tv_nsec = (tv)->tv_usec * (nint)(1000); }
public static extern int pselect(int __nfds, fd_set *__readfds, fd_set *__writefds, fd_set *__exceptfds, [NativeTypeName("const struct timespec *")] timespec *__timeout, [NativeTypeName("const __sigset_t *")] sigset_t *__sigmask);
public static extern int sigtimedwait([NativeTypeName("const sigset_t *")] sigset_t *__set, siginfo_t *__info, [NativeTypeName("const struct timespec *")] timespec *__timeout);
public static int io_getevents(aio_context_t ctx, long_t min_nr, long_t nr, io_event *events, timespec *timeout) { int rv = (int)syscall(SYS_io_getevents, ctx.ring, min_nr, nr, events, timeout); return(rv); }
public static extern int utimensat(int dirfd, byte *path, timespec *times, int flags);
public static extern int futimens(int fd, timespec *times);
/// <summary> /// Attempts to add a timeout to a previously prepared linked item to the Submission Queue without it being submitted. /// The actual submission can be deferred to avoid unnecessary memory barriers. /// </summary> /// <param name="ts">The amount of time after which the timeout should trigger</param> /// <param name="timeoutOptions">Options on how <paramref name="ts"/> is interpreted</param> /// <param name="userData">User data that will be returned with the respective <see cref="Completion"/></param> /// <param name="options">Options for the handling of the prepared Submission Queue Entry</param> /// <returns><code>false</code> if the submission queue is full. <code>true</code> otherwise.</returns> public bool TryPrepareLinkTimeout(timespec *ts, TimeoutOptions timeoutOptions = TimeoutOptions.Relative, ulong userData = 0, SubmissionOption options = SubmissionOption.None) => TryPrepareReadWrite(IORING_OP_LINK_TIMEOUT, -1, ts, 1, 0, (int)timeoutOptions, userData, options);
public static extern int clock_nanosleep(clockid_t __clock_id, int __flags, [NativeTypeName("const struct timespec *")] timespec *__req, [NativeTypeName("struct timespec *")] timespec *__rem);
private static unsafe extern int recvmmsg(int sockfd, mmsghdr *msgvec, UInt32 vlen, int flags, timespec *timeout);
public static extern int timespec_get([NativeTypeName("struct timespec *")] timespec *__ts, int __base);
public static void TIMESPEC_TO_TIMEVAL(timeval *tv, timespec *ts) { (tv)->tv_sec = (ts)->tv_sec; (tv)->tv_usec = (ts)->tv_nsec / 1000; }
public static extern int sched_rr_get_interval(pid_t pid, timespec *tp);